@tokenbuddy/tokenbuddy 1.0.28 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/daemon.d.ts +11 -4
- package/dist/src/daemon.d.ts.map +1 -1
- package/dist/src/daemon.js +130 -42
- package/dist/src/daemon.js.map +1 -1
- package/dist/src/doctor-diagnostics.d.ts.map +1 -1
- package/dist/src/doctor-diagnostics.js +7 -1
- package/dist/src/doctor-diagnostics.js.map +1 -1
- package/dist/src/prewarm-cache.d.ts +4 -0
- package/dist/src/prewarm-cache.d.ts.map +1 -1
- package/dist/src/prewarm-cache.js +1 -0
- package/dist/src/prewarm-cache.js.map +1 -1
- package/dist/src/prewarm-scheduler.d.ts +2 -0
- package/dist/src/prewarm-scheduler.d.ts.map +1 -1
- package/dist/src/prewarm-scheduler.js +4 -1
- package/dist/src/prewarm-scheduler.js.map +1 -1
- package/dist/src/provider-install.d.ts.map +1 -1
- package/dist/src/provider-install.js +196 -18
- package/dist/src/provider-install.js.map +1 -1
- package/dist/src/seller-catalog.d.ts +4 -0
- package/dist/src/seller-catalog.d.ts.map +1 -1
- package/dist/src/seller-catalog.js.map +1 -1
- package/dist/src/seller-pool.d.ts +13 -0
- package/dist/src/seller-pool.d.ts.map +1 -1
- package/dist/src/seller-pool.js +43 -2
- package/dist/src/seller-pool.js.map +1 -1
- package/dist/src/seller-route-planner.d.ts +9 -0
- package/dist/src/seller-route-planner.d.ts.map +1 -1
- package/dist/src/seller-route-planner.js +39 -15
- package/dist/src/seller-route-planner.js.map +1 -1
- package/dist/src/seller-routing-strategy.d.ts +6 -4
- package/dist/src/seller-routing-strategy.d.ts.map +1 -1
- package/dist/src/seller-routing-strategy.js +15 -12
- package/dist/src/seller-routing-strategy.js.map +1 -1
- package/dist/src/terminal-detect.d.ts +5 -5
- package/dist/src/terminal-detect.d.ts.map +1 -1
- package/dist/src/terminal-detect.js +79 -26
- package/dist/src/terminal-detect.js.map +1 -1
- package/package.json +1 -1
- package/src/daemon.ts +168 -46
- package/src/doctor-diagnostics.ts +5 -1
- package/src/prewarm-cache.ts +5 -0
- package/src/prewarm-scheduler.ts +6 -1
- package/src/provider-install.ts +203 -18
- package/src/seller-catalog.ts +4 -0
- package/src/seller-pool.ts +68 -2
- package/src/seller-route-planner.ts +61 -15
- package/src/seller-routing-strategy.ts +21 -16
- package/src/terminal-detect.ts +81 -24
- package/static/ui/assets/index-DEDEl8o2.js +236 -0
- package/static/ui/assets/{index-UAfOhbwC.js.map → index-DEDEl8o2.js.map} +1 -1
- package/static/ui/index.html +1 -1
- package/tests/control-plane-ui-endpoints.test.ts +73 -0
- package/tests/seller-pool.test.ts +55 -0
- package/tests/seller-route-planner.test.ts +45 -1
- package/tests/seller-routing-strategy.test.ts +6 -5
- package/tests/tokenbuddy.test.ts +346 -38
- package/static/ui/assets/index-UAfOhbwC.js +0 -236
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
var Qb=Object.defineProperty;var dv=a=>{throw TypeError(a)};var Yb=(a,i,r)=>i in a?Qb(a,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[i]=r;var vd=(a,i,r)=>Yb(a,typeof i!="symbol"?i+"":i,r),xd=(a,i,r)=>i.has(a)||dv("Cannot "+r);var N=(a,i,r)=>(xd(a,i,"read from private field"),r?r.call(a):i.get(a)),ue=(a,i,r)=>i.has(a)?dv("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,r),ee=(a,i,r,u)=>(xd(a,i,"write to private field"),u?u.call(a,r):i.set(a,r),r),ye=(a,i,r)=>(xd(a,i,"access private method"),r);var Ao=(a,i,r,u)=>({set _(d){ee(a,i,d,r)},get _(){return N(a,i,u)}});(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();var yd={exports:{}},Ur={};/**
|
|
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 fv;function Gb(){if(fv)return Ur;fv=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(u,d,m){var h=null;if(m!==void 0&&(h=""+m),d.key!==void 0&&(h=""+d.key),"key"in d){m={};for(var x in d)x!=="key"&&(m[x]=d[x])}else m=d;return d=m.ref,{$$typeof:a,type:u,key:h,ref:d!==void 0?d:null,props:m}}return Ur.Fragment=i,Ur.jsx=r,Ur.jsxs=r,Ur}var mv;function Kb(){return mv||(mv=1,yd.exports=Gb()),yd.exports}var s=Kb(),bd={exports:{}},he={};/**
|
|
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 hv;function Xb(){if(hv)return he;hv=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),E=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=E&&M[E]||M["@@iterator"],typeof M=="function"?M:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,Q={};function U(M,_,Z){this.props=M,this.context=_,this.refs=Q,this.updater=Z||A}U.prototype.isReactComponent={},U.prototype.setState=function(M,_){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,_,"setState")},U.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function q(){}q.prototype=U.prototype;function K(M,_,Z){this.props=M,this.context=_,this.refs=Q,this.updater=Z||A}var H=K.prototype=new q;H.constructor=K,z(H,U.prototype),H.isPureReactComponent=!0;var V=Array.isArray;function W(){}var F={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function te(M,_,Z){var P=Z.ref;return{$$typeof:a,type:M,key:_,ref:P!==void 0?P:null,props:Z}}function se(M,_){return te(M.type,_,M.props)}function J(M){return typeof M=="object"&&M!==null&&M.$$typeof===a}function fe(M){var _={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Z){return _[Z]})}var pe=/\/+/g;function Ae(M,_){return typeof M=="object"&&M!==null&&M.key!=null?fe(""+M.key):_.toString(36)}function me(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(W,W):(M.status="pending",M.then(function(_){M.status==="pending"&&(M.status="fulfilled",M.value=_)},function(_){M.status==="pending"&&(M.status="rejected",M.reason=_)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function k(M,_,Z,P,X){var le=typeof M;(le==="undefined"||le==="boolean")&&(M=null);var re=!1;if(M===null)re=!0;else switch(le){case"bigint":case"string":case"number":re=!0;break;case"object":switch(M.$$typeof){case a:case i:re=!0;break;case g:return re=M._init,k(re(M._payload),_,Z,P,X)}}if(re)return X=X(M),re=P===""?"."+Ae(M,0):P,V(X)?(Z="",re!=null&&(Z=re.replace(pe,"$&/")+"/"),k(X,_,Z,"",function(qt){return qt})):X!=null&&(J(X)&&(X=se(X,Z+(X.key==null||M&&M.key===X.key?"":(""+X.key).replace(pe,"$&/")+"/")+re)),_.push(X)),1;re=0;var we=P===""?".":P+":";if(V(M))for(var ze=0;ze<M.length;ze++)P=M[ze],le=we+Ae(P,ze),re+=k(P,_,Z,le,X);else if(ze=C(M),typeof ze=="function")for(M=ze.call(M),ze=0;!(P=M.next()).done;)P=P.value,le=we+Ae(P,ze++),re+=k(P,_,Z,le,X);else if(le==="object"){if(typeof M.then=="function")return k(me(M),_,Z,P,X);throw _=String(M),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return re}function $(M,_,Z){if(M==null)return M;var P=[],X=0;return k(M,P,"","",function(le){return _.call(Z,le,X++)}),P}function ne(M){if(M._status===-1){var _=M._result;_=_(),_.then(function(Z){(M._status===0||M._status===-1)&&(M._status=1,M._result=Z)},function(Z){(M._status===0||M._status===-1)&&(M._status=2,M._result=Z)}),M._status===-1&&(M._status=0,M._result=_)}if(M._status===1)return M._result.default;throw M._result}var be=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ge={map:$,forEach:function(M,_,Z){$(M,function(){_.apply(this,arguments)},Z)},count:function(M){var _=0;return $(M,function(){_++}),_},toArray:function(M){return $(M,function(_){return _})||[]},only:function(M){if(!J(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return he.Activity=b,he.Children=ge,he.Component=U,he.Fragment=r,he.Profiler=d,he.PureComponent=K,he.StrictMode=u,he.Suspense=p,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,he.__COMPILER_RUNTIME={__proto__:null,c:function(M){return F.H.useMemoCache(M)}},he.cache=function(M){return function(){return M.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(M,_,Z){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var P=z({},M.props),X=M.key;if(_!=null)for(le in _.key!==void 0&&(X=""+_.key),_)!I.call(_,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&_.ref===void 0||(P[le]=_[le]);var le=arguments.length-2;if(le===1)P.children=Z;else if(1<le){for(var re=Array(le),we=0;we<le;we++)re[we]=arguments[we+2];P.children=re}return te(M.type,X,P)},he.createContext=function(M){return M={$$typeof:h,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:m,_context:M},M},he.createElement=function(M,_,Z){var P,X={},le=null;if(_!=null)for(P in _.key!==void 0&&(le=""+_.key),_)I.call(_,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(X[P]=_[P]);var re=arguments.length-2;if(re===1)X.children=Z;else if(1<re){for(var we=Array(re),ze=0;ze<re;ze++)we[ze]=arguments[ze+2];X.children=we}if(M&&M.defaultProps)for(P in re=M.defaultProps,re)X[P]===void 0&&(X[P]=re[P]);return te(M,le,X)},he.createRef=function(){return{current:null}},he.forwardRef=function(M){return{$$typeof:x,render:M}},he.isValidElement=J,he.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:ne}},he.memo=function(M,_){return{$$typeof:v,type:M,compare:_===void 0?null:_}},he.startTransition=function(M){var _=F.T,Z={};F.T=Z;try{var P=M(),X=F.S;X!==null&&X(Z,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(W,be)}catch(le){be(le)}finally{_!==null&&Z.types!==null&&(_.types=Z.types),F.T=_}},he.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},he.use=function(M){return F.H.use(M)},he.useActionState=function(M,_,Z){return F.H.useActionState(M,_,Z)},he.useCallback=function(M,_){return F.H.useCallback(M,_)},he.useContext=function(M){return F.H.useContext(M)},he.useDebugValue=function(){},he.useDeferredValue=function(M,_){return F.H.useDeferredValue(M,_)},he.useEffect=function(M,_){return F.H.useEffect(M,_)},he.useEffectEvent=function(M){return F.H.useEffectEvent(M)},he.useId=function(){return F.H.useId()},he.useImperativeHandle=function(M,_,Z){return F.H.useImperativeHandle(M,_,Z)},he.useInsertionEffect=function(M,_){return F.H.useInsertionEffect(M,_)},he.useLayoutEffect=function(M,_){return F.H.useLayoutEffect(M,_)},he.useMemo=function(M,_){return F.H.useMemo(M,_)},he.useOptimistic=function(M,_){return F.H.useOptimistic(M,_)},he.useReducer=function(M,_,Z){return F.H.useReducer(M,_,Z)},he.useRef=function(M){return F.H.useRef(M)},he.useState=function(M){return F.H.useState(M)},he.useSyncExternalStore=function(M,_,Z){return F.H.useSyncExternalStore(M,_,Z)},he.useTransition=function(){return F.H.useTransition()},he.version="19.2.7",he}var pv;function lf(){return pv||(pv=1,bd.exports=Xb()),bd.exports}var j=lf(),gd={exports:{}},Br={},jd={exports:{}},Sd={};/**
|
|
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 vv;function Vb(){return vv||(vv=1,(function(a){function i(k,$){var ne=k.length;k.push($);e:for(;0<ne;){var be=ne-1>>>1,ge=k[be];if(0<d(ge,$))k[be]=$,k[ne]=ge,ne=be;else break e}}function r(k){return k.length===0?null:k[0]}function u(k){if(k.length===0)return null;var $=k[0],ne=k.pop();if(ne!==$){k[0]=ne;e:for(var be=0,ge=k.length,M=ge>>>1;be<M;){var _=2*(be+1)-1,Z=k[_],P=_+1,X=k[P];if(0>d(Z,ne))P<ge&&0>d(X,Z)?(k[be]=X,k[P]=ne,be=P):(k[be]=Z,k[_]=ne,be=_);else if(P<ge&&0>d(X,ne))k[be]=X,k[P]=ne,be=P;else break e}}return $}function d(k,$){var ne=k.sortIndex-$.sortIndex;return ne!==0?ne:k.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;a.unstable_now=function(){return m.now()}}else{var h=Date,x=h.now();a.unstable_now=function(){return h.now()-x}}var p=[],v=[],g=1,b=null,E=3,C=!1,A=!1,z=!1,Q=!1,U=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function H(k){for(var $=r(v);$!==null;){if($.callback===null)u(v);else if($.startTime<=k)u(v),$.sortIndex=$.expirationTime,i(p,$);else break;$=r(v)}}function V(k){if(z=!1,H(k),!A)if(r(p)!==null)A=!0,W||(W=!0,fe());else{var $=r(v);$!==null&&me(V,$.startTime-k)}}var W=!1,F=-1,I=5,te=-1;function se(){return Q?!0:!(a.unstable_now()-te<I)}function J(){if(Q=!1,W){var k=a.unstable_now();te=k;var $=!0;try{e:{A=!1,z&&(z=!1,q(F),F=-1),C=!0;var ne=E;try{t:{for(H(k),b=r(p);b!==null&&!(b.expirationTime>k&&se());){var be=b.callback;if(typeof be=="function"){b.callback=null,E=b.priorityLevel;var ge=be(b.expirationTime<=k);if(k=a.unstable_now(),typeof ge=="function"){b.callback=ge,H(k),$=!0;break t}b===r(p)&&u(p),H(k)}else u(p);b=r(p)}if(b!==null)$=!0;else{var M=r(v);M!==null&&me(V,M.startTime-k),$=!1}}break e}finally{b=null,E=ne,C=!1}$=void 0}}finally{$?fe():W=!1}}}var fe;if(typeof K=="function")fe=function(){K(J)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Ae=pe.port2;pe.port1.onmessage=J,fe=function(){Ae.postMessage(null)}}else fe=function(){U(J,0)};function me(k,$){F=U(function(){k(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(k){k.callback=null},a.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<k?Math.floor(1e3/k):5},a.unstable_getCurrentPriorityLevel=function(){return E},a.unstable_next=function(k){switch(E){case 1:case 2:case 3:var $=3;break;default:$=E}var ne=E;E=$;try{return k()}finally{E=ne}},a.unstable_requestPaint=function(){Q=!0},a.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var ne=E;E=k;try{return $()}finally{E=ne}},a.unstable_scheduleCallback=function(k,$,ne){var be=a.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?be+ne:be):ne=be,k){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=ne+ge,k={id:g++,callback:$,priorityLevel:k,startTime:ne,expirationTime:ge,sortIndex:-1},ne>be?(k.sortIndex=ne,i(v,k),r(p)===null&&k===r(v)&&(z?(q(F),F=-1):z=!0,me(V,ne-be))):(k.sortIndex=ge,i(p,k),A||C||(A=!0,W||(W=!0,fe()))),k},a.unstable_shouldYield=se,a.unstable_wrapCallback=function(k){var $=E;return function(){var ne=E;E=$;try{return k.apply(this,arguments)}finally{E=ne}}}})(Sd)),Sd}var xv;function Zb(){return xv||(xv=1,jd.exports=Vb()),jd.exports}var Nd={exports:{}},bt={};/**
|
|
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 yv;function $b(){if(yv)return bt;yv=1;var a=lf();function i(p){var v="https://react.dev/errors/"+p;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)v+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(p,v,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:b==null?null:""+b,children:p,containerInfo:v,implementation:g}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(p,v){if(p==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,bt.createPortal=function(p,v){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(i(299));return m(p,v,null,g)},bt.flushSync=function(p){var v=h.T,g=u.p;try{if(h.T=null,u.p=2,p)return p()}finally{h.T=v,u.p=g,u.d.f()}},bt.preconnect=function(p,v){typeof p=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(p,v))},bt.prefetchDNS=function(p){typeof p=="string"&&u.d.D(p)},bt.preinit=function(p,v){if(typeof p=="string"&&v&&typeof v.as=="string"){var g=v.as,b=x(g,v.crossOrigin),E=typeof v.integrity=="string"?v.integrity:void 0,C=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;g==="style"?u.d.S(p,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:b,integrity:E,fetchPriority:C}):g==="script"&&u.d.X(p,{crossOrigin:b,integrity:E,fetchPriority:C,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},bt.preinitModule=function(p,v){if(typeof p=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var g=x(v.as,v.crossOrigin);u.d.M(p,{crossOrigin:g,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&u.d.M(p)},bt.preload=function(p,v){if(typeof p=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var g=v.as,b=x(g,v.crossOrigin);u.d.L(p,g,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},bt.preloadModule=function(p,v){if(typeof p=="string")if(v){var g=x(v.as,v.crossOrigin);u.d.m(p,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:g,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else u.d.m(p)},bt.requestFormReset=function(p){u.d.r(p)},bt.unstable_batchedUpdates=function(p,v){return p(v)},bt.useFormState=function(p,v,g){return h.H.useFormState(p,v,g)},bt.useFormStatus=function(){return h.H.useHostTransitionStatus()},bt.version="19.2.7",bt}var bv;function Fb(){if(bv)return Nd.exports;bv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Nd.exports=$b(),Nd.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 gv;function Jb(){if(gv)return Br;gv=1;var a=Zb(),i=lf(),r=Fb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function h(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 x(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 p(e){if(m(e)!==e)throw Error(u(188))}function v(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,n=t;;){var o=l.return;if(o===null)break;var c=o.alternate;if(c===null){if(n=o.return,n!==null){l=n;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===l)return p(o),e;if(c===n)return p(o),t;c=c.sibling}throw Error(u(188))}if(l.return!==n.return)l=o,n=c;else{for(var f=!1,y=o.child;y;){if(y===l){f=!0,l=o,n=c;break}if(y===n){f=!0,n=o,l=c;break}y=y.sibling}if(!f){for(y=c.child;y;){if(y===l){f=!0,l=c,n=o;break}if(y===n){f=!0,n=c,l=o;break}y=y.sibling}if(!f)throw Error(u(189))}}if(l.alternate!==n)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,E=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function Ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case U:return"Profiler";case Q:return"StrictMode";case V:return"Suspense";case W:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case K:return e.displayName||"Context";case q:return(e._context.displayName||"Context")+".Consumer";case H:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:Ae(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return Ae(e(t))}catch{}}return null}var me=Array.isArray,k=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},be=[],ge=-1;function M(e){return{current:e}}function _(e){0>ge||(e.current=be[ge],be[ge]=null,ge--)}function Z(e,t){ge++,be[ge]=e.current,e.current=t}var P=M(null),X=M(null),le=M(null),re=M(null);function we(e,t){switch(Z(le,t),Z(X,e),Z(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kp(t),e=Dp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_(P),Z(P,e)}function ze(){_(P),_(X),_(le)}function qt(e){e.memoizedState!==null&&Z(re,e);var t=P.current,l=Dp(t,e.type);t!==l&&(Z(X,e),Z(P,l))}function fl(e){X.current===e&&(_(P),_(X)),re.current===e&&(_(re),Or._currentValue=ne)}var De,zt;function mt(e){if(De===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||"",zt=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+De+e+zt}var An=!1;function oa(e,t){if(!e||An)return"";An=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(B){var D=B}Reflect.construct(e,[],G)}else{try{G.call()}catch(B){D=B}e.call(G.prototype)}}else{try{throw Error()}catch(B){D=B}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(B){if(B&&D&&typeof B.stack=="string")return[B.stack,D.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=n.DetermineComponentFrameRoot(),f=c[0],y=c[1];if(f&&y){var S=f.split(`
|
|
44
|
-
`),O=y.split(`
|
|
45
|
-
`);for(o=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;o<O.length&&!O[o].includes("DetermineComponentFrameRoot");)o++;if(n===S.length||o===O.length)for(n=S.length-1,o=O.length-1;1<=n&&0<=o&&S[n]!==O[o];)o--;for(;1<=n&&0<=o;n--,o--)if(S[n]!==O[o]){if(n!==1||o!==1)do if(n--,o--,0>o||S[n]!==O[o]){var L=`
|
|
46
|
-
`+S[n].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=n&&0<=o);break}}}finally{An=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?mt(l):""}function lu(e,t){switch(e.tag){case 26:case 27:case 5:return mt(e.type);case 16:return mt("Lazy");case 13:return e.child!==t&&t!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return oa(e.type,!1);case 11:return oa(e.type.render,!1);case 1:return oa(e.type,!0);case 31:return mt("Activity");default:return""}}function zn(e){try{var t="",l=null;do t+=lu(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
-
Error generating stack: `+n.message+`
|
|
48
|
-
`+n.stack}}var Sl=Object.prototype.hasOwnProperty,Va=a.unstable_scheduleCallback,Za=a.unstable_cancelCallback,ss=a.unstable_shouldYield,os=a.unstable_requestPaint,Nt=a.unstable_now,au=a.unstable_getCurrentPriorityLevel,us=a.unstable_ImmediatePriority,cs=a.unstable_UserBlockingPriority,Rn=a.unstable_NormalPriority,nu=a.unstable_LowPriority,ds=a.unstable_IdlePriority,iu=a.log,ru=a.unstable_setDisableYieldValue,$a=null,Mt=null;function Nl(e){if(typeof iu=="function"&&ru(e),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode($a,e)}catch{}}var wt=Math.clz32?Math.clz32:hs,fs=Math.log,ms=Math.LN2;function hs(e){return e>>>=0,e===0?32:31-(fs(e)/ms|0)|0}var Fa=256,Ja=262144,Wa=4194304;function Ml(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 Pa(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var o=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var y=n&134217727;return y!==0?(n=y&~c,n!==0?o=Ml(n):(f&=y,f!==0?o=Ml(f):l||(l=y&~e,l!==0&&(o=Ml(l))))):(y=n&~c,y!==0?o=Ml(y):f!==0?o=Ml(f):l||(l=n&~e,l!==0&&(o=Ml(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ps(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 Gi(){var e=Wa;return Wa<<=1,(Wa&62914560)===0&&(Wa=4194304),e}function On(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function oe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ye(e,t,l,n,o,c){var f=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var y=e.entanglements,S=e.expirationTimes,O=e.hiddenUpdates;for(l=f&~l;0<l;){var L=31-wt(l),G=1<<L;y[L]=0,S[L]=-1;var D=O[L];if(D!==null)for(O[L]=null,L=0;L<D.length;L++){var B=D[L];B!==null&&(B.lane&=-536870913)}l&=~G}n!==0&&Qt(e,n,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function Qt(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-wt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function ca(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-wt(l),o=1<<n;o&t|e[n]&t&&(e[n]|=t),l&=~o}}function Ki(e,t){var l=t&-t;return l=(l&42)!==0?1:_n(l),(l&(e.suspendedLanes|t))!==0?0:l}function _n(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 kn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xi(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:nv(e.type))}function Vi(e,t){var l=$.p;try{return $.p=e,t()}finally{$.p=l}}var ut=Math.random().toString(36).slice(2),Ge="__reactFiber$"+ut,tt="__reactProps$"+ut,Dn="__reactContainer$"+ut,su="__reactEvents$"+ut,z0="__reactListeners$"+ut,R0="__reactHandles$"+ut,jf="__reactResources$"+ut,Zi="__reactMarker$"+ut;function ou(e){delete e[Ge],delete e[tt],delete e[su],delete e[z0],delete e[R0]}function Un(e){var t=e[Ge];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Dn]||l[Ge]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Yp(e);e!==null;){if(l=e[Ge])return l;e=Yp(e)}return t}e=l,l=e.parentNode}return null}function Bn(e){if(e=e[Ge]||e[Dn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $i(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Hn(e){var t=e[jf];return t||(t=e[jf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ct(e){e[Zi]=!0}var Sf=new Set,Nf={};function Ia(e,t){Ln(e,t),Ln(e+"Capture",t)}function Ln(e,t){for(Nf[e]=t,e=0;e<t.length;e++)Sf.add(t[e])}var O0=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]*$"),Mf={},wf={};function _0(e){return Sl.call(wf,e)?!0:Sl.call(Mf,e)?!1:O0.test(e)?wf[e]=!0:(Mf[e]=!0,!1)}function vs(e,t,l){if(_0(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function xs(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function kl(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function Pt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function k0(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(f){l=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(f){l=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function uu(e){if(!e._valueTracker){var t=Cf(e)?"checked":"value";e._valueTracker=k0(e,t,""+e[t])}}function Tf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=Cf(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function ys(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 D0=/[\n"\\]/g;function It(e){return e.replace(D0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function cu(e,t,l,n,o,c,f,y){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pt(t)):e.value!==""+Pt(t)&&(e.value=""+Pt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?du(e,f,Pt(t)):l!=null?du(e,f,Pt(l)):n!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+Pt(y):e.removeAttribute("name")}function Ef(e,t,l,n,o,c,f,y){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||l!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){uu(e);return}l=l!=null?""+Pt(l):"",t=t!=null?""+Pt(t):l,y||t===e.value||(e.value=t),e.defaultValue=t}n=n??o,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=y?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),uu(e)}function du(e,t,l){t==="number"&&ys(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function qn(e,t,l,n){if(e=e.options,t){t={};for(var o=0;o<l.length;o++)t["$"+l[o]]=!0;for(l=0;l<e.length;l++)o=t.hasOwnProperty("$"+e[l].value),e[l].selected!==o&&(e[l].selected=o),o&&n&&(e[l].defaultSelected=!0)}else{for(l=""+Pt(l),t=null,o=0;o<e.length;o++){if(e[o].value===l){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Af(e,t,l){if(t!=null&&(t=""+Pt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Pt(l):""}function zf(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(u(92));if(me(n)){if(1<n.length)throw Error(u(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Pt(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),uu(e)}function Qn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var U0=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 Rf(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||U0.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Of(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var o in t)n=t[o],t.hasOwnProperty(o)&&l[o]!==n&&Rf(e,o,n)}else for(var c in t)t.hasOwnProperty(c)&&Rf(e,c,t[c])}function fu(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 B0=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"]]),H0=/^[\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 bs(e){return H0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Dl(){}var mu=null;function hu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yn=null,Gn=null;function _f(e){var t=Bn(e);if(t&&(e=t.stateNode)){var l=e[tt]||null;e:switch(e=t.stateNode,t.type){case"input":if(cu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+It(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var o=n[tt]||null;if(!o)throw Error(u(90));cu(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&Tf(n)}break e;case"textarea":Af(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&qn(e,!!l.multiple,t,!1)}}}var pu=!1;function kf(e,t,l){if(pu)return e(t,l);pu=!0;try{var n=e(t);return n}finally{if(pu=!1,(Yn!==null||Gn!==null)&&(ro(),Yn&&(t=Yn,e=Gn,Gn=Yn=null,_f(t),e)))for(t=0;t<e.length;t++)_f(e[t])}}function Fi(e,t){var l=e.stateNode;if(l===null)return null;var n=l[tt]||null;if(n===null)return null;l=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var Ul=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vu=!1;if(Ul)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){vu=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{vu=!1}var da=null,xu=null,gs=null;function Df(){if(gs)return gs;var e,t=xu,l=t.length,n,o="value"in da?da.value:da.textContent,c=o.length;for(e=0;e<l&&t[e]===o[e];e++);var f=l-e;for(n=1;n<=f&&t[l-n]===o[c-n];n++);return gs=o.slice(e,1<n?1-n:void 0)}function js(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 Ss(){return!0}function Uf(){return!1}function Rt(e){function t(l,n,o,c,f){this._reactName=l,this._targetInst=o,this.type=n,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(l=e[y],this[y]=l?l(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ss:Uf,this.isPropagationStopped=Uf,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ss)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ss)},persist:function(){},isPersistent:Ss}),t}var en={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ns=Rt(en),Wi=b({},en,{view:0,detail:0}),L0=Rt(Wi),yu,bu,Pi,Ms=b({},Wi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ju,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!==Pi&&(Pi&&e.type==="mousemove"?(yu=e.screenX-Pi.screenX,bu=e.screenY-Pi.screenY):bu=yu=0,Pi=e),yu)},movementY:function(e){return"movementY"in e?e.movementY:bu}}),Bf=Rt(Ms),q0=b({},Ms,{dataTransfer:0}),Q0=Rt(q0),Y0=b({},Wi,{relatedTarget:0}),gu=Rt(Y0),G0=b({},en,{animationName:0,elapsedTime:0,pseudoElement:0}),K0=Rt(G0),X0=b({},en,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),V0=Rt(X0),Z0=b({},en,{data:0}),Hf=Rt(Z0),$0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},F0={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"},J0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=J0[e])?!!t[e]:!1}function ju(){return W0}var P0=b({},Wi,{key:function(e){if(e.key){var t=$0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=js(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?F0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ju,charCode:function(e){return e.type==="keypress"?js(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?js(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),I0=Rt(P0),ey=b({},Ms,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lf=Rt(ey),ty=b({},Wi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ju}),ly=Rt(ty),ay=b({},en,{propertyName:0,elapsedTime:0,pseudoElement:0}),ny=Rt(ay),iy=b({},Ms,{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}),ry=Rt(iy),sy=b({},en,{newState:0,oldState:0}),oy=Rt(sy),uy=[9,13,27,32],Su=Ul&&"CompositionEvent"in window,Ii=null;Ul&&"documentMode"in document&&(Ii=document.documentMode);var cy=Ul&&"TextEvent"in window&&!Ii,qf=Ul&&(!Su||Ii&&8<Ii&&11>=Ii),Qf=" ",Yf=!1;function Gf(e,t){switch(e){case"keyup":return uy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kn=!1;function dy(e,t){switch(e){case"compositionend":return Kf(t);case"keypress":return t.which!==32?null:(Yf=!0,Qf);case"textInput":return e=t.data,e===Qf&&Yf?null:e;default:return null}}function fy(e,t){if(Kn)return e==="compositionend"||!Su&&Gf(e,t)?(e=Df(),gs=xu=da=null,Kn=!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 qf&&t.locale!=="ko"?null:t.data;default:return null}}var my={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 Xf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!my[e.type]:t==="textarea"}function Vf(e,t,l,n){Yn?Gn?Gn.push(n):Gn=[n]:Yn=n,t=ho(t,"onChange"),0<t.length&&(l=new Ns("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var er=null,tr=null;function hy(e){Ep(e,0)}function ws(e){var t=$i(e);if(Tf(t))return e}function Zf(e,t){if(e==="change")return t}var $f=!1;if(Ul){var Nu;if(Ul){var Mu="oninput"in document;if(!Mu){var Ff=document.createElement("div");Ff.setAttribute("oninput","return;"),Mu=typeof Ff.oninput=="function"}Nu=Mu}else Nu=!1;$f=Nu&&(!document.documentMode||9<document.documentMode)}function Jf(){er&&(er.detachEvent("onpropertychange",Wf),tr=er=null)}function Wf(e){if(e.propertyName==="value"&&ws(tr)){var t=[];Vf(t,tr,e,hu(e)),kf(hy,t)}}function py(e,t,l){e==="focusin"?(Jf(),er=t,tr=l,er.attachEvent("onpropertychange",Wf)):e==="focusout"&&Jf()}function vy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ws(tr)}function xy(e,t){if(e==="click")return ws(t)}function yy(e,t){if(e==="input"||e==="change")return ws(t)}function by(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yt=typeof Object.is=="function"?Object.is:by;function lr(e,t){if(Yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var o=l[n];if(!Sl.call(t,o)||!Yt(e[o],t[o]))return!1}return!0}function Pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function If(e,t){var l=Pf(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Pf(l)}}function em(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?em(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ys(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=ys(e.document)}return t}function wu(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 gy=Ul&&"documentMode"in document&&11>=document.documentMode,Xn=null,Cu=null,ar=null,Tu=!1;function lm(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Tu||Xn==null||Xn!==ys(n)||(n=Xn,"selectionStart"in n&&wu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ar&&lr(ar,n)||(ar=n,n=ho(Cu,"onSelect"),0<n.length&&(t=new Ns("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=Xn)))}function tn(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Vn={animationend:tn("Animation","AnimationEnd"),animationiteration:tn("Animation","AnimationIteration"),animationstart:tn("Animation","AnimationStart"),transitionrun:tn("Transition","TransitionRun"),transitionstart:tn("Transition","TransitionStart"),transitioncancel:tn("Transition","TransitionCancel"),transitionend:tn("Transition","TransitionEnd")},Eu={},am={};Ul&&(am=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function ln(e){if(Eu[e])return Eu[e];if(!Vn[e])return e;var t=Vn[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in am)return Eu[e]=t[l];return e}var nm=ln("animationend"),im=ln("animationiteration"),rm=ln("animationstart"),jy=ln("transitionrun"),Sy=ln("transitionstart"),Ny=ln("transitioncancel"),sm=ln("transitionend"),om=new Map,Au="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(" ");Au.push("scrollEnd");function ml(e,t){om.set(e,t),Ia(t,[e])}var Cs=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)},el=[],Zn=0,zu=0;function Ts(){for(var e=Zn,t=zu=Zn=0;t<e;){var l=el[t];el[t++]=null;var n=el[t];el[t++]=null;var o=el[t];el[t++]=null;var c=el[t];if(el[t++]=null,n!==null&&o!==null){var f=n.pending;f===null?o.next=o:(o.next=f.next,f.next=o),n.pending=o}c!==0&&um(l,o,c)}}function Es(e,t,l,n){el[Zn++]=e,el[Zn++]=t,el[Zn++]=l,el[Zn++]=n,zu|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Ru(e,t,l,n){return Es(e,t,l,n),As(e)}function an(e,t){return Es(e,null,null,t),As(e)}function um(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var o=!1,c=e.return;c!==null;)c.childLanes|=l,n=c.alternate,n!==null&&(n.childLanes|=l),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-wt(l),e=c.hiddenUpdates,n=e[o],n===null?e[o]=[t]:n.push(t),t.lane=l|536870912),c):null}function As(e){if(50<wr)throw wr=0,qc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $n={};function My(e,t,l,n){this.tag=e,this.key=l,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,l,n){return new My(e,t,l,n)}function Ou(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bl(e,t){var l=e.alternate;return l===null?(l=Gt(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function cm(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zs(e,t,l,n,o,c){var f=0;if(n=e,typeof e=="function")Ou(e)&&(f=1);else if(typeof e=="string")f=Ab(e,l,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Gt(31,l,t,o),e.elementType=te,e.lanes=c,e;case z:return nn(l.children,o,c,t);case Q:f=8,o|=24;break;case U:return e=Gt(12,l,t,o|2),e.elementType=U,e.lanes=c,e;case V:return e=Gt(13,l,t,o),e.elementType=V,e.lanes=c,e;case W:return e=Gt(19,l,t,o),e.elementType=W,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:f=10;break e;case q:f=9;break e;case H:f=11;break e;case F:f=14;break e;case I:f=16,n=null;break e}f=29,l=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Gt(f,l,t,o),t.elementType=e,t.type=n,t.lanes=c,t}function nn(e,t,l,n){return e=Gt(7,e,n,t),e.lanes=l,e}function _u(e,t,l){return e=Gt(6,e,null,t),e.lanes=l,e}function dm(e){var t=Gt(18,null,null,0);return t.stateNode=e,t}function ku(e,t,l){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fm=new WeakMap;function tl(e,t){if(typeof e=="object"&&e!==null){var l=fm.get(e);return l!==void 0?l:(t={value:e,source:t,stack:zn(t)},fm.set(e,t),t)}return{value:e,source:t,stack:zn(t)}}var Fn=[],Jn=0,Rs=null,nr=0,ll=[],al=0,fa=null,wl=1,Cl="";function Hl(e,t){Fn[Jn++]=nr,Fn[Jn++]=Rs,Rs=e,nr=t}function mm(e,t,l){ll[al++]=wl,ll[al++]=Cl,ll[al++]=fa,fa=e;var n=wl;e=Cl;var o=32-wt(n)-1;n&=~(1<<o),l+=1;var c=32-wt(t)+o;if(30<c){var f=o-o%5;c=(n&(1<<f)-1).toString(32),n>>=f,o-=f,wl=1<<32-wt(t)+o|l<<o|n,Cl=c+e}else wl=1<<c|l<<o|n,Cl=e}function Du(e){e.return!==null&&(Hl(e,1),mm(e,1,0))}function Uu(e){for(;e===Rs;)Rs=Fn[--Jn],Fn[Jn]=null,nr=Fn[--Jn],Fn[Jn]=null;for(;e===fa;)fa=ll[--al],ll[al]=null,Cl=ll[--al],ll[al]=null,wl=ll[--al],ll[al]=null}function hm(e,t){ll[al++]=wl,ll[al++]=Cl,ll[al++]=fa,wl=t.id,Cl=t.overflow,fa=e}var ht=null,Ve=null,Ce=!1,ma=null,nl=!1,Bu=Error(u(519));function ha(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ir(tl(t,e)),Bu}function pm(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[Ge]=e,t[tt]=n,l){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(l=0;l<Tr.length;l++)Se(Tr[l],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),Ef(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),zf(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||Op(t.textContent,l)?(n.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),n.onScroll!=null&&Se("scroll",t),n.onScrollEnd!=null&&Se("scrollend",t),n.onClick!=null&&(t.onclick=Dl),t=!0):t=!1,t||ha(e,!0)}function vm(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:nl=!1;return;case 27:case 3:nl=!0;return;default:ht=ht.return}}function Wn(e){if(e!==ht)return!1;if(!Ce)return vm(e),Ce=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||td(e.type,e.memoizedProps)),l=!l),l&&Ve&&ha(e),vm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ve=Qp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ve=Qp(e)}else t===27?(t=Ve,Ea(e.type)?(e=rd,rd=null,Ve=e):Ve=t):Ve=ht?rl(e.stateNode.nextSibling):null;return!0}function rn(){Ve=ht=null,Ce=!1}function Hu(){var e=ma;return e!==null&&(Dt===null?Dt=e:Dt.push.apply(Dt,e),ma=null),e}function ir(e){ma===null?ma=[e]:ma.push(e)}var Lu=M(null),sn=null,Ll=null;function pa(e,t,l){Z(Lu,t._currentValue),t._currentValue=l}function ql(e){e._currentValue=Lu.current,_(Lu)}function qu(e,t,l){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===l)break;e=e.return}}function Qu(e,t,l,n){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var f=o.child;c=c.firstContext;e:for(;c!==null;){var y=c;c=o;for(var S=0;S<t.length;S++)if(y.context===t[S]){c.lanes|=l,y=c.alternate,y!==null&&(y.lanes|=l),qu(c.return,l,e),n||(f=null);break e}c=y.next}}else if(o.tag===18){if(f=o.return,f===null)throw Error(u(341));f.lanes|=l,c=f.alternate,c!==null&&(c.lanes|=l),qu(f,l,e),f=null}else f=o.child;if(f!==null)f.return=o;else for(f=o;f!==null;){if(f===e){f=null;break}if(o=f.sibling,o!==null){o.return=f.return,f=o;break}f=f.return}o=f}}function Pn(e,t,l,n){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var f=o.alternate;if(f===null)throw Error(u(387));if(f=f.memoizedProps,f!==null){var y=o.type;Yt(o.pendingProps.value,f.value)||(e!==null?e.push(y):e=[y])}}else if(o===re.current){if(f=o.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Or):e=[Or])}o=o.return}e!==null&&Qu(t,e,l,n),t.flags|=262144}function Os(e){for(e=e.firstContext;e!==null;){if(!Yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function on(e){sn=e,Ll=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function pt(e){return xm(sn,e)}function _s(e,t){return sn===null&&on(e),xm(e,t)}function xm(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Ll===null){if(e===null)throw Error(u(308));Ll=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ll=Ll.next=t;return l}var wy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Cy=a.unstable_scheduleCallback,Ty=a.unstable_NormalPriority,lt={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yu(){return{controller:new wy,data:new Map,refCount:0}}function rr(e){e.refCount--,e.refCount===0&&Cy(Ty,function(){e.controller.abort()})}var sr=null,Gu=0,In=0,ei=null;function Ey(e,t){if(sr===null){var l=sr=[];Gu=0,In=Vc(),ei={status:"pending",value:void 0,then:function(n){l.push(n)}}}return Gu++,t.then(ym,ym),t}function ym(){if(--Gu===0&&sr!==null){ei!==null&&(ei.status="fulfilled");var e=sr;sr=null,In=0,ei=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ay(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(o){l.push(o)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var o=0;o<l.length;o++)(0,l[o])(t)},function(o){for(n.status="rejected",n.reason=o,o=0;o<l.length;o++)(0,l[o])(void 0)}),n}var bm=k.S;k.S=function(e,t){lp=Nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ey(e,t),bm!==null&&bm(e,t)};var un=M(null);function Ku(){var e=un.current;return e!==null?e:Ke.pooledCache}function ks(e,t){t===null?Z(un,un.current):Z(un,t.pool)}function gm(){var e=Ku();return e===null?null:{parent:lt._currentValue,pool:e}}var ti=Error(u(460)),Xu=Error(u(474)),Ds=Error(u(542)),Us={then:function(){}};function jm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sm(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Dl,Dl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mm(e),e;default:if(typeof t.status=="string")t.then(Dl,Dl);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=n}},function(n){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mm(e),e}throw dn=t,ti}}function cn(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(dn=l,ti):l}}var dn=null;function Nm(){if(dn===null)throw Error(u(459));var e=dn;return dn=null,e}function Mm(e){if(e===ti||e===Ds)throw Error(u(483))}var li=null,or=0;function Bs(e){var t=or;return or+=1,li===null&&(li=[]),Sm(li,e,t)}function ur(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hs(e,t){throw t.$$typeof===E?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wm(e){function t(T,w){if(e){var R=T.deletions;R===null?(T.deletions=[w],T.flags|=16):R.push(w)}}function l(T,w){if(!e)return null;for(;w!==null;)t(T,w),w=w.sibling;return null}function n(T){for(var w=new Map;T!==null;)T.key!==null?w.set(T.key,T):w.set(T.index,T),T=T.sibling;return w}function o(T,w){return T=Bl(T,w),T.index=0,T.sibling=null,T}function c(T,w,R){return T.index=R,e?(R=T.alternate,R!==null?(R=R.index,R<w?(T.flags|=67108866,w):R):(T.flags|=67108866,w)):(T.flags|=1048576,w)}function f(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function y(T,w,R,Y){return w===null||w.tag!==6?(w=_u(R,T.mode,Y),w.return=T,w):(w=o(w,R),w.return=T,w)}function S(T,w,R,Y){var ce=R.type;return ce===z?L(T,w,R.props.children,Y,R.key):w!==null&&(w.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===I&&cn(ce)===w.type)?(w=o(w,R.props),ur(w,R),w.return=T,w):(w=zs(R.type,R.key,R.props,null,T.mode,Y),ur(w,R),w.return=T,w)}function O(T,w,R,Y){return w===null||w.tag!==4||w.stateNode.containerInfo!==R.containerInfo||w.stateNode.implementation!==R.implementation?(w=ku(R,T.mode,Y),w.return=T,w):(w=o(w,R.children||[]),w.return=T,w)}function L(T,w,R,Y,ce){return w===null||w.tag!==7?(w=nn(R,T.mode,Y,ce),w.return=T,w):(w=o(w,R),w.return=T,w)}function G(T,w,R){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=_u(""+w,T.mode,R),w.return=T,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case C:return R=zs(w.type,w.key,w.props,null,T.mode,R),ur(R,w),R.return=T,R;case A:return w=ku(w,T.mode,R),w.return=T,w;case I:return w=cn(w),G(T,w,R)}if(me(w)||fe(w))return w=nn(w,T.mode,R,null),w.return=T,w;if(typeof w.then=="function")return G(T,Bs(w),R);if(w.$$typeof===K)return G(T,_s(T,w),R);Hs(T,w)}return null}function D(T,w,R,Y){var ce=w!==null?w.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ce!==null?null:y(T,w,""+R,Y);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case C:return R.key===ce?S(T,w,R,Y):null;case A:return R.key===ce?O(T,w,R,Y):null;case I:return R=cn(R),D(T,w,R,Y)}if(me(R)||fe(R))return ce!==null?null:L(T,w,R,Y,null);if(typeof R.then=="function")return D(T,w,Bs(R),Y);if(R.$$typeof===K)return D(T,w,_s(T,R),Y);Hs(T,R)}return null}function B(T,w,R,Y,ce){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return T=T.get(R)||null,y(w,T,""+Y,ce);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case C:return T=T.get(Y.key===null?R:Y.key)||null,S(w,T,Y,ce);case A:return T=T.get(Y.key===null?R:Y.key)||null,O(w,T,Y,ce);case I:return Y=cn(Y),B(T,w,R,Y,ce)}if(me(Y)||fe(Y))return T=T.get(R)||null,L(w,T,Y,ce,null);if(typeof Y.then=="function")return B(T,w,R,Bs(Y),ce);if(Y.$$typeof===K)return B(T,w,R,_s(w,Y),ce);Hs(w,Y)}return null}function ae(T,w,R,Y){for(var ce=null,Re=null,ie=w,xe=w=0,Me=null;ie!==null&&xe<R.length;xe++){ie.index>xe?(Me=ie,ie=null):Me=ie.sibling;var Oe=D(T,ie,R[xe],Y);if(Oe===null){ie===null&&(ie=Me);break}e&&ie&&Oe.alternate===null&&t(T,ie),w=c(Oe,w,xe),Re===null?ce=Oe:Re.sibling=Oe,Re=Oe,ie=Me}if(xe===R.length)return l(T,ie),Ce&&Hl(T,xe),ce;if(ie===null){for(;xe<R.length;xe++)ie=G(T,R[xe],Y),ie!==null&&(w=c(ie,w,xe),Re===null?ce=ie:Re.sibling=ie,Re=ie);return Ce&&Hl(T,xe),ce}for(ie=n(ie);xe<R.length;xe++)Me=B(ie,T,xe,R[xe],Y),Me!==null&&(e&&Me.alternate!==null&&ie.delete(Me.key===null?xe:Me.key),w=c(Me,w,xe),Re===null?ce=Me:Re.sibling=Me,Re=Me);return e&&ie.forEach(function(_a){return t(T,_a)}),Ce&&Hl(T,xe),ce}function de(T,w,R,Y){if(R==null)throw Error(u(151));for(var ce=null,Re=null,ie=w,xe=w=0,Me=null,Oe=R.next();ie!==null&&!Oe.done;xe++,Oe=R.next()){ie.index>xe?(Me=ie,ie=null):Me=ie.sibling;var _a=D(T,ie,Oe.value,Y);if(_a===null){ie===null&&(ie=Me);break}e&&ie&&_a.alternate===null&&t(T,ie),w=c(_a,w,xe),Re===null?ce=_a:Re.sibling=_a,Re=_a,ie=Me}if(Oe.done)return l(T,ie),Ce&&Hl(T,xe),ce;if(ie===null){for(;!Oe.done;xe++,Oe=R.next())Oe=G(T,Oe.value,Y),Oe!==null&&(w=c(Oe,w,xe),Re===null?ce=Oe:Re.sibling=Oe,Re=Oe);return Ce&&Hl(T,xe),ce}for(ie=n(ie);!Oe.done;xe++,Oe=R.next())Oe=B(ie,T,xe,Oe.value,Y),Oe!==null&&(e&&Oe.alternate!==null&&ie.delete(Oe.key===null?xe:Oe.key),w=c(Oe,w,xe),Re===null?ce=Oe:Re.sibling=Oe,Re=Oe);return e&&ie.forEach(function(qb){return t(T,qb)}),Ce&&Hl(T,xe),ce}function qe(T,w,R,Y){if(typeof R=="object"&&R!==null&&R.type===z&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case C:e:{for(var ce=R.key;w!==null;){if(w.key===ce){if(ce=R.type,ce===z){if(w.tag===7){l(T,w.sibling),Y=o(w,R.props.children),Y.return=T,T=Y;break e}}else if(w.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===I&&cn(ce)===w.type){l(T,w.sibling),Y=o(w,R.props),ur(Y,R),Y.return=T,T=Y;break e}l(T,w);break}else t(T,w);w=w.sibling}R.type===z?(Y=nn(R.props.children,T.mode,Y,R.key),Y.return=T,T=Y):(Y=zs(R.type,R.key,R.props,null,T.mode,Y),ur(Y,R),Y.return=T,T=Y)}return f(T);case A:e:{for(ce=R.key;w!==null;){if(w.key===ce)if(w.tag===4&&w.stateNode.containerInfo===R.containerInfo&&w.stateNode.implementation===R.implementation){l(T,w.sibling),Y=o(w,R.children||[]),Y.return=T,T=Y;break e}else{l(T,w);break}else t(T,w);w=w.sibling}Y=ku(R,T.mode,Y),Y.return=T,T=Y}return f(T);case I:return R=cn(R),qe(T,w,R,Y)}if(me(R))return ae(T,w,R,Y);if(fe(R)){if(ce=fe(R),typeof ce!="function")throw Error(u(150));return R=ce.call(R),de(T,w,R,Y)}if(typeof R.then=="function")return qe(T,w,Bs(R),Y);if(R.$$typeof===K)return qe(T,w,_s(T,R),Y);Hs(T,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,w!==null&&w.tag===6?(l(T,w.sibling),Y=o(w,R),Y.return=T,T=Y):(l(T,w),Y=_u(R,T.mode,Y),Y.return=T,T=Y),f(T)):l(T,w)}return function(T,w,R,Y){try{or=0;var ce=qe(T,w,R,Y);return li=null,ce}catch(ie){if(ie===ti||ie===Ds)throw ie;var Re=Gt(29,ie,null,T.mode);return Re.lanes=Y,Re.return=T,Re}finally{}}}var fn=wm(!0),Cm=wm(!1),va=!1;function Vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zu(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 xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ya(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(_e&2)!==0){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,t=As(e),um(e,null,l),t}return Es(e,n,t,l),As(e)}function cr(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ca(e,l)}}function $u(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var f={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=f:c=c.next=f,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Fu=!1;function dr(){if(Fu){var e=ei;if(e!==null)throw e}}function fr(e,t,l,n){Fu=!1;var o=e.updateQueue;va=!1;var c=o.firstBaseUpdate,f=o.lastBaseUpdate,y=o.shared.pending;if(y!==null){o.shared.pending=null;var S=y,O=S.next;S.next=null,f===null?c=O:f.next=O,f=S;var L=e.alternate;L!==null&&(L=L.updateQueue,y=L.lastBaseUpdate,y!==f&&(y===null?L.firstBaseUpdate=O:y.next=O,L.lastBaseUpdate=S))}if(c!==null){var G=o.baseState;f=0,L=O=S=null,y=c;do{var D=y.lane&-536870913,B=D!==y.lane;if(B?(Ne&D)===D:(n&D)===D){D!==0&&D===In&&(Fu=!0),L!==null&&(L=L.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var ae=e,de=y;D=t;var qe=l;switch(de.tag){case 1:if(ae=de.payload,typeof ae=="function"){G=ae.call(qe,G,D);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=de.payload,D=typeof ae=="function"?ae.call(qe,G,D):ae,D==null)break e;G=b({},G,D);break e;case 2:va=!0}}D=y.callback,D!==null&&(e.flags|=64,B&&(e.flags|=8192),B=o.callbacks,B===null?o.callbacks=[D]:B.push(D))}else B={lane:D,tag:y.tag,payload:y.payload,callback:y.callback,next:null},L===null?(O=L=B,S=G):L=L.next=B,f|=D;if(y=y.next,y===null){if(y=o.shared.pending,y===null)break;B=y,y=B.next,B.next=null,o.lastBaseUpdate=B,o.shared.pending=null}}while(!0);L===null&&(S=G),o.baseState=S,o.firstBaseUpdate=O,o.lastBaseUpdate=L,c===null&&(o.shared.lanes=0),Na|=f,e.lanes=f,e.memoizedState=G}}function Tm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Em(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Tm(l[e],t)}var ai=M(null),Ls=M(0);function Am(e,t){e=Fl,Z(Ls,e),Z(ai,t),Fl=e|t.baseLanes}function Ju(){Z(Ls,Fl),Z(ai,ai.current)}function Wu(){Fl=Ls.current,_(ai),_(Ls)}var Kt=M(null),il=null;function ba(e){var t=e.alternate;Z(Ie,Ie.current&1),Z(Kt,e),il===null&&(t===null||ai.current!==null||t.memoizedState!==null)&&(il=e)}function Pu(e){Z(Ie,Ie.current),Z(Kt,e),il===null&&(il=e)}function zm(e){e.tag===22?(Z(Ie,Ie.current),Z(Kt,e),il===null&&(il=e)):ga()}function ga(){Z(Ie,Ie.current),Z(Kt,Kt.current)}function Xt(e){_(Kt),il===e&&(il=null),_(Ie)}var Ie=M(0);function qs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||nd(l)||id(l)))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 Ql=0,ve=null,He=null,at=null,Qs=!1,ni=!1,mn=!1,Ys=0,mr=0,ii=null,zy=0;function Je(){throw Error(u(321))}function Iu(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Yt(e[l],t[l]))return!1;return!0}function ec(e,t,l,n,o,c){return Ql=c,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?mh:pc,mn=!1,c=l(n,o),mn=!1,ni&&(c=Om(t,l,n,o)),Rm(e),c}function Rm(e){k.H=vr;var t=He!==null&&He.next!==null;if(Ql=0,at=He=ve=null,Qs=!1,mr=0,ii=null,t)throw Error(u(300));e===null||nt||(e=e.dependencies,e!==null&&Os(e)&&(nt=!0))}function Om(e,t,l,n){ve=e;var o=0;do{if(ni&&(ii=null),mr=0,ni=!1,25<=o)throw Error(u(301));if(o+=1,at=He=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}k.H=hh,c=t(l,n)}while(ni);return c}function Ry(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?hr(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(ve.flags|=1024),t}function tc(){var e=Ys!==0;return Ys=0,e}function lc(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function ac(e){if(Qs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qs=!1}Ql=0,at=He=ve=null,ni=!1,mr=Ys=0,ii=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?ve.memoizedState=at=e:at=at.next=e,at}function et(){if(He===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=at===null?ve.memoizedState:at.next;if(t!==null)at=t,He=e;else{if(e===null)throw ve.alternate===null?Error(u(467)):Error(u(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},at===null?ve.memoizedState=at=e:at=at.next=e}return at}function Gs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hr(e){var t=mr;return mr+=1,ii===null&&(ii=[]),e=Sm(ii,e,t),t=ve,(at===null?t.memoizedState:at.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?mh:pc),e}function Ks(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hr(e);if(e.$$typeof===K)return pt(e)}throw Error(u(438,String(e)))}function nc(e){var t=null,l=ve.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=ve.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Gs(),ve.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=se;return t.index++,l}function Yl(e,t){return typeof t=="function"?t(e):t}function Xs(e){var t=et();return ic(t,He,e)}function ic(e,t,l){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=l;var o=e.baseQueue,c=n.pending;if(c!==null){if(o!==null){var f=o.next;o.next=c.next,c.next=f}t.baseQueue=o=c,n.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var y=f=null,S=null,O=t,L=!1;do{var G=O.lane&-536870913;if(G!==O.lane?(Ne&G)===G:(Ql&G)===G){var D=O.revertLane;if(D===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),G===In&&(L=!0);else if((Ql&D)===D){O=O.next,D===In&&(L=!0);continue}else G={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(y=S=G,f=c):S=S.next=G,ve.lanes|=D,Na|=D;G=O.action,mn&&l(c,G),c=O.hasEagerState?O.eagerState:l(c,G)}else D={lane:G,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(y=S=D,f=c):S=S.next=D,ve.lanes|=G,Na|=G;O=O.next}while(O!==null&&O!==t);if(S===null?f=c:S.next=y,!Yt(c,e.memoizedState)&&(nt=!0,L&&(l=ei,l!==null)))throw l;e.memoizedState=c,e.baseState=f,e.baseQueue=S,n.lastRenderedState=c}return o===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function rc(e){var t=et(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var n=l.dispatch,o=l.pending,c=t.memoizedState;if(o!==null){l.pending=null;var f=o=o.next;do c=e(c,f.action),f=f.next;while(f!==o);Yt(c,t.memoizedState)||(nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),l.lastRenderedState=c}return[c,n]}function _m(e,t,l){var n=ve,o=et(),c=Ce;if(c){if(l===void 0)throw Error(u(407));l=l()}else l=t();var f=!Yt((He||o).memoizedState,l);if(f&&(o.memoizedState=l,nt=!0),o=o.queue,uc(Um.bind(null,n,o,e),[e]),o.getSnapshot!==t||f||at!==null&&at.memoizedState.tag&1){if(n.flags|=2048,ri(9,{destroy:void 0},Dm.bind(null,n,o,l,t),null),Ke===null)throw Error(u(349));c||(Ql&127)!==0||km(n,t,l)}return l}function km(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ve.updateQueue,t===null?(t=Gs(),ve.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Dm(e,t,l,n){t.value=l,t.getSnapshot=n,Bm(t)&&Hm(e)}function Um(e,t,l){return l(function(){Bm(t)&&Hm(e)})}function Bm(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Yt(e,l)}catch{return!0}}function Hm(e){var t=an(e,2);t!==null&&Ut(t,e,2)}function sc(e){var t=Ct();if(typeof e=="function"){var l=e;if(e=l(),mn){Nl(!0);try{l()}finally{Nl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:e},t}function Lm(e,t,l,n){return e.baseState=l,ic(e,He,typeof n=="function"?n:Yl)}function Oy(e,t,l,n,o){if($s(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};k.T!==null?l(!0):c.isTransition=!1,n(c),l=t.pending,l===null?(c.next=t.pending=c,qm(t,c)):(c.next=l.next,t.pending=l.next=c)}}function qm(e,t){var l=t.action,n=t.payload,o=e.state;if(t.isTransition){var c=k.T,f={};k.T=f;try{var y=l(o,n),S=k.S;S!==null&&S(f,y),Qm(e,t,y)}catch(O){oc(e,t,O)}finally{c!==null&&f.types!==null&&(c.types=f.types),k.T=c}}else try{c=l(o,n),Qm(e,t,c)}catch(O){oc(e,t,O)}}function Qm(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Ym(e,t,n)},function(n){return oc(e,t,n)}):Ym(e,t,l)}function Ym(e,t,l){t.status="fulfilled",t.value=l,Gm(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,qm(e,l)))}function oc(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Gm(t),t=t.next;while(t!==n)}e.action=null}function Gm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Km(e,t){return t}function Xm(e,t){if(Ce){var l=Ke.formState;if(l!==null){e:{var n=ve;if(Ce){if(Ve){t:{for(var o=Ve,c=nl;o.nodeType!==8;){if(!c){o=null;break t}if(o=rl(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Ve=rl(o.nextSibling),n=o.data==="F!";break e}}ha(n)}n=!1}n&&(t=l[0])}}return l=Ct(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Km,lastRenderedState:t},l.queue=n,l=ch.bind(null,ve,n),n.dispatch=l,n=sc(!1),c=hc.bind(null,ve,!1,n.queue),n=Ct(),o={state:t,dispatch:null,action:e,pending:null},n.queue=o,l=Oy.bind(null,ve,o,c,l),o.dispatch=l,n.memoizedState=e,[t,l,!1]}function Vm(e){var t=et();return Zm(t,He,e)}function Zm(e,t,l){if(t=ic(e,t,Km)[0],e=Xs(Yl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=hr(t)}catch(f){throw f===ti?Ds:f}else n=t;t=et();var o=t.queue,c=o.dispatch;return l!==t.memoizedState&&(ve.flags|=2048,ri(9,{destroy:void 0},_y.bind(null,o,l),null)),[n,c,e]}function _y(e,t){e.action=t}function $m(e){var t=et(),l=He;if(l!==null)return Zm(t,l,e);et(),t=t.memoizedState,l=et();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function ri(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=ve.updateQueue,t===null&&(t=Gs(),ve.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function Fm(){return et().memoizedState}function Vs(e,t,l,n){var o=Ct();ve.flags|=e,o.memoizedState=ri(1|t,{destroy:void 0},l,n===void 0?null:n)}function Zs(e,t,l,n){var o=et();n=n===void 0?null:n;var c=o.memoizedState.inst;He!==null&&n!==null&&Iu(n,He.memoizedState.deps)?o.memoizedState=ri(t,c,l,n):(ve.flags|=e,o.memoizedState=ri(1|t,c,l,n))}function Jm(e,t){Vs(8390656,8,e,t)}function uc(e,t){Zs(2048,8,e,t)}function ky(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=Gs(),ve.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Wm(e){var t=et().memoizedState;return ky({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Pm(e,t){return Zs(4,2,e,t)}function Im(e,t){return Zs(4,4,e,t)}function eh(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function th(e,t,l){l=l!=null?l.concat([e]):null,Zs(4,4,eh.bind(null,t,e),l)}function cc(){}function lh(e,t){var l=et();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&Iu(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function ah(e,t){var l=et();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&Iu(t,n[1]))return n[0];if(n=e(),mn){Nl(!0);try{e()}finally{Nl(!1)}}return l.memoizedState=[n,t],n}function dc(e,t,l){return l===void 0||(Ql&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=np(),ve.lanes|=e,Na|=e,l)}function nh(e,t,l,n){return Yt(l,t)?l:ai.current!==null?(e=dc(e,l,n),Yt(e,t)||(nt=!0),e):(Ql&42)===0||(Ql&1073741824)!==0&&(Ne&261930)===0?(nt=!0,e.memoizedState=l):(e=np(),ve.lanes|=e,Na|=e,t)}function ih(e,t,l,n,o){var c=$.p;$.p=c!==0&&8>c?c:8;var f=k.T,y={};k.T=y,hc(e,!1,t,l);try{var S=o(),O=k.S;if(O!==null&&O(y,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var L=Ay(S,n);pr(e,t,L,$t(e))}else pr(e,t,n,$t(e))}catch(G){pr(e,t,{then:function(){},status:"rejected",reason:G},$t())}finally{$.p=c,f!==null&&y.types!==null&&(f.types=y.types),k.T=f}}function Dy(){}function fc(e,t,l,n){if(e.tag!==5)throw Error(u(476));var o=rh(e).queue;ih(e,o,t,ne,l===null?Dy:function(){return sh(e),l(n)})}function rh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:ne},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sh(e){var t=rh(e);t.next===null&&(t=e.alternate.memoizedState),pr(e,t.next.queue,{},$t())}function mc(){return pt(Or)}function oh(){return et().memoizedState}function uh(){return et().memoizedState}function Uy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=$t();e=xa(l);var n=ya(t,e,l);n!==null&&(Ut(n,t,l),cr(n,t,l)),t={cache:Yu()},e.payload=t;return}t=t.return}}function By(e,t,l){var n=$t();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},$s(e)?dh(t,l):(l=Ru(e,t,l,n),l!==null&&(Ut(l,e,n),fh(l,t,n)))}function ch(e,t,l){var n=$t();pr(e,t,l,n)}function pr(e,t,l,n){var o={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if($s(e))dh(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,y=c(f,l);if(o.hasEagerState=!0,o.eagerState=y,Yt(y,f))return Es(e,t,o,0),Ke===null&&Ts(),!1}catch{}finally{}if(l=Ru(e,t,o,n),l!==null)return Ut(l,e,n),fh(l,t,n),!0}return!1}function hc(e,t,l,n){if(n={lane:2,revertLane:Vc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},$s(e)){if(t)throw Error(u(479))}else t=Ru(e,l,n,2),t!==null&&Ut(t,e,2)}function $s(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function dh(e,t){ni=Qs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function fh(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ca(e,l)}}var vr={readContext:pt,use:Ks,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je};vr.useEffectEvent=Je;var mh={readContext:pt,use:Ks,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:pt,useEffect:Jm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Vs(4194308,4,eh.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var l=Ct();t=t===void 0?null:t;var n=e();if(mn){Nl(!0);try{e()}finally{Nl(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=Ct();if(l!==void 0){var o=l(t);if(mn){Nl(!0);try{l(t)}finally{Nl(!1)}}}else o=t;return n.memoizedState=n.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},n.queue=e,e=e.dispatch=By.bind(null,ve,e),[n.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:function(e){e=sc(e);var t=e.queue,l=ch.bind(null,ve,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:cc,useDeferredValue:function(e,t){var l=Ct();return dc(l,e,t)},useTransition:function(){var e=sc(!1);return e=ih.bind(null,ve,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=ve,o=Ct();if(Ce){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ke===null)throw Error(u(349));(Ne&127)!==0||km(n,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Jm(Um.bind(null,n,c,e),[e]),n.flags|=2048,ri(9,{destroy:void 0},Dm.bind(null,n,c,l,t),null),l},useId:function(){var e=Ct(),t=Ke.identifierPrefix;if(Ce){var l=Cl,n=wl;l=(n&~(1<<32-wt(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ys++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=zy++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:mc,useFormState:Xm,useActionState:Xm,useOptimistic:function(e){var t=Ct();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=hc.bind(null,ve,!0,l),l.dispatch=t,[e,t]},useMemoCache:nc,useCacheRefresh:function(){return Ct().memoizedState=Uy.bind(null,ve)},useEffectEvent:function(e){var t=Ct(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},pc={readContext:pt,use:Ks,useCallback:lh,useContext:pt,useEffect:uc,useImperativeHandle:th,useInsertionEffect:Pm,useLayoutEffect:Im,useMemo:ah,useReducer:Xs,useRef:Fm,useState:function(){return Xs(Yl)},useDebugValue:cc,useDeferredValue:function(e,t){var l=et();return nh(l,He.memoizedState,e,t)},useTransition:function(){var e=Xs(Yl)[0],t=et().memoizedState;return[typeof e=="boolean"?e:hr(e),t]},useSyncExternalStore:_m,useId:oh,useHostTransitionStatus:mc,useFormState:Vm,useActionState:Vm,useOptimistic:function(e,t){var l=et();return Lm(l,He,e,t)},useMemoCache:nc,useCacheRefresh:uh};pc.useEffectEvent=Wm;var hh={readContext:pt,use:Ks,useCallback:lh,useContext:pt,useEffect:uc,useImperativeHandle:th,useInsertionEffect:Pm,useLayoutEffect:Im,useMemo:ah,useReducer:rc,useRef:Fm,useState:function(){return rc(Yl)},useDebugValue:cc,useDeferredValue:function(e,t){var l=et();return He===null?dc(l,e,t):nh(l,He.memoizedState,e,t)},useTransition:function(){var e=rc(Yl)[0],t=et().memoizedState;return[typeof e=="boolean"?e:hr(e),t]},useSyncExternalStore:_m,useId:oh,useHostTransitionStatus:mc,useFormState:$m,useActionState:$m,useOptimistic:function(e,t){var l=et();return He!==null?Lm(l,He,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:nc,useCacheRefresh:uh};hh.useEffectEvent=Wm;function vc(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var xc={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=$t(),o=xa(n);o.payload=t,l!=null&&(o.callback=l),t=ya(e,o,n),t!==null&&(Ut(t,e,n),cr(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=$t(),o=xa(n);o.tag=1,o.payload=t,l!=null&&(o.callback=l),t=ya(e,o,n),t!==null&&(Ut(t,e,n),cr(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=$t(),n=xa(l);n.tag=2,t!=null&&(n.callback=t),t=ya(e,n,l),t!==null&&(Ut(t,e,l),cr(t,e,l))}};function ph(e,t,l,n,o,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,c,f):t.prototype&&t.prototype.isPureReactComponent?!lr(l,n)||!lr(o,c):!0}function vh(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function hn(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var o in e)l[o]===void 0&&(l[o]=e[o])}return l}function xh(e){Cs(e)}function yh(e){console.error(e)}function bh(e){Cs(e)}function Fs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function gh(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function yc(e,t,l){return l=xa(l),l.tag=3,l.payload={element:null},l.callback=function(){Fs(e,t)},l}function jh(e){return e=xa(e),e.tag=3,e}function Sh(e,t,l,n){var o=l.type.getDerivedStateFromError;if(typeof o=="function"){var c=n.value;e.payload=function(){return o(c)},e.callback=function(){gh(t,l,n)}}var f=l.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){gh(t,l,n),typeof o!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var y=n.stack;this.componentDidCatch(n.value,{componentStack:y!==null?y:""})})}function Hy(e,t,l,n,o){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Pn(t,l,o,!0),l=Kt.current,l!==null){switch(l.tag){case 31:case 13:return il===null?so():l.alternate===null&&We===0&&(We=3),l.flags&=-257,l.flags|=65536,l.lanes=o,n===Us?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),Gc(e,n,o)),!1;case 22:return l.flags|=65536,n===Us?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),Gc(e,n,o)),!1}throw Error(u(435,l.tag))}return Gc(e,n,o),so(),!1}if(Ce)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,n!==Bu&&(e=Error(u(422),{cause:n}),ir(tl(e,l)))):(n!==Bu&&(t=Error(u(423),{cause:n}),ir(tl(t,l))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,n=tl(n,l),o=yc(e.stateNode,n,o),$u(e,o),We!==4&&(We=2)),!1;var c=Error(u(520),{cause:n});if(c=tl(c,l),Mr===null?Mr=[c]:Mr.push(c),We!==4&&(We=2),t===null)return!0;n=tl(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=o&-o,l.lanes|=e,e=yc(l.stateNode,n,e),$u(l,e),!1;case 1:if(t=l.type,c=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Ma===null||!Ma.has(c))))return l.flags|=65536,o&=-o,l.lanes|=o,o=jh(o),Sh(o,e,l,n),$u(l,o),!1}l=l.return}while(l!==null);return!1}var bc=Error(u(461)),nt=!1;function vt(e,t,l,n){t.child=e===null?Cm(t,null,l,n):fn(t,e.child,l,n)}function Nh(e,t,l,n,o){l=l.render;var c=t.ref;if("ref"in n){var f={};for(var y in n)y!=="ref"&&(f[y]=n[y])}else f=n;return on(t),n=ec(e,t,l,f,c,o),y=tc(),e!==null&&!nt?(lc(e,t,o),Gl(e,t,o)):(Ce&&y&&Du(t),t.flags|=1,vt(e,t,n,o),t.child)}function Mh(e,t,l,n,o){if(e===null){var c=l.type;return typeof c=="function"&&!Ou(c)&&c.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=c,wh(e,t,c,n,o)):(e=zs(l.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Tc(e,o)){var f=c.memoizedProps;if(l=l.compare,l=l!==null?l:lr,l(f,n)&&e.ref===t.ref)return Gl(e,t,o)}return t.flags|=1,e=Bl(c,n),e.ref=t.ref,e.return=t,t.child=e}function wh(e,t,l,n,o){if(e!==null){var c=e.memoizedProps;if(lr(c,n)&&e.ref===t.ref)if(nt=!1,t.pendingProps=n=c,Tc(e,o))(e.flags&131072)!==0&&(nt=!0);else return t.lanes=e.lanes,Gl(e,t,o)}return gc(e,t,l,n,o)}function Ch(e,t,l,n){var o=n.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|l:l,e!==null){for(n=t.child=e.child,o=0;n!==null;)o=o|n.lanes|n.childLanes,n=n.sibling;n=o&~c}else n=0,t.child=null;return Th(e,t,c,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ks(t,c!==null?c.cachePool:null),c!==null?Am(t,c):Ju(),zm(t);else return n=t.lanes=536870912,Th(e,t,c!==null?c.baseLanes|l:l,l,n)}else c!==null?(ks(t,c.cachePool),Am(t,c),ga(),t.memoizedState=null):(e!==null&&ks(t,null),Ju(),ga());return vt(e,t,o,l),t.child}function xr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Th(e,t,l,n,o){var c=Ku();return c=c===null?null:{parent:lt._currentValue,pool:c},t.memoizedState={baseLanes:l,cachePool:c},e!==null&&ks(t,null),Ju(),zm(t),e!==null&&Pn(e,t,n,!0),t.childLanes=o,null}function Js(e,t){return t=Ps({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Eh(e,t,l){return fn(t,e.child,null,l),e=Js(t,t.pendingProps),e.flags|=2,Xt(t),t.memoizedState=null,e}function Ly(e,t,l){var n=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(n.mode==="hidden")return e=Js(t,n),t.lanes=536870912,xr(null,e);if(Pu(t),(e=Ve)?(e=qp(e,nl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fa!==null?{id:wl,overflow:Cl}:null,retryLane:536870912,hydrationErrors:null},l=dm(e),l.return=t,t.child=l,ht=t,Ve=null)):e=null,e===null)throw ha(t);return t.lanes=536870912,null}return Js(t,n)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(Pu(t),o)if(t.flags&256)t.flags&=-257,t=Eh(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(nt||Pn(e,t,l,!1),o=(l&e.childLanes)!==0,nt||o){if(n=Ke,n!==null&&(f=Ki(n,l),f!==0&&f!==c.retryLane))throw c.retryLane=f,an(e,f),Ut(n,e,f),bc;so(),t=Eh(e,t,l)}else e=c.treeContext,Ve=rl(f.nextSibling),ht=t,Ce=!0,ma=null,nl=!1,e!==null&&hm(t,e),t=Js(t,n),t.flags|=4096;return t}return e=Bl(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ws(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function gc(e,t,l,n,o){return on(t),l=ec(e,t,l,n,void 0,o),n=tc(),e!==null&&!nt?(lc(e,t,o),Gl(e,t,o)):(Ce&&n&&Du(t),t.flags|=1,vt(e,t,l,o),t.child)}function Ah(e,t,l,n,o,c){return on(t),t.updateQueue=null,l=Om(t,n,l,o),Rm(e),n=tc(),e!==null&&!nt?(lc(e,t,c),Gl(e,t,c)):(Ce&&n&&Du(t),t.flags|=1,vt(e,t,l,c),t.child)}function zh(e,t,l,n,o){if(on(t),t.stateNode===null){var c=$n,f=l.contextType;typeof f=="object"&&f!==null&&(c=pt(f)),c=new l(n,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=xc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=n,c.state=t.memoizedState,c.refs={},Vu(t),f=l.contextType,c.context=typeof f=="object"&&f!==null?pt(f):$n,c.state=t.memoizedState,f=l.getDerivedStateFromProps,typeof f=="function"&&(vc(t,l,f,n),c.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&xc.enqueueReplaceState(c,c.state,null),fr(t,n,c,o),dr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){c=t.stateNode;var y=t.memoizedProps,S=hn(l,y);c.props=S;var O=c.context,L=l.contextType;f=$n,typeof L=="object"&&L!==null&&(f=pt(L));var G=l.getDerivedStateFromProps;L=typeof G=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,L||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||O!==f)&&vh(t,c,n,f),va=!1;var D=t.memoizedState;c.state=D,fr(t,n,c,o),dr(),O=t.memoizedState,y||D!==O||va?(typeof G=="function"&&(vc(t,l,G,n),O=t.memoizedState),(S=va||ph(t,l,S,n,D,O,f))?(L||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=O),c.props=n,c.state=O,c.context=f,n=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{c=t.stateNode,Zu(e,t),f=t.memoizedProps,L=hn(l,f),c.props=L,G=t.pendingProps,D=c.context,O=l.contextType,S=$n,typeof O=="object"&&O!==null&&(S=pt(O)),y=l.getDerivedStateFromProps,(O=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==G||D!==S)&&vh(t,c,n,S),va=!1,D=t.memoizedState,c.state=D,fr(t,n,c,o),dr();var B=t.memoizedState;f!==G||D!==B||va||e!==null&&e.dependencies!==null&&Os(e.dependencies)?(typeof y=="function"&&(vc(t,l,y,n),B=t.memoizedState),(L=va||ph(t,l,L,n,D,B,S)||e!==null&&e.dependencies!==null&&Os(e.dependencies))?(O||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(n,B,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(n,B,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=B),c.props=n,c.state=B,c.context=S,n=L):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),n=!1)}return c=n,Ws(e,t),n=(t.flags&128)!==0,c||n?(c=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&n?(t.child=fn(t,e.child,null,o),t.child=fn(t,null,l,o)):vt(e,t,l,o),t.memoizedState=c.state,e=t.child):e=Gl(e,t,o),e}function Rh(e,t,l,n){return rn(),t.flags|=256,vt(e,t,l,n),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:gm()}}function Nc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Zt),e}function Oh(e,t,l){var n=t.pendingProps,o=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(Ie.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ce){if(o?ba(t):ga(),(e=Ve)?(e=qp(e,nl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fa!==null?{id:wl,overflow:Cl}:null,retryLane:536870912,hydrationErrors:null},l=dm(e),l.return=t,t.child=l,ht=t,Ve=null)):e=null,e===null)throw ha(t);return id(e)?t.lanes=32:t.lanes=536870912,null}var y=n.children;return n=n.fallback,o?(ga(),o=t.mode,y=Ps({mode:"hidden",children:y},o),n=nn(n,o,l,null),y.return=t,n.return=t,y.sibling=n,t.child=y,n=t.child,n.memoizedState=Sc(l),n.childLanes=Nc(e,f,l),t.memoizedState=jc,xr(null,n)):(ba(t),Mc(t,y))}var S=e.memoizedState;if(S!==null&&(y=S.dehydrated,y!==null)){if(c)t.flags&256?(ba(t),t.flags&=-257,t=wc(e,t,l)):t.memoizedState!==null?(ga(),t.child=e.child,t.flags|=128,t=null):(ga(),y=n.fallback,o=t.mode,n=Ps({mode:"visible",children:n.children},o),y=nn(y,o,l,null),y.flags|=2,n.return=t,y.return=t,n.sibling=y,t.child=n,fn(t,e.child,null,l),n=t.child,n.memoizedState=Sc(l),n.childLanes=Nc(e,f,l),t.memoizedState=jc,t=xr(null,n));else if(ba(t),id(y)){if(f=y.nextSibling&&y.nextSibling.dataset,f)var O=f.dgst;f=O,n=Error(u(419)),n.stack="",n.digest=f,ir({value:n,source:null,stack:null}),t=wc(e,t,l)}else if(nt||Pn(e,t,l,!1),f=(l&e.childLanes)!==0,nt||f){if(f=Ke,f!==null&&(n=Ki(f,l),n!==0&&n!==S.retryLane))throw S.retryLane=n,an(e,n),Ut(f,e,n),bc;nd(y)||so(),t=wc(e,t,l)}else nd(y)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Ve=rl(y.nextSibling),ht=t,Ce=!0,ma=null,nl=!1,e!==null&&hm(t,e),t=Mc(t,n.children),t.flags|=4096);return t}return o?(ga(),y=n.fallback,o=t.mode,S=e.child,O=S.sibling,n=Bl(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,O!==null?y=Bl(O,y):(y=nn(y,o,l,null),y.flags|=2),y.return=t,n.return=t,n.sibling=y,t.child=n,xr(null,n),n=t.child,y=e.child.memoizedState,y===null?y=Sc(l):(o=y.cachePool,o!==null?(S=lt._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=gm(),y={baseLanes:y.baseLanes|l,cachePool:o}),n.memoizedState=y,n.childLanes=Nc(e,f,l),t.memoizedState=jc,xr(e.child,n)):(ba(t),l=e.child,e=l.sibling,l=Bl(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=l,t.memoizedState=null,l)}function Mc(e,t){return t=Ps({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ps(e,t){return e=Gt(22,e,null,t),e.lanes=0,e}function wc(e,t,l){return fn(t,e.child,null,l),e=Mc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _h(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),qu(e.return,t,l)}function Cc(e,t,l,n,o,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:o,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=l,f.tailMode=o,f.treeForkCount=c)}function kh(e,t,l){var n=t.pendingProps,o=n.revealOrder,c=n.tail;n=n.children;var f=Ie.current,y=(f&2)!==0;if(y?(f=f&1|2,t.flags|=128):f&=1,Z(Ie,f),vt(e,t,n,l),n=Ce?nr:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_h(e,l,t);else if(e.tag===19)_h(e,l,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(o){case"forwards":for(l=t.child,o=null;l!==null;)e=l.alternate,e!==null&&qs(e)===null&&(o=l),l=l.sibling;l=o,l===null?(o=t.child,t.child=null):(o=l.sibling,l.sibling=null),Cc(t,!1,o,l,c,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&qs(e)===null){t.child=o;break}e=o.sibling,o.sibling=l,l=o,o=e}Cc(t,!0,l,null,c,n);break;case"together":Cc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Gl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Na|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Pn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,l=Bl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Bl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Os(e)))}function qy(e,t,l){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),pa(t,lt,e.memoizedState.cache),rn();break;case 27:case 5:qt(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Pu(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ba(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Oh(e,t,l):(ba(t),e=Gl(e,t,l),e!==null?e.sibling:null);ba(t);break;case 19:var o=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Pn(e,t,l,!1),n=(l&t.childLanes)!==0),o){if(n)return kh(e,t,l);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Z(Ie,Ie.current),n)break;return null;case 22:return t.lanes=0,Ch(e,t,l,t.pendingProps);case 24:pa(t,lt,e.memoizedState.cache)}return Gl(e,t,l)}function Dh(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)nt=!0;else{if(!Tc(e,l)&&(t.flags&128)===0)return nt=!1,qy(e,t,l);nt=(e.flags&131072)!==0}else nt=!1,Ce&&(t.flags&1048576)!==0&&mm(t,nr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=cn(t.elementType),t.type=e,typeof e=="function")Ou(e)?(n=hn(e,n),t.tag=1,t=zh(null,t,e,n,l)):(t.tag=0,t=gc(null,t,e,n,l));else{if(e!=null){var o=e.$$typeof;if(o===H){t.tag=11,t=Nh(null,t,e,n,l);break e}else if(o===F){t.tag=14,t=Mh(null,t,e,n,l);break e}}throw t=Ae(e)||e,Error(u(306,t,""))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,o=hn(n,t.pendingProps),zh(e,t,n,o,l);case 3:e:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var c=t.memoizedState;o=c.element,Zu(e,t),fr(t,n,null,l);var f=t.memoizedState;if(n=f.cache,pa(t,lt,n),n!==c.cache&&Qu(t,[lt],l,!0),dr(),n=f.element,c.isDehydrated)if(c={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Rh(e,t,n,l);break e}else if(n!==o){o=tl(Error(u(424)),t),ir(o),t=Rh(e,t,n,l);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(Ve=rl(e.firstChild),ht=t,Ce=!0,ma=null,nl=!0,l=Cm(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(rn(),n===o){t=Gl(e,t,l);break e}vt(e,t,n,l)}t=t.child}return t;case 26:return Ws(e,t),e===null?(l=Vp(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ce||(l=t.type,e=t.pendingProps,n=po(le.current).createElement(l),n[Ge]=t,n[tt]=e,xt(n,l,e),ct(n),t.stateNode=n):t.memoizedState=Vp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qt(t),e===null&&Ce&&(n=t.stateNode=Gp(t.type,t.pendingProps,le.current),ht=t,nl=!0,o=Ve,Ea(t.type)?(rd=o,Ve=rl(n.firstChild)):Ve=o),vt(e,t,t.pendingProps.children,l),Ws(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((o=n=Ve)&&(n=vb(n,t.type,t.pendingProps,nl),n!==null?(t.stateNode=n,ht=t,Ve=rl(n.firstChild),nl=!1,o=!0):o=!1),o||ha(t)),qt(t),o=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,n=c.children,td(o,c)?n=null:f!==null&&td(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=ec(e,t,Ry,null,null,l),Or._currentValue=o),Ws(e,t),vt(e,t,n,l),t.child;case 6:return e===null&&Ce&&((e=l=Ve)&&(l=xb(l,t.pendingProps,nl),l!==null?(t.stateNode=l,ht=t,Ve=null,e=!0):e=!1),e||ha(t)),null;case 13:return Oh(e,t,l);case 4:return we(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=fn(t,null,n,l):vt(e,t,n,l),t.child;case 11:return Nh(e,t,t.type,t.pendingProps,l);case 7:return vt(e,t,t.pendingProps,l),t.child;case 8:return vt(e,t,t.pendingProps.children,l),t.child;case 12:return vt(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,pa(t,t.type,n.value),vt(e,t,n.children,l),t.child;case 9:return o=t.type._context,n=t.pendingProps.children,on(t),o=pt(o),n=n(o),t.flags|=1,vt(e,t,n,l),t.child;case 14:return Mh(e,t,t.type,t.pendingProps,l);case 15:return wh(e,t,t.type,t.pendingProps,l);case 19:return kh(e,t,l);case 31:return Ly(e,t,l);case 22:return Ch(e,t,l,t.pendingProps);case 24:return on(t),n=pt(lt),e===null?(o=Ku(),o===null&&(o=Ke,c=Yu(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=l),o=c),t.memoizedState={parent:n,cache:o},Vu(t),pa(t,lt,o)):((e.lanes&l)!==0&&(Zu(e,t),fr(t,null,null,l),dr()),o=e.memoizedState,c=t.memoizedState,o.parent!==n?(o={parent:n,cache:n},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),pa(t,lt,n)):(n=c.cache,pa(t,lt,n),n!==o.cache&&Qu(t,[lt],l,!0))),vt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Kl(e){e.flags|=4}function Ec(e,t,l,n,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(op())e.flags|=8192;else throw dn=Us,Xu}else e.flags&=-16777217}function Uh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wp(t))if(op())e.flags|=8192;else throw dn=Us,Xu}function Is(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Gi():536870912,e.lanes|=t,ci|=t)}function yr(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var o=e.child;o!==null;)l|=o.lanes|o.childLanes,n|=o.subtreeFlags&65011712,n|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)l|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function Qy(e,t,l){var n=t.pendingProps;switch(Uu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ql(lt),ze(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Wn(t)?Kl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Hu())),Ze(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(Kl(t),c!==null?(Ze(t),Uh(t,c)):(Ze(t),Ec(t,o,null,n,l))):c?c!==e.memoizedState?(Kl(t),Ze(t),Uh(t,c)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Kl(t),Ze(t),Ec(t,o,e,n,l)),null;case 27:if(fl(t),l=le.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Kl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}e=P.current,Wn(t)?pm(t):(e=Gp(o,n,l),t.stateNode=e,Kl(t))}return Ze(t),null;case 5:if(fl(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Kl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}if(c=P.current,Wn(t))pm(t);else{var f=po(le.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?c.multiple=!0:n.size&&(c.size=n.size);break;default:c=typeof n.is=="string"?f.createElement(o,{is:n.is}):f.createElement(o)}}c[Ge]=t,c[tt]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(xt(c,o,n),o){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Kl(t)}}return Ze(t),Ec(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Kl(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=le.current,Wn(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,o=ht,o!==null)switch(o.tag){case 27:case 5:n=o.memoizedProps}e[Ge]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Op(e.nodeValue,l)),e||ha(t,!0)}else e=po(e).createTextNode(n),e[Ge]=t,t.stateNode=e}return Ze(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=Wn(t),l!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ge]=t}else rn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else l=Hu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Xt(t),t):(Xt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ze(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Wn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Ge]=t}else rn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),o=!1}else o=Hu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Xt(t),t):(Xt(t),null)}return Xt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,o=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(o=n.alternate.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==o&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Is(t,t.updateQueue),Ze(t),null);case 4:return ze(),e===null&&Jc(t.stateNode.containerInfo),Ze(t),null;case 10:return ql(t.type),Ze(t),null;case 19:if(_(Ie),n=t.memoizedState,n===null)return Ze(t),null;if(o=(t.flags&128)!==0,c=n.rendering,c===null)if(o)yr(n,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=qs(e),c!==null){for(t.flags|=128,yr(n,!1),e=c.updateQueue,t.updateQueue=e,Is(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)cm(l,e),l=l.sibling;return Z(Ie,Ie.current&1|2),Ce&&Hl(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Nt()>no&&(t.flags|=128,o=!0,yr(n,!1),t.lanes=4194304)}else{if(!o)if(e=qs(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Is(t,e),yr(n,!0),n.tail===null&&n.tailMode==="hidden"&&!c.alternate&&!Ce)return Ze(t),null}else 2*Nt()-n.renderingStartTime>no&&l!==536870912&&(t.flags|=128,o=!0,yr(n,!1),t.lanes=4194304);n.isBackwards?(c.sibling=t.child,t.child=c):(e=n.last,e!==null?e.sibling=c:t.child=c,n.last=c)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Nt(),e.sibling=null,l=Ie.current,Z(Ie,o?l&1|2:l&1),Ce&&Hl(t,n.treeForkCount),e):(Ze(t),null);case 22:case 23:return Xt(t),Wu(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(l&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),l=t.updateQueue,l!==null&&Is(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&_(un),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ql(lt),Ze(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Yy(e,t){switch(Uu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ql(lt),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fl(t),null;case 31:if(t.memoizedState!==null){if(Xt(t),t.alternate===null)throw Error(u(340));rn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));rn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(Ie),null;case 4:return ze(),null;case 10:return ql(t.type),null;case 22:case 23:return Xt(t),Wu(),e!==null&&_(un),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ql(lt),null;case 25:return null;default:return null}}function Bh(e,t){switch(Uu(t),t.tag){case 3:ql(lt),ze();break;case 26:case 27:case 5:fl(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&Xt(t);break;case 13:Xt(t);break;case 19:_(Ie);break;case 10:ql(t.type);break;case 22:case 23:Xt(t),Wu(),e!==null&&_(un);break;case 24:ql(lt)}}function br(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var o=n.next;l=o;do{if((l.tag&e)===e){n=void 0;var c=l.create,f=l.inst;n=c(),f.destroy=n}l=l.next}while(l!==o)}}catch(y){Be(t,t.return,y)}}function ja(e,t,l){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var c=o.next;n=c;do{if((n.tag&e)===e){var f=n.inst,y=f.destroy;if(y!==void 0){f.destroy=void 0,o=t;var S=l,O=y;try{O()}catch(L){Be(o,S,L)}}}n=n.next}while(n!==c)}}catch(L){Be(t,t.return,L)}}function Hh(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Em(t,l)}catch(n){Be(e,e.return,n)}}}function Lh(e,t,l){l.props=hn(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){Be(e,t,n)}}function gr(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(o){Be(e,t,o)}}function Tl(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(o){Be(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){Be(e,t,o)}else l.current=null}function qh(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(o){Be(e,e.return,o)}}function Ac(e,t,l){try{var n=e.stateNode;cb(n,e.type,l,t),n[tt]=t}catch(o){Be(e,e.return,o)}}function Qh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ea(e.type)||e.tag===4}function zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qh(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&&Ea(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 Rc(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Dl));else if(n!==4&&(n===27&&Ea(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Rc(e,t,l),e=e.sibling;e!==null;)Rc(e,t,l),e=e.sibling}function eo(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&Ea(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(eo(e,t,l),e=e.sibling;e!==null;)eo(e,t,l),e=e.sibling}function Yh(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);xt(t,n,l),t[Ge]=e,t[tt]=l}catch(c){Be(e,e.return,c)}}var Xl=!1,it=!1,Oc=!1,Gh=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Gy(e,t){if(e=e.containerInfo,Ic=So,e=tm(e),wu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var o=n.anchorOffset,c=n.focusNode;n=n.focusOffset;try{l.nodeType,c.nodeType}catch{l=null;break e}var f=0,y=-1,S=-1,O=0,L=0,G=e,D=null;t:for(;;){for(var B;G!==l||o!==0&&G.nodeType!==3||(y=f+o),G!==c||n!==0&&G.nodeType!==3||(S=f+n),G.nodeType===3&&(f+=G.nodeValue.length),(B=G.firstChild)!==null;)D=G,G=B;for(;;){if(G===e)break t;if(D===l&&++O===o&&(y=f),D===c&&++L===n&&(S=f),(B=G.nextSibling)!==null)break;G=D,D=G.parentNode}G=B}l=y===-1||S===-1?null:{start:y,end:S}}else l=null}l=l||{start:0,end:0}}else l=null;for(ed={focusedElem:e,selectionRange:l},So=!1,dt=t;dt!==null;)if(t=dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,dt=e;else for(;dt!==null;){switch(t=dt,c=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(l=0;l<e.length;l++)o=e[l],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,l=t,o=c.memoizedProps,c=c.memoizedState,n=l.stateNode;try{var ae=hn(l.type,o);e=n.getSnapshotBeforeUpdate(ae,c),n.__reactInternalSnapshotBeforeUpdate=e}catch(de){Be(l,l.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)ad(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ad(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(u(163))}if(e=t.sibling,e!==null){e.return=t.return,dt=e;break}dt=t.return}}function Kh(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:Zl(e,l),n&4&&br(5,l);break;case 1:if(Zl(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(f){Be(l,l.return,f)}else{var o=hn(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Be(l,l.return,f)}}n&64&&Hh(l),n&512&&gr(l,l.return);break;case 3:if(Zl(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Em(e,t)}catch(f){Be(l,l.return,f)}}break;case 27:t===null&&n&4&&Yh(l);case 26:case 5:Zl(e,l),t===null&&n&4&&qh(l),n&512&&gr(l,l.return);break;case 12:Zl(e,l);break;case 31:Zl(e,l),n&4&&Zh(e,l);break;case 13:Zl(e,l),n&4&&$h(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Py.bind(null,l),yb(e,l))));break;case 22:if(n=l.memoizedState!==null||Xl,!n){t=t!==null&&t.memoizedState!==null||it,o=Xl;var c=it;Xl=n,(it=t)&&!c?$l(e,l,(l.subtreeFlags&8772)!==0):Zl(e,l),Xl=o,it=c}break;case 30:break;default:Zl(e,l)}}function Xh(e){var t=e.alternate;t!==null&&(e.alternate=null,Xh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ou(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 $e=null,Ot=!1;function Vl(e,t,l){for(l=l.child;l!==null;)Vh(e,t,l),l=l.sibling}function Vh(e,t,l){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount($a,l)}catch{}switch(l.tag){case 26:it||Tl(l,t),Vl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:it||Tl(l,t);var n=$e,o=Ot;Ea(l.type)&&($e=l.stateNode,Ot=!1),Vl(e,t,l),Ar(l.stateNode),$e=n,Ot=o;break;case 5:it||Tl(l,t);case 6:if(n=$e,o=Ot,$e=null,Vl(e,t,l),$e=n,Ot=o,$e!==null)if(Ot)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(l.stateNode)}catch(c){Be(l,t,c)}else try{$e.removeChild(l.stateNode)}catch(c){Be(l,t,c)}break;case 18:$e!==null&&(Ot?(e=$e,Hp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),yi(e)):Hp($e,l.stateNode));break;case 4:n=$e,o=Ot,$e=l.stateNode.containerInfo,Ot=!0,Vl(e,t,l),$e=n,Ot=o;break;case 0:case 11:case 14:case 15:ja(2,l,t),it||ja(4,l,t),Vl(e,t,l);break;case 1:it||(Tl(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Lh(l,t,n)),Vl(e,t,l);break;case 21:Vl(e,t,l);break;case 22:it=(n=it)||l.memoizedState!==null,Vl(e,t,l),it=n;break;default:Vl(e,t,l)}}function Zh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{yi(e)}catch(l){Be(t,t.return,l)}}}function $h(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yi(e)}catch(l){Be(t,t.return,l)}}function Ky(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Gh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Gh),t;default:throw Error(u(435,e.tag))}}function to(e,t){var l=Ky(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var o=Iy.bind(null,e,n);n.then(o,o)}})}function _t(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var o=l[n],c=e,f=t,y=f;e:for(;y!==null;){switch(y.tag){case 27:if(Ea(y.type)){$e=y.stateNode,Ot=!1;break e}break;case 5:$e=y.stateNode,Ot=!1;break e;case 3:case 4:$e=y.stateNode.containerInfo,Ot=!0;break e}y=y.return}if($e===null)throw Error(u(160));Vh(c,f,o),$e=null,Ot=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fh(t,e),t=t.sibling}var hl=null;function Fh(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_t(t,e),kt(e),n&4&&(ja(3,e,e.return),br(3,e),ja(5,e,e.return));break;case 1:_t(t,e),kt(e),n&512&&(it||l===null||Tl(l,l.return)),n&64&&Xl&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var o=hl;if(_t(t,e),kt(e),n&512&&(it||l===null||Tl(l,l.return)),n&4){var c=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,o=o.ownerDocument||o;t:switch(n){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Zi]||c[Ge]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(n),o.head.insertBefore(c,o.querySelector("head > title"))),xt(c,n,l),c[Ge]=e,ct(c),n=c;break e;case"link":var f=Fp("link","href",o).get(n+(l.href||""));if(f){for(var y=0;y<f.length;y++)if(c=f[y],c.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&c.getAttribute("rel")===(l.rel==null?null:l.rel)&&c.getAttribute("title")===(l.title==null?null:l.title)&&c.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){f.splice(y,1);break t}}c=o.createElement(n),xt(c,n,l),o.head.appendChild(c);break;case"meta":if(f=Fp("meta","content",o).get(n+(l.content||""))){for(y=0;y<f.length;y++)if(c=f[y],c.getAttribute("content")===(l.content==null?null:""+l.content)&&c.getAttribute("name")===(l.name==null?null:l.name)&&c.getAttribute("property")===(l.property==null?null:l.property)&&c.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&c.getAttribute("charset")===(l.charSet==null?null:l.charSet)){f.splice(y,1);break t}}c=o.createElement(n),xt(c,n,l),o.head.appendChild(c);break;default:throw Error(u(468,n))}c[Ge]=e,ct(c),n=c}e.stateNode=n}else Jp(o,e.type,e.stateNode);else e.stateNode=$p(o,n,e.memoizedProps);else c!==n?(c===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):c.count--,n===null?Jp(o,e.type,e.stateNode):$p(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Ac(e,e.memoizedProps,l.memoizedProps)}break;case 27:_t(t,e),kt(e),n&512&&(it||l===null||Tl(l,l.return)),l!==null&&n&4&&Ac(e,e.memoizedProps,l.memoizedProps);break;case 5:if(_t(t,e),kt(e),n&512&&(it||l===null||Tl(l,l.return)),e.flags&32){o=e.stateNode;try{Qn(o,"")}catch(ae){Be(e,e.return,ae)}}n&4&&e.stateNode!=null&&(o=e.memoizedProps,Ac(e,o,l!==null?l.memoizedProps:o)),n&1024&&(Oc=!0);break;case 6:if(_t(t,e),kt(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(ae){Be(e,e.return,ae)}}break;case 3:if(yo=null,o=hl,hl=vo(t.containerInfo),_t(t,e),hl=o,kt(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ae){Be(e,e.return,ae)}Oc&&(Oc=!1,Jh(e));break;case 4:n=hl,hl=vo(e.stateNode.containerInfo),_t(t,e),kt(e),hl=n;break;case 12:_t(t,e),kt(e);break;case 31:_t(t,e),kt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,to(e,n)));break;case 13:_t(t,e),kt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ao=Nt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,to(e,n)));break;case 22:o=e.memoizedState!==null;var S=l!==null&&l.memoizedState!==null,O=Xl,L=it;if(Xl=O||o,it=L||S,_t(t,e),it=L,Xl=O,kt(e),n&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(l===null||S||Xl||it||pn(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){S=l=t;try{if(c=S.stateNode,o)f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{y=S.stateNode;var G=S.memoizedProps.style,D=G!=null&&G.hasOwnProperty("display")?G.display:null;y.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(ae){Be(S,S.return,ae)}}}else if(t.tag===6){if(l===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(ae){Be(S,S.return,ae)}}}else if(t.tag===18){if(l===null){S=t;try{var B=S.stateNode;o?Lp(B,!0):Lp(S.stateNode,!1)}catch(ae){Be(S,S.return,ae)}}}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;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,to(e,l))));break;case 19:_t(t,e),kt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,to(e,n)));break;case 30:break;case 21:break;default:_t(t,e),kt(e)}}function kt(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(Qh(n)){l=n;break}n=n.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var o=l.stateNode,c=zc(e);eo(e,c,o);break;case 5:var f=l.stateNode;l.flags&32&&(Qn(f,""),l.flags&=-33);var y=zc(e);eo(e,y,f);break;case 3:case 4:var S=l.stateNode.containerInfo,O=zc(e);Rc(e,O,S);break;default:throw Error(u(161))}}catch(L){Be(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Zl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Kh(e,t.alternate,t),t=t.sibling}function pn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ja(4,t,t.return),pn(t);break;case 1:Tl(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Lh(t,t.return,l),pn(t);break;case 27:Ar(t.stateNode);case 26:case 5:Tl(t,t.return),pn(t);break;case 22:t.memoizedState===null&&pn(t);break;case 30:pn(t);break;default:pn(t)}e=e.sibling}}function $l(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,o=e,c=t,f=c.flags;switch(c.tag){case 0:case 11:case 15:$l(o,c,l),br(4,c);break;case 1:if($l(o,c,l),n=c,o=n.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(O){Be(n,n.return,O)}if(n=c,o=n.updateQueue,o!==null){var y=n.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)Tm(S[o],y)}catch(O){Be(n,n.return,O)}}l&&f&64&&Hh(c),gr(c,c.return);break;case 27:Yh(c);case 26:case 5:$l(o,c,l),l&&n===null&&f&4&&qh(c),gr(c,c.return);break;case 12:$l(o,c,l);break;case 31:$l(o,c,l),l&&f&4&&Zh(o,c);break;case 13:$l(o,c,l),l&&f&4&&$h(o,c);break;case 22:c.memoizedState===null&&$l(o,c,l),gr(c,c.return);break;case 30:break;default:$l(o,c,l)}t=t.sibling}}function _c(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&rr(l))}function kc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rr(e))}function pl(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wh(e,t,l,n),t=t.sibling}function Wh(e,t,l,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:pl(e,t,l,n),o&2048&&br(9,t);break;case 1:pl(e,t,l,n);break;case 3:pl(e,t,l,n),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rr(e)));break;case 12:if(o&2048){pl(e,t,l,n),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,y=c.onPostCommit;typeof y=="function"&&y(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Be(t,t.return,S)}}else pl(e,t,l,n);break;case 31:pl(e,t,l,n);break;case 13:pl(e,t,l,n);break;case 23:break;case 22:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?pl(e,t,l,n):jr(e,t):c._visibility&2?pl(e,t,l,n):(c._visibility|=2,si(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),o&2048&&_c(f,t);break;case 24:pl(e,t,l,n),o&2048&&kc(t.alternate,t);break;default:pl(e,t,l,n)}}function si(e,t,l,n,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,y=l,S=n,O=f.flags;switch(f.tag){case 0:case 11:case 15:si(c,f,y,S,o),br(8,f);break;case 23:break;case 22:var L=f.stateNode;f.memoizedState!==null?L._visibility&2?si(c,f,y,S,o):jr(c,f):(L._visibility|=2,si(c,f,y,S,o)),o&&O&2048&&_c(f.alternate,f);break;case 24:si(c,f,y,S,o),o&&O&2048&&kc(f.alternate,f);break;default:si(c,f,y,S,o)}t=t.sibling}}function jr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,o=n.flags;switch(n.tag){case 22:jr(l,n),o&2048&&_c(n.alternate,n);break;case 24:jr(l,n),o&2048&&kc(n.alternate,n);break;default:jr(l,n)}t=t.sibling}}var Sr=8192;function oi(e,t,l){if(e.subtreeFlags&Sr)for(e=e.child;e!==null;)Ph(e,t,l),e=e.sibling}function Ph(e,t,l){switch(e.tag){case 26:oi(e,t,l),e.flags&Sr&&e.memoizedState!==null&&zb(l,hl,e.memoizedState,e.memoizedProps);break;case 5:oi(e,t,l);break;case 3:case 4:var n=hl;hl=vo(e.stateNode.containerInfo),oi(e,t,l),hl=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Sr,Sr=16777216,oi(e,t,l),Sr=n):oi(e,t,l));break;default:oi(e,t,l)}}function Ih(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 Nr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];dt=n,tp(n,e)}Ih(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ep(e),e=e.sibling}function ep(e){switch(e.tag){case 0:case 11:case 15:Nr(e),e.flags&2048&&ja(9,e,e.return);break;case 3:Nr(e);break;case 12:Nr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,lo(e)):Nr(e);break;default:Nr(e)}}function lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];dt=n,tp(n,e)}Ih(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ja(8,t,t.return),lo(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,lo(t));break;default:lo(t)}e=e.sibling}}function tp(e,t){for(;dt!==null;){var l=dt;switch(l.tag){case 0:case 11:case 15:ja(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:rr(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,dt=n;else e:for(l=e;dt!==null;){n=dt;var o=n.sibling,c=n.return;if(Xh(n),n===l){dt=null;break e}if(o!==null){o.return=c,dt=o;break e}dt=c}}}var Xy={getCacheForType:function(e){var t=pt(lt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return pt(lt).controller.signal}},Vy=typeof WeakMap=="function"?WeakMap:Map,_e=0,Ke=null,je=null,Ne=0,Ue=0,Vt=null,Sa=!1,ui=!1,Dc=!1,Fl=0,We=0,Na=0,vn=0,Uc=0,Zt=0,ci=0,Mr=null,Dt=null,Bc=!1,ao=0,lp=0,no=1/0,io=null,Ma=null,rt=0,wa=null,di=null,Jl=0,Hc=0,Lc=null,ap=null,wr=0,qc=null;function $t(){return(_e&2)!==0&&Ne!==0?Ne&-Ne:k.T!==null?Vc():Xi()}function np(){if(Zt===0)if((Ne&536870912)===0||Ce){var e=Ja;Ja<<=1,(Ja&3932160)===0&&(Ja=262144),Zt=e}else Zt=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Zt}function Ut(e,t,l){(e===Ke&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(fi(e,0),Ca(e,Ne,Zt,!1)),oe(e,l),((_e&2)===0||e!==Ke)&&(e===Ke&&((_e&2)===0&&(vn|=l),We===4&&Ca(e,Ne,Zt,!1)),El(e))}function ip(e,t,l){if((_e&6)!==0)throw Error(u(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||ua(e,t),o=n?Fy(e,t):Yc(e,t,!0),c=n;do{if(o===0){ui&&!n&&Ca(e,t,0,!1);break}else{if(l=e.current.alternate,c&&!Zy(l)){o=Yc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var y=e;o=Mr;var S=y.current.memoizedState.isDehydrated;if(S&&(fi(y,f).flags|=256),f=Yc(y,f,!1),f!==2){if(Dc&&!S){y.errorRecoveryDisabledLanes|=c,vn|=c,o=4;break e}c=Dt,Dt=o,c!==null&&(Dt===null?Dt=c:Dt.push.apply(Dt,c))}o=f}if(c=!1,o!==2)continue}}if(o===1){fi(e,0),Ca(e,t,0,!0);break}e:{switch(n=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Ca(n,t,Zt,!Sa);break e;case 2:Dt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=ao+300-Nt(),10<o)){if(Ca(n,t,Zt,!Sa),Pa(n,0,!0)!==0)break e;Jl=t,n.timeoutHandle=Up(rp.bind(null,n,l,Dt,io,Bc,t,Zt,vn,ci,Sa,c,"Throttled",-0,0),o);break e}rp(n,l,Dt,io,Bc,t,Zt,vn,ci,Sa,c,null,-0,0)}}break}while(!0);El(e)}function rp(e,t,l,n,o,c,f,y,S,O,L,G,D,B){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dl},Ph(t,c,G);var ae=(c&62914560)===c?ao-Nt():(c&4194048)===c?lp-Nt():0;if(ae=Rb(G,ae),ae!==null){Jl=c,e.cancelPendingCommit=ae(hp.bind(null,e,t,c,l,n,o,f,y,S,L,G,null,D,B)),Ca(e,c,f,!O);return}}hp(e,t,c,l,n,o,f,y,S)}function Zy(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var o=l[n],c=o.getSnapshot;o=o.value;try{if(!Yt(c(),o))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Ca(e,t,l,n){t&=~Uc,t&=~vn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var c=31-wt(o),f=1<<c;n[c]=-1,o&=~f}l!==0&&Qt(e,l,t)}function ro(){return(_e&6)===0?(Cr(0),!1):!0}function Qc(){if(je!==null){if(Ue===0)var e=je.return;else e=je,Ll=sn=null,ac(e),li=null,or=0,e=je;for(;e!==null;)Bh(e.alternate,e),e=e.return;je=null}}function fi(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,mb(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Jl=0,Qc(),Ke=e,je=l=Bl(e.current,null),Ne=t,Ue=0,Vt=null,Sa=!1,ui=ua(e,t),Dc=!1,ci=Zt=Uc=vn=Na=We=0,Dt=Mr=null,Bc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var o=31-wt(n),c=1<<o;t|=e[o],n&=~c}return Fl=t,Ts(),l}function sp(e,t){ve=null,k.H=vr,t===ti||t===Ds?(t=Nm(),Ue=3):t===Xu?(t=Nm(),Ue=4):Ue=t===bc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Vt=t,je===null&&(We=1,Fs(e,tl(t,e.current)))}function op(){var e=Kt.current;return e===null?!0:(Ne&4194048)===Ne?il===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===il:!1}function up(){var e=k.H;return k.H=vr,e===null?vr:e}function cp(){var e=k.A;return k.A=Xy,e}function so(){We=4,Sa||(Ne&4194048)!==Ne&&Kt.current!==null||(ui=!0),(Na&134217727)===0&&(vn&134217727)===0||Ke===null||Ca(Ke,Ne,Zt,!1)}function Yc(e,t,l){var n=_e;_e|=2;var o=up(),c=cp();(Ke!==e||Ne!==t)&&(io=null,fi(e,t)),t=!1;var f=We;e:do try{if(Ue!==0&&je!==null){var y=je,S=Vt;switch(Ue){case 8:Qc(),f=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(t=!0);var O=Ue;if(Ue=0,Vt=null,mi(e,y,S,O),l&&ui){f=0;break e}break;default:O=Ue,Ue=0,Vt=null,mi(e,y,S,O)}}$y(),f=We;break}catch(L){sp(e,L)}while(!0);return t&&e.shellSuspendCounter++,Ll=sn=null,_e=n,k.H=o,k.A=c,je===null&&(Ke=null,Ne=0,Ts()),f}function $y(){for(;je!==null;)dp(je)}function Fy(e,t){var l=_e;_e|=2;var n=up(),o=cp();Ke!==e||Ne!==t?(io=null,no=Nt()+500,fi(e,t)):ui=ua(e,t);e:do try{if(Ue!==0&&je!==null){t=je;var c=Vt;t:switch(Ue){case 1:Ue=0,Vt=null,mi(e,t,c,1);break;case 2:case 9:if(jm(c)){Ue=0,Vt=null,fp(t);break}t=function(){Ue!==2&&Ue!==9||Ke!==e||(Ue=7),El(e)},c.then(t,t);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:jm(c)?(Ue=0,Vt=null,fp(t)):(Ue=0,Vt=null,mi(e,t,c,7));break;case 5:var f=null;switch(je.tag){case 26:f=je.memoizedState;case 5:case 27:var y=je;if(f?Wp(f):y.stateNode.complete){Ue=0,Vt=null;var S=y.sibling;if(S!==null)je=S;else{var O=y.return;O!==null?(je=O,oo(O)):je=null}break t}}Ue=0,Vt=null,mi(e,t,c,5);break;case 6:Ue=0,Vt=null,mi(e,t,c,6);break;case 8:Qc(),We=6;break e;default:throw Error(u(462))}}Jy();break}catch(L){sp(e,L)}while(!0);return Ll=sn=null,k.H=n,k.A=o,_e=l,je!==null?0:(Ke=null,Ne=0,Ts(),We)}function Jy(){for(;je!==null&&!ss();)dp(je)}function dp(e){var t=Dh(e.alternate,e,Fl);e.memoizedProps=e.pendingProps,t===null?oo(e):je=t}function fp(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Ah(l,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=Ah(l,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:ac(t);default:Bh(l,t),t=je=cm(t,Fl),t=Dh(l,t,Fl)}e.memoizedProps=e.pendingProps,t===null?oo(e):je=t}function mi(e,t,l,n){Ll=sn=null,ac(t),li=null,or=0;var o=t.return;try{if(Hy(e,o,t,l,Ne)){We=1,Fs(e,tl(l,e.current)),je=null;return}}catch(c){if(o!==null)throw je=o,c;We=1,Fs(e,tl(l,e.current)),je=null;return}t.flags&32768?(Ce||n===1?e=!0:ui||(Ne&536870912)!==0?e=!1:(Sa=e=!0,(n===2||n===9||n===3||n===6)&&(n=Kt.current,n!==null&&n.tag===13&&(n.flags|=16384))),mp(t,e)):oo(t)}function oo(e){var t=e;do{if((t.flags&32768)!==0){mp(t,Sa);return}e=t.return;var l=Qy(t.alternate,t,Fl);if(l!==null){je=l;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);We===0&&(We=5)}function mp(e,t){do{var l=Yy(e.alternate,e);if(l!==null){l.flags&=32767,je=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){je=e;return}je=e=l}while(e!==null);We=6,je=null}function hp(e,t,l,n,o,c,f,y,S){e.cancelPendingCommit=null;do uo();while(rt!==0);if((_e&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=zu,Ye(e,l,c,f,y,S),e===Ke&&(je=Ke=null,Ne=0),di=t,wa=e,Jl=l,Hc=c,Lc=o,ap=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,eb(Rn,function(){return bp(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=k.T,k.T=null,o=$.p,$.p=2,f=_e,_e|=4;try{Gy(e,t,l)}finally{_e=f,$.p=o,k.T=n}}rt=1,pp(),vp(),xp()}}function pp(){if(rt===1){rt=0;var e=wa,t=di,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=k.T,k.T=null;var n=$.p;$.p=2;var o=_e;_e|=4;try{Fh(t,e);var c=ed,f=tm(e.containerInfo),y=c.focusedElem,S=c.selectionRange;if(f!==y&&y&&y.ownerDocument&&em(y.ownerDocument.documentElement,y)){if(S!==null&&wu(y)){var O=S.start,L=S.end;if(L===void 0&&(L=O),"selectionStart"in y)y.selectionStart=O,y.selectionEnd=Math.min(L,y.value.length);else{var G=y.ownerDocument||document,D=G&&G.defaultView||window;if(D.getSelection){var B=D.getSelection(),ae=y.textContent.length,de=Math.min(S.start,ae),qe=S.end===void 0?de:Math.min(S.end,ae);!B.extend&&de>qe&&(f=qe,qe=de,de=f);var T=If(y,de),w=If(y,qe);if(T&&w&&(B.rangeCount!==1||B.anchorNode!==T.node||B.anchorOffset!==T.offset||B.focusNode!==w.node||B.focusOffset!==w.offset)){var R=G.createRange();R.setStart(T.node,T.offset),B.removeAllRanges(),de>qe?(B.addRange(R),B.extend(w.node,w.offset)):(R.setEnd(w.node,w.offset),B.addRange(R))}}}}for(G=[],B=y;B=B.parentNode;)B.nodeType===1&&G.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<G.length;y++){var Y=G[y];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}So=!!Ic,ed=Ic=null}finally{_e=o,$.p=n,k.T=l}}e.current=t,rt=2}}function vp(){if(rt===2){rt=0;var e=wa,t=di,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=k.T,k.T=null;var n=$.p;$.p=2;var o=_e;_e|=4;try{Kh(e,t.alternate,t)}finally{_e=o,$.p=n,k.T=l}}rt=3}}function xp(){if(rt===4||rt===3){rt=0,os();var e=wa,t=di,l=Jl,n=ap;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?rt=5:(rt=0,di=wa=null,yp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Ma=null),kn(l),t=t.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot($a,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=k.T,o=$.p,$.p=2,k.T=null;try{for(var c=e.onRecoverableError,f=0;f<n.length;f++){var y=n[f];c(y.value,{componentStack:y.stack})}}finally{k.T=t,$.p=o}}(Jl&3)!==0&&uo(),El(e),o=e.pendingLanes,(l&261930)!==0&&(o&42)!==0?e===qc?wr++:(wr=0,qc=e):wr=0,Cr(0)}}function yp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,rr(t)))}function uo(){return pp(),vp(),xp(),bp()}function bp(){if(rt!==5)return!1;var e=wa,t=Hc;Hc=0;var l=kn(Jl),n=k.T,o=$.p;try{$.p=32>l?32:l,k.T=null,l=Lc,Lc=null;var c=wa,f=Jl;if(rt=0,di=wa=null,Jl=0,(_e&6)!==0)throw Error(u(331));var y=_e;if(_e|=4,ep(c.current),Wh(c,c.current,f,l),_e=y,Cr(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot($a,c)}catch{}return!0}finally{$.p=o,k.T=n,yp(e,t)}}function gp(e,t,l){t=tl(l,t),t=yc(e.stateNode,t,2),e=ya(e,t,2),e!==null&&(oe(e,2),El(e))}function Be(e,t,l){if(e.tag===3)gp(e,e,l);else for(;t!==null;){if(t.tag===3){gp(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ma===null||!Ma.has(n))){e=tl(l,e),l=jh(2),n=ya(t,l,2),n!==null&&(Sh(l,n,t,e),oe(n,2),El(n));break}}t=t.return}}function Gc(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new Vy;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(l)||(Dc=!0,o.add(l),e=Wy.bind(null,e,t,l),t.then(e,e))}function Wy(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ke===e&&(Ne&l)===l&&(We===4||We===3&&(Ne&62914560)===Ne&&300>Nt()-ao?(_e&2)===0&&fi(e,0):Uc|=l,ci===Ne&&(ci=0)),El(e)}function jp(e,t){t===0&&(t=Gi()),e=an(e,t),e!==null&&(oe(e,t),El(e))}function Py(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),jp(e,l)}function Iy(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),jp(e,l)}function eb(e,t){return Va(e,t)}var co=null,hi=null,Kc=!1,fo=!1,Xc=!1,Ta=0;function El(e){e!==hi&&e.next===null&&(hi===null?co=hi=e:hi=hi.next=e),fo=!0,Kc||(Kc=!0,lb())}function Cr(e,t){if(!Xc&&fo){Xc=!0;do for(var l=!1,n=co;n!==null;){if(e!==0){var o=n.pendingLanes;if(o===0)var c=0;else{var f=n.suspendedLanes,y=n.pingedLanes;c=(1<<31-wt(42|e)+1)-1,c&=o&~(f&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,wp(n,c))}else c=Ne,c=Pa(n,n===Ke?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(c&3)===0||ua(n,c)||(l=!0,wp(n,c));n=n.next}while(l);Xc=!1}}function tb(){Sp()}function Sp(){fo=Kc=!1;var e=0;Ta!==0&&fb()&&(e=Ta);for(var t=Nt(),l=null,n=co;n!==null;){var o=n.next,c=Np(n,t);c===0?(n.next=null,l===null?co=o:l.next=o,o===null&&(hi=l)):(l=n,(e!==0||(c&3)!==0)&&(fo=!0)),n=o}rt!==0&&rt!==5||Cr(e),Ta!==0&&(Ta=0)}function Np(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-wt(c),y=1<<f,S=o[f];S===-1?((y&l)===0||(y&n)!==0)&&(o[f]=ps(y,t)):S<=t&&(e.expiredLanes|=y),c&=~y}if(t=Ke,l=Ne,l=Pa(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Za(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ua(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&Za(n),kn(l)){case 2:case 8:l=cs;break;case 32:l=Rn;break;case 268435456:l=ds;break;default:l=Rn}return n=Mp.bind(null,e),l=Va(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&Za(n),e.callbackPriority=2,e.callbackNode=null,2}function Mp(e,t){if(rt!==0&&rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(uo()&&e.callbackNode!==l)return null;var n=Ne;return n=Pa(e,e===Ke?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(ip(e,n,t),Np(e,Nt()),e.callbackNode!=null&&e.callbackNode===l?Mp.bind(null,e):null)}function wp(e,t){if(uo())return null;ip(e,t,!0)}function lb(){hb(function(){(_e&6)!==0?Va(us,tb):Sp()})}function Vc(){if(Ta===0){var e=In;e===0&&(e=Fa,Fa<<=1,(Fa&261888)===0&&(Fa=256)),Ta=e}return Ta}function Cp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:bs(""+e)}function Tp(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function ab(e,t,l,n,o){if(t==="submit"&&l&&l.stateNode===o){var c=Cp((o[tt]||null).action),f=n.submitter;f&&(t=(t=f[tt]||null)?Cp(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var y=new Ns("action","action",null,n,o);e.push({event:y,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ta!==0){var S=f?Tp(o,f):new FormData(o);fc(l,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(y.preventDefault(),S=f?Tp(o,f):new FormData(o),fc(l,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var Zc=0;Zc<Au.length;Zc++){var $c=Au[Zc],nb=$c.toLowerCase(),ib=$c[0].toUpperCase()+$c.slice(1);ml(nb,"on"+ib)}ml(nm,"onAnimationEnd"),ml(im,"onAnimationIteration"),ml(rm,"onAnimationStart"),ml("dblclick","onDoubleClick"),ml("focusin","onFocus"),ml("focusout","onBlur"),ml(jy,"onTransitionRun"),ml(Sy,"onTransitionStart"),ml(Ny,"onTransitionCancel"),ml(sm,"onTransitionEnd"),Ln("onMouseEnter",["mouseout","mouseover"]),Ln("onMouseLeave",["mouseout","mouseover"]),Ln("onPointerEnter",["pointerout","pointerover"]),Ln("onPointerLeave",["pointerout","pointerover"]),Ia("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ia("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ia("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ia("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ia("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ia("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tr="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(" "),rb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tr));function Ep(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],o=n.event;n=n.listeners;e:{var c=void 0;if(t)for(var f=n.length-1;0<=f;f--){var y=n[f],S=y.instance,O=y.currentTarget;if(y=y.listener,S!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=O;try{c(o)}catch(L){Cs(L)}o.currentTarget=null,c=S}else for(f=0;f<n.length;f++){if(y=n[f],S=y.instance,O=y.currentTarget,y=y.listener,S!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=O;try{c(o)}catch(L){Cs(L)}o.currentTarget=null,c=S}}}}function Se(e,t){var l=t[su];l===void 0&&(l=t[su]=new Set);var n=e+"__bubble";l.has(n)||(Ap(t,e,2,!1),l.add(n))}function Fc(e,t,l){var n=0;t&&(n|=4),Ap(l,e,n,t)}var mo="_reactListening"+Math.random().toString(36).slice(2);function Jc(e){if(!e[mo]){e[mo]=!0,Sf.forEach(function(l){l!=="selectionchange"&&(rb.has(l)||Fc(l,!1,e),Fc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[mo]||(t[mo]=!0,Fc("selectionchange",!1,t))}}function Ap(e,t,l,n){switch(nv(t)){case 2:var o=kb;break;case 8:o=Db;break;default:o=dd}l=o.bind(null,t,l,e),o=void 0,!vu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,l,{capture:!0,passive:o}):e.addEventListener(t,l,!0):o!==void 0?e.addEventListener(t,l,{passive:o}):e.addEventListener(t,l,!1)}function Wc(e,t,l,n,o){var c=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var y=n.stateNode.containerInfo;if(y===o)break;if(f===4)for(f=n.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===o)return;f=f.return}for(;y!==null;){if(f=Un(y),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){n=c=f;continue e}y=y.parentNode}}n=n.return}kf(function(){var O=c,L=hu(l),G=[];e:{var D=om.get(e);if(D!==void 0){var B=Ns,ae=e;switch(e){case"keypress":if(js(l)===0)break e;case"keydown":case"keyup":B=I0;break;case"focusin":ae="focus",B=gu;break;case"focusout":ae="blur",B=gu;break;case"beforeblur":case"afterblur":B=gu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":B=Bf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=Q0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=ly;break;case nm:case im:case rm:B=K0;break;case sm:B=ny;break;case"scroll":case"scrollend":B=L0;break;case"wheel":B=ry;break;case"copy":case"cut":case"paste":B=V0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=Lf;break;case"toggle":case"beforetoggle":B=oy}var de=(t&4)!==0,qe=!de&&(e==="scroll"||e==="scrollend"),T=de?D!==null?D+"Capture":null:D;de=[];for(var w=O,R;w!==null;){var Y=w;if(R=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||R===null||T===null||(Y=Fi(w,T),Y!=null&&de.push(Er(w,Y,R))),qe)break;w=w.return}0<de.length&&(D=new B(D,ae,null,l,L),G.push({event:D,listeners:de}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",D&&l!==mu&&(ae=l.relatedTarget||l.fromElement)&&(Un(ae)||ae[Dn]))break e;if((B||D)&&(D=L.window===L?L:(D=L.ownerDocument)?D.defaultView||D.parentWindow:window,B?(ae=l.relatedTarget||l.toElement,B=O,ae=ae?Un(ae):null,ae!==null&&(qe=m(ae),de=ae.tag,ae!==qe||de!==5&&de!==27&&de!==6)&&(ae=null)):(B=null,ae=O),B!==ae)){if(de=Bf,Y="onMouseLeave",T="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(de=Lf,Y="onPointerLeave",T="onPointerEnter",w="pointer"),qe=B==null?D:$i(B),R=ae==null?D:$i(ae),D=new de(Y,w+"leave",B,l,L),D.target=qe,D.relatedTarget=R,Y=null,Un(L)===O&&(de=new de(T,w+"enter",ae,l,L),de.target=R,de.relatedTarget=qe,Y=de),qe=Y,B&&ae)t:{for(de=sb,T=B,w=ae,R=0,Y=T;Y;Y=de(Y))R++;Y=0;for(var ce=w;ce;ce=de(ce))Y++;for(;0<R-Y;)T=de(T),R--;for(;0<Y-R;)w=de(w),Y--;for(;R--;){if(T===w||w!==null&&T===w.alternate){de=T;break t}T=de(T),w=de(w)}de=null}else de=null;B!==null&&zp(G,D,B,de,!1),ae!==null&&qe!==null&&zp(G,qe,ae,de,!0)}}e:{if(D=O?$i(O):window,B=D.nodeName&&D.nodeName.toLowerCase(),B==="select"||B==="input"&&D.type==="file")var Re=Zf;else if(Xf(D))if($f)Re=yy;else{Re=vy;var ie=py}else B=D.nodeName,!B||B.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?O&&fu(O.elementType)&&(Re=Zf):Re=xy;if(Re&&(Re=Re(e,O))){Vf(G,Re,l,L);break e}ie&&ie(e,D,O),e==="focusout"&&O&&D.type==="number"&&O.memoizedProps.value!=null&&du(D,"number",D.value)}switch(ie=O?$i(O):window,e){case"focusin":(Xf(ie)||ie.contentEditable==="true")&&(Xn=ie,Cu=O,ar=null);break;case"focusout":ar=Cu=Xn=null;break;case"mousedown":Tu=!0;break;case"contextmenu":case"mouseup":case"dragend":Tu=!1,lm(G,l,L);break;case"selectionchange":if(gy)break;case"keydown":case"keyup":lm(G,l,L)}var xe;if(Su)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Kn?Gf(e,l)&&(Me="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Me="onCompositionStart");Me&&(qf&&l.locale!=="ko"&&(Kn||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Kn&&(xe=Df()):(da=L,xu="value"in da?da.value:da.textContent,Kn=!0)),ie=ho(O,Me),0<ie.length&&(Me=new Hf(Me,e,null,l,L),G.push({event:Me,listeners:ie}),xe?Me.data=xe:(xe=Kf(l),xe!==null&&(Me.data=xe)))),(xe=cy?dy(e,l):fy(e,l))&&(Me=ho(O,"onBeforeInput"),0<Me.length&&(ie=new Hf("onBeforeInput","beforeinput",null,l,L),G.push({event:ie,listeners:Me}),ie.data=xe)),ab(G,e,O,l,L)}Ep(G,t)})}function Er(e,t,l){return{instance:e,listener:t,currentTarget:l}}function ho(e,t){for(var l=t+"Capture",n=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=Fi(e,l),o!=null&&n.unshift(Er(e,o,c)),o=Fi(e,t),o!=null&&n.push(Er(e,o,c))),e.tag===3)return n;e=e.return}return[]}function sb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zp(e,t,l,n,o){for(var c=t._reactName,f=[];l!==null&&l!==n;){var y=l,S=y.alternate,O=y.stateNode;if(y=y.tag,S!==null&&S===n)break;y!==5&&y!==26&&y!==27||O===null||(S=O,o?(O=Fi(l,c),O!=null&&f.unshift(Er(l,O,S))):o||(O=Fi(l,c),O!=null&&f.push(Er(l,O,S)))),l=l.return}f.length!==0&&e.push({event:t,listeners:f})}var ob=/\r\n?/g,ub=/\u0000|\uFFFD/g;function Rp(e){return(typeof e=="string"?e:""+e).replace(ob,`
|
|
49
|
-
`).replace(ub,"")}function Op(e,t){return t=Rp(t),Rp(e)===t}function Le(e,t,l,n,o,c){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Qn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Qn(e,""+n);break;case"className":xs(e,"class",n);break;case"tabIndex":xs(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":xs(e,l,n);break;case"style":Of(e,n,c);break;case"data":if(t!=="object"){xs(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=bs(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"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 c=="function"&&(l==="formAction"?(t!=="input"&&Le(e,t,"name",o.name,o,null),Le(e,t,"formEncType",o.formEncType,o,null),Le(e,t,"formMethod",o.formMethod,o,null),Le(e,t,"formTarget",o.formTarget,o,null)):(Le(e,t,"encType",o.encType,o,null),Le(e,t,"method",o.method,o,null),Le(e,t,"target",o.target,o,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=bs(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=Dl);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=bs(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":Se("beforetoggle",e),Se("toggle",e),vs(e,"popover",n);break;case"xlinkActuate":kl(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":kl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":kl(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":kl(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":kl(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":kl(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":kl(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":kl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":kl(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":vs(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=B0.get(l)||l,vs(e,l,n))}}function Pc(e,t,l,n,o,c){switch(l){case"style":Of(e,n,c);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof n=="string"?Qn(e,n):(typeof n=="number"||typeof n=="bigint")&&Qn(e,""+n);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Dl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Nf.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(o=l.endsWith("Capture"),t=l.slice(2,o?l.length-7:void 0),c=e[tt]||null,c=c!=null?c[l]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof n=="function")){typeof c!="function"&&c!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,o);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):vs(e,l,n)}}}function xt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var n=!1,o=!1,c;for(c in l)if(l.hasOwnProperty(c)){var f=l[c];if(f!=null)switch(c){case"src":n=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Le(e,t,c,f,l,null)}}o&&Le(e,t,"srcSet",l.srcSet,l,null),n&&Le(e,t,"src",l.src,l,null);return;case"input":Se("invalid",e);var y=c=f=o=null,S=null,O=null;for(n in l)if(l.hasOwnProperty(n)){var L=l[n];if(L!=null)switch(n){case"name":o=L;break;case"type":f=L;break;case"checked":S=L;break;case"defaultChecked":O=L;break;case"value":c=L;break;case"defaultValue":y=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:Le(e,t,n,L,l,null)}}Ef(e,c,y,S,O,f,o,!1);return;case"select":Se("invalid",e),n=f=c=null;for(o in l)if(l.hasOwnProperty(o)&&(y=l[o],y!=null))switch(o){case"value":c=y;break;case"defaultValue":f=y;break;case"multiple":n=y;default:Le(e,t,o,y,l,null)}t=c,l=f,e.multiple=!!n,t!=null?qn(e,!!n,t,!1):l!=null&&qn(e,!!n,l,!0);return;case"textarea":Se("invalid",e),c=o=n=null;for(f in l)if(l.hasOwnProperty(f)&&(y=l[f],y!=null))switch(f){case"value":n=y;break;case"defaultValue":o=y;break;case"children":c=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(u(91));break;default:Le(e,t,f,y,l,null)}zf(e,n,o,c);return;case"option":for(S in l)if(l.hasOwnProperty(S)&&(n=l[S],n!=null))switch(S){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Le(e,t,S,n,l,null)}return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(n=0;n<Tr.length;n++)Se(Tr[n],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("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(O in l)if(l.hasOwnProperty(O)&&(n=l[O],n!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Le(e,t,O,n,l,null)}return;default:if(fu(t)){for(L in l)l.hasOwnProperty(L)&&(n=l[L],n!==void 0&&Pc(e,t,L,n,l,void 0));return}}for(y in l)l.hasOwnProperty(y)&&(n=l[y],n!=null&&Le(e,t,y,n,l,null))}function cb(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,f=null,y=null,S=null,O=null,L=null;for(B in l){var G=l[B];if(l.hasOwnProperty(B)&&G!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":S=G;default:n.hasOwnProperty(B)||Le(e,t,B,null,n,G)}}for(var D in n){var B=n[D];if(G=l[D],n.hasOwnProperty(D)&&(B!=null||G!=null))switch(D){case"type":c=B;break;case"name":o=B;break;case"checked":O=B;break;case"defaultChecked":L=B;break;case"value":f=B;break;case"defaultValue":y=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:B!==G&&Le(e,t,D,B,n,G)}}cu(e,f,y,S,O,L,c,o);return;case"select":B=f=y=D=null;for(c in l)if(S=l[c],l.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":B=S;default:n.hasOwnProperty(c)||Le(e,t,c,null,n,S)}for(o in n)if(c=n[o],S=l[o],n.hasOwnProperty(o)&&(c!=null||S!=null))switch(o){case"value":D=c;break;case"defaultValue":y=c;break;case"multiple":f=c;default:c!==S&&Le(e,t,o,c,n,S)}t=y,l=f,n=B,D!=null?qn(e,!!l,D,!1):!!n!=!!l&&(t!=null?qn(e,!!l,t,!0):qn(e,!!l,l?[]:"",!1));return;case"textarea":B=D=null;for(y in l)if(o=l[y],l.hasOwnProperty(y)&&o!=null&&!n.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:Le(e,t,y,null,n,o)}for(f in n)if(o=n[f],c=l[f],n.hasOwnProperty(f)&&(o!=null||c!=null))switch(f){case"value":D=o;break;case"defaultValue":B=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&Le(e,t,f,o,n,c)}Af(e,D,B);return;case"option":for(var ae in l)if(D=l[ae],l.hasOwnProperty(ae)&&D!=null&&!n.hasOwnProperty(ae))switch(ae){case"selected":e.selected=!1;break;default:Le(e,t,ae,null,n,D)}for(S in n)if(D=n[S],B=l[S],n.hasOwnProperty(S)&&D!==B&&(D!=null||B!=null))switch(S){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Le(e,t,S,D,n,B)}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 de in l)D=l[de],l.hasOwnProperty(de)&&D!=null&&!n.hasOwnProperty(de)&&Le(e,t,de,null,n,D);for(O in n)if(D=n[O],B=l[O],n.hasOwnProperty(O)&&D!==B&&(D!=null||B!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:Le(e,t,O,D,n,B)}return;default:if(fu(t)){for(var qe in l)D=l[qe],l.hasOwnProperty(qe)&&D!==void 0&&!n.hasOwnProperty(qe)&&Pc(e,t,qe,void 0,n,D);for(L in n)D=n[L],B=l[L],!n.hasOwnProperty(L)||D===B||D===void 0&&B===void 0||Pc(e,t,L,D,n,B);return}}for(var T in l)D=l[T],l.hasOwnProperty(T)&&D!=null&&!n.hasOwnProperty(T)&&Le(e,t,T,null,n,D);for(G in n)D=n[G],B=l[G],!n.hasOwnProperty(G)||D===B||D==null&&B==null||Le(e,t,G,D,n,B)}function _p(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function db(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var o=l[n],c=o.transferSize,f=o.initiatorType,y=o.duration;if(c&&y&&_p(f)){for(f=0,y=o.responseEnd,n+=1;n<l.length;n++){var S=l[n],O=S.startTime;if(O>y)break;var L=S.transferSize,G=S.initiatorType;L&&_p(G)&&(S=S.responseEnd,f+=L*(S<y?1:(y-O)/(S-O)))}if(--n,t+=8*(c+f)/(o.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 Ic=null,ed=null;function po(e){return e.nodeType===9?e:e.ownerDocument}function kp(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 Dp(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 td(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 ld=null;function fb(){var e=window.event;return e&&e.type==="popstate"?e===ld?!1:(ld=e,!0):(ld=null,!1)}var Up=typeof setTimeout=="function"?setTimeout:void 0,mb=typeof clearTimeout=="function"?clearTimeout:void 0,Bp=typeof Promise=="function"?Promise:void 0,hb=typeof queueMicrotask=="function"?queueMicrotask:typeof Bp<"u"?function(e){return Bp.resolve(null).then(e).catch(pb)}:Up;function pb(e){setTimeout(function(){throw e})}function Ea(e){return e==="head"}function Hp(e,t){var l=t,n=0;do{var o=l.nextSibling;if(e.removeChild(l),o&&o.nodeType===8)if(l=o.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(o),yi(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Ar(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ar(l);for(var c=l.firstChild;c;){var f=c.nextSibling,y=c.nodeName;c[Zi]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||l.removeChild(c),c=f}}else l==="body"&&Ar(e.ownerDocument.body);l=o}while(l);yi(t)}function Lp(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function ad(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ad(l),ou(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function vb(e,t,l,n){for(;e.nodeType===1;){var o=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Zi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=rl(e.nextSibling),e===null)break}return null}function xb(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=rl(e.nextSibling),e===null))return null;return e}function qp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=rl(e.nextSibling),e===null))return null;return e}function nd(e){return e.data==="$?"||e.data==="$~"}function id(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yb(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function rl(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 rd=null;function Qp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return rl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Yp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Gp(e,t,l){switch(t=po(l),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Ar(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ou(e)}var sl=new Map,Kp=new Set;function vo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Wl=$.d;$.d={f:bb,r:gb,D:jb,C:Sb,L:Nb,m:Mb,X:Cb,S:wb,M:Tb};function bb(){var e=Wl.f(),t=ro();return e||t}function gb(e){var t=Bn(e);t!==null&&t.tag===5&&t.type==="form"?sh(t):Wl.r(e)}var pi=typeof document>"u"?null:document;function Xp(e,t,l){var n=pi;if(n&&typeof t=="string"&&t){var o=It(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Kp.has(o)||(Kp.add(o),e={rel:e,crossOrigin:l,href:t},n.querySelector(o)===null&&(t=n.createElement("link"),xt(t,"link",e),ct(t),n.head.appendChild(t)))}}function jb(e){Wl.D(e),Xp("dns-prefetch",e,null)}function Sb(e,t){Wl.C(e,t),Xp("preconnect",e,t)}function Nb(e,t,l){Wl.L(e,t,l);var n=pi;if(n&&e&&t){var o='link[rel="preload"][as="'+It(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+It(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+It(l.imageSizes)+'"]')):o+='[href="'+It(e)+'"]';var c=o;switch(t){case"style":c=vi(e);break;case"script":c=xi(e)}sl.has(c)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),sl.set(c,e),n.querySelector(o)!==null||t==="style"&&n.querySelector(zr(c))||t==="script"&&n.querySelector(Rr(c))||(t=n.createElement("link"),xt(t,"link",e),ct(t),n.head.appendChild(t)))}}function Mb(e,t){Wl.m(e,t);var l=pi;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+It(n)+'"][href="'+It(e)+'"]',c=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=xi(e)}if(!sl.has(c)&&(e=b({rel:"modulepreload",href:e},t),sl.set(c,e),l.querySelector(o)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Rr(c)))return}n=l.createElement("link"),xt(n,"link",e),ct(n),l.head.appendChild(n)}}}function wb(e,t,l){Wl.S(e,t,l);var n=pi;if(n&&e){var o=Hn(n).hoistableStyles,c=vi(e);t=t||"default";var f=o.get(c);if(!f){var y={loading:0,preload:null};if(f=n.querySelector(zr(c)))y.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=sl.get(c))&&sd(e,l);var S=f=n.createElement("link");ct(S),xt(S,"link",e),S._p=new Promise(function(O,L){S.onload=O,S.onerror=L}),S.addEventListener("load",function(){y.loading|=1}),S.addEventListener("error",function(){y.loading|=2}),y.loading|=4,xo(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:y},o.set(c,f)}}}function Cb(e,t){Wl.X(e,t);var l=pi;if(l&&e){var n=Hn(l).hoistableScripts,o=xi(e),c=n.get(o);c||(c=l.querySelector(Rr(o)),c||(e=b({src:e,async:!0},t),(t=sl.get(o))&&od(e,t),c=l.createElement("script"),ct(c),xt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function Tb(e,t){Wl.M(e,t);var l=pi;if(l&&e){var n=Hn(l).hoistableScripts,o=xi(e),c=n.get(o);c||(c=l.querySelector(Rr(o)),c||(e=b({src:e,async:!0,type:"module"},t),(t=sl.get(o))&&od(e,t),c=l.createElement("script"),ct(c),xt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function Vp(e,t,l,n){var o=(o=le.current)?vo(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=vi(l.href),l=Hn(o).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=vi(l.href);var c=Hn(o).hoistableStyles,f=c.get(e);if(f||(o=o.ownerDocument||o,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=o.querySelector(zr(e)))&&!c._p&&(f.instance=c,f.state.loading=5),sl.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},sl.set(e,l),c||Eb(o,e,l,f.state))),t&&n===null)throw Error(u(528,""));return f}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xi(l),l=Hn(o).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function vi(e){return'href="'+It(e)+'"'}function zr(e){return'link[rel="stylesheet"]['+e+"]"}function Zp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Eb(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),xt(t,"link",l),ct(t),e.head.appendChild(t))}function xi(e){return'[src="'+It(e)+'"]'}function Rr(e){return"script[async]"+e}function $p(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+It(l.href)+'"]');if(n)return t.instance=n,ct(n),n;var o=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ct(n),xt(n,"style",o),xo(n,l.precedence,e),t.instance=n;case"stylesheet":o=vi(l.href);var c=e.querySelector(zr(o));if(c)return t.state.loading|=4,t.instance=c,ct(c),c;n=Zp(l),(o=sl.get(o))&&sd(n,o),c=(e.ownerDocument||e).createElement("link"),ct(c);var f=c;return f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),xt(c,"link",n),t.state.loading|=4,xo(c,l.precedence,e),t.instance=c;case"script":return c=xi(l.src),(o=e.querySelector(Rr(c)))?(t.instance=o,ct(o),o):(n=l,(o=sl.get(c))&&(n=b({},l),od(n,o)),e=e.ownerDocument||e,o=e.createElement("script"),ct(o),xt(o,"link",n),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,xo(n,l.precedence,e));return t.instance}function xo(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=n.length?n[n.length-1]:null,c=o,f=0;f<n.length;f++){var y=n[f];if(y.dataset.precedence===t)c=y;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function od(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var yo=null;function Fp(e,t,l){if(yo===null){var n=new Map,o=yo=new Map;o.set(l,n)}else o=yo,n=o.get(l),n||(n=new Map,o.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),o=0;o<l.length;o++){var c=l[o];if(!(c[Zi]||c[Ge]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var y=n.get(f);y?y.push(c):n.set(f,[c])}}return n}function Jp(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Ab(e,t,l){if(l===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 Wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function zb(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=vi(n.href),c=t.querySelector(zr(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bo.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,ct(c);return}c=t.ownerDocument||t,n=Zp(n),(o=sl.get(o))&&sd(n,o),c=c.createElement("link"),ct(c);var f=c;f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),xt(c,"link",n),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=bo.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ud=0;function Rb(e,t){return e.stylesheets&&e.count===0&&jo(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&ud===0&&(ud=62500*db());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&jo(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>ud?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(o)}}:null}function bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var go=null;function jo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,go=new Map,t.forEach(Ob,e),go=null,bo.call(e))}function Ob(e,t){if(!(t.state.loading&4)){var l=go.get(e);if(l)var n=l.get(null);else{l=new Map,go.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var f=o[c];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(l.set(f.dataset.precedence,f),n=f)}n&&l.set(null,n)}o=t.instance,f=o.getAttribute("data-precedence"),c=l.get(f)||n,c===n&&l.set(null,o),l.set(f,o),this.count++,n=bo.bind(this),o.addEventListener("load",n),o.addEventListener("error",n),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Or={$$typeof:K,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function _b(e,t,l,n,o,c,f,y,S){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=On(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=On(0),this.hiddenUpdates=On(null),this.identifierPrefix=n,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Pp(e,t,l,n,o,c,f,y,S,O,L,G){return e=new _b(e,t,l,f,S,O,L,G,y),t=1,c===!0&&(t|=24),c=Gt(3,null,null,t),e.current=c,c.stateNode=e,t=Yu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:n,isDehydrated:l,cache:t},Vu(c),e}function Ip(e){return e?(e=$n,e):$n}function ev(e,t,l,n,o,c){o=Ip(o),n.context===null?n.context=o:n.pendingContext=o,n=xa(t),n.payload={element:l},c=c===void 0?null:c,c!==null&&(n.callback=c),l=ya(e,n,t),l!==null&&(Ut(l,e,t),cr(l,e,t))}function tv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function cd(e,t){tv(e,t),(e=e.alternate)&&tv(e,t)}function lv(e){if(e.tag===13||e.tag===31){var t=an(e,67108864);t!==null&&Ut(t,e,67108864),cd(e,67108864)}}function av(e){if(e.tag===13||e.tag===31){var t=$t();t=_n(t);var l=an(e,t);l!==null&&Ut(l,e,t),cd(e,t)}}var So=!0;function kb(e,t,l,n){var o=k.T;k.T=null;var c=$.p;try{$.p=2,dd(e,t,l,n)}finally{$.p=c,k.T=o}}function Db(e,t,l,n){var o=k.T;k.T=null;var c=$.p;try{$.p=8,dd(e,t,l,n)}finally{$.p=c,k.T=o}}function dd(e,t,l,n){if(So){var o=fd(n);if(o===null)Wc(e,t,n,No,l),iv(e,n);else if(Bb(o,e,t,l,n))n.stopPropagation();else if(iv(e,n),t&4&&-1<Ub.indexOf(e)){for(;o!==null;){var c=Bn(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=Ml(c.pendingLanes);if(f!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;f;){var S=1<<31-wt(f);y.entanglements[1]|=S,f&=~S}El(c),(_e&6)===0&&(no=Nt()+500,Cr(0))}}break;case 31:case 13:y=an(c,2),y!==null&&Ut(y,c,2),ro(),cd(c,2)}if(c=fd(n),c===null&&Wc(e,t,n,No,l),c===o)break;o=c}o!==null&&n.stopPropagation()}else Wc(e,t,n,null,l)}}function fd(e){return e=hu(e),md(e)}var No=null;function md(e){if(No=null,e=Un(e),e!==null){var t=m(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=h(t),e!==null)return e;e=null}else if(l===31){if(e=x(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return No=e,null}function nv(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(au()){case us:return 2;case cs:return 8;case Rn:case nu:return 32;case ds:return 268435456;default:return 32}default:return 32}}var hd=!1,Aa=null,za=null,Ra=null,_r=new Map,kr=new Map,Oa=[],Ub="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 iv(e,t){switch(e){case"focusin":case"focusout":Aa=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":_r.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":kr.delete(t.pointerId)}}function Dr(e,t,l,n,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Bn(t),t!==null&&lv(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Bb(e,t,l,n,o){switch(t){case"focusin":return Aa=Dr(Aa,e,t,l,n,o),!0;case"dragenter":return za=Dr(za,e,t,l,n,o),!0;case"mouseover":return Ra=Dr(Ra,e,t,l,n,o),!0;case"pointerover":var c=o.pointerId;return _r.set(c,Dr(_r.get(c)||null,e,t,l,n,o)),!0;case"gotpointercapture":return c=o.pointerId,kr.set(c,Dr(kr.get(c)||null,e,t,l,n,o)),!0}return!1}function rv(e){var t=Un(e.target);if(t!==null){var l=m(t);if(l!==null){if(t=l.tag,t===13){if(t=h(l),t!==null){e.blockedOn=t,Vi(e.priority,function(){av(l)});return}}else if(t===31){if(t=x(l),t!==null){e.blockedOn=t,Vi(e.priority,function(){av(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=fd(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);mu=n,l.target.dispatchEvent(n),mu=null}else return t=Bn(l),t!==null&&lv(t),e.blockedOn=l,!1;t.shift()}return!0}function sv(e,t,l){Mo(e)&&l.delete(t)}function Hb(){hd=!1,Aa!==null&&Mo(Aa)&&(Aa=null),za!==null&&Mo(za)&&(za=null),Ra!==null&&Mo(Ra)&&(Ra=null),_r.forEach(sv),kr.forEach(sv)}function wo(e,t){e.blockedOn===t&&(e.blockedOn=null,hd||(hd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Hb)))}var Co=null;function ov(e){Co!==e&&(Co=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Co===e&&(Co=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],o=e[t+2];if(typeof n!="function"){if(md(n||l)===null)continue;break}var c=Bn(l);c!==null&&(e.splice(t,3),t-=3,fc(c,{pending:!0,data:o,method:l.method,action:n},n,o))}}))}function yi(e){function t(S){return wo(S,e)}Aa!==null&&wo(Aa,e),za!==null&&wo(za,e),Ra!==null&&wo(Ra,e),_r.forEach(t),kr.forEach(t);for(var l=0;l<Oa.length;l++){var n=Oa[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Oa.length&&(l=Oa[0],l.blockedOn===null);)rv(l),l.blockedOn===null&&Oa.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var o=l[n],c=l[n+1],f=o[tt]||null;if(typeof c=="function")f||ov(l);else if(f){var y=null;if(c&&c.hasAttribute("formAction")){if(o=c,f=c[tt]||null)y=f.formAction;else if(md(o)!==null)continue}else y=f.action;typeof y=="function"?l[n+1]=y:(l.splice(n,3),n-=3),ov(l)}}}function uv(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(f){return o=f})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function pd(e){this._internalRoot=e}To.prototype.render=pd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,n=$t();ev(l,n,e,t,null,null)},To.prototype.unmount=pd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ev(e.current,2,null,e,null,null),ro(),t[Dn]=null}};function To(e){this._internalRoot=e}To.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xi();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Oa.length&&t!==0&&t<Oa[l].priority;l++);Oa.splice(l,0,e),l===0&&rv(e)}};var cv=i.version;if(cv!=="19.2.7")throw Error(u(527,cv,"19.2.7"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Lb={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{$a=Eo.inject(Lb),Mt=Eo}catch{}}return Br.createRoot=function(e,t){if(!d(e))throw Error(u(299));var l=!1,n="",o=xh,c=yh,f=bh;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Pp(e,1,!1,null,null,l,n,null,o,c,f,uv),e[Dn]=t.current,Jc(e),new pd(t)},Br.hydrateRoot=function(e,t,l){if(!d(e))throw Error(u(299));var n=!1,o="",c=xh,f=yh,y=bh,S=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(o=l.identifierPrefix),l.onUncaughtError!==void 0&&(c=l.onUncaughtError),l.onCaughtError!==void 0&&(f=l.onCaughtError),l.onRecoverableError!==void 0&&(y=l.onRecoverableError),l.formState!==void 0&&(S=l.formState)),t=Pp(e,1,!0,t,l??null,n,o,S,c,f,y,uv),t.context=Ip(null),l=t.current,n=$t(),n=_n(n),o=xa(n),o.callback=null,ya(l,o,n),l=n,t.current.lanes=l,oe(t,l),El(t),e[Dn]=t.current,Jc(e),new To(t)},Br.version="19.2.7",Br}var jv;function Wb(){if(jv)return gd.exports;jv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),gd.exports=Jb(),gd.exports}var Pb=Wb();/**
|
|
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 Sv="popstate";function Nv(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function Ib(a={}){function i(u,d){var v;let m=(v=d.state)==null?void 0:v.masked,{pathname:h,search:x,hash:p}=m||u.location;return _d("",{pathname:h,search:x,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default",m?{pathname:u.location.pathname,search:u.location.search,hash:u.location.hash}:void 0)}function r(u,d){return typeof d=="string"?d:Kr(d)}return tg(i,r,null,a)}function Fe(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function Ol(a,i){if(!a){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function eg(){return Math.random().toString(36).substring(2,10)}function Mv(a,i){return{usr:a.state,key:a.key,idx:i,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function _d(a,i,r=null,u,d){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof i=="string"?Li(i):i,state:r,key:i&&i.key||u||eg(),mask:d}}function Kr({pathname:a="/",search:i="",hash:r=""}){return i&&i!=="?"&&(a+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(a+=r.charAt(0)==="#"?r:"#"+r),a}function Li(a){let i={};if(a){let r=a.indexOf("#");r>=0&&(i.hash=a.substring(r),a=a.substring(0,r));let u=a.indexOf("?");u>=0&&(i.search=a.substring(u),a=a.substring(0,u)),a&&(i.pathname=a)}return i}function tg(a,i,r,u={}){let{window:d=document.defaultView,v5Compat:m=!1}=u,h=d.history,x="POP",p=null,v=g();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function g(){return(h.state||{idx:null}).idx}function b(){x="POP";let Q=g(),U=Q==null?null:Q-v;v=Q,p&&p({action:x,location:z.location,delta:U})}function E(Q,U){x="PUSH";let q=Nv(Q)?Q:_d(z.location,Q,U);v=g()+1;let K=Mv(q,v),H=z.createHref(q.mask||q);try{h.pushState(K,"",H)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(H)}m&&p&&p({action:x,location:z.location,delta:1})}function C(Q,U){x="REPLACE";let q=Nv(Q)?Q:_d(z.location,Q,U);v=g();let K=Mv(q,v),H=z.createHref(q.mask||q);h.replaceState(K,"",H),m&&p&&p({action:x,location:z.location,delta:0})}function A(Q){return lg(d,Q)}let z={get action(){return x},get location(){return a(d,h)},listen(Q){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(Sv,b),p=Q,()=>{d.removeEventListener(Sv,b),p=null}},createHref(Q){return i(d,Q)},createURL:A,encodeLocation(Q){let U=A(Q);return{pathname:U.pathname,search:U.search,hash:U.hash}},push:E,replace:C,go(Q){return h.go(Q)}};return z}function lg(a,i,r=!1){let u="http://localhost";a&&(u=a.location.origin!=="null"?a.location.origin:a.location.href),Fe(u,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:Kr(i);return d=d.replace(/ $/,"%20"),!r&&d.startsWith("//")&&(d=u+d),new URL(d,u)}function px(a,i,r="/"){return ag(a,i,r,!1)}function ag(a,i,r,u,d){let m=typeof i=="string"?Li(i):i,h=na(m.pathname||"/",r);if(h==null)return null;let x=ng(a),p=null,v=vg(h);for(let g=0;p==null&&g<x.length;++g)p=hg(x[g],v,u);return p}function ng(a){let i=vx(a);return ig(i),i}function vx(a,i=[],r=[],u="",d=!1){let m=(h,x,p=d,v)=>{let g={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:x,route:h};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(u)&&p)return;Fe(g.relativePath.startsWith(u),`Absolute route path "${g.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(u.length)}let b=yl([u,g.relativePath]),E=r.concat(g);h.children&&h.children.length>0&&(Fe(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),vx(h.children,i,E,b,p)),!(h.path==null&&!h.index)&&i.push({path:b,score:fg(b,h.index),routesMeta:E})};return a.forEach((h,x)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))m(h,x);else for(let v of xx(h.path))m(h,x,!0,v)}),i}function xx(a){let i=a.split("/");if(i.length===0)return[];let[r,...u]=i,d=r.endsWith("?"),m=r.replace(/\?$/,"");if(u.length===0)return d?[m,""]:[m];let h=xx(u.join("/")),x=[];return x.push(...h.map(p=>p===""?m:[m,p].join("/"))),d&&x.push(...h),x.map(p=>a.startsWith("/")&&p===""?"/":p)}function ig(a){a.sort((i,r)=>i.score!==r.score?r.score-i.score:mg(i.routesMeta.map(u=>u.childrenIndex),r.routesMeta.map(u=>u.childrenIndex)))}var rg=/^:[\w-]+$/,sg=3,og=2,ug=1,cg=10,dg=-2,wv=a=>a==="*";function fg(a,i){let r=a.split("/"),u=r.length;return r.some(wv)&&(u+=dg),i&&(u+=og),r.filter(d=>!wv(d)).reduce((d,m)=>d+(rg.test(m)?sg:m===""?ug:cg),u)}function mg(a,i){return a.length===i.length&&a.slice(0,-1).every((u,d)=>u===i[d])?a[a.length-1]-i[i.length-1]:0}function hg(a,i,r=!1){let{routesMeta:u}=a,d={},m="/",h=[];for(let x=0;x<u.length;++x){let p=u[x],v=x===u.length-1,g=m==="/"?i:i.slice(m.length)||"/",b=qo({path:p.relativePath,caseSensitive:p.caseSensitive,end:v},g),E=p.route;if(!b&&v&&r&&!u[u.length-1].route.index&&(b=qo({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!b)return null;Object.assign(d,b.params),h.push({params:d,pathname:yl([m,b.pathname]),pathnameBase:gg(yl([m,b.pathnameBase])),route:E}),b.pathnameBase!=="/"&&(m=yl([m,b.pathnameBase]))}return h}function qo(a,i){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[r,u]=pg(a.path,a.caseSensitive,a.end),d=i.match(r);if(!d)return null;let m=d[0],h=m.replace(/(.)\/+$/,"$1"),x=d.slice(1);return{params:u.reduce((v,{paramName:g,isOptional:b},E)=>{if(g==="*"){let A=x[E]||"";h=m.slice(0,m.length-A.length).replace(/(.)\/+$/,"$1")}const C=x[E];return b&&!C?v[g]=void 0:v[g]=(C||"").replace(/%2F/g,"/"),v},{}),pathname:m,pathnameBase:h,pattern:a}}function pg(a,i=!1,r=!0){Ol(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let u=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,x,p,v,g)=>{if(u.push({paramName:x,isOptional:p!=null}),p){let b=g.charAt(v+h.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(u.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),u]}function vg(a){try{return a.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Ol(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),a}}function na(a,i){if(i==="/")return a;if(!a.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,u=a.charAt(r);return u&&u!=="/"?null:a.slice(r)||"/"}var xg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function yg(a,i="/"){let{pathname:r,search:u="",hash:d=""}=typeof a=="string"?Li(a):a,m;return r?(r=bx(r),r.startsWith("/")?m=Cv(r.substring(1),"/"):m=Cv(r,i)):m=i,{pathname:m,search:jg(u),hash:Sg(d)}}function Cv(a,i){let r=Qo(i).split("/");return a.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function Md(a,i,r,u){return`Cannot include a '${a}' character in a manually specified \`to.${i}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function bg(a){return a.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function yx(a){let i=bg(a);return i.map((r,u)=>u===i.length-1?r.pathname:r.pathnameBase)}function af(a,i,r,u=!1){let d;typeof a=="string"?d=Li(a):(d={...a},Fe(!d.pathname||!d.pathname.includes("?"),Md("?","pathname","search",d)),Fe(!d.pathname||!d.pathname.includes("#"),Md("#","pathname","hash",d)),Fe(!d.search||!d.search.includes("#"),Md("#","search","hash",d)));let m=a===""||d.pathname==="",h=m?"/":d.pathname,x;if(h==null)x=r;else{let b=i.length-1;if(!u&&h.startsWith("..")){let E=h.split("/");for(;E[0]==="..";)E.shift(),b-=1;d.pathname=E.join("/")}x=b>=0?i[b]:"/"}let p=yg(d,x),v=h&&h!=="/"&&h.endsWith("/"),g=(m||h===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(v||g)&&(p.pathname+="/"),p}var bx=a=>a.replace(/\/\/+/g,"/"),yl=a=>bx(a.join("/")),Qo=a=>a.replace(/\/+$/,""),gg=a=>Qo(a).replace(/^\/*/,"/"),jg=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Sg=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Ng=class{constructor(a,i,r,u=!1){this.status=a,this.statusText=i||"",this.internal=u,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Mg(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function wg(a){let i=a.map(r=>r.route.path).filter(Boolean);return yl(i)||"/"}var gx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jx(a,i){let r=a;if(typeof r!="string"||!xg.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let u=r,d=!1;if(gx)try{let m=new URL(window.location.href),h=r.startsWith("//")?new URL(m.protocol+r):new URL(r),x=na(h.pathname,i);h.origin===m.origin&&x!=null?r=x+h.search+h.hash:d=!0}catch{Ol(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Sx=["POST","PUT","PATCH","DELETE"];new Set(Sx);var Cg=["GET",...Sx];new Set(Cg);var qi=j.createContext(null);qi.displayName="DataRouter";var $o=j.createContext(null);$o.displayName="DataRouterState";var Nx=j.createContext(!1);function Tg(){return j.useContext(Nx)}var Mx=j.createContext({isTransitioning:!1});Mx.displayName="ViewTransition";var Eg=j.createContext(new Map);Eg.displayName="Fetchers";var Ag=j.createContext(null);Ag.displayName="Await";var ul=j.createContext(null);ul.displayName="Navigation";var ts=j.createContext(null);ts.displayName="Location";var ia=j.createContext({outlet:null,matches:[],isDataRoute:!1});ia.displayName="Route";var nf=j.createContext(null);nf.displayName="RouteError";var wx="REACT_ROUTER_ERROR",zg="REDIRECT",Rg="ROUTE_ERROR_RESPONSE";function Og(a){if(a.startsWith(`${wx}:${zg}:{`))try{let i=JSON.parse(a.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function _g(a){if(a.startsWith(`${wx}:${Rg}:{`))try{let i=JSON.parse(a.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new Ng(i.status,i.statusText,i.data)}catch{}}function kg(a,{relative:i}={}){Fe(ls(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:u}=j.useContext(ul),{hash:d,pathname:m,search:h}=as(a,{relative:i}),x=m;return r!=="/"&&(x=m==="/"?r:yl([r,m])),u.createHref({pathname:x,search:h,hash:d})}function ls(){return j.useContext(ts)!=null}function ra(){return Fe(ls(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(ts).location}var Cx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Tx(a){j.useContext(ul).static||j.useLayoutEffect(a)}function Dg(){let{isDataRoute:a}=j.useContext(ia);return a?$g():Ug()}function Ug(){Fe(ls(),"useNavigate() may be used only in the context of a <Router> component.");let a=j.useContext(qi),{basename:i,navigator:r}=j.useContext(ul),{matches:u}=j.useContext(ia),{pathname:d}=ra(),m=JSON.stringify(yx(u)),h=j.useRef(!1);return Tx(()=>{h.current=!0}),j.useCallback((p,v={})=>{if(Ol(h.current,Cx),!h.current)return;if(typeof p=="number"){r.go(p);return}let g=af(p,JSON.parse(m),d,v.relative==="path");a==null&&i!=="/"&&(g.pathname=g.pathname==="/"?i:yl([i,g.pathname])),(v.replace?r.replace:r.push)(g,v.state,v)},[i,r,m,d,a])}j.createContext(null);function as(a,{relative:i}={}){let{matches:r}=j.useContext(ia),{pathname:u}=ra(),d=JSON.stringify(yx(r));return j.useMemo(()=>af(a,JSON.parse(d),u,i==="path"),[a,d,u,i])}function Bg(a,i){return Ex(a,i)}function Ex(a,i,r){var Q;Fe(ls(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=j.useContext(ul),{matches:d}=j.useContext(ia),m=d[d.length-1],h=m?m.params:{},x=m?m.pathname:"/",p=m?m.pathnameBase:"/",v=m&&m.route;{let U=v&&v.path||"";zx(x,!v||U.endsWith("*")||U.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${x}" (under <Route path="${U}">) 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="${U}"> to <Route path="${U==="/"?"*":`${U}/*`}">.`)}let g=ra(),b;if(i){let U=typeof i=="string"?Li(i):i;Fe(p==="/"||((Q=U.pathname)==null?void 0:Q.startsWith(p)),`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 "${p}" but pathname "${U.pathname}" was given in the \`location\` prop.`),b=U}else b=g;let E=b.pathname||"/",C=E;if(p!=="/"){let U=p.replace(/^\//,"").split("/");C="/"+E.replace(/^\//,"").split("/").slice(U.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(U=>Object.assign(U,{route:r.manifest[U.route.id]||U.route})):px(a,{pathname:C});Ol(v||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ol(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 z=Yg(A&&A.map(U=>Object.assign({},U,{params:Object.assign({},h,U.params),pathname:yl([p,u.encodeLocation?u.encodeLocation(U.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathname]),pathnameBase:U.pathnameBase==="/"?p:yl([p,u.encodeLocation?u.encodeLocation(U.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathnameBase])})),d,r);return i&&z?j.createElement(ts.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},z):z}function Hg(){let a=Zg(),i=Mg(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},m={padding:"2px 4px",backgroundColor:u},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:m},"ErrorBoundary")," or"," ",j.createElement("code",{style:m},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},i),r?j.createElement("pre",{style:d},r):null,h)}var Lg=j.createElement(Hg,null),Ax=class extends j.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){this.props.onError?this.props.onError(a,i):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=_g(a.digest);r&&(a=r)}let i=a!==void 0?j.createElement(ia.Provider,{value:this.props.routeContext},j.createElement(nf.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?j.createElement(qg,{error:a},i):i}};Ax.contextType=Nx;var wd=new WeakMap;function qg({children:a,error:i}){let{basename:r}=j.useContext(ul);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let u=Og(i.digest);if(u){let d=wd.get(i);if(d)throw d;let m=jx(u.location,r);if(gx&&!wd.get(i))if(m.isExternal||u.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:u.replace}));throw wd.set(i,h),h}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return a}function Qg({routeContext:a,match:i,children:r}){let u=j.useContext(qi);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),j.createElement(ia.Provider,{value:a},r)}function Yg(a,i=[],r){let u=r==null?void 0:r.state;if(a==null){if(!u)return null;if(u.errors)a=u.matches;else if(i.length===0&&!u.initialized&&u.matches.length>0)a=u.matches;else return null}let d=a,m=u==null?void 0:u.errors;if(m!=null){let g=d.findIndex(b=>b.route.id&&(m==null?void 0:m[b.route.id])!==void 0);Fe(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,g+1))}let h=!1,x=-1;if(r&&u){h=u.renderFallback;for(let g=0;g<d.length;g++){let b=d[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(x=g),b.route.id){let{loaderData:E,errors:C}=u,A=b.route.loader&&!E.hasOwnProperty(b.route.id)&&(!C||C[b.route.id]===void 0);if(b.route.lazy||A){r.isStatic&&(h=!0),x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}}let p=r==null?void 0:r.onError,v=u&&p?(g,b)=>{var E,C;p(g,{location:u.location,params:((C=(E=u.matches)==null?void 0:E[0])==null?void 0:C.params)??{},pattern:wg(u.matches),errorInfo:b})}:void 0;return d.reduceRight((g,b,E)=>{let C,A=!1,z=null,Q=null;u&&(C=m&&b.route.id?m[b.route.id]:void 0,z=b.route.errorElement||Lg,h&&(x<0&&E===0?(zx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,Q=null):x===E&&(A=!0,Q=b.route.hydrateFallbackElement||null)));let U=i.concat(d.slice(0,E+1)),q=()=>{let K;return C?K=z:A?K=Q:b.route.Component?K=j.createElement(b.route.Component,null):b.route.element?K=b.route.element:K=g,j.createElement(Qg,{match:b,routeContext:{outlet:g,matches:U,isDataRoute:u!=null},children:K})};return u&&(b.route.ErrorBoundary||b.route.errorElement||E===0)?j.createElement(Ax,{location:u.location,revalidation:u.revalidation,component:z,error:C,children:q(),routeContext:{outlet:null,matches:U,isDataRoute:!0},onError:v}):q()},null)}function rf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gg(a){let i=j.useContext(qi);return Fe(i,rf(a)),i}function Kg(a){let i=j.useContext($o);return Fe(i,rf(a)),i}function Xg(a){let i=j.useContext(ia);return Fe(i,rf(a)),i}function sf(a){let i=Xg(a),r=i.matches[i.matches.length-1];return Fe(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function Vg(){return sf("useRouteId")}function Zg(){var u;let a=j.useContext(nf),i=Kg("useRouteError"),r=sf("useRouteError");return a!==void 0?a:(u=i.errors)==null?void 0:u[r]}function $g(){let{router:a}=Gg("useNavigate"),i=sf("useNavigate"),r=j.useRef(!1);return Tx(()=>{r.current=!0}),j.useCallback(async(d,m={})=>{Ol(r.current,Cx),r.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:i,...m}))},[a,i])}var Tv={};function zx(a,i,r){!i&&!Tv[a]&&(Tv[a]=!0,Ol(!1,r))}j.memo(Fg);function Fg({routes:a,manifest:i,future:r,state:u,isStatic:d,onError:m}){return Ex(a,void 0,{manifest:i,state:u,isStatic:d,onError:m})}function Ni(a){Fe(!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 Jg({basename:a="/",children:i=null,location:r,navigationType:u="POP",navigator:d,static:m=!1,useTransitions:h}){Fe(!ls(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=a.replace(/^\/*/,"/"),p=j.useMemo(()=>({basename:x,navigator:d,static:m,useTransitions:h,future:{}}),[x,d,m,h]);typeof r=="string"&&(r=Li(r));let{pathname:v="/",search:g="",hash:b="",state:E=null,key:C="default",mask:A}=r,z=j.useMemo(()=>{let Q=na(v,x);return Q==null?null:{location:{pathname:Q,search:g,hash:b,state:E,key:C,mask:A},navigationType:u}},[x,v,g,b,E,C,u,A]);return Ol(z!=null,`<Router basename="${x}"> is not able to match the URL "${v}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:j.createElement(ul.Provider,{value:p},j.createElement(ts.Provider,{children:i,value:z}))}function Wg({children:a,location:i}){return Bg(kd(a),i)}function kd(a,i=[]){let r=[];return j.Children.forEach(a,(u,d)=>{if(!j.isValidElement(u))return;let m=[...i,d];if(u.type===j.Fragment){r.push.apply(r,kd(u.props.children,m));return}Fe(u.type===Ni,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Fe(!u.props.index||!u.props.children,"An index route cannot have child routes.");let h={id:u.props.id||m.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(h.children=kd(u.props.children,m)),r.push(h)}),r}var Uo="get",Bo="application/x-www-form-urlencoded";function Fo(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function Pg(a){return Fo(a)&&a.tagName.toLowerCase()==="button"}function Ig(a){return Fo(a)&&a.tagName.toLowerCase()==="form"}function e1(a){return Fo(a)&&a.tagName.toLowerCase()==="input"}function t1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function l1(a,i){return a.button===0&&(!i||i==="_self")&&!t1(a)}var zo=null;function a1(){if(zo===null)try{new FormData(document.createElement("form"),0),zo=!1}catch{zo=!0}return zo}var n1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cd(a){return a!=null&&!n1.has(a)?(Ol(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bo}"`),null):a}function i1(a,i){let r,u,d,m,h;if(Ig(a)){let x=a.getAttribute("action");u=x?na(x,i):null,r=a.getAttribute("method")||Uo,d=Cd(a.getAttribute("enctype"))||Bo,m=new FormData(a)}else if(Pg(a)||e1(a)&&(a.type==="submit"||a.type==="image")){let x=a.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=a.getAttribute("formaction")||x.getAttribute("action");if(u=p?na(p,i):null,r=a.getAttribute("formmethod")||x.getAttribute("method")||Uo,d=Cd(a.getAttribute("formenctype"))||Cd(x.getAttribute("enctype"))||Bo,m=new FormData(x,a),!a1()){let{name:v,type:g,value:b}=a;if(g==="image"){let E=v?`${v}.`:"";m.append(`${E}x`,"0"),m.append(`${E}y`,"0")}else v&&m.append(v,b)}}else{if(Fo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Uo,u=null,d=Bo,h=a}return m&&d==="text/plain"&&(h=m,m=void 0),{action:u,method:r.toLowerCase(),encType:d,formData:m,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function of(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function Rx(a,i,r,u){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:i&&na(d.pathname,i)==="/"?d.pathname=`${Qo(i)}/_root.${u}`:d.pathname=`${Qo(d.pathname)}.${u}`,d}async function r1(a,i){if(a.id in i)return i[a.id];try{let r=await import(a.module);return i[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function s1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function o1(a,i,r){let u=await Promise.all(a.map(async d=>{let m=i.routes[d.route.id];if(m){let h=await r1(m,r);return h.links?h.links():[]}return[]}));return f1(u.flat(1).filter(s1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Ev(a,i,r,u,d,m){let h=(p,v)=>r[v]?p.route.id!==r[v].route.id:!0,x=(p,v)=>{var g;return r[v].pathname!==p.pathname||((g=r[v].route.path)==null?void 0:g.endsWith("*"))&&r[v].params["*"]!==p.params["*"]};return m==="assets"?i.filter((p,v)=>h(p,v)||x(p,v)):m==="data"?i.filter((p,v)=>{var b;let g=u.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(h(p,v)||x(p,v))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((b=r[0])==null?void 0:b.params)||{},nextUrl:new URL(a,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function u1(a,i,{includeHydrateFallback:r}={}){return c1(a.map(u=>{let d=i.routes[u.route.id];if(!d)return[];let m=[d.module];return d.clientActionModule&&(m=m.concat(d.clientActionModule)),d.clientLoaderModule&&(m=m.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(m=m.concat(d.hydrateFallbackModule)),d.imports&&(m=m.concat(d.imports)),m}).flat(1))}function c1(a){return[...new Set(a)]}function d1(a){let i={},r=Object.keys(a).sort();for(let u of r)i[u]=a[u];return i}function f1(a,i){let r=new Set;return new Set(i),a.reduce((u,d)=>{let m=JSON.stringify(d1(d));return r.has(m)||(r.add(m),u.push({key:m,link:d})),u},[])}function uf(){let a=j.useContext(qi);return of(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function m1(){let a=j.useContext($o);return of(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var cf=j.createContext(void 0);cf.displayName="FrameworkContext";function df(){let a=j.useContext(cf);return of(a,"You must render this element inside a <HydratedRouter> element"),a}function h1(a,i){let r=j.useContext(cf),[u,d]=j.useState(!1),[m,h]=j.useState(!1),{onFocus:x,onBlur:p,onMouseEnter:v,onMouseLeave:g,onTouchStart:b}=i,E=j.useRef(null);j.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let z=U=>{U.forEach(q=>{h(q.isIntersecting)})},Q=new IntersectionObserver(z,{threshold:.5});return E.current&&Q.observe(E.current),()=>{Q.disconnect()}}},[a]),j.useEffect(()=>{if(u){let z=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(z)}}},[u]);let C=()=>{d(!0)},A=()=>{d(!1),h(!1)};return r?a!=="intent"?[m,E,{}]:[m,E,{onFocus:Hr(x,C),onBlur:Hr(p,A),onMouseEnter:Hr(v,C),onMouseLeave:Hr(g,A),onTouchStart:Hr(b,C)}]:[!1,E,{}]}function Hr(a,i){return r=>{a&&a(r),r.defaultPrevented||i(r)}}function p1({page:a,...i}){let r=Tg(),{router:u}=uf(),d=j.useMemo(()=>px(u.routes,a,u.basename),[u.routes,a,u.basename]);return d?r?j.createElement(x1,{page:a,matches:d,...i}):j.createElement(y1,{page:a,matches:d,...i}):null}function v1(a){let{manifest:i,routeModules:r}=df(),[u,d]=j.useState([]);return j.useEffect(()=>{let m=!1;return o1(a,i,r).then(h=>{m||d(h)}),()=>{m=!0}},[a,i,r]),u}function x1({page:a,matches:i,...r}){let u=ra(),{future:d}=df(),{basename:m}=uf(),h=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let x=Rx(a,m,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,v=[];for(let g of i)typeof g.route.shouldRevalidate=="function"?p=!0:v.push(g.route.id);return p&&v.length>0&&x.searchParams.set("_routes",v.join(",")),[x.pathname+x.search]},[m,d.v8_trailingSlashAwareDataRequests,a,u,i]);return j.createElement(j.Fragment,null,h.map(x=>j.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})))}function y1({page:a,matches:i,...r}){let u=ra(),{future:d,manifest:m,routeModules:h}=df(),{basename:x}=uf(),{loaderData:p,matches:v}=m1(),g=j.useMemo(()=>Ev(a,i,v,m,u,"data"),[a,i,v,m,u]),b=j.useMemo(()=>Ev(a,i,v,m,u,"assets"),[a,i,v,m,u]),E=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let z=new Set,Q=!1;if(i.forEach(q=>{var H;let K=m.routes[q.route.id];!K||!K.hasLoader||(!g.some(V=>V.route.id===q.route.id)&&q.route.id in p&&((H=h[q.route.id])!=null&&H.shouldRevalidate)||K.hasClientLoader?Q=!0:z.add(q.route.id))}),z.size===0)return[];let U=Rx(a,x,d.v8_trailingSlashAwareDataRequests,"data");return Q&&z.size>0&&U.searchParams.set("_routes",i.filter(q=>z.has(q.route.id)).map(q=>q.route.id).join(",")),[U.pathname+U.search]},[x,d.v8_trailingSlashAwareDataRequests,p,u,m,g,i,a,h]),C=j.useMemo(()=>u1(b,m),[b,m]),A=v1(b);return j.createElement(j.Fragment,null,E.map(z=>j.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...r})),C.map(z=>j.createElement("link",{key:z,rel:"modulepreload",href:z,...r})),A.map(({key:z,link:Q})=>j.createElement("link",{key:z,nonce:r.nonce,...Q,crossOrigin:Q.crossOrigin??r.crossOrigin})))}function b1(...a){return i=>{a.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var g1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{g1&&(window.__reactRouterVersion="7.17.0")}catch{}function j1({basename:a,children:i,useTransitions:r,window:u}){let d=j.useRef();d.current==null&&(d.current=Ib({window:u,v5Compat:!0}));let m=d.current,[h,x]=j.useState({action:m.action,location:m.location}),p=j.useCallback(v=>{r===!1?x(v):j.startTransition(()=>x(v))},[r]);return j.useLayoutEffect(()=>m.listen(p),[m,p]),j.createElement(Jg,{basename:a,children:i,location:h.location,navigationType:h.action,navigator:m,useTransitions:r})}var Ox=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ns=j.forwardRef(function({onClick:i,discover:r="render",prefetch:u="none",relative:d,reloadDocument:m,replace:h,mask:x,state:p,target:v,to:g,preventScrollReset:b,viewTransition:E,defaultShouldRevalidate:C,...A},z){let{basename:Q,navigator:U,useTransitions:q}=j.useContext(ul),K=typeof g=="string"&&Ox.test(g),H=jx(g,Q);g=H.to;let V=kg(g,{relative:d}),W=ra(),F=null;if(x){let me=af(x,[],W.mask?W.mask.pathname:"/",!0);Q!=="/"&&(me.pathname=me.pathname==="/"?Q:yl([Q,me.pathname])),F=U.createHref(me)}let[I,te,se]=h1(u,A),J=M1(g,{replace:h,mask:x,state:p,target:v,preventScrollReset:b,relative:d,viewTransition:E,defaultShouldRevalidate:C,useTransitions:q});function fe(me){i&&i(me),me.defaultPrevented||J(me)}let pe=!(H.isExternal||m),Ae=j.createElement("a",{...A,...se,href:(pe?F:void 0)||H.absoluteURL||V,onClick:pe?fe:i,ref:b1(z,te),target:v,"data-discover":!K&&r==="render"?"true":void 0});return I&&!K?j.createElement(j.Fragment,null,Ae,j.createElement(p1,{page:V})):Ae});ns.displayName="Link";var ff=j.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:u="",end:d=!1,style:m,to:h,viewTransition:x,children:p,...v},g){let b=as(h,{relative:v.relative}),E=ra(),C=j.useContext($o),{navigator:A,basename:z}=j.useContext(ul),Q=C!=null&&A1(b)&&x===!0,U=A.encodeLocation?A.encodeLocation(b).pathname:b.pathname,q=E.pathname,K=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;r||(q=q.toLowerCase(),K=K?K.toLowerCase():null,U=U.toLowerCase()),K&&z&&(K=na(K,z)||K);const H=U!=="/"&&U.endsWith("/")?U.length-1:U.length;let V=q===U||!d&&q.startsWith(U)&&q.charAt(H)==="/",W=K!=null&&(K===U||!d&&K.startsWith(U)&&K.charAt(U.length)==="/"),F={isActive:V,isPending:W,isTransitioning:Q},I=V?i:void 0,te;typeof u=="function"?te=u(F):te=[u,V?"active":null,W?"pending":null,Q?"transitioning":null].filter(Boolean).join(" ");let se=typeof m=="function"?m(F):m;return j.createElement(ns,{...v,"aria-current":I,className:te,ref:g,style:se,to:h,viewTransition:x},typeof p=="function"?p(F):p)});ff.displayName="NavLink";var S1=j.forwardRef(({discover:a="render",fetcherKey:i,navigate:r,reloadDocument:u,replace:d,state:m,method:h=Uo,action:x,onSubmit:p,relative:v,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:E,...C},A)=>{let{useTransitions:z}=j.useContext(ul),Q=T1(),U=E1(x,{relative:v}),q=h.toLowerCase()==="get"?"get":"post",K=typeof x=="string"&&Ox.test(x),H=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let W=V.nativeEvent.submitter,F=(W==null?void 0:W.getAttribute("formmethod"))||h,I=()=>Q(W||V.currentTarget,{fetcherKey:i,method:F,navigate:r,replace:d,state:m,relative:v,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:E});z&&r!==!1?j.startTransition(()=>I()):I()};return j.createElement("form",{ref:A,method:q,action:U,onSubmit:u?p:H,...C,"data-discover":!K&&a==="render"?"true":void 0})});S1.displayName="Form";function N1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _x(a){let i=j.useContext(qi);return Fe(i,N1(a)),i}function M1(a,{target:i,replace:r,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:x,defaultShouldRevalidate:p,useTransitions:v}={}){let g=Dg(),b=ra(),E=as(a,{relative:h});return j.useCallback(C=>{if(l1(C,i)){C.preventDefault();let A=r!==void 0?r:Kr(b)===Kr(E),z=()=>g(a,{replace:A,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:x,defaultShouldRevalidate:p});v?j.startTransition(()=>z()):z()}},[b,g,E,r,u,d,i,a,m,h,x,p,v])}var w1=0,C1=()=>`__${String(++w1)}__`;function T1(){let{router:a}=_x("useSubmit"),{basename:i}=j.useContext(ul),r=Vg(),u=a.fetch,d=a.navigate;return j.useCallback(async(m,h={})=>{let{action:x,method:p,encType:v,formData:g,body:b}=i1(m,i);if(h.navigate===!1){let E=h.fetcherKey||C1();await u(E,r,h.action||x,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:b,formMethod:h.method||p,formEncType:h.encType||v,flushSync:h.flushSync})}else await d(h.action||x,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:b,formMethod:h.method||p,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[u,d,i,r])}function E1(a,{relative:i}={}){let{basename:r}=j.useContext(ul),u=j.useContext(ia);Fe(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),m={...as(a||".",{relative:i})},h=ra();if(a==null){m.search=h.search;let x=new URLSearchParams(m.search),p=x.getAll("index");if(p.some(g=>g==="")){x.delete("index"),p.filter(b=>b).forEach(b=>x.append("index",b));let g=x.toString();m.search=g?`?${g}`:""}}return(!a||a===".")&&d.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(m.pathname=m.pathname==="/"?r:yl([r,m.pathname])),Kr(m)}function A1(a,{relative:i}={}){let r=j.useContext(Mx);Fe(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=_x("useViewTransitionState"),d=as(a,{relative:i});if(!r.isTransitioning)return!1;let m=na(r.currentLocation.pathname,u)||r.currentLocation.pathname,h=na(r.nextLocation.pathname,u)||r.nextLocation.pathname;return qo(d.pathname,h)!=null||qo(d.pathname,m)!=null}var Qi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yn,Da,wi,nx,z1=(nx=class extends Qi{constructor(){super();ue(this,yn);ue(this,Da);ue(this,wi);ee(this,wi,i=>{if(typeof window<"u"&&window.addEventListener){const r=()=>i();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,Da)||this.setEventListener(N(this,wi))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,Da))==null||i.call(this),ee(this,Da,void 0))}setEventListener(i){var r;ee(this,wi,i),(r=N(this,Da))==null||r.call(this),ee(this,Da,i(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(i){N(this,yn)!==i&&(ee(this,yn,i),this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(r=>{r(i)})}isFocused(){var i;return typeof N(this,yn)=="boolean"?N(this,yn):((i=globalThis.document)==null?void 0:i.visibilityState)!=="hidden"}},yn=new WeakMap,Da=new WeakMap,wi=new WeakMap,nx),mf=new z1,R1={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},Ua,tf,ix,O1=(ix=class{constructor(){ue(this,Ua,R1);ue(this,tf,!1)}setTimeoutProvider(a){ee(this,Ua,a)}setTimeout(a,i){return N(this,Ua).setTimeout(a,i)}clearTimeout(a){N(this,Ua).clearTimeout(a)}setInterval(a,i){return N(this,Ua).setInterval(a,i)}clearInterval(a){N(this,Ua).clearInterval(a)}},Ua=new WeakMap,tf=new WeakMap,ix),xn=new O1;function _1(a){setTimeout(a,0)}var k1=typeof window>"u"||"Deno"in globalThis;function Et(){}function D1(a,i){return typeof a=="function"?a(i):a}function Dd(a){return typeof a=="number"&&a>=0&&a!==1/0}function kx(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Ka(a,i){return typeof a=="function"?a(i):a}function Jt(a,i){return typeof a=="function"?a(i):a}function Av(a,i){const{type:r="all",exact:u,fetchStatus:d,predicate:m,queryKey:h,stale:x}=a;if(h){if(u){if(i.queryHash!==hf(h,i.options))return!1}else if(!Xr(i.queryKey,h))return!1}if(r!=="all"){const p=i.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof x=="boolean"&&i.isStale()!==x||d&&d!==i.state.fetchStatus||m&&!m(i))}function zv(a,i){const{exact:r,status:u,predicate:d,mutationKey:m}=a;if(m){if(!i.options.mutationKey)return!1;if(r){if(Tn(i.options.mutationKey)!==Tn(m))return!1}else if(!Xr(i.options.mutationKey,m))return!1}return!(u&&i.state.status!==u||d&&!d(i))}function hf(a,i){return((i==null?void 0:i.queryKeyHashFn)||Tn)(a)}function Tn(a){return JSON.stringify(a,(i,r)=>Ud(r)?Object.keys(r).sort().reduce((u,d)=>(u[d]=r[d],u),{}):r)}function Xr(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(r=>Xr(a[r],i[r])):!1}var U1=Object.prototype.hasOwnProperty;function Dx(a,i,r=0){if(a===i)return a;if(r>500)return i;const u=Rv(a)&&Rv(i);if(!u&&!(Ud(a)&&Ud(i)))return i;const m=(u?a:Object.keys(a)).length,h=u?i:Object.keys(i),x=h.length,p=u?new Array(x):{};let v=0;for(let g=0;g<x;g++){const b=u?g:h[g],E=a[b],C=i[b];if(E===C){p[b]=E,(u?g<m:U1.call(a,b))&&v++;continue}if(E===null||C===null||typeof E!="object"||typeof C!="object"){p[b]=C;continue}const A=Dx(E,C,r+1);p[b]=A,A===E&&v++}return m===x&&v===m?a:p}function Yo(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const r in a)if(a[r]!==i[r])return!1;return!0}function Rv(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function Ud(a){if(!Ov(a))return!1;const i=a.constructor;if(i===void 0)return!0;const r=i.prototype;return!(!Ov(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function Ov(a){return Object.prototype.toString.call(a)==="[object Object]"}function B1(a){return new Promise(i=>{xn.setTimeout(i,a)})}function Bd(a,i,r){return typeof r.structuralSharing=="function"?r.structuralSharing(a,i):r.structuralSharing!==!1?Dx(a,i):i}function H1(a,i,r=0){const u=[...a,i];return r&&u.length>r?u.slice(1):u}function L1(a,i,r=0){const u=[i,...a];return r&&u.length>r?u.slice(0,-1):u}var pf=Symbol();function Ux(a,i){return!a.queryFn&&(i!=null&&i.initialPromise)?()=>i.initialPromise:!a.queryFn||a.queryFn===pf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function vf(a,i){return typeof a=="function"?a(...i):!!a}function q1(a,i,r){let u=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??(d=i()),u||(u=!0,d.aborted?r():d.addEventListener("abort",r,{once:!0})),d)}),a}var Vr=(()=>{let a=()=>k1;return{isServer(){return a()},setIsServer(i){a=i}}})();function Hd(){let a,i;const r=new Promise((d,m)=>{a=d,i=m});r.status="pending",r.catch(()=>{});function u(d){Object.assign(r,d),delete r.resolve,delete r.reject}return r.resolve=d=>{u({status:"fulfilled",value:d}),a(d)},r.reject=d=>{u({status:"rejected",reason:d}),i(d)},r}var Q1=_1;function Y1(){let a=[],i=0,r=x=>{x()},u=x=>{x()},d=Q1;const m=x=>{i?a.push(x):d(()=>{r(x)})},h=()=>{const x=a;a=[],x.length&&d(()=>{u(()=>{x.forEach(p=>{r(p)})})})};return{batch:x=>{let p;i++;try{p=x()}finally{i--,i||h()}return p},batchCalls:x=>(...p)=>{m(()=>{x(...p)})},schedule:m,setNotifyFunction:x=>{r=x},setBatchNotifyFunction:x=>{u=x},setScheduler:x=>{d=x}}}var st=Y1(),Ci,Ba,Ti,rx,G1=(rx=class extends Qi{constructor(){super();ue(this,Ci,!0);ue(this,Ba);ue(this,Ti);ee(this,Ti,i=>{if(typeof window<"u"&&window.addEventListener){const r=()=>i(!0),u=()=>i(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",u)}}})}onSubscribe(){N(this,Ba)||this.setEventListener(N(this,Ti))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,Ba))==null||i.call(this),ee(this,Ba,void 0))}setEventListener(i){var r;ee(this,Ti,i),(r=N(this,Ba))==null||r.call(this),ee(this,Ba,i(this.setOnline.bind(this)))}setOnline(i){N(this,Ci)!==i&&(ee(this,Ci,i),this.listeners.forEach(u=>{u(i)}))}isOnline(){return N(this,Ci)}},Ci=new WeakMap,Ba=new WeakMap,Ti=new WeakMap,rx),Go=new G1;function K1(a){return Math.min(1e3*2**a,3e4)}function Bx(a){return(a??"online")==="online"?Go.isOnline():!0}var Ld=class extends Error{constructor(a){super("CancelledError"),this.revert=a==null?void 0:a.revert,this.silent=a==null?void 0:a.silent}};function Hx(a){let i=!1,r=0,u;const d=Hd(),m=()=>d.status!=="pending",h=z=>{var Q;if(!m()){const U=new Ld(z);E(U),(Q=a.onCancel)==null||Q.call(a,U)}},x=()=>{i=!0},p=()=>{i=!1},v=()=>mf.isFocused()&&(a.networkMode==="always"||Go.isOnline())&&a.canRun(),g=()=>Bx(a.networkMode)&&a.canRun(),b=z=>{m()||(u==null||u(),d.resolve(z))},E=z=>{m()||(u==null||u(),d.reject(z))},C=()=>new Promise(z=>{var Q;u=U=>{(m()||v())&&z(U)},(Q=a.onPause)==null||Q.call(a)}).then(()=>{var z;u=void 0,m()||(z=a.onContinue)==null||z.call(a)}),A=()=>{if(m())return;let z;const Q=r===0?a.initialPromise:void 0;try{z=Q??a.fn()}catch(U){z=Promise.reject(U)}Promise.resolve(z).then(b).catch(U=>{var W;if(m())return;const q=a.retry??(Vr.isServer()?0:3),K=a.retryDelay??K1,H=typeof K=="function"?K(r,U):K,V=q===!0||typeof q=="number"&&r<q||typeof q=="function"&&q(r,U);if(i||!V){E(U);return}r++,(W=a.onFail)==null||W.call(a,r,U),B1(H).then(()=>v()?void 0:C()).then(()=>{i?E(U):A()})})};return{promise:d,status:()=>d.status,cancel:h,continue:()=>(u==null||u(),d),cancelRetry:x,continueRetry:p,canStart:g,start:()=>(g()?A():C().then(A),d)}}var bn,sx,Lx=(sx=class{constructor(){ue(this,bn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dd(this.gcTime)&&ee(this,bn,xn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Vr.isServer()?1/0:300*1e3))}clearGcTimeout(){N(this,bn)!==void 0&&(xn.clearTimeout(N(this,bn)),ee(this,bn,void 0))}},bn=new WeakMap,sx);function X1(a){return{onFetch:(i,r)=>{var g,b,E,C,A;const u=i.options,d=(E=(b=(g=i.fetchOptions)==null?void 0:g.meta)==null?void 0:b.fetchMore)==null?void 0:E.direction,m=((C=i.state.data)==null?void 0:C.pages)||[],h=((A=i.state.data)==null?void 0:A.pageParams)||[];let x={pages:[],pageParams:[]},p=0;const v=async()=>{let z=!1;const Q=K=>{q1(K,()=>i.signal,()=>z=!0)},U=Ux(i.options,i.fetchOptions),q=async(K,H,V)=>{if(z)return Promise.reject(i.signal.reason);if(H==null&&K.pages.length)return Promise.resolve(K);const F=(()=>{const J={client:i.client,queryKey:i.queryKey,pageParam:H,direction:V?"backward":"forward",meta:i.options.meta};return Q(J),J})(),I=await U(F),{maxPages:te}=i.options,se=V?L1:H1;return{pages:se(K.pages,I,te),pageParams:se(K.pageParams,H,te)}};if(d&&m.length){const K=d==="backward",H=K?V1:_v,V={pages:m,pageParams:h},W=H(u,V);x=await q(V,W,K)}else{const K=a??m.length;do{const H=p===0?h[0]??u.initialPageParam:_v(u,x);if(p>0&&H==null)break;x=await q(x,H),p++}while(p<K)}return x};i.options.persister?i.fetchFn=()=>{var z,Q;return(Q=(z=i.options).persister)==null?void 0:Q.call(z,v,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},r)}:i.fetchFn=v}}}function _v(a,{pages:i,pageParams:r}){const u=i.length-1;return i.length>0?a.getNextPageParam(i[u],i,r[u],r):void 0}function V1(a,{pages:i,pageParams:r}){var u;return i.length>0?(u=a.getPreviousPageParam)==null?void 0:u.call(a,i[0],i,r[0],r):void 0}var Ei,gn,Ai,ol,jn,ft,Jr,Sn,Ft,qx,Pl,ox,Z1=(ox=class extends Lx{constructor(i){super();ue(this,Ft);ue(this,Ei);ue(this,gn);ue(this,Ai);ue(this,ol);ue(this,jn);ue(this,ft);ue(this,Jr);ue(this,Sn);ee(this,Sn,!1),ee(this,Jr,i.defaultOptions),this.setOptions(i.options),this.observers=[],ee(this,jn,i.client),ee(this,ol,N(this,jn).getQueryCache()),this.queryKey=i.queryKey,this.queryHash=i.queryHash,ee(this,gn,Dv(this.options)),this.state=i.state??N(this,gn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,Ei)}get promise(){var i;return(i=N(this,ft))==null?void 0:i.promise}setOptions(i){if(this.options={...N(this,Jr),...i},i!=null&&i._type&&ee(this,Ei,i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Dv(this.options);r.data!==void 0&&(this.setState(kv(r.data,r.dataUpdatedAt)),ee(this,gn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,ol).remove(this)}setData(i,r){const u=Bd(this.state.data,i,this.options);return ye(this,Ft,Pl).call(this,{data:u,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),u}setState(i){ye(this,Ft,Pl).call(this,{type:"setState",state:i})}cancel(i){var u,d;const r=(u=N(this,ft))==null?void 0:u.promise;return(d=N(this,ft))==null||d.cancel(i),r?r.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,gn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>Jt(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>Ka(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!kx(this.state.dataUpdatedAt,i)}onFocus(){var r;const i=this.observers.find(u=>u.shouldFetchOnWindowFocus());i==null||i.refetch({cancelRefetch:!1}),(r=N(this,ft))==null||r.continue()}onOnline(){var r;const i=this.observers.find(u=>u.shouldFetchOnReconnect());i==null||i.refetch({cancelRefetch:!1}),(r=N(this,ft))==null||r.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),N(this,ol).notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(r=>r!==i),this.observers.length||(N(this,ft)&&(N(this,Sn)||ye(this,Ft,qx).call(this)?N(this,ft).cancel({revert:!0}):N(this,ft).cancelRetry()),this.scheduleGc()),N(this,ol).notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ye(this,Ft,Pl).call(this,{type:"invalidate"})}async fetch(i,r){var v,g,b,E,C,A,z,Q,U,q,K;if(this.state.fetchStatus!=="idle"&&((v=N(this,ft))==null?void 0:v.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,ft))return N(this,ft).continueRetry(),N(this,ft).promise}if(i&&this.setOptions(i),!this.options.queryFn){const H=this.observers.find(V=>V.options.queryFn);H&&this.setOptions(H.options)}const u=new AbortController,d=H=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>(ee(this,Sn,!0),u.signal)})},m=()=>{const H=Ux(this.options,r),W=(()=>{const F={client:N(this,jn),queryKey:this.queryKey,meta:this.meta};return d(F),F})();return ee(this,Sn,!1),this.options.persister?this.options.persister(H,W,this):H(W)},x=(()=>{const H={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,jn),state:this.state,fetchFn:m};return d(H),H})(),p=N(this,Ei)==="infinite"?X1(this.options.pages):this.options.behavior;p==null||p.onFetch(x,this),ee(this,Ai,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=x.fetchOptions)==null?void 0:g.meta))&&ye(this,Ft,Pl).call(this,{type:"fetch",meta:(b=x.fetchOptions)==null?void 0:b.meta}),ee(this,ft,Hx({initialPromise:r==null?void 0:r.initialPromise,fn:x.fetchFn,onCancel:H=>{H instanceof Ld&&H.revert&&this.setState({...N(this,Ai),fetchStatus:"idle"}),u.abort()},onFail:(H,V)=>{ye(this,Ft,Pl).call(this,{type:"failed",failureCount:H,error:V})},onPause:()=>{ye(this,Ft,Pl).call(this,{type:"pause"})},onContinue:()=>{ye(this,Ft,Pl).call(this,{type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0}));try{const H=await N(this,ft).start();if(H===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(H),(C=(E=N(this,ol).config).onSuccess)==null||C.call(E,H,this),(z=(A=N(this,ol).config).onSettled)==null||z.call(A,H,this.state.error,this),H}catch(H){if(H instanceof Ld){if(H.silent)return N(this,ft).promise;if(H.revert){if(this.state.data===void 0)throw H;return this.state.data}}throw ye(this,Ft,Pl).call(this,{type:"error",error:H}),(U=(Q=N(this,ol).config).onError)==null||U.call(Q,H,this),(K=(q=N(this,ol).config).onSettled)==null||K.call(q,this.state.data,H,this),H}finally{this.scheduleGc()}}},Ei=new WeakMap,gn=new WeakMap,Ai=new WeakMap,ol=new WeakMap,jn=new WeakMap,ft=new WeakMap,Jr=new WeakMap,Sn=new WeakMap,Ft=new WeakSet,qx=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Pl=function(i){const r=u=>{switch(i.type){case"failed":return{...u,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...Qx(u.data,this.options),fetchMeta:i.meta??null};case"success":const d={...u,...kv(i.data,i.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,Ai,i.manual?d:void 0),d;case"error":const m=i.error;return{...u,error:m,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:m,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...i.state}}};this.state=r(this.state),st.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),N(this,ol).notify({query:this,type:"updated",action:i})})},ox);function Qx(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bx(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function kv(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Dv(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,r=i!==void 0,u=r?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:r?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Bt,Te,Wr,Tt,Nn,zi,Il,Ha,Pr,Ri,Oi,Mn,wn,La,_i,ke,Yr,qd,Qd,Yd,Gd,Kd,Xd,Vd,Yx,ux,$1=(ux=class extends Qi{constructor(i,r){super();ue(this,ke);ue(this,Bt);ue(this,Te);ue(this,Wr);ue(this,Tt);ue(this,Nn);ue(this,zi);ue(this,Il);ue(this,Ha);ue(this,Pr);ue(this,Ri);ue(this,Oi);ue(this,Mn);ue(this,wn);ue(this,La);ue(this,_i,new Set);this.options=r,ee(this,Bt,i),ee(this,Ha,null),ee(this,Il,Hd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Te).addObserver(this),Uv(N(this,Te),this.options)?ye(this,ke,Yr).call(this):this.updateResult(),ye(this,ke,Gd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zd(N(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zd(N(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,ke,Kd).call(this),ye(this,ke,Xd).call(this),N(this,Te).removeObserver(this)}setOptions(i){const r=this.options,u=N(this,Te);if(this.options=N(this,Bt).defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jt(this.options.enabled,N(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ye(this,ke,Vd).call(this),N(this,Te).setOptions(this.options),r._defaulted&&!Yo(this.options,r)&&N(this,Bt).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Te),observer:this});const d=this.hasListeners();d&&Bv(N(this,Te),u,this.options,r)&&ye(this,ke,Yr).call(this),this.updateResult(),d&&(N(this,Te)!==u||Jt(this.options.enabled,N(this,Te))!==Jt(r.enabled,N(this,Te))||Ka(this.options.staleTime,N(this,Te))!==Ka(r.staleTime,N(this,Te)))&&ye(this,ke,qd).call(this);const m=ye(this,ke,Qd).call(this);d&&(N(this,Te)!==u||Jt(this.options.enabled,N(this,Te))!==Jt(r.enabled,N(this,Te))||m!==N(this,La))&&ye(this,ke,Yd).call(this,m)}getOptimisticResult(i){const r=N(this,Bt).getQueryCache().build(N(this,Bt),i),u=this.createResult(r,i);return J1(this,u)&&(ee(this,Tt,u),ee(this,zi,this.options),ee(this,Nn,N(this,Te).state)),u}getCurrentResult(){return N(this,Tt)}trackResult(i,r){return new Proxy(i,{get:(u,d)=>(this.trackProp(d),r==null||r(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Il).status==="pending"&&N(this,Il).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(i){N(this,_i).add(i)}getCurrentQuery(){return N(this,Te)}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const r=N(this,Bt).defaultQueryOptions(i),u=N(this,Bt).getQueryCache().build(N(this,Bt),r);return u.fetch().then(()=>this.createResult(u,r))}fetch(i){return ye(this,ke,Yr).call(this,{...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Tt)))}createResult(i,r){var te;const u=N(this,Te),d=this.options,m=N(this,Tt),h=N(this,Nn),x=N(this,zi),v=i!==u?i.state:N(this,Wr),{state:g}=i;let b={...g},E=!1,C;if(r._optimisticResults){const se=this.hasListeners(),J=!se&&Uv(i,r),fe=se&&Bv(i,u,r,d);(J||fe)&&(b={...b,...Qx(g.data,i.options)}),r._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:A,errorUpdatedAt:z,status:Q}=b;C=b.data;let U=!1;if(r.placeholderData!==void 0&&C===void 0&&Q==="pending"){let se;m!=null&&m.isPlaceholderData&&r.placeholderData===(x==null?void 0:x.placeholderData)?(se=m.data,U=!0):se=typeof r.placeholderData=="function"?r.placeholderData((te=N(this,Oi))==null?void 0:te.state.data,N(this,Oi)):r.placeholderData,se!==void 0&&(Q="success",C=Bd(m==null?void 0:m.data,se,r),E=!0)}if(r.select&&C!==void 0&&!U)if(m&&C===(h==null?void 0:h.data)&&r.select===N(this,Pr))C=N(this,Ri);else try{ee(this,Pr,r.select),C=r.select(C),C=Bd(m==null?void 0:m.data,C,r),ee(this,Ri,C),ee(this,Ha,null)}catch(se){ee(this,Ha,se)}N(this,Ha)&&(A=N(this,Ha),C=N(this,Ri),z=Date.now(),Q="error");const q=b.fetchStatus==="fetching",K=Q==="pending",H=Q==="error",V=K&&q,W=C!==void 0,I={status:Q,fetchStatus:b.fetchStatus,isPending:K,isSuccess:Q==="success",isError:H,isInitialLoading:V,isLoading:V,data:C,dataUpdatedAt:b.dataUpdatedAt,error:A,errorUpdatedAt:z,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:b.dataUpdateCount>v.dataUpdateCount||b.errorUpdateCount>v.errorUpdateCount,isFetching:q,isRefetching:q&&!K,isLoadingError:H&&!W,isPaused:b.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:H&&W,isStale:xf(i,r),refetch:this.refetch,promise:N(this,Il),isEnabled:Jt(r.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const se=I.data!==void 0,J=I.status==="error"&&!se,fe=me=>{J?me.reject(I.error):se&&me.resolve(I.data)},pe=()=>{const me=ee(this,Il,I.promise=Hd());fe(me)},Ae=N(this,Il);switch(Ae.status){case"pending":i.queryHash===u.queryHash&&fe(Ae);break;case"fulfilled":(J||I.data!==Ae.value)&&pe();break;case"rejected":(!J||I.error!==Ae.reason)&&pe();break}}return I}updateResult(){const i=N(this,Tt),r=this.createResult(N(this,Te),this.options);if(ee(this,Nn,N(this,Te).state),ee(this,zi,this.options),N(this,Nn).data!==void 0&&ee(this,Oi,N(this,Te)),Yo(r,i))return;ee(this,Tt,r);const u=()=>{if(!i)return!0;const{notifyOnChangeProps:d}=this.options,m=typeof d=="function"?d():d;if(m==="all"||!m&&!N(this,_i).size)return!0;const h=new Set(m??N(this,_i));return this.options.throwOnError&&h.add("error"),Object.keys(N(this,Tt)).some(x=>{const p=x;return N(this,Tt)[p]!==i[p]&&h.has(p)})};ye(this,ke,Yx).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,ke,Gd).call(this)}},Bt=new WeakMap,Te=new WeakMap,Wr=new WeakMap,Tt=new WeakMap,Nn=new WeakMap,zi=new WeakMap,Il=new WeakMap,Ha=new WeakMap,Pr=new WeakMap,Ri=new WeakMap,Oi=new WeakMap,Mn=new WeakMap,wn=new WeakMap,La=new WeakMap,_i=new WeakMap,ke=new WeakSet,Yr=function(i){ye(this,ke,Vd).call(this);let r=N(this,Te).fetch(this.options,i);return i!=null&&i.throwOnError||(r=r.catch(Et)),r},qd=function(){ye(this,ke,Kd).call(this);const i=Ka(this.options.staleTime,N(this,Te));if(Vr.isServer()||N(this,Tt).isStale||!Dd(i))return;const u=kx(N(this,Tt).dataUpdatedAt,i)+1;ee(this,Mn,xn.setTimeout(()=>{N(this,Tt).isStale||this.updateResult()},u))},Qd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Te)):this.options.refetchInterval)??!1},Yd=function(i){ye(this,ke,Xd).call(this),ee(this,La,i),!(Vr.isServer()||Jt(this.options.enabled,N(this,Te))===!1||!Dd(N(this,La))||N(this,La)===0)&&ee(this,wn,xn.setInterval(()=>{(this.options.refetchIntervalInBackground||mf.isFocused())&&ye(this,ke,Yr).call(this)},N(this,La)))},Gd=function(){ye(this,ke,qd).call(this),ye(this,ke,Yd).call(this,ye(this,ke,Qd).call(this))},Kd=function(){N(this,Mn)!==void 0&&(xn.clearTimeout(N(this,Mn)),ee(this,Mn,void 0))},Xd=function(){N(this,wn)!==void 0&&(xn.clearInterval(N(this,wn)),ee(this,wn,void 0))},Vd=function(){const i=N(this,Bt).getQueryCache().build(N(this,Bt),this.options);if(i===N(this,Te))return;const r=N(this,Te);ee(this,Te,i),ee(this,Wr,i.state),this.hasListeners()&&(r==null||r.removeObserver(this),i.addObserver(this))},Yx=function(i){st.batch(()=>{i.listeners&&this.listeners.forEach(r=>{r(N(this,Tt))}),N(this,Bt).getQueryCache().notify({query:N(this,Te),type:"observerResultsUpdated"})})},ux);function F1(a,i){return Jt(i.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&Jt(i.retryOnMount,a)===!1)}function Uv(a,i){return F1(a,i)||a.state.data!==void 0&&Zd(a,i,i.refetchOnMount)}function Zd(a,i,r){if(Jt(i.enabled,a)!==!1&&Ka(i.staleTime,a)!=="static"){const u=typeof r=="function"?r(a):r;return u==="always"||u!==!1&&xf(a,i)}return!1}function Bv(a,i,r,u){return(a!==i||Jt(u.enabled,a)===!1)&&(!r.suspense||a.state.status!=="error")&&xf(a,r)}function xf(a,i){return Jt(i.enabled,a)!==!1&&a.isStaleByTime(Ka(i.staleTime,a))}function J1(a,i){return!Yo(a.getCurrentResult(),i)}var Ir,Al,gt,Cn,zl,ka,cx,W1=(cx=class extends Lx{constructor(i){super();ue(this,zl);ue(this,Ir);ue(this,Al);ue(this,gt);ue(this,Cn);ee(this,Ir,i.client),this.mutationId=i.mutationId,ee(this,gt,i.mutationCache),ee(this,Al,[]),this.state=i.state||Gx(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){N(this,Al).includes(i)||(N(this,Al).push(i),this.clearGcTimeout(),N(this,gt).notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){ee(this,Al,N(this,Al).filter(r=>r!==i)),this.scheduleGc(),N(this,gt).notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){N(this,Al).length||(this.state.status==="pending"?this.scheduleGc():N(this,gt).remove(this))}continue(){var i;return((i=N(this,Cn))==null?void 0:i.continue())??this.execute(this.state.variables)}async execute(i){var h,x,p,v,g,b,E,C,A,z,Q,U,q,K,H,V,W,F;const r=()=>{ye(this,zl,ka).call(this,{type:"continue"})},u={client:N(this,Ir),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Cn,Hx({fn:()=>this.options.mutationFn?this.options.mutationFn(i,u):Promise.reject(new Error("No mutationFn found")),onFail:(I,te)=>{ye(this,zl,ka).call(this,{type:"failed",failureCount:I,error:te})},onPause:()=>{ye(this,zl,ka).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,gt).canRun(this)}));const d=this.state.status==="pending",m=!N(this,Cn).canStart();try{if(d)r();else{ye(this,zl,ka).call(this,{type:"pending",variables:i,isPaused:m}),N(this,gt).config.onMutate&&await N(this,gt).config.onMutate(i,this,u);const te=await((x=(h=this.options).onMutate)==null?void 0:x.call(h,i,u));te!==this.state.context&&ye(this,zl,ka).call(this,{type:"pending",context:te,variables:i,isPaused:m})}const I=await N(this,Cn).start();return await((v=(p=N(this,gt).config).onSuccess)==null?void 0:v.call(p,I,i,this.state.context,this,u)),await((b=(g=this.options).onSuccess)==null?void 0:b.call(g,I,i,this.state.context,u)),await((C=(E=N(this,gt).config).onSettled)==null?void 0:C.call(E,I,null,this.state.variables,this.state.context,this,u)),await((z=(A=this.options).onSettled)==null?void 0:z.call(A,I,null,i,this.state.context,u)),ye(this,zl,ka).call(this,{type:"success",data:I}),I}catch(I){try{await((U=(Q=N(this,gt).config).onError)==null?void 0:U.call(Q,I,i,this.state.context,this,u))}catch(te){Promise.reject(te)}try{await((K=(q=this.options).onError)==null?void 0:K.call(q,I,i,this.state.context,u))}catch(te){Promise.reject(te)}try{await((V=(H=N(this,gt).config).onSettled)==null?void 0:V.call(H,void 0,I,this.state.variables,this.state.context,this,u))}catch(te){Promise.reject(te)}try{await((F=(W=this.options).onSettled)==null?void 0:F.call(W,void 0,I,i,this.state.context,u))}catch(te){Promise.reject(te)}throw ye(this,zl,ka).call(this,{type:"error",error:I}),I}finally{N(this,gt).runNext(this)}}},Ir=new WeakMap,Al=new WeakMap,gt=new WeakMap,Cn=new WeakMap,zl=new WeakSet,ka=function(i){const r=u=>{switch(i.type){case"failed":return{...u,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...u,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:i.error,failureCount:u.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=r(this.state),st.batch(()=>{N(this,Al).forEach(u=>{u.onMutationUpdate(i)}),N(this,gt).notify({mutation:this,type:"updated",action:i})})},cx);function Gx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ea,vl,es,dx,P1=(dx=class extends Qi{constructor(i={}){super();ue(this,ea);ue(this,vl);ue(this,es);this.config=i,ee(this,ea,new Set),ee(this,vl,new Map),ee(this,es,0)}build(i,r,u){const d=new W1({client:i,mutationCache:this,mutationId:++Ao(this,es)._,options:i.defaultMutationOptions(r),state:u});return this.add(d),d}add(i){N(this,ea).add(i);const r=Ro(i);if(typeof r=="string"){const u=N(this,vl).get(r);u?u.push(i):N(this,vl).set(r,[i])}this.notify({type:"added",mutation:i})}remove(i){if(N(this,ea).delete(i)){const r=Ro(i);if(typeof r=="string"){const u=N(this,vl).get(r);if(u)if(u.length>1){const d=u.indexOf(i);d!==-1&&u.splice(d,1)}else u[0]===i&&N(this,vl).delete(r)}}this.notify({type:"removed",mutation:i})}canRun(i){const r=Ro(i);if(typeof r=="string"){const u=N(this,vl).get(r),d=u==null?void 0:u.find(m=>m.state.status==="pending");return!d||d===i}else return!0}runNext(i){var u;const r=Ro(i);if(typeof r=="string"){const d=(u=N(this,vl).get(r))==null?void 0:u.find(m=>m!==i&&m.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){st.batch(()=>{N(this,ea).forEach(i=>{this.notify({type:"removed",mutation:i})}),N(this,ea).clear(),N(this,vl).clear()})}getAll(){return Array.from(N(this,ea))}find(i){const r={exact:!0,...i};return this.getAll().find(u=>zv(r,u))}findAll(i={}){return this.getAll().filter(r=>zv(i,r))}notify(i){st.batch(()=>{this.listeners.forEach(r=>{r(i)})})}resumePausedMutations(){const i=this.getAll().filter(r=>r.state.isPaused);return st.batch(()=>Promise.all(i.map(r=>r.continue().catch(Et))))}},ea=new WeakMap,vl=new WeakMap,es=new WeakMap,dx);function Ro(a){var i;return(i=a.options.scope)==null?void 0:i.id}var ta,qa,Ht,la,aa,Ho,$d,fx,I1=(fx=class extends Qi{constructor(r,u){super();ue(this,aa);ue(this,ta);ue(this,qa);ue(this,Ht);ue(this,la);ee(this,ta,r),this.setOptions(u),this.bindMethods(),ye(this,aa,Ho).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var d;const u=this.options;this.options=N(this,ta).defaultMutationOptions(r),Yo(this.options,u)||N(this,ta).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,Ht),observer:this}),u!=null&&u.mutationKey&&this.options.mutationKey&&Tn(u.mutationKey)!==Tn(this.options.mutationKey)?this.reset():((d=N(this,Ht))==null?void 0:d.state.status)==="pending"&&N(this,Ht).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=N(this,Ht))==null||r.removeObserver(this)}onMutationUpdate(r){ye(this,aa,Ho).call(this),ye(this,aa,$d).call(this,r)}getCurrentResult(){return N(this,qa)}reset(){var r;(r=N(this,Ht))==null||r.removeObserver(this),ee(this,Ht,void 0),ye(this,aa,Ho).call(this),ye(this,aa,$d).call(this)}mutate(r,u){var d;return ee(this,la,u),(d=N(this,Ht))==null||d.removeObserver(this),ee(this,Ht,N(this,ta).getMutationCache().build(N(this,ta),this.options)),N(this,Ht).addObserver(this),N(this,Ht).execute(r)}},ta=new WeakMap,qa=new WeakMap,Ht=new WeakMap,la=new WeakMap,aa=new WeakSet,Ho=function(){var u;const r=((u=N(this,Ht))==null?void 0:u.state)??Gx();ee(this,qa,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},$d=function(r){st.batch(()=>{var u,d,m,h,x,p,v,g;if(N(this,la)&&this.hasListeners()){const b=N(this,qa).variables,E=N(this,qa).context,C={client:N(this,ta),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(d=(u=N(this,la)).onSuccess)==null||d.call(u,r.data,b,E,C)}catch(A){Promise.reject(A)}try{(h=(m=N(this,la)).onSettled)==null||h.call(m,r.data,null,b,E,C)}catch(A){Promise.reject(A)}}else if((r==null?void 0:r.type)==="error"){try{(p=(x=N(this,la)).onError)==null||p.call(x,r.error,b,E,C)}catch(A){Promise.reject(A)}try{(g=(v=N(this,la)).onSettled)==null||g.call(v,void 0,r.error,b,E,C)}catch(A){Promise.reject(A)}}}this.listeners.forEach(b=>{b(N(this,qa))})})},fx),Rl,mx,e2=(mx=class extends Qi{constructor(i={}){super();ue(this,Rl);this.config=i,ee(this,Rl,new Map)}build(i,r,u){const d=r.queryKey,m=r.queryHash??hf(d,r);let h=this.get(m);return h||(h=new Z1({client:i,queryKey:d,queryHash:m,options:i.defaultQueryOptions(r),state:u,defaultOptions:i.getQueryDefaults(d)}),this.add(h)),h}add(i){N(this,Rl).has(i.queryHash)||(N(this,Rl).set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const r=N(this,Rl).get(i.queryHash);r&&(i.destroy(),r===i&&N(this,Rl).delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){st.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return N(this,Rl).get(i)}getAll(){return[...N(this,Rl).values()]}find(i){const r={exact:!0,...i};return this.getAll().find(u=>Av(r,u))}findAll(i={}){const r=this.getAll();return Object.keys(i).length>0?r.filter(u=>Av(i,u)):r}notify(i){st.batch(()=>{this.listeners.forEach(r=>{r(i)})})}onFocus(){st.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){st.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},Rl=new WeakMap,mx),Pe,Qa,Ya,ki,Di,Ga,Ui,Bi,hx,t2=(hx=class{constructor(a={}){ue(this,Pe);ue(this,Qa);ue(this,Ya);ue(this,ki);ue(this,Di);ue(this,Ga);ue(this,Ui);ue(this,Bi);ee(this,Pe,a.queryCache||new e2),ee(this,Qa,a.mutationCache||new P1),ee(this,Ya,a.defaultOptions||{}),ee(this,ki,new Map),ee(this,Di,new Map),ee(this,Ga,0)}mount(){Ao(this,Ga)._++,N(this,Ga)===1&&(ee(this,Ui,mf.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,Pe).onFocus())})),ee(this,Bi,Go.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,Pe).onOnline())})))}unmount(){var a,i;Ao(this,Ga)._--,N(this,Ga)===0&&((a=N(this,Ui))==null||a.call(this),ee(this,Ui,void 0),(i=N(this,Bi))==null||i.call(this),ee(this,Bi,void 0))}isFetching(a){return N(this,Pe).findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return N(this,Qa).findAll({...a,status:"pending"}).length}getQueryData(a){var r;const i=this.defaultQueryOptions({queryKey:a});return(r=N(this,Pe).get(i.queryHash))==null?void 0:r.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),r=N(this,Pe).build(this,i),u=r.state.data;return u===void 0?this.fetchQuery(a):(a.revalidateIfStale&&r.isStaleByTime(Ka(i.staleTime,r))&&this.prefetchQuery(i),Promise.resolve(u))}getQueriesData(a){return N(this,Pe).findAll(a).map(({queryKey:i,state:r})=>{const u=r.data;return[i,u]})}setQueryData(a,i,r){const u=this.defaultQueryOptions({queryKey:a}),d=N(this,Pe).get(u.queryHash),m=d==null?void 0:d.state.data,h=D1(i,m);if(h!==void 0)return N(this,Pe).build(this,u).setData(h,{...r,manual:!0})}setQueriesData(a,i,r){return st.batch(()=>N(this,Pe).findAll(a).map(({queryKey:u})=>[u,this.setQueryData(u,i,r)]))}getQueryState(a){var r;const i=this.defaultQueryOptions({queryKey:a});return(r=N(this,Pe).get(i.queryHash))==null?void 0:r.state}removeQueries(a){const i=N(this,Pe);st.batch(()=>{i.findAll(a).forEach(r=>{i.remove(r)})})}resetQueries(a,i){const r=N(this,Pe);return st.batch(()=>(r.findAll(a).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const r={revert:!0,...i},u=st.batch(()=>N(this,Pe).findAll(a).map(d=>d.cancel(r)));return Promise.all(u).then(Et).catch(Et)}invalidateQueries(a,i={}){return st.batch(()=>(N(this,Pe).findAll(a).forEach(r=>{r.invalidate()}),(a==null?void 0:a.refetchType)==="none"?Promise.resolve():this.refetchQueries({...a,type:(a==null?void 0:a.refetchType)??(a==null?void 0:a.type)??"active"},i)))}refetchQueries(a,i={}){const r={...i,cancelRefetch:i.cancelRefetch??!0},u=st.batch(()=>N(this,Pe).findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let m=d.fetch(void 0,r);return r.throwOnError||(m=m.catch(Et)),d.state.fetchStatus==="paused"?Promise.resolve():m}));return Promise.all(u).then(Et)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const r=N(this,Pe).build(this,i);return r.isStaleByTime(Ka(i.staleTime,r))?r.fetch(i):Promise.resolve(r.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Et).catch(Et)}fetchInfiniteQuery(a){return a._type="infinite",this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Et).catch(Et)}ensureInfiniteQueryData(a){return a._type="infinite",this.ensureQueryData(a)}resumePausedMutations(){return Go.isOnline()?N(this,Qa).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,Pe)}getMutationCache(){return N(this,Qa)}getDefaultOptions(){return N(this,Ya)}setDefaultOptions(a){ee(this,Ya,a)}setQueryDefaults(a,i){N(this,ki).set(Tn(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...N(this,ki).values()],r={};return i.forEach(u=>{Xr(a,u.queryKey)&&Object.assign(r,u.defaultOptions)}),r}setMutationDefaults(a,i){N(this,Di).set(Tn(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...N(this,Di).values()],r={};return i.forEach(u=>{Xr(a,u.mutationKey)&&Object.assign(r,u.defaultOptions)}),r}defaultQueryOptions(a){if(a._defaulted)return a;const i={...N(this,Ya).queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=hf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===pf&&(i.enabled=!1),i}defaultMutationOptions(a){return a!=null&&a._defaulted?a:{...N(this,Ya).mutations,...(a==null?void 0:a.mutationKey)&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){N(this,Pe).clear(),N(this,Qa).clear()}},Pe=new WeakMap,Qa=new WeakMap,Ya=new WeakMap,ki=new WeakMap,Di=new WeakMap,Ga=new WeakMap,Ui=new WeakMap,Bi=new WeakMap,hx),Kx=j.createContext(void 0),is=a=>{const i=j.useContext(Kx);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},l2=({client:a,children:i})=>(j.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),s.jsx(Kx.Provider,{value:a,children:i})),Xx=j.createContext(!1),a2=()=>j.useContext(Xx);Xx.Provider;function n2(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var i2=j.createContext(n2()),r2=()=>j.useContext(i2),s2=(a,i,r)=>{const u=r!=null&&r.state.error&&typeof a.throwOnError=="function"?vf(a.throwOnError,[r.state.error,r]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||u)&&(i.isReset()||(a.retryOnMount=!1))},o2=a=>{j.useEffect(()=>{a.clearReset()},[a])},u2=({result:a,errorResetBoundary:i,throwOnError:r,query:u,suspense:d})=>a.isError&&!i.isReset()&&!a.isFetching&&u&&(d&&a.data===void 0||vf(r,[a.error,u])),c2=a=>{if(a.suspense){const r=d=>d==="static"?d:Math.max(d??1e3,1e3),u=a.staleTime;a.staleTime=typeof u=="function"?(...d)=>r(u(...d)):r(u),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},d2=(a,i)=>a.isLoading&&a.isFetching&&!i,f2=(a,i)=>(a==null?void 0:a.suspense)&&i.isPending,Hv=(a,i,r)=>i.fetchOptimistic(a).catch(()=>{r.clearReset()});function m2(a,i,r){var C,A,z,Q;const u=a2(),d=r2(),m=is(),h=m.defaultQueryOptions(a);(A=(C=m.getDefaultOptions().queries)==null?void 0:C._experimental_beforeQuery)==null||A.call(C,h);const x=m.getQueryCache().get(h.queryHash),p=a.subscribed!==!1;h._optimisticResults=u?"isRestoring":p?"optimistic":void 0,c2(h),s2(h,d,x),o2(d);const v=!m.getQueryCache().get(h.queryHash),[g]=j.useState(()=>new i(m,h)),b=g.getOptimisticResult(h),E=!u&&p;if(j.useSyncExternalStore(j.useCallback(U=>{const q=E?g.subscribe(st.batchCalls(U)):Et;return g.updateResult(),q},[g,E]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),j.useEffect(()=>{g.setOptions(h)},[h,g]),f2(h,b))throw Hv(h,g,d);if(u2({result:b,errorResetBoundary:d,throwOnError:h.throwOnError,query:x,suspense:h.suspense}))throw b.error;if((Q=(z=m.getDefaultOptions().queries)==null?void 0:z._experimental_afterQuery)==null||Q.call(z,h,b),h.experimental_prefetchInRender&&!Vr.isServer()&&d2(b,u)){const U=v?Hv(h,g,d):x==null?void 0:x.promise;U==null||U.catch(Et).finally(()=>{g.updateResult()})}return h.notifyOnChangeProps?b:g.trackResult(b)}function cl(a,i){return m2(a,$1)}function En(a,i){const r=is(),[u]=j.useState(()=>new I1(r,a));j.useEffect(()=>{u.setOptions(a)},[u,a]);const d=j.useSyncExternalStore(j.useCallback(h=>u.subscribe(st.batchCalls(h)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),m=j.useCallback((h,x)=>{u.mutate(h,x).catch(Et)},[u]);if(d.error&&vf(u.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:m,mutateAsync:d.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 Vx=(...a)=>a.filter((i,r,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===r).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 h2=a=>a.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 p2=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,u)=>u?u.toUpperCase():r.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 Lv=a=>{const i=p2(a);return i.charAt(0).toUpperCase()+i.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 Td={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 v2=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},x2=j.createContext({}),y2=()=>j.useContext(x2),b2=j.forwardRef(({color:a,size:i,strokeWidth:r,absoluteStrokeWidth:u,className:d="",children:m,iconNode:h,...x},p)=>{const{size:v=24,strokeWidth:g=2,absoluteStrokeWidth:b=!1,color:E="currentColor",className:C=""}=y2()??{},A=u??b?Number(r??g)*24/Number(i??v):r??g;return j.createElement("svg",{ref:p,...Td,width:i??v??Td.width,height:i??v??Td.height,stroke:a??E,strokeWidth:A,className:Vx("lucide",C,d),...!m&&!v2(x)&&{"aria-hidden":"true"},...x},[...h.map(([z,Q])=>j.createElement(z,Q)),...Array.isArray(m)?m:[m]])});/**
|
|
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 Qe=(a,i)=>{const r=j.forwardRef(({className:u,...d},m)=>j.createElement(b2,{ref:m,iconNode:i,className:Vx(`lucide-${h2(Lv(a))}`,`lucide-${a}`,u),...d}));return r.displayName=Lv(a),r};/**
|
|
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 g2=[["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"}]],qv=Qe("activity",g2);/**
|
|
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 j2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Jo=Qe("arrow-right",j2);/**
|
|
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 S2=[["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"}]],Qv=Qe("boxes",S2);/**
|
|
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 N2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wt=Qe("check",N2);/**
|
|
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 M2=[["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"}]],Fd=Qe("circle-dashed",M2);/**
|
|
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 w2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],C2=Qe("clock-3",w2);/**
|
|
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 T2=[["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"}]],E2=Qe("copy",T2);/**
|
|
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 A2=[["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"}]],z2=Qe("cpu",A2);/**
|
|
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 R2=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Hi=Qe("credit-card",R2);/**
|
|
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 O2=[["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"}]],_2=Qe("database",O2);/**
|
|
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 k2=[["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"}]],Zx=Qe("git-branch",k2);/**
|
|
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 D2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],U2=Qe("globe",D2);/**
|
|
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 B2=[["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"}]],H2=Qe("landmark",B2);/**
|
|
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 L2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],At=Qe("loader-circle",L2);/**
|
|
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 q2=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],Q2=Qe("lock-keyhole",q2);/**
|
|
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 Y2=[["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"}]],G2=Qe("network",Y2);/**
|
|
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 K2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ko=Qe("plus",K2);/**
|
|
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 X2=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],V2=Qe("receipt-text",X2);/**
|
|
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 Z2=[["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"}]],Jd=Qe("refresh-cw",Z2);/**
|
|
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 $2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wo=Qe("search",$2);/**
|
|
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 F2=[["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"}]],J2=Qe("settings-2",F2);/**
|
|
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 W2=[["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"}]],P2=Qe("shield-check",W2);/**
|
|
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 I2=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ej=Qe("smartphone",I2);/**
|
|
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 tj=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],$x=Qe("timer",tj);/**
|
|
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 lj=[["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"}]],Fx=Qe("trash-2",lj);/**
|
|
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 aj=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],nj=Qe("trending-up",aj);/**
|
|
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 ij=[["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"}]],Gr=Qe("wallet-cards",ij);/**
|
|
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 rj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zr=Qe("x",rj);class Jx extends Error{constructor(r,u,d){super(r);vd(this,"status");vd(this,"code");this.status=u,this.code=d}}async function dl(a){var r,u;const i=await fetch(a);if(!i.ok){const d=await i.json().catch(()=>({}));throw new Jx(((r=d.error)==null?void 0:r.message)??`${a} returned ${i.status}`,i.status,(u=d.error)==null?void 0:u.code)}return i.json()}async function sa(a,i,r){var d,m;const u=await fetch(i,{method:a,headers:r?{"content-type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Jx(((d=h.error)==null?void 0:d.message)??`${a} ${i} returned ${u.status}`,u.status,(m=h.error)==null?void 0:m.code)}return u.json()}function Po(){return cl({queryKey:["ledger","inferences"],queryFn:()=>dl("/ledger/inferences"),refetchInterval:1e4})}function sj(){return cl({queryKey:["ledger","purchases"],queryFn:()=>dl("/ledger/purchases"),refetchInterval:1e4})}function Wx(){return cl({queryKey:["payments"],queryFn:()=>dl("/payments"),refetchInterval:1e4})}function Px(){const a=is();return En({mutationFn:()=>sa("POST","/payments/clawtip/activate"),onSuccess:()=>{a.invalidateQueries({queryKey:["payments"]})}})}function Ix(){return En({mutationFn:()=>sa("POST","/payments/clawtip/recharge")})}function e0(){return cl({queryKey:["routing","strategy"],queryFn:()=>dl("/routing/strategy")})}function t0(){const a=is();return En({mutationFn:i=>sa("PUT","/routing/strategy",i),onSuccess:()=>{a.invalidateQueries({queryKey:["routing","strategy"]})}})}function oj(a){const i=new URLSearchParams;for(const[r,u]of Object.entries(a))u!=null&&u!==""&&i.set(r,uj(u));return cl({queryKey:["routing","preview",i.toString()],queryFn:()=>dl(`/routing/preview?${i.toString()}`),enabled:!1})}function uj(a){return Array.isArray(a)?a.join(","):typeof a=="object"&&a!==null?Object.entries(a).map(([i,r])=>`${i}:${r}`).join(","):String(a)}function l0(){return cl({queryKey:["sellers"],queryFn:()=>dl("/sellers"),refetchInterval:3e4})}function yf(){return cl({queryKey:["models"],queryFn:()=>dl("/models"),refetchInterval:3e4})}function cj(){return cl({queryKey:["prewarm","focus-set"],queryFn:()=>dl("/v1.2/prewarm").then(a=>({ok:!0,focusSet:a.focusSet??[],source:"historical"}))})}async function Lo(a){const i=Array.isArray(a)?{models:a}:a;return sa("PUT","/prewarm/focus-set",i)}function a0(){return cl({queryKey:["status"],queryFn:()=>dl("/status"),refetchInterval:5e3})}function dj(){return cl({queryKey:["update","status"],queryFn:()=>dl("/update/status"),refetchInterval:3600*1e3})}function fj(){return En({mutationFn:()=>sa("POST","/update/run")})}function St({children:a,className:i=""}){return s.jsx("div",{className:["rounded-[var(--radius-xl)] border border-[var(--color-line-2)] bg-white shadow-[var(--shadow-panel)]",i].join(" "),children:a})}function rs({tone:a="lavender",children:i}){const r={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)]",r[a]??r.lavender].join(" "),children:[s.jsx("span",{className:"size-1.5 rounded-full bg-current"}),i]})}const Ee="—",Lt=a=>a<10?`0${a}`:`${a}`;function gl(a,i={}){if(!Number.isFinite(a))return Ee;const r=a;return i.compact===!1||r<1e4?Math.round(r).toLocaleString("en-US"):r<1e6?`${(r/1e3).toFixed(1)}K`:r<1e9?`${(r/1e6).toFixed(1)}M`:`${(r/1e9).toFixed(2)}B`}function $r(a,i,r={}){const u=r.separator??" / ";return`In ${gl(a,r)}${u}Out ${gl(i,r)}`}function mj(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?Ee:`Input ${Xe(a)} / Output ${Xe(i)}`}function Xe(a){return Number.isFinite(a)?Math.round(a).toLocaleString("en-US"):Ee}function ot(a,i={}){if(!Number.isFinite(a))return Ee;const r=Math.abs(a/1e6),u=i.digits??(i.ledger&&r<.01?6:4),d=`$${(a/1e6).toFixed(u)}`;return i.signed&&a>=0?`+${d}`:d}function hj(a,i,r={}){return!Number.isFinite(a)&&!Number.isFinite(i)?Ee:`${ot(a,r)} / ${ot(i,r)}`}function yt(a){if(!Number.isFinite(a))return Ee;const i=Math.max(0,Math.round(a));return i<1e3?`${i}ms`:`${(i/1e3).toFixed(2)}s`}function bf(a){return Number.isFinite(a)?`${Math.round(a*100)}%`:Ee}function n0(a){if(!Number.isFinite(a))return Ee;const i=Math.max(0,1-a);return bf(i)}function i0(a,i){return hj(a,i,{digits:4})}function _l(a){return a?a.trim().toLowerCase().replaceAll("_"," "):Ee}function Xa(a){const i=_l(a);return i==="ok"||i==="online"||i==="configured"||i==="settled"||i==="completed"||i==="success"||i==="active"||i==="healthy"?"green":i==="fallback"||i==="pending"||i==="degraded"||i==="preview"?"amber":i==="failed"||i==="error"||i==="canceled"||i==="unhealthy"||i==="offline"?"red":i==="running"?"blue":"gray"}function Fr(a,i=32){return a?a.length>i?`${a.slice(0,i)}...`:a:Ee}function pj(a){return a?a.startsWith("tbs-")&&a.length>10?a.slice(0,10):a.length<=12?a:a.slice(0,12):Ee}function r0(a){if(!a)return Ee;const i=new Date(a);if(Number.isNaN(i.getTime()))return Ee;const r=new Date,u=i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()&&i.getDate()===r.getDate(),d=`${Lt(i.getHours())}:${Lt(i.getMinutes())}`;return u?d:`${Lt(i.getMonth()+1)}/${Lt(i.getDate())} ${d}`}function jl(a){if(!a)return Ee;const i=new Date(a);return Number.isNaN(i.getTime())?Ee:`${i.getFullYear()}-${Lt(i.getMonth()+1)}-${Lt(i.getDate())} ${Lt(i.getHours())}:${Lt(i.getMinutes())}:${Lt(i.getSeconds())}`}function s0(a){if(!a)return Ee;const i=new Date(a);return Number.isNaN(i.getTime())?Ee:`${i.getFullYear()}/${Lt(i.getMonth()+1)}/${Lt(i.getDate())} ${Lt(i.getHours())}:${Lt(i.getMinutes())}:${Lt(i.getSeconds())}`}function vj(a){return r0(a)}function o0({inferences:a,modelsResponse:i,sellersResponse:r,previewPlan:u,activeModelId:d}){const m=bj(i,r),h=[...a].sort(Nj),x=new Map,p=new Map;let v=0,g=0,b=0;for(const C of h){const A=C.modelId||Ee,z=C.sellerKey||Ee,Q=xl(C.promptTokens)??0,U=xl(C.completionTokens)??0,q=Q+U,K=xl(C.billedMicros)??0;v+=1,g+=q,b+=K;const H=x.get(A)??gj(A);H.entries.push(C),H.requestCount+=1,H.inputTokens+=Q,H.outputTokens+=U,H.totalSpendMicros+=K,H.touchedSellers.add(z),H.sellerCounts.set(z,(H.sellerCounts.get(z)??0)+1),H.fallbackCount+=xl(C.fallbackCount)??0;const V=xl(C.ttftMs);V!==void 0&&(H.ttftTotal+=V,H.ttftCount+=1);const W=xl(C.durationMs);W!==void 0&&(H.durationTotal+=W,H.durationCount+=1),x.set(A,H);const F=p.get(z)??{requestCount:0,totalTokens:0};F.requestCount+=1,F.totalTokens+=q,p.set(z,F)}const E=Array.from(x.values()).map(C=>xj(C,p,m)).sort(Mj);if(E.length===0){const C=yj(d,u,m);C&&E.push(C)}return{rows:E,totalRequests:v,totalTokens:g,totalSpendMicros:b}}function xj(a,i,r){const u=a.entries[a.entries.length-1],d=(u==null?void 0:u.sellerKey)||Ee,m=u0(d,r),h=a.sellerCounts.get(d)??0,x=i.get(d),p=r.modelsBySellerAndModel.get(`${d}\0${a.modelId}`);return{source:"ledger",modelId:a.modelId,currentSellerId:d,currentSellerName:m.name,currentSellerUrl:m.url,currentSellerStatus:m.status,currentSellerPaymentMethods:m.paymentMethods,sellerDiscount:m.discount,sellerServiceFee:m.serviceFee,sellerModelCount:m.modelCount,requestCount:a.requestCount,currentSellerModelRequests:h,currentSellerRequests:(x==null?void 0:x.requestCount)??h,inputTokens:a.inputTokens,outputTokens:a.outputTokens,totalTokens:a.inputTokens+a.outputTokens,currentSellerTokens:(x==null?void 0:x.totalTokens)??0,totalSpendMicros:a.totalSpendMicros,avgTtftMs:Yv(a.ttftTotal,a.ttftCount),avgDurationMs:Yv(a.durationTotal,a.durationCount),lastTtftMs:xl(u==null?void 0:u.ttftMs),lastDurationMs:xl(u==null?void 0:u.durationMs),selectedAt:jj(a.entries,d),lastSellerSwitchAt:Sj(a.entries),lastAccessAt:u==null?void 0:u.createdAt,lastRequestId:u==null?void 0:u.requestId,lastStatus:u==null?void 0:u.status,routeReason:u==null?void 0:u.routeReason,upstreamStatus:u==null?void 0:u.upstreamStatus,fallbackCount:a.fallbackCount,falloverChain:(u==null?void 0:u.falloverChain)??[],touchedSellerCount:a.touchedSellers.size,inputPriceMicrosPer1m:p==null?void 0:p.inputPriceMicrosPer1m,outputPriceMicrosPer1m:p==null?void 0:p.outputPriceMicrosPer1m}}function yj(a,i,r){var p,v,g;const u=(p=i==null?void 0:i.routes)==null?void 0:p[0];if(!u||!a)return;const d=u0(u.seller.id,r,u),m=xl(u.metrics.ttftMs)??xl(u.metrics.avgLatencyMs),h=xl(u.metrics.avgInferenceMs),x=r.modelsBySellerAndModel.get(`${u.seller.id}\0${a}`);return{source:"preview",modelId:a,currentSellerId:u.seller.id,currentSellerName:d.name,currentSellerUrl:d.url,currentSellerStatus:d.status,currentSellerPaymentMethods:d.paymentMethods,sellerDiscount:d.discount,sellerServiceFee:d.serviceFee,sellerModelCount:d.modelCount,requestCount:0,currentSellerModelRequests:0,currentSellerRequests:0,inputTokens:0,outputTokens:0,totalTokens:0,currentSellerTokens:0,totalSpendMicros:0,avgTtftMs:m,avgDurationMs:h,lastTtftMs:m,lastDurationMs:h,routeReason:i.reason??i.sourceReason??"Preview route",fallbackCount:0,falloverChain:((v=i.routes)==null?void 0:v.map(b=>b.seller.id))??[],touchedSellerCount:((g=i.routes)==null?void 0:g.length)??1,inputPriceMicrosPer1m:x==null?void 0:x.inputPriceMicrosPer1m,outputPriceMicrosPer1m:x==null?void 0:x.outputPriceMicrosPer1m}}function bj(a,i){const r=new Map;for(const u of(a==null?void 0:a.data)??[]){const d=r.get(u.sellerId)??new Set;d.add(u.id),r.set(u.sellerId,d)}return{registryById:new Map(((i==null?void 0:i.sellers)??[]).map(u=>[u.id,u])),catalogById:new Map(((a==null?void 0:a.sellers)??[]).map(u=>[u.id,u])),modelsBySellerAndModel:new Map(((a==null?void 0:a.data)??[]).map(u=>[`${u.sellerId}\0${u.id}`,u])),modelCountsBySellerId:new Map(Array.from(r.entries()).map(([u,d])=>[u,d.size]))}}function gj(a){return{modelId:a,entries:[],sellerCounts:new Map,touchedSellers:new Set,requestCount:0,inputTokens:0,outputTokens:0,totalSpendMicros:0,ttftTotal:0,ttftCount:0,durationTotal:0,durationCount:0,fallbackCount:0}}function jj(a,i){var r;for(let u=a.length-1;u>=0;u-=1){const d=a[u];if(d.sellerKey!==i)return(r=a[u+1])==null?void 0:r.createdAt;if(u===0)return d.createdAt}}function Sj(a){let i;for(let r=1;r<a.length;r+=1)a[r].sellerKey!==a[r-1].sellerKey&&(i=a[r].createdAt);return i}function u0(a,i,r){const u=i.catalogById.get(a),d=i.registryById.get(a),m=(r==null?void 0:r.metrics.discountRatio)??(u==null?void 0:u.discountRatio);return{name:wj((r==null?void 0:r.seller.name)??(u==null?void 0:u.name)??(d==null?void 0:d.name)??a),url:(r==null?void 0:r.seller.url)??(u==null?void 0:u.url)??(d==null?void 0:d.url),status:(u==null?void 0:u.status)??(d==null?void 0:d.status)??Ee,paymentMethods:(u==null?void 0:u.paymentMethods)??(d==null?void 0:d.paymentMethods)??(r==null?void 0:r.seller.paymentMethods)??[],discount:n0(m),serviceFee:bf(u==null?void 0:u.serviceFeeRatio),modelCount:(u==null?void 0:u.modelCount)??i.modelCountsBySellerId.get(a)}}function Nj(a,i){return Xo(a.createdAt)-Xo(i.createdAt)}function Mj(a,i){return Xo(i.lastAccessAt)-Xo(a.lastAccessAt)}function Xo(a){if(!a)return 0;const i=new Date(a).getTime();return Number.isNaN(i)?0:i}function Yv(a,i){return i>0?a/i:void 0}function xl(a){return Number.isFinite(a)?a:void 0}function wj(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function Gv(){var fe,pe,Ae,me,k,$,ne,be,ge,M,_,Z,P,X,le,re,we,ze,qt,fl;const[a,i]=j.useState(null),r=a0(),u=e0(),d=Wx(),m=Px(),h=Ix(),x=d.refetch,p=m.reset,v=Po(),g=l0(),b=yf(),E=dj(),C=fj(),A=((fe=v.data)==null?void 0:fe.inferences)??[],z=((pe=d.data)==null?void 0:pe.payments)??[],Q=new Set((((Ae=b.data)==null?void 0:Ae.data)??[]).map(De=>De.id)).size,U=((me=g.data)==null?void 0:me.sellers.length)??(($=(k=b.data)==null?void 0:k.sellers)==null?void 0:$.length)??0,q=j.useMemo(()=>Hj(A),[A]),K=j.useMemo(()=>Lj(z,A),[A,z]),H=j.useMemo(()=>o0({inferences:A,modelsResponse:b.data,sellersResponse:g.data}),[A,b.data,g.data]),W=z.some(De=>bl(De.method)==="clawtip"&&(De.enabled||f0(De.config,"walletConfigPresent")))||((ne=m.data)==null?void 0:ne.walletConfigPresent)===!0,F=((be=r.data)==null?void 0:be.status)==="running"&&!r.isError,I=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),te=((ge=u.data)==null?void 0:ge.strategy.mode)??((M=r.data)==null?void 0:M.sellerRoutingMode)??Ee,se=((_=u.data)==null?void 0:_.strategy.scorer)??((Z=r.data)==null?void 0:Z.sellerRoutingScorer)??Ee,J=()=>{i(null),m.reset(),h.reset()};return j.useEffect(()=>{if((a==null?void 0:a.kind)!=="activate"||bl(a.method)!=="clawtip"||W)return;const De=window.setInterval(()=>{x()},1500);return()=>window.clearInterval(De)},[W,a==null?void 0:a.kind,a==null?void 0:a.method,x]),j.useEffect(()=>{(a==null?void 0:a.kind)==="activate"&&bl(a.method)==="clawtip"&&W&&(i(null),p())},[W,a==null?void 0:a.kind,a==null?void 0:a.method,p]),s.jsxs("div",{className:"min-w-0 overflow-x-hidden space-y-3",children:[s.jsx(Cj,{currentVersion:(P=E.data)==null?void 0:P.currentVersion,latestVersion:(X=E.data)==null?void 0:X.latestVersion,updateAvailable:(le=E.data)==null?void 0:le.updateAvailable,running:C.isPending,result:C.data,error:C.error,onUpdate:()=>C.mutate()}),s.jsxs("section",{className:"grid grid-cols-2 gap-2.5 md:grid-cols-3 xl:grid-cols-6",children:[s.jsx(gi,{to:"/routing",icon:s.jsx(Zx,{className:"size-4"}),label:"Router",value:te,note:`${se} scorer`,tone:"router"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(qv,{className:"size-4"}),label:"Today requests",value:Xe(q.todayRequestCount),note:`${Xe(q.totalRequestCount)} total`,tone:"requests"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Hi,{className:"size-4"}),label:"Spend today",value:ot(q.todaySpendMicros,{digits:4}),note:`${ot(q.totalSpendMicros,{digits:4})} total`,tone:"spend"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Qv,{className:"size-4"}),label:"Today tokens",value:gl(q.todayInputTokens+q.todayOutputTokens),note:$r(q.todayInputTokens,q.todayOutputTokens),tone:"tokens"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(qv,{className:"size-4"}),label:"Total tokens",value:gl(q.inputTokens+q.outputTokens),note:$r(q.inputTokens,q.outputTokens),tone:"tokens"}),s.jsx(gi,{to:"/routing",icon:s.jsx(Qv,{className:"size-4"}),label:"Models / Sellers",value:`${Q}`,note:`${U} sellers`,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(Tj,{rows:H.rows,totalRequests:H.totalRequests,totalTokens:H.totalTokens}),s.jsxs(St,{className:"p-3.5",children:[s.jsx("div",{className:"flex items-start justify-between gap-4",children:s.jsx("div",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"text-[1rem] font-semibold text-[var(--color-ink)]",children:"Payment management"}),s.jsx(rs,{tone:z.some(De=>De.enabled)?"green":"amber",children:z.some(De=>De.enabled)?"configured":"not configured"})]})})}),s.jsx("div",{className:"mt-2 min-w-0 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-white",children:K.map(De=>s.jsx(Aj,{...De,onActivate:()=>{i({kind:"activate",method:De.method}),De.method==="clawtip"&&m.mutate()},onRecharge:()=>{i({kind:"recharge",method:De.method}),De.method==="clawtip"&&h.mutate()}},De.method))})]}),s.jsxs(St,{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(nj,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),s.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"TokenUsage"})]})}),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:[q.modelUsage.map(De=>s.jsx(Dj,{model:De.model,color:De.color},De.model)),s.jsx(Kv,{label:"in"}),s.jsx(Kv,{label:"out",dashed:!0})]})]}),s.jsxs("div",{className:"grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_190px]",children:[s.jsx(Oj,{days:q.days,series:q.modelUsage}),s.jsxs("div",{className:"grid gap-3",children:[s.jsx(_j,{days:q.days,values:q.cost,total:ot(q.weeklySpendMicros)}),s.jsx(kj,{values:q.thirtyDaySpend,total:ot(q.totalSpendMicros)})]})]})]})]})}),s.jsx(Uj,{checkedAt:I,healthy:F,pid:(re=r.data)==null?void 0:re.pid,status:(we=r.data)==null?void 0:we.status,proxyPort:(ze=r.data)==null?void 0:ze.proxyPort,controlPort:(qt=r.data)==null?void 0:qt.controlPort,registryUrl:(fl=r.data)==null?void 0:fl.sellerRegistryUrl}),a?s.jsx(Rj,{modal:a,methods:K,qr:a.kind==="activate"?m.data:h.data,loading:a.kind==="activate"?m.isPending:h.isPending,error:a.kind==="activate"?m.error:h.error,onClose:J}):null]})}function Cj({currentVersion:a,latestVersion:i,updateAvailable:r,running:u,result:d,error:m,onUpdate:h}){if(!r&&!u&&!d&&!m)return null;const x=d?d.install.succeeded?d.restart.scheduled||d.restart.restarted?"Installed. tb-proxyd restart is in progress.":d.restart.error??"Installed. Restart needs attention.":d.install.error??"Update failed.":void 0,p=(m==null?void 0:m.message)??x??(a&&i?`TokenBuddy ${a} -> ${i}`:"TokenBuddy update available"),v=!!(m||(d==null?void 0:d.install.succeeded)===!1||d!=null&&d.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",v?"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",v?"text-[var(--color-danger)]":"text-[var(--color-purple)]"].join(" "),children:s.jsx(Jd,{className:["size-4",u?"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:p})]})]}),r?s.jsxs("button",{type:"button",onClick:h,disabled:u,className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[var(--radius-md)] border border-[var(--color-lavender-2)] bg-white px-3 text-[0.76rem] font-semibold text-[var(--color-purple)] transition hover:border-[var(--color-purple)] hover:bg-[var(--color-page)] disabled:cursor-wait disabled:opacity-70",children:[s.jsx(Jd,{className:["size-3.5",u?"animate-spin":""].join(" ")}),u?"Updating":"Update"]}):null]})}function Tj({rows:a,totalRequests:i,totalTokens:r}){var d;const u=a.slice(0,3);return s.jsxs(St,{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(Zx,{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(ns,{to:"/routing",className:"shrink-0 rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2.5 py-1.5 text-[0.72rem] font-semibold text-[var(--color-purple)] transition hover:bg-white",children:"Details"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)]/55 px-3.5 py-2 sm:grid-cols-4",children:[s.jsx(Oo,{label:"Req",value:Xe(i)}),s.jsx(Oo,{label:"Token",value:gl(r)}),s.jsx(Oo,{label:"Models",value:Xe(a.length)}),s.jsx(Oo,{label:"Latest",value:r0((d=a[0])==null?void 0:d.lastAccessAt)})]}),u.length>0?s.jsx("div",{className:"divide-y divide-[var(--color-line-2)]",children:u.map(m=>s.jsx(Ej,{row:m},`${m.modelId}-${m.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 Oo({label:a,value:i}){return s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.65rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:i})]})}function Ej({row:a}){const i=a.lastSellerSwitchAt??a.selectedAt;return s.jsxs("div",{className:"grid min-w-0 gap-3 px-3.5 py-3 lg:grid-cols-[minmax(0,1.05fr)_minmax(0,2fr)] lg:items-center",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-[0.72rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"truncate",children:a.currentSellerName}),s.jsx("span",{className:"font-mono",children:a.currentSellerStatus})]})]}),s.jsxs("div",{className:"grid min-w-0 grid-cols-2 gap-1.5 sm:grid-cols-3 lg:grid-cols-6",children:[s.jsx(bi,{label:"In",value:gl(a.inputTokens),tone:"tokens",title:`Input tokens: ${Xe(a.inputTokens)}`}),s.jsx(bi,{label:"Out",value:gl(a.outputTokens),tone:"success",title:`Output tokens: ${Xe(a.outputTokens)}`}),s.jsx(bi,{label:"TTFT",value:yt(a.lastTtftMs??a.avgTtftMs),tone:"router",title:`Time to first token: ${yt(a.lastTtftMs??a.avgTtftMs)}`}),s.jsx(bi,{label:"Total",value:yt(a.lastDurationMs??a.avgDurationMs),tone:"slate",title:`Total inference duration: ${yt(a.lastDurationMs??a.avgDurationMs)}`}),s.jsx(bi,{label:"Disc",value:a.sellerDiscount,tone:"success",title:`Seller discount: ${a.sellerDiscount}`}),s.jsx(bi,{label:"Switch",value:vj(i),tone:"slate",title:`Last seller switch: ${jl(i)}`})]})]})}function bi({label:a,value:i,tone:r,title:u}){const d={router:"bg-[var(--color-lavender)] text-[var(--color-router)]",success:"bg-[var(--color-success-soft)] text-[var(--color-success)]",warning:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]",tokens:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",slate:"bg-slate-50 text-slate-700"}[r];return s.jsxs("div",{className:["min-w-0 rounded-[var(--radius-md)] px-2 py-1",d].join(" "),title:u??`${a}: ${i}`,children:[s.jsx("div",{className:"text-[0.58rem] font-semibold uppercase tracking-wider opacity-70",children:a}),s.jsx("div",{className:"truncate font-mono text-[0.76rem] font-semibold",children:i})]})}function gi({to:a,icon:i,label:r,value:u,note:d,tone:m}){const h={router:{card:"border border-[var(--color-hairline-strong)] bg-white shadow-[var(--shadow-panel-strong)] hover:border-[var(--color-primary)] before:bg-[var(--color-router)]",icon:"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)] before:bg-[var(--color-success)]",icon:"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-spend-border)] bg-[var(--color-spend-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-spend)] before:bg-[var(--color-spend)]",icon:"bg-white text-[var(--color-spend)]",label:"text-[var(--color-spend)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-spend)]"},tokens:{card:"border border-[var(--color-tokens-border)] bg-[var(--color-tokens-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-tokens)] before:bg-[var(--color-tokens)]",icon:"bg-white text-[var(--color-tokens)]",label:"text-[var(--color-tokens)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-tokens)]"},inventory:{card:"border border-[var(--color-inventory-border)] bg-[var(--color-inventory-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-inventory)] before:bg-[var(--color-inventory)]",icon:"bg-white text-[var(--color-inventory)]",label:"text-[var(--color-inventory)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-inventory)]"}}[m];return s.jsxs(ns,{to:a,"aria-label":`Open ${r}`,className:["relative block min-h-[94px] overflow-hidden rounded-[var(--radius-xl)] p-3 transition before:absolute before:inset-y-0 before:left-0 before:w-1 hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",h.card].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`grid size-7 place-items-center rounded-[var(--radius-md)] ${h.icon}`,children:i}),s.jsx("span",{className:["text-right text-[0.66rem] font-semibold uppercase leading-3 tracking-[0.08em]",h.label].join(" "),children:r})]}),s.jsx("div",{className:["mt-2 text-[1.25rem] font-semibold leading-none tracking-tight",h.value].join(" "),children:u}),s.jsx("div",{className:["mt-1.5 truncate text-[0.72rem] font-medium",h.note].join(" "),children:d})]})}function Aj({name:a,method:i,balance:r,status:u,note:d,action:m,icon:h,balanceHidden:x,onActivate:p,onRecharge:v}){const g=u==="Bound",b=g&&x&&bl(i)==="clawtip";return s.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_74px_82px] items-center gap-2 border-b border-[var(--color-line-2)] px-2 py-2.5 last:border-b-0 sm:grid-cols-[minmax(0,1fr)_96px_92px] sm:gap-3 sm:px-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(zj,{method:i,icon:h,bound:g}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:a}),d?s.jsx("div",{className:"mt-0.5 truncate text-[0.74rem] text-[var(--color-muted)]",children:d}):null]})})]}),b?s.jsxs("button",{type:"button",className:"inline-flex w-fit items-center gap-1 rounded-[7px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2 py-1 font-mono text-[0.82rem] font-semibold text-[var(--color-purple)] transition hover:border-[var(--color-purple)] hover:bg-white active:translate-y-px",onClick:v,"aria-label":"Scan with JD app to view ClawTip wallet balance",title:"Scan with JD app to view wallet balance",children:[s.jsx(Q2,{className:"size-3.5"}),"••••"]}):s.jsx("div",{className:"font-mono text-[0.9rem] font-semibold text-[var(--color-ink)]",children:r}),s.jsx("button",{className:"rounded-[8px] bg-[var(--color-purple)] px-2.5 py-1.5 text-[0.76rem] font-semibold text-white shadow-[0_8px_18px_rgba(124,61,240,0.16)] transition hover:bg-[#6e32dc] active:translate-y-px",onClick:g?v:p,"aria-label":m,title:`${m} ${a}`,children:m})]})}function zj({method:a,icon:i,bound:r}){return bl(a)==="clawtip"?s.jsx("div",{className:"grid size-8 shrink-0 place-items-center rounded-[8px] border border-red-100 bg-[#e1251b] font-mono text-[0.72rem] font-black uppercase tracking-tight text-white shadow-[0_8px_18px_rgba(225,37,27,0.16)]","aria-label":"JD wallet",title:"JD wallet",children:"JD"}):s.jsx("div",{className:["grid size-8 shrink-0 place-items-center rounded-[8px] text-[0.8rem] font-bold",r?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:i})}function Rj({modal:a,methods:i,qr:r,loading:u,error:d,onClose:m}){const h=a.kind==="recharge",x=i.find(z=>z.method===a.method),p=h&&bl(a.method)==="clawtip",v=Ed(x==null?void 0:x.config,"resourceUrl"),g=Ed(x==null?void 0:x.config,"walletConfigPath"),b=Ed(x==null?void 0:x.config,"orderNo"),E=(r==null?void 0:r.walletConfigPresent)===!0||f0(x==null?void 0:x.config,"walletConfigPresent"),C=!h&&!!(r!=null&&r.qrImageUrl)&&!E&&!d,A=(x==null?void 0:x.name)??c0(a.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:p?"ClawTip wallet QR":h?`Recharge ${A}`:`Activate ${A}`}),s.jsx("p",{className:"mt-1 text-[0.82rem] leading-5 text-[var(--color-muted)]",children:p?"Scan with JD app to view wallet balance or recharge.":h?"Load the fixed ClawTip recharge QR from static assets.":"Reuse the tb init ClawTip flow and wait for wallet binding."})]}),s.jsx("button",{className:"rounded-[7px] p-1.5 text-[var(--color-muted)] transition hover:bg-[var(--color-page)]",onClick:m,"aria-label":"Close payment modal",children:s.jsx(Zr,{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:r!=null&&r.qrImageUrl?s.jsx("img",{className:"max-h-[72vh] w-full object-contain",src:r.qrImageUrl,alt:`${A} ${h?"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:[u?s.jsx(At,{className:"size-5 animate-spin text-[var(--color-purple)]"}):null,s.jsx("span",{children:u?"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(Lr,{label:"Method",value:A}),s.jsx(Lr,{label:"Wallet",value:E?"bound":"waiting",warn:!E}),r!=null&&r.orderNo||b?s.jsx(Lr,{label:"Order",value:(r==null?void 0:r.orderNo)??b??""}):null,r!=null&&r.walletConfigPath||g?s.jsx(Lr,{label:"Config",value:Qj((r==null?void 0:r.walletConfigPath)??g??"")}):null,r!=null&&r.clawtipId?s.jsx(Lr,{label:"Device",value:r.clawtipId}):null]}),d?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:d instanceof Error?d.message:String(d)}):null,r!=null&&r.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:h?"Scan with JD app to view wallet balance or recharge.":s.jsxs("span",{className:"flex items-start gap-2",children:[C?s.jsx(At,{className:"mt-0.5 size-4 shrink-0 animate-spin"}):null,s.jsx("span",{children:E?"Wallet bound. Closing...":"Scan with JD app. TokenBuddy is waiting for the local wallet config."})]})}):null,r!=null&&r.resourceUrl||v?s.jsx("a",{className:"block rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 py-2 font-mono text-[0.75rem] text-[var(--color-purple)] transition hover:bg-[var(--color-lavender)]",href:(r==null?void 0:r.resourceUrl)??v,target:"_blank",rel:"noreferrer",children:d0((r==null?void 0:r.resourceUrl)??v??"")}):!(r!=null&&r.qrImageUrl)&&!u&&!d?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 Oj({days:a,series:i}){const d={top:14,right:18,bottom:26,left:26},m=i.flatMap(v=>[...v.input,...v.output]),h=Math.max(1,...m),x=v=>d.left+v*(680-d.left-d.right)/Math.max(1,a.length-1),p=v=>d.top+(1-v/h)*(150-d.top-d.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(v=>s.jsx("line",{x1:d.left,x2:680-d.right,y1:d.top+(1-v)*(150-d.top-d.bottom),y2:d.top+(1-v)*(150-d.top-d.bottom),stroke:"var(--color-chart-grid)",strokeWidth:"1"},v)),a.map((v,g)=>s.jsx("text",{x:x(g),y:143,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[10px]",children:v},v)),i.map(v=>s.jsxs("g",{children:[s.jsx("path",{d:Wd(v.input.map((g,b)=>[x(b),p(g)])),fill:"none",stroke:v.color,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:Wd(v.output.map((g,b)=>[x(b),p(g)])),fill:"none",stroke:v.color,strokeWidth:"2.4",strokeDasharray:"5 5",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.75"}),v.input.map((g,b)=>s.jsx("circle",{cx:x(b),cy:p(g),r:"2.7",fill:v.color},`${v.model}-input-${b}`)),v.output.map((g,b)=>s.jsx("circle",{cx:x(b),cy:p(g),r:"2.2",fill:"#fff",stroke:v.color,strokeWidth:"1.8"},`${v.model}-output-${b}`))]},v.model)),i.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 _j({days:a,values:i,total:r}){const m={top:10,right:8,bottom:16,left:8},h=Math.max(1,...i),x=v=>m.left+v*(190-m.left-m.right)/Math.max(1,i.length-1),p=v=>m.top+(1-v/h)*(72-m.top-m.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:"Cost curve"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:r})]}),s.jsxs("svg",{className:"h-[66px] w-full",viewBox:"0 0 190 72",role:"img","aria-label":"Daily cost curve",children:[s.jsx("path",{d:Wd(i.map((v,g)=>[x(g),p(v)])),fill:"none",stroke:"var(--color-chart-cost)",strokeWidth:"3",strokeLinecap:"round"}),i.map((v,g)=>s.jsx("circle",{cx:x(g),cy:p(v),r:"2.4",fill:"var(--color-chart-cost)"},a[g]))]})]})}function kj({values:a,total:i}){const r=Math.max(1,...a);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 spend"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:i})]}),s.jsx("div",{className:"flex h-[60px] items-end gap-1",children:a.map((u,d)=>s.jsx("span",{className:"flex-1 rounded-t-[3px] bg-[var(--color-tokens)]/75",style:{height:`${Math.max(8,u/r*100)}%`}},d))})]})}function Wd(a){return a.length===0?"":a.length===1?`M ${a[0][0]} ${a[0][1]}`:a.reduce((i,r,u)=>{if(u===0)return`M ${r[0]} ${r[1]}`;const d=a[u-1],m=(d[0]+r[0])/2;return`${i} C ${m} ${d[1]}, ${m} ${r[1]}, ${r[0]} ${r[1]}`},"")}function Dj({model:a,color:i}){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:a,children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:i}}),s.jsx("span",{className:"truncate font-mono text-[0.68rem]",children:a})]})}function Kv({label:a,dashed:i=!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)]",i?"border-dashed":""].join(" ")}),s.jsx("span",{className:"font-mono text-[0.68rem]",children:a})]})}function Lr({label:a,value:i,warn:r=!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:a}),s.jsx("div",{className:["font-mono text-[0.94rem] font-semibold",r?"text-amber-700":"text-[var(--color-ink)]"].join(" "),children:i})]})}function Uj({checkedAt:a,healthy:i,pid:r,status:u,proxyPort:d,controlPort:m,registryUrl:h}){const x=[{icon:s.jsx(z2,{className:"size-3"}),label:"Daemon",value:r?`pid ${r}`:u??Ee,tone:i?"green":"amber"},{icon:s.jsx(G2,{className:"size-3"}),label:"Proxy",value:d?`:${d}`:Ee,tone:"blue"},{icon:s.jsx(J2,{className:"size-3"}),label:"Control",value:m?`:${m}`:Ee,tone:"router"},{icon:s.jsx(U2,{className:"size-3"}),label:"Registry",value:h?d0(h):Ee,tone:"spend"}];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(Jd,{className:"size-3.5"}),a]}),x.map(p=>s.jsx(Bj,{...p},p.label))]})}function Bj({icon:a,label:i,value:r,tone:u}){const d={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)]"}[u];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)]",d].join(" "),children:a}),s.jsx("span",{className:"text-[0.72rem] font-semibold text-[var(--color-ink)]",children:i}),s.jsx("span",{className:"min-w-0 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:r})]})}function Hj(a){const i=Xv(7),r=Xv(30),u=Pd(new Date),d=new Set(i.map(H=>H.key)),m=new Map(r.map((H,V)=>[H.key,V])),h=["var(--color-chart-input)","var(--color-spend)","var(--color-chart-cost)","var(--color-inventory)"],x=new Map,p=i.map(()=>0),v=r.map(()=>0);let g=0,b=0,E=0,C=0,A=0,z=0,Q=0,U=0,q=0;for(const H of a){const V=Pd(new Date(H.createdAt)),W=H.billedMicros??0,F=H.promptTokens??0,I=H.completionTokens??0;q+=1,b+=W,C+=F,A+=I,V===u&&(U+=1,g+=W,z+=F,Q+=I);const te=i.findIndex(J=>J.key===V);if(te>=0){E+=W,p[te]+=W/1e6;const J=x.get(H.modelId)??{input:i.map(()=>0),output:i.map(()=>0),total:0};J.input[te]+=F,J.output[te]+=I,J.total+=F+I,x.set(H.modelId,J)}else d.has(V)&&(E+=W);const se=m.get(V);se!==void 0&&(v[se]+=W/1e6)}const K=Array.from(x.entries()).sort((H,V)=>V[1].total-H[1].total).slice(0,4).map(([H,V],W)=>({model:H,color:h[W%h.length],input:V.input,output:V.output}));return{days:i.map(H=>H.label),modelUsage:K,cost:p,thirtyDaySpend:v,todaySpendMicros:g,totalSpendMicros:b,weeklySpendMicros:E,inputTokens:C,outputTokens:A,todayInputTokens:z,todayOutputTokens:Q,todayRequestCount:U,totalRequestCount:q}}function Lj(a,i){const r=new Map;for(const u of[...i].sort((d,m)=>d.createdAt.localeCompare(m.createdAt)))!u.paymentMethod||u.balanceSnapshotMicros===void 0||r.set(bl(u.paymentMethod),u.balanceSnapshotMicros);return[...a].filter(u=>bl(u.method)!=="mock").sort((u,d)=>Number(d.isDefault)-Number(u.isDefault)||u.method.localeCompare(d.method)).map(u=>{const d=bl(u.method),m=u.enabled||!!(u.config&&Object.keys(u.config).length>0),h=r.get(d),x=d==="clawtip";return{name:c0(u.method),method:u.method,balance:x?"••••":ot(h),status:u.enabled?"Bound":"Available",note:m?u.isDefault?"Default wallet":"Configured":"Not bound",action:u.enabled?"Recharge":"Activate",icon:qj(u.method),balanceHidden:x,config:u.config}})}function Xv(a){const i=[],r=new Intl.DateTimeFormat("en",{weekday:"short"});for(let u=a-1;u>=0;u-=1){const d=new Date;d.setHours(0,0,0,0),d.setDate(d.getDate()-u),i.push({key:Pd(d),label:r.format(d)})}return i}function Pd(a){if(Number.isNaN(a.getTime()))return"";const i=a.getFullYear(),r=String(a.getMonth()+1).padStart(2,"0"),u=String(a.getDate()).padStart(2,"0");return`${i}-${r}-${u}`}function c0(a){const i=bl(a);return i==="clawtip"?"ClawTip":i==="alipay-agent"?"Alipay Agent Payment":i==="wechat-pay"?"WeChat Pay":i==="coinbase-smart-wallet"?"Coinbase Smart Wallet":a.split(/[-_\s]+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function qj(a){const i=bl(a);return i==="clawtip"?"C":i==="wechat-pay"?"W":i==="alipay-agent"?"A":i.charAt(0).toUpperCase()||"P"}function bl(a){return a.trim().toLowerCase()}function d0(a){try{const i=new URL(a),r=i.pathname==="/"?"":i.pathname;return`${i.host}${r}`.slice(0,34)}catch{return a.length>34?`${a.slice(0,31)}...`:a}}function Qj(a){const i=a.split("/");return i.length<=3?a:`.../${i.slice(-2).join("/")}`}function Ed(a,i){const r=a==null?void 0:a[i];return typeof r=="string"&&r.length>0?r:void 0}function f0(a,i){return(a==null?void 0:a[i])===!0}const Yj=[{value:"fullAuto",label:"Full auto",help:"Choose from all compatible sellers for each model."},{value:"fixedSet",label:"Fixed set",help:"Choose automatically within your selected seller set."},{value:"fixed",label:"Fixed",help:"Pin one fixed seller for each model."}],Gj=[{value:"balanced",label:"Balanced",help:"Balance reliability, speed, and cost."},{value:"speed",label:"Speed first",help:"Prioritize low TTFT and high throughput."},{value:"discount",label:"Cost first",help:"Prioritize discount and available balance."}];function Kj(){var ge,M,_,Z,P;const a=e0(),i=t0(),r=l0(),u=yf(),d=cj(),m=Po(),[h,x]=j.useState({mode:"fullAuto",scorer:"balanced"}),[p,v]=j.useState([]),[g,b]=j.useState(""),[E,C]=j.useState(null),[A,z]=j.useState(null),Q=oj({...h,modelId:g}),U=u.data,q=((ge=r.data)==null?void 0:ge.sellers)??[],K=((M=d.data)==null?void 0:M.focusSet)??[],H=j.useMemo(()=>lS((U==null?void 0:U.data)??[],K),[K,U==null?void 0:U.data]),V=nS(Q.data),W=j.useMemo(()=>aS(q,U,(V==null?void 0:V.routes)??[]),[U,V==null?void 0:V.routes,q]),F=j.useMemo(()=>p.map(X=>H.find(le=>le.id===X)).filter(v0),[H,p]),I=h.sellerIds??[],te=h.fixedByModel??{},se=F.length,J=F.filter(X=>h.mode==="fixed"?!!te[X.id]:h.mode==="fixedSet"?I.length>0:!0).length,fe=j.useMemo(()=>{var X;return o0({inferences:((X=m.data)==null?void 0:X.inferences)??[],modelsResponse:U,sellersResponse:r.data,previewPlan:V,activeModelId:g})},[g,(_=m.data)==null?void 0:_.inferences,U,V,r.data]);j.useEffect(()=>{var X;(X=a.data)!=null&&X.strategy&&x(a.data.strategy)},[(Z=a.data)==null?void 0:Z.strategy]),j.useEffect(()=>{if(p.length>0||H.length===0)return;const X=K.filter(re=>H.some(we=>we.id===re)),le=X.length>0?X:H.slice(0,2).map(re=>re.id);v(le),b(le[0]??"")},[K,H,p.length]),j.useEffect(()=>{!g||p.includes(g)||b(p[0]??"")},[g,p]),j.useEffect(()=>{g&&Q.refetch()},[g,h.mode,h.scorer,h.sellerId,(P=h.sellerIds)==null?void 0:P.join(","),uS(h.fixedByModel)]);async function pe(X){x(X),C(null);try{await i.mutateAsync(X)}catch(le){C(le instanceof Error?le.message:String(le))}}function Ae(X){v(le=>{if(le.includes(X)){const we=le.filter(ze=>ze!==X);return g===X&&b(we[0]??""),Lo(we).catch(()=>{}),we}b(X);const re=[...le,X];return Lo(re).catch(()=>{}),re})}function me(X){v(le=>{const re=le.filter(we=>we!==X);return g===X&&b(re[0]??""),Lo(re).catch(()=>{}),re})}function k(X){const le=iS({...h,mode:X},W,g);pe(le)}function $(X){pe({...h,scorer:X})}function ne(X,le){const re=h.sellerIds??[],we=re.includes(le)?re.filter(ze=>ze!==le):[...re,le];pe({...h,mode:"fixedSet",sellerIds:we,sellerId:void 0})}function be(X,le){const re={...h.fixedByModel??{},[X]:le};pe({...h,mode:"fixed",fixedByModel:re,sellerId:void 0,sellerIds:void 0}),b(X),z(null)}return s.jsxs("div",{className:"space-y-5",children:[s.jsx("section",{children:s.jsxs(St,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Models"})}),s.jsxs("button",{type:"button",onClick:()=>z({kind:"models"}),className:"inline-flex items-center gap-1.5 rounded-[8px] bg-[var(--color-purple)] px-3 py-1.5 text-[0.78rem] font-semibold text-white hover:bg-[var(--color-purple-2)]","aria-label":"Add",title:"Add models","data-testid":"routing-add-models",children:[s.jsx(Ko,{size:14}),"Add"]})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[F.map(X=>{const le=g===X.id,re=X.sellerCount>0;return s.jsxs("div",{className:["inline-flex min-h-9 items-center gap-2 rounded-[9px] border px-3 py-1.5 transition-colors",re?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-purple)] hover:border-[var(--color-purple)] hover:bg-white":"border-rose-200 bg-rose-50 text-rose-700 hover:bg-white",le?"ring-2 ring-[var(--color-lavender-2)] ring-offset-1 ring-offset-white":""].join(" "),children:[s.jsx("button",{type:"button",onClick:()=>b(X.id),className:"flex items-center text-left",children:s.jsx("span",{className:["font-mono text-[0.82rem] font-semibold",re?"text-[var(--color-purple)]":"text-rose-700"].join(" "),children:X.id})}),s.jsx("button",{type:"button",onClick:()=>me(X.id),className:["inline-flex size-5 items-center justify-center rounded-[6px]",re?"text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]":"text-rose-700/70 hover:bg-white hover:text-rose-700"].join(" "),"aria-label":`Remove ${X.id}`,children:s.jsx(Fx,{size:12})})]},X.id)}),F.length===0?s.jsx("div",{className:"px-4 py-8 text-center text-[0.88rem] text-[var(--color-muted)]",children:"No models yet. Click Add to add common models."}):null,d.isError?s.jsx("div",{className:"px-3 py-2 text-[0.82rem] text-amber-700",children:"Focus models could not be saved."}):null]})]})}),s.jsx("section",{children:s.jsx(St,{className:"overflow-hidden",children:s.jsxs("div",{className:"p-5",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Strategy"}),s.jsxs("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:[J,"/",Math.max(se,1)," configured"]})]}),a.isLoading||r.isLoading||u.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,a.isError||r.isError||u.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,E?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:E}):null,s.jsx("div",{className:"mb-5 grid grid-cols-1 gap-2 md:grid-cols-3",children:Yj.map(X=>s.jsx(Ij,{active:h.mode===X.value,title:X.label,description:X.help,onClick:()=>k(X.value)},X.value))}),s.jsx("div",{className:"rounded-[14px] border border-[var(--color-line-2)] bg-white p-4",children:s.jsx(Xj,{mode:h.mode,scorer:h.scorer,selectedModels:F,fixedSetSellers:I,fixedByModel:te,sellers:W,activeModelId:g,onScorerChange:$,onOpenSellerPicker:z,onToggleFixedSetSeller:ne})})]})})}),s.jsx(Vj,{summary:fe}),(A==null?void 0:A.kind)==="models"?s.jsx(Wj,{models:H,selectedModelIds:p,onClose:()=>z(null),onToggle:Ae}):null,(A==null?void 0:A.kind)==="sellers"?s.jsx(Pj,{modelId:A.modelId,selection:A.selection,selectedSellerIds:A.selection==="single"?te[A.modelId]?[te[A.modelId]]:[]:I,scorer:h.scorer,sellers:W,onClose:()=>z(null),onToggle:X=>{A.selection==="single"?be(A.modelId,X):ne(A.modelId,X)}}):null]})}function Xj({mode:a,scorer:i,selectedModels:r,fixedSetSellers:u,fixedByModel:d,sellers:m,activeModelId:h,onScorerChange:x,onOpenSellerPicker:p,onToggleFixedSetSeller:v}){var E;const g=dS(r,h),b=(E=g[0])==null?void 0:E.id;return a==="fullAuto"?s.jsx("div",{children:s.jsx(Vv,{scorer:i,onChange:x})}):a==="fixedSet"?s.jsxs("div",{className:"space-y-3",children:[s.jsx(Vv,{scorer:i,onChange:x}),s.jsx(Fj,{modelId:b,sellers:m,sellerIds:u,onChoose:C=>p({kind:"sellers",modelId:C,selection:"multi"}),onRemove:C=>{b&&v(b,C)}})]}):s.jsx("div",{className:"space-y-3",children:s.jsx(Jj,{selectedModels:g,activeModelId:h,resolveValue:C=>oS(d[C],m),onChoose:C=>p({kind:"sellers",modelId:C,selection:"single"})})})}function Vj({summary:a}){return s.jsx("section",{children:s.jsxs(St,{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.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Model route activity"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.74rem] text-[var(--color-muted)]",children:[Xe(a.totalRequests)," requests · ",gl(a.totalTokens)," tokens · ",ot(a.totalSpendMicros,{digits:4})]})]}),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:[Xe(a.rows.length)," models"]})]}),s.jsxs("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:[a.rows.map(i=>s.jsx(Zj,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?s.jsx("div",{className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."}):null]}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[1180px] border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.68rem] 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:"NODE"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"REQ"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"DISC"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"TTFT"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"TOKEN"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"SWITCH"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"TIME"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[a.rows.map(i=>s.jsx($j,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."})}):null]})]})})]})})}function Zj({row:a}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.92rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[s.jsx(Mi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?s.jsx(Mi,{tone:Xa(a.lastStatus),children:_l(a.lastStatus)}):null,a.upstreamStatus?s.jsx(Mi,{tone:Xa(a.upstreamStatus),children:_l(a.upstreamStatus)}):null]}),a.routeReason?s.jsx("div",{className:"mt-1 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),s.jsxs("div",{className:"min-w-0 text-right",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:a.currentSellerId}),s.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):Ee})]})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[s.jsx(ji,{label:"Node stats",value:Xe(a.currentSellerRequests),detail:`${Xe(a.sellerModelCount)} models · ${Xe(a.touchedSellerCount)} nodes`}),s.jsx(ji,{label:"Discount",value:a.sellerDiscount,detail:`fee ${a.sellerServiceFee} · ${i0(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)}`,tone:"green"}),s.jsx(ji,{label:"Speed",value:yt(a.lastTtftMs??a.avgTtftMs),detail:`${yt(a.lastDurationMs??a.avgDurationMs)} total`}),s.jsx(ji,{label:"Tokens",value:gl(a.totalTokens),detail:`${$r(a.inputTokens,a.outputTokens)} · ${ot(a.totalSpendMicros,{digits:4})}`}),s.jsx(ji,{label:"Switch",value:jl(a.selectedAt),compact:!0}),s.jsx(ji,{label:"Last access",value:jl(a.lastAccessAt),detail:a.lastRequestId??void 0,compact:!0})]})]})}function ji({label:a,value:i,detail:r,tone:u="default",compact:d=!1}){return s.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[s.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["mt-1 min-w-0 truncate font-mono font-semibold",d?"text-[0.72rem]":"text-[0.88rem]",u==="green"?"text-emerald-700":"text-[var(--color-ink)]"].join(" "),title:i,children:i}),r?s.jsx("div",{className:"mt-0.5 truncate text-[0.68rem] text-[var(--color-muted)]",title:r,children:r}):null]})}function $j({row:a}){return s.jsxs("tr",{className:"align-top transition hover:bg-[var(--color-lavender)]/25",children:[s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"max-w-[230px] truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[s.jsx(Mi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?s.jsx(Mi,{tone:Xa(a.lastStatus),children:_l(a.lastStatus)}):null,a.upstreamStatus?s.jsx(Mi,{tone:Xa(a.upstreamStatus),children:_l(a.upstreamStatus)}):null]}),a.routeReason?s.jsx("div",{className:"mt-1 max-w-[240px] truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"max-w-[210px] truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),s.jsx("div",{className:"mt-0.5 max-w-[210px] truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:pj(a.currentSellerId)}),s.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):Ee})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:Xe(a.currentSellerRequests)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"node requests"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[Xe(a.sellerModelCount)," models · ",Xe(a.touchedSellerCount)," nodes"]})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-emerald-700",children:a.sellerDiscount}),s.jsxs("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:["fee ",a.sellerServiceFee]}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:i0(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:yt(a.lastTtftMs??a.avgTtftMs)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"TTFT"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[yt(a.lastDurationMs??a.avgDurationMs)," total"]})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:gl(a.totalTokens)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:$r(a.inputTokens,a.outputTokens)}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:ot(a.totalSpendMicros,{digits:4})})]}),s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.74rem] text-[var(--color-muted)]",children:jl(a.selectedAt)}),s.jsxs("td",{className:"whitespace-nowrap px-4 py-3",children:[s.jsx("div",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:jl(a.lastAccessAt)}),a.lastRequestId?s.jsx("div",{className:"mt-1 max-w-[160px] truncate font-mono text-[0.68rem] text-[var(--color-faint)]",title:a.lastRequestId,children:a.lastRequestId}):null]})]})}function Mi({tone:a,children:i}){const r={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"}[a];return s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.66rem] font-semibold uppercase",r].join(" "),children:i})}function Vv({scorer:a,onChange:i}){return s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white p-1.5",children:s.jsx("div",{className:"grid grid-cols-1 gap-1.5 md:grid-cols-3",children:Gj.map(r=>s.jsxs("button",{type:"button",onClick:()=>i(r.value),"aria-label":`Routing scorer: ${r.label}`,className:["flex min-h-14 items-center gap-2 rounded-[9px] px-3 py-2 text-left transition-colors",a===r.value?"bg-[var(--color-lavender)] text-[var(--color-ink)]":"text-[var(--color-muted)] hover:bg-[var(--color-lavender)]/40"].join(" "),children:[s.jsx(Io,{active:a===r.value,fixed:!0}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-[0.86rem] font-semibold",children:r.label}),s.jsx("span",{className:"block truncate text-[0.72rem] text-[var(--color-muted)]",children:r.help})]})]},r.value))})})}function Fj({modelId:a,sellers:i,sellerIds:r,onChoose:u,onRemove:d}){if(!a)return s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-4 text-[0.86rem] text-[var(--color-muted)]",children:"Add models before configuring a seller set."});const m=r.map(h=>i.find(x=>x.id===h)).filter(v0);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-3 border-b border-[var(--color-line-2)] bg-white/70 px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Sellers"})}),s.jsx("button",{type:"button",onClick:()=>u(a),className:"rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-purple)] hover:bg-white","aria-label":`Add sellers to fixed set for ${a}`,children:"Add sellers"})]}),m.length>0?s.jsx("div",{className:"min-w-0 max-w-full overflow-x-auto",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),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:"TTFT"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"}),s.jsx("th",{className:"w-10 px-3 py-2 font-semibold"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:m.map(h=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:h.name}),s.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[s.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:h.discount}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:h.price})]}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:h.markupFee}),s.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:h.paymentMethods.join(", ")}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:yt(h.latencyMs)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:Xe(h.tokensPerSecond)}),s.jsx("td",{className:"px-3 py-2.5 text-right",children:s.jsx("button",{type:"button",onClick:()=>d(h.id),className:"inline-flex size-7 items-center justify-center rounded-[7px] text-[var(--color-muted)] hover:bg-rose-50 hover:text-rose-700","aria-label":`Remove ${h.name}`,children:s.jsx(Fx,{size:14})})})]},h.id))})]})}):s.jsx("div",{className:"px-3 py-8 text-center text-[0.86rem] text-[var(--color-muted)]",children:"No sellers yet. Click Add sellers to build the fixed set."})]})}function Jj({selectedModels:a,activeModelId:i,resolveValue:r,onChoose:u}){return a.length===0?s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-4 text-[0.86rem] text-[var(--color-muted)]",children:"Add models before configuring sellers."}):s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] rounded-[12px] border border-[var(--color-line-2)] bg-white",children:a.map(d=>s.jsxs("div",{className:["flex flex-wrap items-center gap-3 px-3 py-3",i===d.id?"bg-[var(--color-lavender)]/55":""].join(" "),children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:d.id})}),s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>u(d.id),className:"max-w-[240px] truncate rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-purple)] hover:bg-white","aria-label":`Choose seller for ${d.id}`,children:r(d.id)}),s.jsx("button",{type:"button",onClick:()=>u(d.id),className:"rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-muted)] hover:border-[var(--color-lavender-2)] hover:text-[var(--color-purple)]","aria-label":`Reselect seller for ${d.id}`,children:"Reselect"})]})]},d.id))})}function Wj({models:a,selectedModelIds:i,onClose:r,onToggle:u}){const[d,m]=j.useState(""),h=a.filter(x=>p0(d,[x.id,x.paymentMethod,x.enabled?"enabled":"not enabled"]));return s.jsxs(m0,{title:"Add models",onClose:r,children:[s.jsx(h0,{value:d,onChange:m,placeholder:"Search models or payment"}),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.84rem]",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-10 px-3 py-2 font-semibold"}),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:"Sellers"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[h.map(x=>{const p=i.includes(x.id);return s.jsxs("tr",{onClick:()=>u(x.id),className:["cursor-pointer",p?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35",x.enabled?"":"opacity-60"].join(" "),children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(Io,{active:p,fixed:!1})}),s.jsx("td",{className:"px-3 py-2.5 font-mono font-semibold text-[var(--color-ink)]",children:x.id}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(eS,{enabled:x.enabled,paymentMethod:x.paymentMethod})}),s.jsx("td",{className:"px-3 py-2.5 text-right text-[var(--color-muted)]",children:x.sellerCount})]},x.id)}),h.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.jsx("div",{className:"mt-3 flex items-center justify-end border-t border-[var(--color-line-2)] pt-3",children:s.jsx("button",{type:"button",onClick:r,"aria-label":"Done","data-testid":"routing-model-picker-done",className:"inline-flex h-9 items-center justify-center rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:"Done"})})]})}function Pj({modelId:a,selection:i,selectedSellerIds:r,scorer:u,sellers:d,onClose:m,onToggle:h}){const[x,p]=j.useState(""),g=tS(d.filter(b=>b.coverageModelIds.includes(a)),[a],u).filter(b=>p0(x,[b.name,b.id,b.paymentMethods.join(" "),b.health,b.notes.join(" ")]));return s.jsxs(m0,{title:`Choose seller · ${a}`,onClose:m,children:[s.jsx(h0,{value:x,onChange:p,placeholder:"Search sellers, 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-10 px-3 py-2 font-semibold"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),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:"TTFT"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[g.map(b=>{const E=r.includes(b.id);return s.jsxs("tr",{onClick:()=>h(b.id),className:["cursor-pointer",E?"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(Io,{active:E,fixed:i==="single"})}),s.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:b.name}),s.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[s.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:b.discount}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:b.price})]}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:b.markupFee}),s.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:b.paymentMethods.join(", ")}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:yt(b.latencyMs)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:Xe(b.tokensPerSecond)})]},b.id)}),g.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No sellers found."})}):null]})]})})]})}function m0({title:a,children:i,onClose:r}){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:a}),s.jsx("button",{type:"button",onClick:r,className:"inline-flex size-8 items-center justify-center rounded-[8px] text-[var(--color-muted)] hover:bg-[var(--color-lavender)] hover:text-[var(--color-purple)]","aria-label":"Close",children:s.jsx(Zr,{size:16})})]}),s.jsx("div",{className:"max-h-[calc(86dvh-65px)] overflow-auto p-4",children:i})]})})}function Ij({active:a,title:i,description:r,onClick:u}){return s.jsxs("button",{type:"button",onClick:u,"aria-label":`Set ${i} routing mode`,className:["min-h-[86px] rounded-[12px] border px-3 py-2.5 text-left transition-all",a?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-ink)]":"border-[var(--color-line-2)] bg-white text-[var(--color-muted)] hover:border-[var(--color-line)]"].join(" "),children:[s.jsxs("span",{className:"flex items-center gap-2 font-mono text-[0.86rem] font-semibold",children:[s.jsx(Io,{active:a,fixed:!0}),i]}),s.jsx("span",{className:"mt-1.5 block text-[0.74rem] leading-snug text-[var(--color-muted)]",children:r})]})}function eS({enabled:a,paymentMethod:i}){return s.jsxs("span",{className:["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[0.72rem] ring-1",a?"bg-emerald-50 text-emerald-700 ring-emerald-100":"bg-slate-100 text-slate-500 ring-slate-200"].join(" "),children:[a?s.jsx(P2,{size:12}):s.jsx(Fd,{size:12}),i," ",a?"enabled":"not enabled"]})}function Io({active:a,fixed:i}){return s.jsx("span",{className:["inline-flex size-5 shrink-0 items-center justify-center border",i?"rounded-full":"rounded-[6px]",a?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line)] bg-white text-transparent"].join(" "),children:s.jsx(Wt,{size:13,strokeWidth:2.4})})}function tS(a,i,r){return[...a].sort((u,d)=>{const m=Zv(u,i),h=Zv(d,i);return m!==h?h-m:r==="speed"?sS(u.latencyMs,d.latencyMs):r==="discount"?Number.parseInt(d.discount,10)-Number.parseInt(u.discount,10):d.healthScore-u.healthScore})}function lS(a,i){const r=new Map;for(const d of a){const m=r.get(d.id)??{sellerIds:new Set,paymentMethods:new Set};m.sellerIds.add(d.sellerId);for(const h of d.paymentMethods)m.paymentMethods.add(h);r.set(d.id,m)}const u=new Map(i.map((d,m)=>[d,m]));return Array.from(r.entries()).map(([d,m])=>({id:d,paymentMethod:Array.from(m.paymentMethods)[0]??Ee,enabled:m.sellerIds.size>0,sellerCount:m.sellerIds.size})).sort((d,m)=>{const h=u.get(d.id),x=u.get(m.id);return h!==void 0||x!==void 0?(h??9999)-(x??9999):d.id.localeCompare(m.id)})}function aS(a,i,r){const u=(i==null?void 0:i.data)??[],d=new Map(((i==null?void 0:i.sellers)??[]).map(h=>[h.id,h])),m=new Map(r.map(h=>[h.seller.id,h]));return a.map((h,x)=>{var A;const p=m.get(h.id),v=d.get(h.id),g=Array.from(new Set(u.filter(z=>z.sellerId===h.id).map(z=>z.id))),b=(p==null?void 0:p.metrics.ttftMs)??(p==null?void 0:p.metrics.avgLatencyMs),E=p==null?void 0:p.metrics.healthScore,C=(p==null?void 0:p.metrics.discountRatio)??(v==null?void 0:v.discountRatio);return{id:h.id,name:cS(h.name??(v==null?void 0:v.name)??h.id),endpoint:h.url,health:(v==null?void 0:v.status)==="error"||(v==null?void 0:v.status)==="manifest_unavailable"||h.status==="failed"?"offline":h.status==="degraded"?"degraded":"online",healthScore:Number.isFinite(E)?Math.round(E):0,coverageModelIds:g,paymentMethods:(v==null?void 0:v.paymentMethods)??h.paymentMethods??[],discount:n0(C),markupFee:bf(v==null?void 0:v.serviceFeeRatio),price:p?"preview":"registry",latencyMs:Number.isFinite(b)?Math.round(b):void 0,tokensPerSecond:void 0,notes:[((A=h.supportedProtocols)==null?void 0:A.join(", "))||"no protocols",`registry #${x+1}`]}})}function nS(a){if(a)return a.plan??{routes:a.routes,mode:a.mode,scorer:a.scorer,reason:a.reason}}function iS(a,i,r){var u,d;if(a.mode==="fixed"){const m={...a.fixedByModel??{}},h=((u=rS(i,r))==null?void 0:u.id)||((d=i[0])==null?void 0:d.id);return r&&!m[r]&&h&&(m[r]=h),{mode:"fixed",scorer:a.scorer,fixedByModel:m}}if(a.mode==="fixedSet"){const m=a.sellerIds&&a.sellerIds.length>0?a.sellerIds:i.filter(h=>!r||h.coverageModelIds.includes(r)).slice(0,2).map(h=>h.id);return{mode:"fixedSet",scorer:a.scorer,sellerIds:m}}return{mode:"fullAuto",scorer:a.scorer}}function rS(a,i){return a.find(r=>!i||r.coverageModelIds.includes(i))}function Zv(a,i){return i.length===0?a.coverageModelIds.length:i.filter(r=>a.coverageModelIds.includes(r)).length}function sS(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);return r&&u?a-i:r?-1:u?1:0}function oS(a,i){var r;return a?((r=i.find(u=>u.id===a))==null?void 0:r.name)??a:"Not selected"}function uS(a){return Object.entries(a??{}).sort(([i],[r])=>i.localeCompare(r)).map(([i,r])=>`${i}:${r}`).join(",")}function cS(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function h0({value:a,onChange:i,placeholder:r}){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(Wo,{size:15}),s.jsx("input",{name:"routing-search",value:a,onChange:u=>i(u.target.value),placeholder:r,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 p0(a,i){const r=a.trim().toLowerCase();return r?i.some(u=>u.toLowerCase().includes(r)):!0}function dS(a,i){return i?[...a].sort((r,u)=>r.id===i?-1:u.id===i?1:0):a}function v0(a){return a!==void 0}function x0({totalItems:a,pageSize:i,page:r,onPageChange:u,onPageSizeChange:d,pageSizeOptions:m=[25,50,100]}){const h=Math.max(1,Math.ceil(a/i)),x=j.useMemo(()=>fS(r,h),[r,h]);if(a===0)return null;const p=(r-1)*i+1,v=Math.min(r*i,a);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:p}),"-",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:v})," of"," ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:a})]}),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:i,onChange:g=>{const b=Math.max(1,Number(g.target.value)||25);d==null||d(b),u(1)},children:m.map(g=>s.jsx("option",{value:g,children:g},g))}),s.jsxs("div",{className:"ml-2 flex items-center gap-1",children:[s.jsx("button",{type:"button",disabled:r<=1,onClick:()=>u(1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"First page","aria-label":"First page",children:"«"}),s.jsx("button",{type:"button",disabled:r<=1,onClick:()=>u(r-1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Previous page","aria-label":"Previous page",children:"‹"}),x.map((g,b)=>g==="…"?s.jsx("span",{className:"px-1.5 text-[var(--color-muted)]",children:"…"},`gap-${b}`):s.jsx("button",{type:"button",onClick:()=>u(g),"aria-label":`Page ${g}`,"aria-current":g===r?"page":void 0,className:g===r?"px-2.5 py-0.5 rounded bg-[var(--color-purple)] text-white font-medium":"px-2.5 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] hover:bg-[var(--color-lavender)]/40",children:g},g)),s.jsx("button",{type:"button",disabled:r>=h,onClick:()=>u(r+1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Next page","aria-label":"Next page",children:"›"}),s.jsx("button",{type:"button",disabled:r>=h,onClick:()=>u(h),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",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,defaultValue:r,"aria-label":"Go to page",onKeyDown:g=>{if(g.key==="Enter"){const b=Math.max(1,Math.min(h,Number(g.target.value)||1));u(b)}},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 fS(a,i){if(i<=7)return Array.from({length:i},(d,m)=>m+1);const r=[],u=d=>{r[r.length-1]!==d&&r.push(d)};u(1),a>4&&u("…");for(let d=Math.max(2,a-1);d<=Math.min(i-1,a+1);d++)u(d);return a<i-3&&u("…"),u(i),r}function mS(){var ge,M;const a=Po(),i=sj(),[r,u]=j.useState("inferences"),[d,m]=j.useState(""),[h,x]=j.useState("all"),[p,v]=j.useState("all"),[g,b]=j.useState("all"),[E,C]=j.useState("all"),[A,z]=j.useState(1),[Q,U]=j.useState(1),[q,K]=j.useState(25),[H,V]=j.useState(null),[W,F]=j.useState(null),I=a.isLoading||i.isLoading,te=((ge=a.data)==null?void 0:ge.inferences)??[],se=((M=i.data)==null?void 0:M.purchases)??[],J=d.trim().toLowerCase(),fe=j.useMemo(()=>bS(te,se),[te,se]),pe=j.useMemo(()=>gS(te),[te]),Ae=j.useMemo(()=>jS(se),[se]),me=j.useMemo(()=>te.filter(_=>h!=="all"&&_.status!==h||p!=="all"&&_.modelId!==p?!1:SS(_,J)).sort((_,Z)=>Z.createdAt.localeCompare(_.createdAt)),[te,p,h,J]),k=j.useMemo(()=>se.filter(_=>g!=="all"&&_.status!==g||E!=="all"&&_.paymentMethod!==E?!1:NS(_,J)).sort((_,Z)=>Z.createdAt.localeCompare(_.createdAt)),[se,E,g,J]),$=j.useMemo(()=>Fv(me,A,q),[me,A,q]),ne=j.useMemo(()=>Fv(k,Q,q),[k,Q,q]),be=a.isError||i.isError;return j.useEffect(()=>{const _=Math.max(1,Math.ceil(me.length/q));A>_&&z(_)},[me.length,A,q]),j.useEffect(()=>{const _=Math.max(1,Math.ceil(k.length/q));Q>_&&U(_)},[k.length,q,Q]),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("section",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[s.jsx(_o,{icon:s.jsx(V2,{className:"size-5"}),label:"Inference spend",value:ot(fe.inferenceSpendMicros,{digits:4}),detail:`${Xe(fe.inferenceCount)} requests`,tone:"spend"}),s.jsx(_o,{icon:s.jsx(_2,{className:"size-5"}),label:"Token usage",value:gl(fe.inputTokens+fe.outputTokens),detail:$r(fe.inputTokens,fe.outputTokens),tone:"tokens"}),s.jsx(_o,{icon:s.jsx(Gr,{className:"size-5"}),label:"Purchase credit",value:ot(fe.purchaseCreditMicros,{digits:4}),detail:`${Xe(fe.settledPurchases)} settled`,tone:"credit"}),s.jsx(_o,{icon:s.jsx(C2,{className:"size-5"}),label:"Average response",value:yt(fe.averageDurationMs),detail:"Completed inference time",tone:"latency"})]}),s.jsxs(St,{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:"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($v,{label:"Inferences",active:r==="inferences",count:me.length,onClick:()=>u("inferences"),children:"Inferences"}),s.jsx($v,{label:"Purchases",active:r==="purchases",count:k.length,onClick:()=>u("purchases"),children:"Purchases"})]})]}),s.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-[minmax(220px,1fr)_160px_200px]",children:[s.jsxs("label",{className:"relative block",children:[s.jsx(Wo,{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:d,placeholder:r==="inferences"?"Search request, model, seller...":"Search purchase, method, seller...",onChange:_=>{m(_.target.value),z(1),U(1)}})]}),r==="inferences"?s.jsxs(s.Fragment,{children:[s.jsx(ko,{label:"Status",value:h,options:pe.statuses,onChange:_=>{x(_),z(1)}}),s.jsx(ko,{label:"Model",value:p,options:pe.models,onChange:_=>{v(_),z(1)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(ko,{label:"Status",value:g,options:Ae.statuses,onChange:_=>{b(_),U(1)}}),s.jsx(ko,{label:"Method",value:E,options:Ae.methods,onChange:_=>{C(_),U(1)}})]})]})]}),be?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,I?s.jsx(yS,{}):r==="inferences"?s.jsx(hS,{entries:$,total:me.length,page:A,pageSize:q,openId:H,onToggle:_=>V(H===_?null:_),onPageChange:z,onPageSizeChange:_=>{K(_),z(1),U(1)}}):s.jsx(pS,{entries:ne,total:k.length,page:Q,pageSize:q,openId:W,onToggle:_=>F(W===_?null:_),onPageChange:U,onPageSizeChange:_=>{K(_),z(1),U(1)}})]})]})}function _o({icon:a,label:i,value:r,detail:u,tone:d}){const m={spend:{card:"border-[#cceee6] bg-[#e8fbf7]",icon:"bg-white text-[#0f766e]",label:"text-[#0f766e]",value:"text-[#201a38]",accent:"bg-[#0f766e]"},tokens:{card:"border-[#d9e7ff] bg-[#eaf2ff]",icon:"bg-white text-[#2563eb]",label:"text-[#2563eb]",value:"text-[#201a38]",accent:"bg-[#2563eb]"},credit:{card:"border-[#dff8ec] bg-[#e8fff6]",icon:"bg-white text-emerald-700",label:"text-emerald-700",value:"text-[#201a38]",accent:"bg-emerald-500"},latency:{card:"border-[#f8d5de] bg-[#fff0f3]",icon:"bg-white text-[#ef5b78]",label:"text-[#ef5b78]",value:"text-[#201a38]",accent:"bg-[#ef5b78]"}}[d];return s.jsxs(St,{className:["relative flex min-h-[7rem] items-center gap-4 overflow-hidden px-4 py-4",m.card].join(" "),children:[s.jsx("div",{className:["absolute inset-y-0 left-0 w-1",m.accent].join(" ")}),s.jsx("div",{className:["grid size-11 shrink-0 place-items-center rounded-[10px] shadow-sm",m.icon].join(" "),children:a}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:["text-[0.72rem] font-bold uppercase tracking-[0.08em]",m.label].join(" "),children:i}),s.jsx("div",{className:["mt-1 truncate font-mono text-[1.55rem] font-bold leading-none tracking-normal",m.value].join(" "),children:r}),s.jsx("div",{className:"mt-2 truncate text-[0.76rem] font-medium text-[var(--color-muted)]",children:u})]})]})}function $v({label:a,active:i,count:r,onClick:u,children:d}){return s.jsxs("button",{type:"button",onClick:u,"aria-label":`${a} ledger records, ${Xe(r)} records`,className:["inline-flex h-8 items-center justify-center gap-2 rounded-[8px] px-3 text-[0.82rem] font-semibold transition",i?"bg-white text-[var(--color-ink)] shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:[s.jsx("span",{children:d}),s.jsx("span",{className:"font-mono text-[0.76rem]",children:Xe(r)})]})}function ko({label:a,value:i,options:r,onChange:u}){return s.jsxs("label",{className:"grid gap-1",children:[s.jsx("span",{className:"sr-only",children:a}),s.jsxs("select",{"aria-label":a,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:i,onChange:d=>u(d.target.value),children:[s.jsxs("option",{value:"all",children:["All ",a.toLowerCase()]}),r.map(d=>s.jsx("option",{value:d,children:d},d))]})]})}function hS({entries:a,total:i,page:r,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:x}){return i===0?s.jsx(j0,{label:"inference records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>s.jsx(vS,{entry:p,open:d===p.requestId,onToggle:()=>m(p.requestId)},p.requestId))}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[1080px] 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:"REQ"}),s.jsx("th",{className:"px-4 py-2.5",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2.5",children:"SELLER"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TOKEN"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"COST"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TTFT"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TOTAL"}),s.jsx("th",{className:"px-4 py-2.5",children:"STATUS"})]})}),a.map(p=>s.jsxs("tbody",{children:[s.jsxs("tr",{onClick:()=>m(p.requestId),className:"cursor-pointer 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:s0(p.createdAt)}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(eu,{tone:"purple",children:s.jsx($x,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"max-w-[180px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.requestId}),s.jsx("div",{className:"mt-0.5 max-w-[180px] truncate text-[0.72rem] text-[var(--color-muted)]",children:p.endpoint})]})]})}),s.jsx("td",{className:"max-w-[190px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),s.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),s.jsxs("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem]",children:[s.jsx("div",{children:Xe(p.promptTokens)}),s.jsx("div",{className:"text-[0.72rem] text-[var(--color-muted)]",children:Xe(p.completionTokens)})]}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-[var(--color-ink)]",children:ot(p.billedMicros,{ledger:!0})}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] text-[var(--color-muted)]",children:yt(p.ttftMs)}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] text-[var(--color-muted)]",children:yt(p.durationMs)}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(rs,{tone:Xa(p.status),children:_l(p.status)})})]}),d===p.requestId?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:s.jsx(y0,{entry:p})})}):null]},p.requestId))]})}),s.jsx(x0,{totalItems:i,pageSize:u,page:r,onPageChange:h,onPageSizeChange:x})]})}function pS({entries:a,total:i,page:r,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:x}){return i===0?s.jsx(j0,{label:"purchase records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>s.jsx(xS,{entry:p,open:d===p.purchaseId,onToggle:()=>m(p.purchaseId)},p.purchaseId))}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[980px] 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:"When"}),s.jsx("th",{className:"px-4 py-2.5",children:"Purchase"}),s.jsx("th",{className:"px-4 py-2.5",children:"Payment method"}),s.jsx("th",{className:"px-4 py-2.5",children:"Model"}),s.jsx("th",{className:"px-4 py-2.5",children:"Seller"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Credit"}),s.jsx("th",{className:"px-4 py-2.5",children:"Status"})]})}),a.map(p=>s.jsxs("tbody",{children:[s.jsxs("tr",{onClick:()=>m(p.purchaseId),className:"cursor-pointer 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:s0(p.createdAt)}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(eu,{tone:"green",children:s.jsx(Hi,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"max-w-[210px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.purchaseId}),s.jsx("div",{className:"mt-0.5 max-w-[210px] truncate text-[0.72rem] text-[var(--color-muted)]",children:Fr(p.paymentReferenceHash)})]})]})}),s.jsx("td",{className:"px-4 py-3 text-[var(--color-ink)]",children:p.paymentMethod}),s.jsx("td",{className:"max-w-[180px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),s.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-emerald-700",children:ot(p.creditMicros,{digits:4,signed:!0})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(rs,{tone:Xa(p.status),children:_l(p.status)})})]}),d===p.purchaseId?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:s.jsx(b0,{entry:p})})}):null]},p.purchaseId))]})}),s.jsx(x0,{totalItems:i,pageSize:u,page:r,onPageChange:h,onPageSizeChange:x})]})}function vS({entry:a,open:i,onToggle:r}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsx("button",{type:"button",onClick:r,"aria-expanded":i,"aria-label":`Inference ${a.requestId}`,className:"block w-full text-left",children:s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(eu,{tone:"purple",children:s.jsx($x,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.requestId,children:a.requestId}),s.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.endpoint,children:a.endpoint})]}),s.jsx(rs,{tone:Xa(a.status),children:_l(a.status)})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[s.jsx(jt,{label:"Time",value:jl(a.createdAt),compact:!0}),s.jsx(jt,{label:"Model",value:a.modelId}),s.jsx(jt,{label:"Seller",value:a.sellerKey}),s.jsx(jt,{label:"Cost",value:ot(a.billedMicros,{ledger:!0}),tone:"strong"}),s.jsx(jt,{label:"In",value:Xe(a.promptTokens)}),s.jsx(jt,{label:"Out",value:Xe(a.completionTokens)}),s.jsx(jt,{label:"TTFT",value:yt(a.ttftMs)}),s.jsx(jt,{label:"Total",value:yt(a.durationMs)}),s.jsx(jt,{label:"Route",value:a.routeReason??Ee})]})]})]})}),i?s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:s.jsx(y0,{entry:a})}):null]})}function xS({entry:a,open:i,onToggle:r}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsx("button",{type:"button",onClick:r,"aria-expanded":i,"aria-label":`Purchase ${a.purchaseId}`,className:"block w-full text-left",children:s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(eu,{tone:"green",children:s.jsx(Hi,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.purchaseId,children:a.purchaseId}),s.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.paymentReferenceHash??void 0,children:Fr(a.paymentReferenceHash)})]}),s.jsx(rs,{tone:Xa(a.status),children:_l(a.status)})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[s.jsx(jt,{label:"Time",value:jl(a.createdAt),compact:!0}),s.jsx(jt,{label:"Method",value:a.paymentMethod}),s.jsx(jt,{label:"Model",value:a.modelId}),s.jsx(jt,{label:"Seller",value:a.sellerKey}),s.jsx(jt,{label:"Credit",value:ot(a.creditMicros,{digits:4,signed:!0}),tone:"green"}),s.jsx(jt,{label:"Currency",value:a.currency}),s.jsx(jt,{label:"Completed",value:jl(a.completedAt),compact:!0})]})]})]})}),i?s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:s.jsx(b0,{entry:a})}):null]})}function jt({label:a,value:i,tone:r="default",compact:u=!1}){return s.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[s.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["mt-1 truncate font-mono font-semibold",u?"text-[0.7rem]":"text-[0.84rem]",r==="green"?"text-emerald-700":r==="strong"?"text-[var(--color-ink)]":"text-[var(--color-text)]"].join(" "),title:i,children:i})]})}function eu({tone:a,children:i}){return s.jsx("div",{className:["grid size-9 shrink-0 place-items-center rounded-lg border",a==="purple"?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-purple)]":"border-emerald-100 bg-emerald-50 text-emerald-700"].join(" "),children:i})}function y0({entry:a}){return s.jsx(g0,{rows:[["Request ID",a.requestId],["Created",jl(a.createdAt)],["Endpoint",a.endpoint],["Payment method",a.paymentMethod??Ee],["Route",`${a.routeReason??Ee} -> ${a.sellerKey}`],["Fallback chain",a.falloverChain&&a.falloverChain.length>0?a.falloverChain.join(" -> "):Ee],["Upstream status",_l(a.upstreamStatus)],["TTFT / total",`${yt(a.ttftMs)} / ${yt(a.durationMs)}`],["Input / output tokens",mj(a.promptTokens,a.completionTokens)],["Billed",ot(a.billedMicros,{ledger:!0})],["Balance after",ot(a.balanceSnapshotMicros,{digits:4})],["Prompt hash",Fr(a.promptHash)],["Response hash",Fr(a.responseHash)],["Price version",a.priceVersion??Ee]]})}function b0({entry:a}){return s.jsx(g0,{rows:[["Purchase ID",a.purchaseId],["Created",jl(a.createdAt)],["Completed",jl(a.completedAt)],["Payment method",a.paymentMethod],["Payment reference",Fr(a.paymentReferenceHash)],["Credit",ot(a.creditMicros,{digits:4})],["Credit micros",Xe(a.creditMicros)],["Currency",a.currency],["Seller",a.sellerKey],["Model",a.modelId]]})}function g0({rows:a}){return s.jsx("div",{className:"grid gap-x-4 gap-y-2 text-[0.84rem] sm:grid-cols-[150px_minmax(0,1fr)]",children:a.map(([i,r])=>s.jsxs("div",{className:"contents",children:[s.jsx("div",{className:"text-[var(--color-muted)]",children:i}),s.jsx("div",{className:"min-w-0 break-all font-mono text-[0.8rem] text-[var(--color-ink)]",children:r})]},i))})}function yS(){return s.jsx("div",{className:"space-y-2 px-4 py-4",children:Array.from({length:7},(a,i)=>s.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-lavender)]/35"},i))})}function j0({label:a}){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(Wo,{className:"size-5"})}),s.jsxs("div",{className:"mt-4 font-semibold text-[var(--color-ink)]",children:["No matching ",a]}),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 bS(a,i){const r=a.reduce((p,v)=>p+(v.billedMicros??0),0),u=i.reduce((p,v)=>p+v.creditMicros,0),d=a.reduce((p,v)=>p+(v.promptTokens??0),0),m=a.reduce((p,v)=>p+(v.completionTokens??0),0),h=a.map(p=>p.durationMs).filter(p=>p!==void 0),x=h.length===0?void 0:h.reduce((p,v)=>p+v,0)/h.length;return{inferenceCount:a.length,inferenceSpendMicros:r,purchaseCreditMicros:u,inputTokens:d,outputTokens:m,settledPurchases:i.filter(p=>MS(p.status)).length,averageDurationMs:x}}function gS(a){return{statuses:Vo(a.map(i=>i.status)),models:Vo(a.map(i=>i.modelId))}}function jS(a){return{statuses:Vo(a.map(i=>i.status)),methods:Vo(a.map(i=>i.paymentMethod))}}function Vo(a){return Array.from(new Set(a.filter(Boolean))).sort((i,r)=>i.localeCompare(r))}function SS(a,i){return i?[a.requestId,a.sellerKey,a.modelId,a.endpoint,a.status,a.paymentMethod,a.routeReason,a.upstreamStatus].some(r=>r==null?void 0:r.toLowerCase().includes(i)):!0}function NS(a,i){return i?[a.purchaseId,a.sellerKey,a.modelId,a.paymentMethod,a.status,a.currency,a.paymentReferenceHash].some(r=>r==null?void 0:r.toLowerCase().includes(i)):!0}function Fv(a,i,r){const u=(i-1)*r;return a.slice(u,u+r)}function MS(a){return a==="settled"||a==="active"||a==="completed"||a==="success"}function wS(){return cl({queryKey:["init","state"],queryFn:()=>dl("/init/state"),refetchInterval:1e4})}async function CS(a){return sa("POST","/init/complete",void 0)}function TS(){return En({mutationFn:()=>sa("POST","/init/doctor/run")})}function ES(){return cl({queryKey:["providers","status"],queryFn:()=>dl("/providers/status"),refetchInterval:1e4})}function AS(){return En({mutationFn:a=>sa("POST","/providers/install/preview",a)})}function zS(){const a=is();return En({mutationFn:i=>sa("POST","/providers/install/apply",i),onSuccess:()=>{a.invalidateQueries({queryKey:["providers","status"]}),a.invalidateQueries({queryKey:["init","state"]})}})}const RS=[{value:"fullAuto",title:"全自动",body:"自动选择可用供应商。"},{value:"fixedSet",title:"固定供应商组",body:"在指定供应商组内切换。"},{value:"fixed",title:"固定供应商",body:"始终使用指定供应商。"}],OS=[{value:"balanced",title:"平衡模式",body:"综合速度、价格、健康度、余额。"},{value:"speed",title:"速度优先",body:"优先选择更快、吞吐量更高供应商。"},{value:"discount",title:"成本优先",body:"优先选择更低成本供应商。"}],Jv=[{index:1,label:"选择模型",value:"默认模型"},{index:2,label:"绑定钱包",value:"支付方式"},{index:3,label:"配置策略",value:"路由规则"},{index:4,label:"配置工具",value:"终端接入"}],_S=[{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 钱包入口预留"}],kS=["GPT","Claude","Gemini","DeepSeek","Kimi","Qwen","MiniMax","GLM","Doubao","Grok"];function DS(a){const i=new URLSearchParams(a);return i.has("verifyPaymentMethods")?2:(i.has("verifyPickerDom")||i.has("verifyNoIntro")||i.has("verifyCompact"),1)}function US(){var fs,ms,hs,Fa,Ja,Wa,Ml,Pa,ua,ps,Gi,On;const[a,i]=j.useState(()=>DS(typeof window>"u"?"":window.location.search)),[r,u]=j.useState([]),[d,m]=j.useState(!1),[h,x]=j.useState(),[p,v]=j.useState(!1),[g,b]=j.useState(!1),[E,C]=j.useState("fullAuto"),[A,z]=j.useState("balanced"),[Q,U]=j.useState(""),[q,K]=j.useState([]),[H,V]=j.useState(),[W,F]=j.useState(""),[I,te]=j.useState([]),[se,J]=j.useState({}),[fe,pe]=j.useState(),[Ae,me]=j.useState(),[k,$]=j.useState(!1),[ne,be]=j.useState(null),[ge,M]=j.useState(!1),[_,Z]=j.useState(),P=wS(),X=a0(),le=t0(),re=Wx(),we=ES(),ze=Px(),qt=Ix(),fl=AS(),De=zS(),zt=TS(),mt=yf(),An=Po(),oa=j.useMemo(()=>{var oe;return qS(((oe=mt.data)==null?void 0:oe.data)??[])},[(fs=mt.data)==null?void 0:fs.data]),lu=j.useMemo(()=>{var oe,Ye,Qt;return lN(((oe=mt.data)==null?void 0:oe.sellers)??[],((Ye=mt.data)==null?void 0:Ye.data)??[],((Qt=An.data)==null?void 0:Qt.inferences)??[])},[(ms=An.data)==null?void 0:ms.inferences,(hs=mt.data)==null?void 0:hs.data,(Fa=mt.data)==null?void 0:Fa.sellers]),zn=j.useMemo(()=>{var oe;return QS(oa,r,((oe=P.data)==null?void 0:oe.recommendedModels)??[])},[(Ja=P.data)==null?void 0:Ja.recommendedModels,oa,r]),Sl=j.useMemo(()=>r.length>0?r:zn.map(oe=>oe.id),[zn,r]),Va=`http://127.0.0.1:${((Wa=X.data)==null?void 0:Wa.proxyPort)??((Ml=P.data)==null?void 0:Ml.runtime.proxyPort)??17821}`,Za=j.useMemo(()=>{var oe;return(((oe=we.data)==null?void 0:oe.clients)??[]).filter(Ye=>Ye.id!=="custom"&&Ye.detected)},[(Pa=we.data)==null?void 0:Pa.clients]),ss=((ua=re.data)==null?void 0:ua.payments.filter(oe=>oe.enabled&&tu(oe.method)!=="mock"))??[],os=j.useMemo(()=>oN(E,A,Q,q),[Q,q,E,A]),Nt=uN({serviceReady:((ps=X.data)==null?void 0:ps.status)==="running",modelCount:oa.length,routingMode:E,paymentReady:ss.length>0,configuredTools:((Gi=we.data)==null?void 0:Gi.summary.configuredCount)??0}),au=((On=zt.data)==null?void 0:On.checks.map(cN))??Nt;j.useEffect(()=>{p||!P.data||(u(P.data.focusSet),v(!0))},[P.data,p]),j.useEffect(()=>{W||r.length===0||F(r[0])},[W,r]),j.useEffect(()=>{g||Za.length===0||b(!0)},[g,Za]),j.useEffect(()=>{a!==5||zt.data||zt.error||zt.isPending||zt.mutate()},[a,zt]),j.useEffect(()=>{var Qt;const oe=ca=>{ca.preventDefault(),be(ca),Z("浏览器已经允许直接安装 TokenBuddy。")},Ye=()=>{M(!0),be(null),Z("TokenBuddy 桌面应用已安装。")};return window.addEventListener("beforeinstallprompt",oe),window.addEventListener("appinstalled",Ye),(Qt=window.matchMedia)!=null&&Qt.call(window,"(display-mode: standalone)").matches&&M(!0),()=>{window.removeEventListener("beforeinstallprompt",oe),window.removeEventListener("appinstalled",Ye)}},[]);const us=oe=>{x(void 0),u(Ye=>Ye.includes(oe)?Ye.filter(Qt=>Qt!==oe):[...Ye,oe])},cs=async()=>{m(!0),x(void 0);try{await Lo(r),x("关注模型已保存。后续工具配置会优先参考这些模型。")}catch(oe){x(`保存失败:${oe instanceof Error?oe.message:String(oe)}`)}finally{m(!1)}},Rn=async()=>{if(V(void 0),!os){V(E==="fixed"?"请选择一个固定供应商。":"请至少选择一个供应商。");return}try{await le.mutateAsync(os),V("供应商路由策略已保存。"),i(4)}catch(oe){V(`保存失败:${oe instanceof Error?oe.message:String(oe)}`)}},nu=async()=>{try{await ze.mutateAsync()}catch{}},ds=async()=>{try{await qt.mutateAsync()}catch{}},iu=async()=>{pe(void 0);const oe=W||Sl[0];if(!oe){pe("请先选择一个默认模型。");return}if(I.length===0){pe("请选择至少一个要写入 TokenBuddy 配置的终端工具。");return}try{await fl.mutateAsync({providers:I,proxyUrl:Va,model:oe,providerSelections:lx(I,se,Sl,oe)}),pe("已生成写入预览。确认无误后可以写入配置。")}catch(Ye){pe(`预览失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}},ru=async()=>{pe(void 0);const oe=W||Sl[0];if(!oe){pe("请先选择一个默认模型。");return}if(I.length===0){pe("请选择至少一个要写入 TokenBuddy 配置的终端工具。");return}try{const Ye=await De.mutateAsync({providers:I,proxyUrl:Va,model:oe,providerSelections:lx(I,se,Sl,oe)});pe(`已写入 ${Ye.applied.length} 个配置文件。`),i(5)}catch(Ye){pe(`写入失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}},$a=()=>{X.refetch(),P.refetch(),re.refetch(),we.refetch(),mt.refetch(),zt.mutate()},Mt=async()=>{me(void 0),$(!0);try{await CS(),me("初始化已标记完成。你可以把 TokenBuddy 安装成桌面应用,之后从系统应用入口打开。"),P.refetch()}catch(oe){me(`完成失败:${oe instanceof Error?oe.message:String(oe)}`)}finally{$(!1)}},Nl=async()=>{if(!ne){Z("请在浏览器地址栏右侧或菜单里选择“安装应用”。");return}try{Z(void 0),await ne.prompt();const oe=await ne.userChoice;if(be(null),oe.outcome==="accepted"){M(!0),Z("TokenBuddy 桌面应用已安装。");return}Z("你可以稍后继续使用浏览器安装入口。")}catch(oe){Z(`安装未完成:${oe instanceof Error?oe.message:String(oe)}`)}},wt=(()=>{var oe,Ye,Qt,ca,Ki,_n,kn,Xi,Vi;return a<=1?s.jsx(HS,{commonModels:zn,allModels:oa,loading:mt.isLoading,error:mt.error,selectedModels:r,saving:d,saveMessage:h,onToggleModel:us,onSave:cs,onContinue:()=>i(2)}):a===2?s.jsx(JS,{payments:((oe=re.data)==null?void 0:oe.payments)??[],enabledPaymentCount:ss.length,loading:re.isLoading,qrUrl:(Ye=ze.data)==null?void 0:Ye.qrImageUrl,rechargeQrUrl:(Qt=qt.data)==null?void 0:Qt.qrImageUrl,walletConfigPresent:(ca=ze.data)==null?void 0:ca.walletConfigPresent,error:ze.error,rechargeError:qt.error,binding:ze.isPending,rechargeLoading:qt.isPending,onBind:nu,onLoadRecharge:ds,onRefreshPayments:()=>{re.refetch()},onBack:()=>i(1),onContinue:()=>i(3)}):a===3?s.jsx($S,{mode:E,scorer:A,sellers:lu,fixedSellerId:Q,fixedSetSellerIds:q,saving:le.isPending,message:H,onModeChange:C,onScorerChange:z,onFixedSellerChange:U,onToggleFixedSetSeller:ut=>{K(Ge=>Ge.includes(ut)?Ge.filter(tt=>tt!==ut):[...Ge,ut])},onSave:Rn,onBack:()=>i(2)}):a===4?s.jsx(PS,{clients:((Ki=we.data)==null?void 0:Ki.clients)??[],candidates:Za,loading:we.isLoading,selectedProviders:I,selectedModel:W||Sl[0]||"",modelOptions:Sl,providerSelections:se,proxyUrl:Va,previewChanges:(_n=fl.data)==null?void 0:_n.changes,applying:De.isPending,previewing:fl.isPending,message:fe,onToggleProvider:ut=>{te(Ge=>Ge.includes(ut)?Ge.filter(tt=>tt!==ut):[...Ge,ut])},onModelChange:F,onProviderSelectionChange:(ut,Ge)=>{J(tt=>({...tt,[ut]:Ge}))},onPreview:iu,onInstall:ru,onBack:()=>i(3)}):a===5?s.jsx(eN,{items:au,status:(kn=zt.data)==null?void 0:kn.status,generatedAt:(Xi=zt.data)==null?void 0:Xi.generatedAt,running:zt.isPending,error:zt.error,onRefresh:$a,onBack:()=>i(4),onContinue:()=>i(6)}):s.jsx(tN,{complete:((Vi=P.data)==null?void 0:Vi.setup.status)==="completed",message:Ae,installMessage:_,canInstall:!!ne,installed:ge,saving:k,onBack:()=>i(5),onComplete:Mt,onInstall:Nl})})();return s.jsxs("div",{className:"min-w-0 space-y-3",children:[s.jsx(BS,{activeStep:a,onSelect:i}),s.jsx("div",{className:"min-w-0",children:wt})]})}function BS({activeStep:a,onSelect:i}){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:Jv.map(r=>{const u=a===r.index,d=a>r.index;return s.jsxs(j.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>i(r.index),"aria-current":u?"step":void 0,className:["relative flex min-w-[190px] flex-1 items-center gap-2 rounded-[8px] px-3 py-2 text-left transition",u?"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",u?"border-[var(--color-purple)] text-[var(--color-purple)] shadow-[0_0_0_3px_rgba(124,61,240,0.1)]":"",d?"border-emerald-200 bg-emerald-50 text-emerald-700":"",!u&&!d?"border-[var(--color-line-2)] text-[var(--color-muted)]":""].join(" "),children:d?s.jsx(Wt,{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]",u?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:["STEP ",r.index,":"]}),s.jsx("span",{className:["mt-0.5 block text-[0.82rem] font-semibold",u?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:r.label}),s.jsx("span",{className:"block truncate text-[0.7rem] text-[var(--color-muted)]",children:r.value})]})]}),r.index<Jv.length?s.jsx("div",{className:"hidden min-w-8 items-center justify-center text-[var(--color-purple)]/70 sm:flex",children:s.jsx(Jo,{className:"size-5",strokeWidth:2.6})}):null]},r.index)})})})}function Yi({index:a,title:i,detail:r,meta:u,action:d}){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(a).padStart(2,"0")}),s.jsx("div",{className:"text-[0.92rem] font-semibold text-[var(--color-ink)]",children:i}),r?s.jsx("span",{className:"text-[0.74rem] text-[var(--color-muted)]",children:r}):null,u?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:u}):null]})}),d?s.jsx("div",{className:"shrink-0",children:d}):null]})}function HS({commonModels:a,allModels:i,loading:r,error:u,selectedModels:d,saving:m,saveMessage:h,onToggleModel:x,onSave:p,onContinue:v}){const[g,b]=j.useState(!1),E=d.map(C=>i.find(A=>A.id===C)??{id:C,sellerCount:0,protocols:[],paymentMethods:[]});return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:1,title:"模型访问",detail:"默认和高频模型",meta:`${d.length} selected`,action:s.jsxs("button",{type:"button",disabled:r||!!u,onClick:()=>b(!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(Ko,{className:"size-3.5"}),"添加模型"]})}),u?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["模型目录加载失败:",u instanceof Error?u.message:String(u)]}):null,E.length===0?s.jsxs("button",{type:"button",disabled:r||!!u,onClick:()=>b(!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(Ko,{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:E.map(C=>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:C.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:()=>x(C.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 ${C.id}`,children:s.jsx(Zr,{className:"size-3"})})]},C.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:[r?s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx(At,{className:"size-3.5 animate-spin text-[var(--color-purple)]"})," loading catalog"]}):null,!r&&!u&&d.length===0?s.jsx("span",{children:"请选择至少一个可能使用的模型。"}):null,h?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:h}):null]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{type:"button",disabled:m||d.length===0,onClick:p,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:[m?s.jsx(At,{className:"size-3.5 animate-spin"}):null,"保存"]}),s.jsxs("button",{type:"button",disabled:d.length===0,onClick:v,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(Jo,{className:"size-3.5"})]})]})]})]}),g?s.jsx(LS,{models:a,allModels:i,selectedModelIds:d,onToggle:x,onClose:()=>b(!1)}):null]})}function LS({models:a,allModels:i,selectedModelIds:r,onToggle:u,onClose:d}){const[m,h]=j.useState("common"),[x,p]=j.useState(""),v=x.trim(),g=m==="common"?a:v?KS(i,v):[],b=m==="common"?"没有可用的推荐模型。":"输入关键词搜索全部可用模型。",E=[{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:[r.length," selected"]}),s.jsx("button",{type:"button",onClick:d,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(Zr,{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:"已选模型"}),r.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:r.map(C=>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:C}),s.jsx("button",{type:"button",onClick:()=>u(C),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 ${C}`,children:s.jsx(Zr,{className:"size-3"})})]},C))})]}),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:E.map(C=>{const A=m===C.id;return s.jsxs("button",{type:"button",onClick:()=>h(C.id),className:["rounded-[9px] border px-3 py-2 text-left transition",A?"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",A?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:C.label}),s.jsx("span",{className:"mt-0.5 block text-[0.72rem] text-[var(--color-muted)]",children:C.hint})]},C.id)})}),m==="all"?s.jsxs("label",{className:"relative mt-3 block",children:[s.jsx(Wo,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),s.jsx("input",{value:x,onChange:C=>p(C.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:g.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:b}):s.jsx("div",{className:"grid gap-2",children:g.map(C=>{const A=r.includes(C.id);return s.jsxs("button",{type:"button",onClick:()=>u(C.id),"aria-pressed":A,className:["flex items-center gap-3 rounded-[10px] border px-3 py-2 text-left transition",A?"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",A?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] bg-white text-transparent"].join(" "),children:s.jsx(Wt,{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:C.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:gf(C.id)}),s.jsx("span",{className:"rounded-full bg-emerald-50 px-2 py-0.5 font-semibold text-emerald-700",children:"可用"}),Id(C.paymentMethods)?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:Id(C.paymentMethods)}):null]})]}),s.jsx("span",{className:["rounded-[7px] px-2 py-1 text-[0.72rem] font-semibold",A?"bg-[var(--color-purple)] text-white":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:A?"已选择":"选择"})]},C.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:r.length})," 个模型"]}),s.jsxs("button",{type:"button",onClick:d,"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(Wt,{className:"size-3.5"})]})]})]})})}function qS(a){const i=new Map;for(const r of a){const u=i.get(r.id)??{sellers:new Set,protocols:new Set,paymentMethods:new Set};u.sellers.add(r.sellerId);for(const d of r.supportedProtocols)u.protocols.add(d);for(const d of r.paymentMethods)u.paymentMethods.add(d);i.set(r.id,u)}return Array.from(i.entries()).map(([r,u])=>({id:r,sellerCount:u.sellers.size,protocols:Array.from(u.protocols).sort(),paymentMethods:Array.from(u.paymentMethods).sort()})).sort((r,u)=>u.sellerCount!==r.sellerCount?u.sellerCount-r.sellerCount:r.id.localeCompare(u.id))}function QS(a,i,r){const u=YS(a,r);if(u.length>0)return u.slice(0,14);const d=new Set(i),m=new Map;for(const p of i){const v=a.find(g=>g.id===p);v&&m.set(v.id,v)}const h=a.map(p=>({model:p,rank:XS(p.id)})).filter(p=>p.rank<100).sort((p,v)=>p.rank!==v.rank?p.rank-v.rank:v.model.sellerCount!==p.model.sellerCount?v.model.sellerCount-p.model.sellerCount:p.model.id.localeCompare(v.model.id)),x=new Map;for(const p of h){const v=gf(p.model.id),g=x.get(v)??[];g.push(p),x.set(v,g)}for(const p of kS){const v=p==="GPT"?3:p==="Claude"||p==="Gemini"?2:1;for(const g of(x.get(p)??[]).slice(0,v))m.set(g.model.id,g.model)}for(const p of h){if(m.size>=14)break;d.has(p.model.id)||m.set(p.model.id,p.model)}return Array.from(m.values()).slice(0,14)}function YS(a,i){const r=new Map;for(const u of i){const d=GS(a,u,r);d&&r.set(d.id,d)}return Array.from(r.values())}function GS(a,i,r){const u=Ad(i);if(!u)return;const d=a.find(m=>Ad(m.id)===u&&!r.has(m.id));return d||a.find(m=>{if(r.has(m.id))return!1;const h=Ad(m.id);return h.includes(u)||u.includes(h)})}function Ad(a){return a.trim().toLowerCase().replace(/_/g,"-")}function KS(a,i){const r=i.trim().toLowerCase();return r?a.filter(u=>[u.id,gf(u.id),...u.paymentMethods].some(d=>d.toLowerCase().includes(r))):a}function XS(a){const i=a.toLowerCase();return i.includes("gpt-5.5")||i.includes("gpt-5-5")||i.includes("gpt-5_5")?0:i.includes("gpt-5.4")||i.includes("gpt-5-4")||i.includes("gpt-5_4")?1:i.includes("gpt-5")||i.includes("gpt-latest")||i.includes("openai/gpt")?2:i.includes("claude")&&(i.includes("4.8")||i.includes("4-8"))?3:i.includes("claude")&&i.includes("opus")?4:i.includes("claude")&&i.includes("sonnet")?5:i.includes("claude")?6:i.includes("gemini")&&(i.includes("3.1")||i.includes("3-1"))?7:i.includes("gemini")&&i.includes("pro")?8:i.includes("gemini")?9:i.includes("deepseek")?10:i.includes("kimi")||i.includes("moonshot")?11:i.includes("qwen")||i.includes("tongyi")?12:i.includes("minimax")?13:i.includes("glm")||i.includes("zhipu")?14:i.includes("doubao")||i.includes("bytedance")?15:i.includes("grok")?16:100}function gf(a){const i=a.toLowerCase();return i.includes("gpt")||i.includes("openai")?"GPT":i.includes("claude")||i.includes("anthropic")?"Claude":i.includes("gemini")||i.includes("google")?"Gemini":i.includes("deepseek")?"DeepSeek":i.includes("kimi")||i.includes("moonshot")?"Kimi":i.includes("qwen")||i.includes("tongyi")?"Qwen":i.includes("minimax")?"MiniMax":i.includes("glm")||i.includes("zhipu")?"GLM":i.includes("doubao")||i.includes("bytedance")?"Doubao":i.includes("grok")?"Grok":"Common"}function Id(a){return a.length===0?"":`${VS(a.map(ZS)).join("、")}`}function VS(a){return Array.from(new Set(a))}function ZS(a){const i=tu(a);return i.includes("x402")?"X402":i.includes("clawtip")?"ClawTip":i.includes("wallet")?"钱包":i.includes("mock")||i.includes("test")?"测试":"其它"}function tu(a){return a.trim().toLowerCase()}function $S({mode:a,scorer:i,sellers:r,fixedSellerId:u,fixedSetSellerIds:d,saving:m,message:h,onModeChange:x,onScorerChange:p,onFixedSellerChange:v,onToggleFixedSetSeller:g,onSave:b,onBack:E}){const C=a!=="fullAuto";return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:3,title:"配置策略",detail:"路由规则",meta:`${E0(a)} / ${pN(i)}`}),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:RS.map(A=>s.jsxs("button",{type:"button",onClick:()=>x(A.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",a===A.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",a===A.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Wt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.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:OS.map(A=>s.jsxs("button",{type:"button",onClick:()=>p(A.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",i===A.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",i===A.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Wt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.value))})]})]}),C?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:a==="fixed"?u?"已选择 1 个":"尚未选择":`已选择 ${d.length} 个`})]}),r.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(FS,{mode:a,sellers:r,fixedSellerId:u,fixedSetSellerIds:d,onFixedSellerChange:v,onToggleFixedSetSeller:g})]}):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(S0,{backLabel:"上一步:绑定钱包",nextLabel:"下一步:配置工具",saving:m,message:h,onBack:E,onNext:b})]})}function FS({mode:a,sellers:i,fixedSellerId:r,fixedSetSellerIds:u,onFixedSellerChange:d,onToggleFixedSetSeller:m}){const[h,x]=j.useState({key:"status",direction:"asc"}),p=j.useMemo(()=>N0(i,h),[i,h]),v=b=>{x(E=>({key:b,direction:E.key===b&&E.direction==="asc"?"desc":"asc"}))},g=b=>{if(a==="fixed"){d(b);return}m(b)};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(Si,{label:"供应商",sortKey:"name",sort:h,onSort:v}),s.jsx(Si,{label:"状态",sortKey:"status",sort:h,onSort:v}),s.jsx(Si,{label:"模型",sortKey:"models",sort:h,onSort:v,align:"right"}),s.jsx(Si,{label:"价格",sortKey:"price",sort:h,onSort:v}),s.jsx(Si,{label:"折扣",sortKey:"discount",sort:h,onSort:v,align:"right"}),s.jsx(Si,{label:"响应",sortKey:"speed",sort:h,onSort:v,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:p.map(b=>{const E=a==="fixed"?r===b.id:u.includes(b.id);return s.jsxs("tr",{onClick:()=>g(b.id),className:["cursor-pointer transition hover:bg-[var(--color-lavender)]/45",E?"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",E?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Wt,{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:b.name}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.68rem] text-[var(--color-muted)]",children:b.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",xN(b.status)].join(" "),children:vN(b.status)})}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-ink)]",children:b.modelCount}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 font-mono text-[0.72rem] text-[var(--color-ink)]",children:nN(b.minInputPriceMicrosPer1m,b.minOutputPriceMicrosPer1m)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-purple)]",children:iN(b.discountRatio)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:rN(b.avgResponseMs,b.avgTtftMs)}),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:Id(b.paymentMethods)||"—"})})]},b.id)})})]})})})}function Si({label:a,sortKey:i,sort:r,align:u="left",onSort:d}){const m=r.key===i,h=m?r.direction==="asc"?"↑":"↓":"↕";return s.jsx("th",{className:["px-3 py-2 font-semibold",u==="right"?"text-right":"text-left"].join(" "),children:s.jsxs("button",{type:"button",onClick:()=>d(i),className:["inline-flex items-center gap-1 rounded-[6px] px-1.5 py-1 transition hover:bg-white",u==="right"?"justify-end":"justify-start",m?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:[s.jsx("span",{children:a}),s.jsx("span",{className:"font-mono text-[0.66rem]",children:h})]})})}function JS({payments:a,enabledPaymentCount:i,loading:r,qrUrl:u,rechargeQrUrl:d,walletConfigPresent:m,error:h,rechargeError:x,binding:p,rechargeLoading:v,onBind:g,onLoadRecharge:b,onRefreshPayments:E,onBack:C,onContinue:A}){const[z,Q]=j.useState("clawtip"),[U,q]=j.useState(!1),[K,H]=j.useState(!1),V=a.find(k=>tu(k.method)==="clawtip"),W=!!(V!=null&&V.enabled||m||WS(V==null?void 0:V.config,"walletConfigPresent")),F=U&&W,I=[{method:"clawtip",name:"ClawTip",detail:"JD App 扫码 / 微支付",status:W?"已绑定":"可绑定",available:!0},..._S.map(k=>({...k,status:"Coming soon",available:!1}))],te=I.find(k=>k.method===z)??I[0],se=te.method==="clawtip",J=se&&W&&!F,fe=F||J||U,pe=se?fe:!0,Ae=()=>{q(!0),g()},me=()=>{H(!0),b()};return j.useEffect(()=>{if(!se||!U||W)return;const k=window.setInterval(E,1500);return()=>window.clearInterval(k)},[U,W,E,se]),j.useEffect(()=>{!J||d||v||K||(H(!0),b())},[b,v,d,K,J]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:2,title:"选择支付方式",detail:"钱包和充值通道",meta:r?"checking":`${i} active`,action:se&&J?s.jsxs("button",{type:"button",disabled:v,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:[v?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Hi,{className:"size-3.5"}),"刷新充值码"]}):se&&U&&!W?s.jsxs("button",{type:"button",disabled:p,onClick:Ae,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:[p?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Gr,{className:"size-3.5"}),"重新生成"]}):se&&!U&&!W?s.jsxs("button",{type:"button",disabled:p,onClick:Ae,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:[p?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Gr,{className:"size-3.5"}),"开始绑定"]}):se?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",pe?"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(k=>{const $=k.method===te.method;return s.jsxs("button",{type:"button",onClick:()=>Q(k.method),"aria-pressed":$,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",$?"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",$?"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:Wv(k.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:k.name}),s.jsx("span",{className:"mt-0.5 block truncate text-[0.73rem] text-[var(--color-muted)]",children:k.detail})]}),s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.68rem] font-semibold",k.available?"bg-emerald-50 text-emerald-700":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:k.status})]},k.method)})}),se?fe?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:F?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(Wt,{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 钱包已经写入本机配置,可以继续配置路由策略。"})]})}):J?d?s.jsx("img",{src:d,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:[v?s.jsx(At,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(Hi,{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("button",{type:"button",disabled:v,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:"重新加载"})]})}):U&&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)]"}):U?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:[p?s.jsx(At,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(Gr,{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:p?"正在生成二维码":"等待二维码"}),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:Wv(te.method)}),s.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-[var(--color-ink)]",children:te.name}),s.jsxs("div",{className:"mt-1 text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[te.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"})]})})]}),se&&!W&&U&&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,se&&J&&x?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["加载充值二维码失败:",x instanceof Error?x.message:String(x)]}):null]}),s.jsx(S0,{backLabel:"上一步:模型访问",nextLabel:"下一步:配置策略",message:i>0?"支付方式已可用,可以继续配置路由策略。":"如果你暂时跳过绑定,后续首次购买模型额度时仍需要完成支付配置。",onBack:C,onNext:A})]})}function Wv(a){const i=tu(a);return i==="wechat-pay"?s.jsx(ej,{className:"size-4"}):i==="alipay-agent"?s.jsx(H2,{className:"size-4"}):i==="coinbase-smart-wallet"?s.jsx(Hi,{className:"size-4"}):s.jsx(Gr,{className:"size-4"})}function WS(a,i){const r=a==null?void 0:a[i];return r===!0||r==="true"||r===1||r==="1"}function PS({clients:a,candidates:i,loading:r,selectedProviders:u,selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:x,previewChanges:p,applying:v,previewing:g,message:b,onToggleProvider:E,onModelChange:C,onProviderSelectionChange:A,onPreview:z,onInstall:Q,onBack:U}){var se;const q=new Set(i.map(J=>J.id)),K=i.length,H=a.find(J=>J.id==="custom")??C0(x),V=[...a.filter(J=>J.id!=="custom"),{...H,name:"其他工具"}],W=((se=V[0])==null?void 0:se.id)??"custom",[F,I]=j.useState(W),te=V.find(J=>J.id===F)??V[0]??H;return j.useEffect(()=>{var J;V.some(fe=>fe.id===F)||I(((J=V[0])==null?void 0:J.id)??"custom")},[F,V]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:4,title:"配置工具",detail:"终端接入",meta:`${u.length} 本次写入 / ${K} 已安装`,action:r?s.jsx(At,{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:[a.length," tools"]})]}),s.jsx("div",{className:"mt-2 grid max-h-[380px] gap-2 overflow-y-auto pr-1",children:V.map(J=>{const fe=J.id!=="custom"&&q.has(J.id),pe=u.includes(J.id),Ae=te.id===J.id;return s.jsxs("div",{className:["rounded-[10px] border p-2.5 text-left transition",Ae?"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",Ae?"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:sN(J.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:J.name}),pe?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:A0(J)}),J.commandName?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:J.commandName}):null,J.id==="custom"?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:"复制配置"}):null]})]}),J.id!=="custom"?s.jsx("button",{type:"button",disabled:!fe,className:["mt-0.5 grid size-5 shrink-0 place-items-center rounded-full border",pe?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] bg-white text-transparent",fe?"":"opacity-45"].join(" "),"aria-label":pe?`移出 ${J.name} 本次写入`:`写入 ${J.name} 的 TokenBuddy 配置`,"aria-pressed":pe,title:pe?"移出本次写入":"加入本次写入",onClick:()=>E(J.id),children:s.jsx(Wt,{className:"size-3"})}):null]}),s.jsx("button",{type:"button",onClick:()=>I(J.id),className:["mt-2 inline-flex h-7 items-center justify-center rounded-[7px] px-2 text-[0.72rem] font-semibold transition",Ae?"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:"查看配置"})]},J.id)})})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:s.jsx(IS,{client:te,selected:u.includes(te.id),installable:te.id!=="custom"&&q.has(te.id),selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:x,onToggleInstall:()=>E(te.id),onModelChange:C,onProviderSelectionChange:A})})]}),p?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:"配置文件变更"}),p.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:p.map(J=>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:yN(J.action)}),s.jsx("span",{children:J.providerId})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:J.path}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:J.summary})]},`${J.providerId}:${J.path}:${J.summary}`))})]}):null]}),s.jsxs(St,{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:b?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:b}):null}),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:"上一步:配置策略"}),s.jsxs("button",{type:"button",disabled:g||u.length===0,onClick:z,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:[g?s.jsx(At,{className:"size-4 animate-spin"}):null,"预览写入"]}),s.jsxs("button",{type:"button",disabled:v||u.length===0,onClick:Q,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:[v?s.jsx(At,{className:"size-4 animate-spin"}):null,"写入 TokenBuddy 配置"]})]})]})]})}function IS({client:a,selected:i,installable:r,selectedModel:u,modelOptions:d,providerSelections:m,proxyUrl:h,onToggleInstall:x,onModelChange:p,onProviderSelectionChange:v}){var E,C,A;if(a.id==="custom"){const z=a.manualConfig??C0(h).manualConfig;return s.jsxs("div",{className:"space-y-3",children:[s.jsx(zd,{client:a,selected:!1,installable:!1}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Qr,{label:"OpenAI base URL",value:(z==null?void 0:z.openaiBaseUrl)??T0(h)}),s.jsx(Qr,{label:"Anthropic base URL",value:(z==null?void 0:z.anthropicBaseUrl)??h}),s.jsx(Qr,{label:"API key",value:(z==null?void 0:z.apiKey)??"TOKENBUDDY_PROXY"})]}),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(a.id==="claude-code"){const z=w0(m[a.id],d,u),Q=(q,K)=>{v(a.id,{...z,fallbackModel:z.fallbackModel||K||u,roles:{...z.roles,[q]:K?{upstreamModel:K,displayName:K}:void 0}})},U=q=>{v(a.id,{...z,fallbackModel:q}),p(q)};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(zd,{client:a,selected:i,installable:r,onToggleInstall:x}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(qr,{label:"Fallback",value:z.fallbackModel??u,modelOptions:d,onChange:U}),s.jsx(qr,{label:"Haiku",value:((E=z.roles.haiku)==null?void 0:E.upstreamModel)??"",modelOptions:d,onChange:q=>Q("haiku",q)}),s.jsx(qr,{label:"Sonnet",value:((C=z.roles.sonnet)==null?void 0:C.upstreamModel)??"",modelOptions:d,onChange:q=>Q("sonnet",q)}),s.jsx(qr,{label:"Opus",value:((A=z.roles.opus)==null?void 0:A.upstreamModel)??"",modelOptions:d,onChange:q=>Q("opus",q)})]}),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 g=M0(a.id,m[a.id],u),b=z=>{p(z),v(a.id,{selectionKind:"single-model",protocolPreference:ef(a.id),defaultModel:z})};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(zd,{client:a,selected:i,installable:r,onToggleInstall:x}),s.jsx(qr,{label:"模型",value:g.defaultModel,modelOptions:d,onChange:b}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(Qr,{label:"Proxy URL",value:h,compact:!0}),s.jsx(Qr,{label:"API key",value:"TOKENBUDDY_PROXY",compact:!0})]}),a.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:a.configPath}):null]})}function zd({client:a,selected:i,installable:r,onToggleInstall:u}){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:a.name}),s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.7rem] font-semibold",a.configured?"bg-emerald-50 text-emerald-700":a.status==="installed"?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:A0(a)})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:a.reason})]}),a.id!=="custom"?s.jsxs("button",{type:"button",disabled:!r,onClick:u,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",i?"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:[i?s.jsx(Wt,{className:"size-3.5"}):s.jsx(Ko,{className:"size-3.5"}),i?"已加入本次写入":"写入 TokenBuddy 配置"]}):null]})}function qr({label:a,value:i,modelOptions:r,onChange:u}){return s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-muted)]",children:a}),s.jsxs("select",{value:i,onChange:d=>u(d.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:"请选择模型"}),r.map(d=>s.jsx("option",{value:d,children:d},d))]})]})}function Qr({label:a,value:i,compact:r=!1}){const[u,d]=j.useState(!1),m=async()=>{try{await navigator.clipboard.writeText(i),d(!0),window.setTimeout(()=>d(!1),1200)}catch{d(!1)}};return s.jsxs("div",{className:["rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2",r?"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:a}),s.jsxs("button",{type:"button",onClick:m,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(E2,{className:"size-3"}),u?"已复制":"复制"]})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.76rem] text-[var(--color-ink)]",children:i})]})}function eN({items:a,status:i,generatedAt:r,running:u,error:d,onRefresh:m,onBack:h,onContinue:x}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:5,title:"验证网关",detail:"本机状态",meta:u?"checking":ax(i),action:s.jsxs("button",{type:"button",disabled:u,onClick:m,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:[u?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Fd,{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",dN(i)].join(" "),children:u?"正在检查":ax(i)}),r?s.jsxs("span",{children:["检查时间:",new Date(r).toLocaleString()]}):s.jsx("span",{children:"等待后端检查。"})]}),d?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.82rem] leading-6 text-rose-700",children:["检查失败:",d instanceof Error?d.message:String(d)]}):null,s.jsx("div",{className:"mt-3 grid gap-2 xl:grid-cols-2",children:a.map(p=>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",mN(p.status)].join(" "),children:p.ok?s.jsx(Wt,{className:"size-3.5"}):s.jsx(Fd,{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:[p.title,s.jsx("span",{className:["rounded-full px-1.5 py-0.5 text-[0.68rem]",hN(p.status)].join(" "),children:fN(p.status)})]}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:p.body})]})]},p.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:h,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:x,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(Jo,{className:"size-3.5"})]})]})]})]})})}function tN({complete:a,message:i,installMessage:r,canInstall:u,installed:d,saving:m,onBack:h,onComplete:x,onInstall:p}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:6,title:a?"初始化完成":"桌面应用",detail:d?"已安装":"可选安装",meta:a?"complete":d?"installed":"optional",action:s.jsxs("button",{type:"button",disabled:d,onClick:p,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(Wt,{className:"size-3.5"}),d?"已安装":"安装应用"]})}),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:d?"TokenBuddy 桌面应用已安装":u?"浏览器支持直接安装":"可从浏览器菜单安装"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:d?"你可以从系统应用入口打开 TokenBuddy。":u?"点击右上角安装按钮并确认浏览器弹窗。":"在地址栏右侧或浏览器菜单中找到安装应用入口。"}),r?s.jsx("div",{className:"mt-2 text-[0.78rem] font-medium text-[var(--color-ink)]",children:r}):null]}),s.jsx("div",{className:"grid gap-2 lg:grid-cols-3",children:[{title:"安装入口",body:"地址栏或浏览器菜单。"},{title:"应用名称",body:"TokenBuddy。"},{title:"本地服务",body:"继续由 tb-proxyd 提供。"}].map((v,g)=>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:g+1}),s.jsx("span",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:v.title})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] 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:i?s.jsx("span",{className:"font-medium text-[var(--color-ink)]",children:i}):"完成后可以进入控制台。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:h,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:m||a,onClick:x,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:[m?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Wt,{className:"size-3.5"}),a?"已完成":"完成初始化"]}),s.jsx(ns,{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 S0({backLabel:a,nextLabel:i,saving:r=!1,message:u,onBack:d,onNext:m}){return s.jsxs(St,{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:u??"配置完成后继续下一步。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:d,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:a}),s.jsxs("button",{type:"button",disabled:r,onClick:m,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:[r?s.jsx(At,{className:"size-3.5 animate-spin"}):null,i,r?null:s.jsx(Jo,{className:"size-3.5"})]})]})]})}function lN(a,i,r){const u=new Map;for(const h of i){const x=u.get(h.sellerId)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,responseMsSamples:[],ttftMsSamples:[]};x.modelIds.add(h.id);for(const p of h.supportedProtocols)x.protocols.add(p);for(const p of h.paymentMethods)x.paymentMethods.add(p);x.minInputPriceMicrosPer1m=Iv(x.minInputPriceMicrosPer1m,h.inputPriceMicrosPer1m),x.minOutputPriceMicrosPer1m=Iv(x.minOutputPriceMicrosPer1m,h.outputPriceMicrosPer1m),u.set(h.sellerId,x)}for(const h of r){const x=h.sellerKey;if(!x)continue;const p=u.get(x)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,responseMsSamples:[],ttftMsSamples:[]};Number.isFinite(h.durationMs)&&p.responseMsSamples.push(h.durationMs),Number.isFinite(h.ttftMs)&&p.ttftMsSamples.push(h.ttftMs),u.set(x,p)}const d=a.map(h=>{const x=u.get(h.id);return{id:h.id,name:ex(h.name??h.manifestSellerId??h.id),status:h.status,modelCount:h.modelCount??(x==null?void 0:x.modelIds.size)??0,protocols:h.supportedProtocols??Array.from((x==null?void 0:x.protocols)??[]),paymentMethods:h.paymentMethods??Array.from((x==null?void 0:x.paymentMethods)??[]),discountRatio:h.discountRatio,serviceFeeRatio:h.serviceFeeRatio,minInputPriceMicrosPer1m:x==null?void 0:x.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:x==null?void 0:x.minOutputPriceMicrosPer1m,avgResponseMs:Do((x==null?void 0:x.responseMsSamples)??[]),avgTtftMs:Do((x==null?void 0:x.ttftMsSamples)??[])}}),m=new Set(d.map(h=>h.id));for(const[h,x]of u.entries()){if(m.has(h))continue;const p=i.find(v=>v.sellerId===h);d.push({id:h,name:ex((p==null?void 0:p.sellerName)??h),status:"unknown",modelCount:x.modelIds.size,protocols:Array.from(x.protocols).sort(),paymentMethods:Array.from(x.paymentMethods).sort(),minInputPriceMicrosPer1m:x.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:x.minOutputPriceMicrosPer1m,avgResponseMs:Do(x.responseMsSamples),avgTtftMs:Do(x.ttftMsSamples)})}return N0(d,{key:"status",direction:"asc"})}function N0(a,i){const r=i.direction==="asc"?1:-1;return[...a].sort((u,d)=>{const m=aN(u,d,i.key);if(m!==0)return m*r;const h=Zo(u.status)-Zo(d.status);return h!==0?h:d.modelCount!==u.modelCount?d.modelCount-u.modelCount:u.name.localeCompare(d.name)})}function aN(a,i,r){return r==="status"?Zo(a.status)-Zo(i.status):r==="name"?a.name.localeCompare(i.name):r==="models"?a.modelCount-i.modelCount:r==="price"?Rd(Pv(a),Pv(i)):r==="discount"?Rd(a.discountRatio,i.discountRatio):Rd(a.avgResponseMs??a.avgTtftMs,i.avgResponseMs??i.avgTtftMs)}function Pv(a){if(!(!Number.isFinite(a.minInputPriceMicrosPer1m)&&!Number.isFinite(a.minOutputPriceMicrosPer1m)))return(a.minInputPriceMicrosPer1m??0)+(a.minOutputPriceMicrosPer1m??0)}function Iv(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);if(r&&u)return Math.min(a,i);if(r)return a;if(u)return i}function Do(a){const i=a.filter(r=>Number.isFinite(r));if(i.length!==0)return i.reduce((r,u)=>r+u,0)/i.length}function Rd(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);return r&&u?a-i:r?-1:u?1:0}function ex(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function nN(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?"-":`I ${tx(a)} / O ${tx(i)}`}function tx(a){if(!Number.isFinite(a))return"-";const i=a/1e6;return`$${i>=1?i.toFixed(2):i.toFixed(4)}`}function iN(a){if(!Number.isFinite(a))return"-";const i=a;if(i<=0)return"free";const r=Math.max(0,1-i);return r>=.01?`${Math.round(r*100)}% off`:`x${i.toFixed(2)}`}function rN(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?"-":Number.isFinite(a)&&Number.isFinite(i)?`${Math.round(a)}ms / T ${Math.round(i)}ms`:Number.isFinite(a)?`${Math.round(a)}ms`:`T ${Math.round(i)}ms`}function lx(a,i,r,u){const d=u||r[0]||"",m={};for(const h of a)h!=="custom"&&(m[h]=h==="claude-code"?w0(i[h],r,d):M0(h,i[h],d));return m}function M0(a,i,r){return(i==null?void 0:i.selectionKind)==="single-model"?{...i,protocolPreference:i.protocolPreference??ef(a),defaultModel:i.defaultModel||r}:{selectionKind:"single-model",protocolPreference:ef(a),defaultModel:r}}function w0(a,i,r){var m;const u=(a==null?void 0:a.selectionKind)==="claude-role-mapping"?(m=a.roles.sonnet)==null?void 0:m.upstreamModel:void 0,d=r||u||i[0]||"";return(a==null?void 0:a.selectionKind)==="claude-role-mapping"?{...a,protocolPreference:"messages",fallbackModel:a.fallbackModel||d,roles:{...a.roles,sonnet:a.roles.sonnet??(d?{upstreamModel:d,displayName:d}:void 0)}}:{selectionKind:"claude-role-mapping",protocolPreference:"messages",fallbackModel:d,roles:{sonnet:d?{upstreamModel:d,displayName:d}:void 0}}}function ef(a){if(a==="codex")return"responses";if(a==="claude-code"||a==="claude-desktop")return"messages";if(["openclaw","opencode","hermes"].includes(a))return"chat_completions"}function C0(a){return{id:"custom",name:"其他工具",status:"manual",detected:!0,configured:!1,reason:"复制本地推理服务接口到任意 OpenAI 或 Anthropic 兼容客户端。",manualConfig:{openaiBaseUrl:T0(a),anthropicBaseUrl:a,apiKey:"TOKENBUDDY_PROXY"}}}function T0(a){const i=a.replace(/\/+$/,"");return i.endsWith("/v1")?i:`${i}/v1`}function sN(a){const i=a.trim();return i?i.slice(0,1).toUpperCase():"?"}function oN(a,i,r,u){if(a==="fixed"){const d=r.trim();return d?{mode:a,scorer:i,sellerId:d}:void 0}if(a==="fixedSet"){const d=Array.from(new Set(u.map(m=>m.trim()).filter(Boolean)));return d.length===0?void 0:{mode:a,scorer:i,sellerIds:d}}return{mode:a,scorer:i}}function uN({serviceReady:a,modelCount:i,routingMode:r,paymentReady:u,configuredTools:d}){return[{title:a?"本地网关正在运行":"本地网关尚未就绪",body:a?"控制台服务和本地代理已经响应。":"请确认 tb-proxyd 已启动,并等待控制台刷新状态。",ok:a,status:a?"passed":"failed",details:[]},{title:i>0?"模型目录已加载":"模型目录尚未加载",body:i>0?`已发现 ${i} 个可用模型。`:"请检查供应商注册表或网络连接。",ok:i>0,status:i>0?"passed":"failed",details:[]},{title:"路由策略已选择",body:`当前策略为${E0(r)},TokenBuddy 会按这个策略规划供应商。`,ok:!!r,status:r?"passed":"failed",details:[]},{title:u?"支付方式可用":"支付方式尚未可用",body:u?"已经检测到至少一个可用支付方式。":"请完成 ClawTip 绑定,或稍后在支付页面补充配置。",ok:u,status:u?"passed":"warning",details:[]},{title:d>0?"终端工具已接入":"终端工具尚未接入",body:d>0?`已经写入 ${d} 个终端工具配置。`:"如果你还没有安装终端工具,可以稍后再执行接入。",ok:d>0,status:d>0?"passed":"warning",details:[]}]}function cN(a){return{title:a.label,body:a.message,ok:a.status==="passed"||a.status==="skipped",status:a.status,details:a.details}}function ax(a){return a==="passed"?"全部通过":a==="warning"?"存在警告":a==="failed"?"需要修复":"等待检查"}function dN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="warning"?"bg-amber-50 text-amber-700":a==="failed"?"bg-rose-50 text-rose-700":"bg-[var(--color-page)] text-[var(--color-muted)]"}function fN(a){return a==="passed"?"通过":a==="warning"?"警告":a==="failed"?"失败":"已跳过"}function mN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="failed"?"bg-rose-50 text-rose-700":a==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function hN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="failed"?"bg-rose-50 text-rose-700":a==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function E0(a){return a==="fixed"?"固定供应商":a==="fixedSet"?"固定供应商组":"全自动"}function pN(a){return a==="speed"?"速度优先":a==="discount"?"成本优先":"平衡模式"}function vN(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?"状态正常":["error","failed","unavailable"].includes(i)?"状态异常":["unknown","pending"].includes(i)?"等待检测":`状态:${a}`}function xN(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?"bg-emerald-50 text-emerald-700":["error","failed","unavailable"].includes(i)?"bg-rose-50 text-rose-700":"bg-amber-50 text-amber-700"}function Zo(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?0:["unknown","pending"].includes(i)?1:2}function A0(a){return a.configured?"已配置":a.status==="installed"?"已安装":a.status==="manual"?"需要手动配置":a.detected?"已检测到":"未检测到"}function yN(a){return a==="create"?"创建":"更新"}function bN(){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.jsxs(ff,{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("span",{className:"font-mono text-[0.86rem] font-bold uppercase tracking-[0.14em] text-[var(--color-ink)]",children:"tokenbuddy"}),s.jsx("span",{className:"ml-1.5 inline-block size-1.5 rounded-full bg-[var(--color-primary)] shadow-[0_0_0_3px_rgba(124,61,240,0.18)]","aria-hidden":!0})]}),s.jsxs("div",{className:"ml-auto flex min-w-0 gap-0.5 sm:gap-1",children:[s.jsx(Od,{to:"/overview",children:"Overview"}),s.jsx(Od,{to:"/routing",children:"Routing"}),s.jsx(Od,{to:"/ledger",children:"Ledger"})]})]}),s.jsx("main",{className:"mx-auto max-w-[1180px] px-3 py-5 sm:px-6 sm:py-7",children:s.jsxs(Wg,{children:[s.jsx(Ni,{path:"/",element:s.jsx(Gv,{})}),s.jsx(Ni,{path:"/overview",element:s.jsx(Gv,{})}),s.jsx(Ni,{path:"/init",element:s.jsx(US,{})}),s.jsx(Ni,{path:"/routing",element:s.jsx(Kj,{})}),s.jsx(Ni,{path:"/ledger",element:s.jsx(mS,{})})]})})]})}function Od({to:a,children:i}){return s.jsx(ff,{to:a,className:({isActive:r})=>["rounded-[var(--radius-md)] px-2 py-1.5 text-[0.82rem] font-medium transition-colors sm:px-3.5 sm:text-[0.92rem]",r?"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:i})}function gN(){!("serviceWorker"in navigator)||window.location.port==="5173"||window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}const jN=new t2({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1}}});Pb.createRoot(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(l2,{client:jN,children:s.jsx(j1,{children:s.jsx(bN,{})})})}));gN();
|
|
236
|
-
//# sourceMappingURL=index-UAfOhbwC.js.map
|