@tokenbuddy/tokenbuddy 1.0.19 → 1.0.21
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/package.json +1 -1
- package/static/ui/assets/index-BBuXE99D.js +216 -0
- package/static/ui/assets/index-BBuXE99D.js.map +1 -0
- package/static/ui/assets/index-yD_hcuW8.css +1 -0
- package/static/ui/index.html +2 -2
- package/static/ui/assets/index-BILQcD8g.js +0 -226
- package/static/ui/assets/index-BILQcD8g.js.map +0 -1
- package/static/ui/assets/index-C5KsebCA.css +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
var qy=Object.defineProperty;var cx=a=>{throw TypeError(a)};var Qy=(a,i,s)=>i in a?qy(a,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[i]=s;var hd=(a,i,s)=>Qy(a,typeof i!="symbol"?i+"":i,s),pd=(a,i,s)=>i.has(a)||cx("Cannot "+s);var N=(a,i,s)=>(pd(a,i,"read from private field"),s?s.call(a):i.get(a)),ce=(a,i,s)=>i.has(a)?cx("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,s),te=(a,i,s,u)=>(pd(a,i,"write to private field"),u?u.call(a,s):i.set(a,s),s),be=(a,i,s)=>(pd(a,i,"access private method"),s);var wo=(a,i,s,u)=>({set _(d){te(a,i,d,s)},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 s(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=s(d);fetch(d.href,m)}})();var xd={exports:{}},Or={};/**
|
|
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 dx;function Yy(){if(dx)return Or;dx=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(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 v in d)v!=="key"&&(m[v]=d[v])}else m=d;return d=m.ref,{$$typeof:a,type:u,key:h,ref:d!==void 0?d:null,props:m}}return Or.Fragment=i,Or.jsx=s,Or.jsxs=s,Or}var fx;function Gy(){return fx||(fx=1,xd.exports=Yy()),xd.exports}var r=Gy(),vd={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 mx;function Ky(){if(mx)return he;mx=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=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"),v=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=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,U={};function k(M,O,Z){this.props=M,this.context=O,this.refs=U,this.updater=Z||A}k.prototype.isReactComponent={},k.prototype.setState=function(M,O){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,O,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function G(){}G.prototype=k.prototype;function K(M,O,Z){this.props=M,this.context=O,this.refs=U,this.updater=Z||A}var H=K.prototype=new G;H.constructor=K,z(H,k.prototype),H.isPureReactComponent=!0;var V=Array.isArray;function P(){}var $={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function le(M,O,Z){var I=Z.ref;return{$$typeof:a,type:M,key:O,ref:I!==void 0?I:null,props:Z}}function oe(M,O){return le(M.type,O,M.props)}function F(M){return typeof M=="object"&&M!==null&&M.$$typeof===a}function me(M){var O={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Z){return O[Z]})}var pe=/\/+/g;function Te(M,O){return typeof M=="object"&&M!==null&&M.key!=null?me(""+M.key):O.toString(36)}function ue(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(P,P):(M.status="pending",M.then(function(O){M.status==="pending"&&(M.status="fulfilled",M.value=O)},function(O){M.status==="pending"&&(M.status="rejected",M.reason=O)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function B(M,O,Z,I,X){var ae=typeof M;(ae==="undefined"||ae==="boolean")&&(M=null);var W=!1;if(M===null)W=!0;else switch(ae){case"bigint":case"string":case"number":W=!0;break;case"object":switch(M.$$typeof){case a:case i:W=!0;break;case g:return W=M._init,B(W(M._payload),O,Z,I,X)}}if(W)return X=X(M),W=I===""?"."+Te(M,0):I,V(X)?(Z="",W!=null&&(Z=W.replace(pe,"$&/")+"/"),B(X,O,Z,"",function(ml){return ml})):X!=null&&(F(X)&&(X=oe(X,Z+(X.key==null||M&&M.key===X.key?"":(""+X.key).replace(pe,"$&/")+"/")+W)),O.push(X)),1;W=0;var Ee=I===""?".":I+":";if(V(M))for(var Re=0;Re<M.length;Re++)I=M[Re],ae=Ee+Te(I,Re),W+=B(I,O,Z,ae,X);else if(Re=C(M),typeof Re=="function")for(M=Re.call(M),Re=0;!(I=M.next()).done;)I=I.value,ae=Ee+Te(I,Re++),W+=B(I,O,Z,ae,X);else if(ae==="object"){if(typeof M.then=="function")return B(ue(M),O,Z,I,X);throw O=String(M),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return W}function J(M,O,Z){if(M==null)return M;var I=[],X=0;return B(M,I,"","",function(ae){return O.call(Z,ae,X++)}),I}function re(M){if(M._status===-1){var O=M._result;O=O(),O.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=O)}if(M._status===1)return M._result.default;throw M._result}var ye=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=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(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ge={map:J,forEach:function(M,O,Z){J(M,function(){O.apply(this,arguments)},Z)},count:function(M){var O=0;return J(M,function(){O++}),O},toArray:function(M){return J(M,function(O){return O})||[]},only:function(M){if(!F(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return he.Activity=y,he.Children=ge,he.Component=k,he.Fragment=s,he.Profiler=d,he.PureComponent=K,he.StrictMode=u,he.Suspense=p,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,he.__COMPILER_RUNTIME={__proto__:null,c:function(M){return $.H.useMemoCache(M)}},he.cache=function(M){return function(){return M.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(M,O,Z){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var I=z({},M.props),X=M.key;if(O!=null)for(ae in O.key!==void 0&&(X=""+O.key),O)!ee.call(O,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&O.ref===void 0||(I[ae]=O[ae]);var ae=arguments.length-2;if(ae===1)I.children=Z;else if(1<ae){for(var W=Array(ae),Ee=0;Ee<ae;Ee++)W[Ee]=arguments[Ee+2];I.children=W}return le(M.type,X,I)},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,O,Z){var I,X={},ae=null;if(O!=null)for(I in O.key!==void 0&&(ae=""+O.key),O)ee.call(O,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(X[I]=O[I]);var W=arguments.length-2;if(W===1)X.children=Z;else if(1<W){for(var Ee=Array(W),Re=0;Re<W;Re++)Ee[Re]=arguments[Re+2];X.children=Ee}if(M&&M.defaultProps)for(I in W=M.defaultProps,W)X[I]===void 0&&(X[I]=W[I]);return le(M,ae,X)},he.createRef=function(){return{current:null}},he.forwardRef=function(M){return{$$typeof:v,render:M}},he.isValidElement=F,he.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:re}},he.memo=function(M,O){return{$$typeof:x,type:M,compare:O===void 0?null:O}},he.startTransition=function(M){var O=$.T,Z={};$.T=Z;try{var I=M(),X=$.S;X!==null&&X(Z,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(P,ye)}catch(ae){ye(ae)}finally{O!==null&&Z.types!==null&&(O.types=Z.types),$.T=O}},he.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},he.use=function(M){return $.H.use(M)},he.useActionState=function(M,O,Z){return $.H.useActionState(M,O,Z)},he.useCallback=function(M,O){return $.H.useCallback(M,O)},he.useContext=function(M){return $.H.useContext(M)},he.useDebugValue=function(){},he.useDeferredValue=function(M,O){return $.H.useDeferredValue(M,O)},he.useEffect=function(M,O){return $.H.useEffect(M,O)},he.useEffectEvent=function(M){return $.H.useEffectEvent(M)},he.useId=function(){return $.H.useId()},he.useImperativeHandle=function(M,O,Z){return $.H.useImperativeHandle(M,O,Z)},he.useInsertionEffect=function(M,O){return $.H.useInsertionEffect(M,O)},he.useLayoutEffect=function(M,O){return $.H.useLayoutEffect(M,O)},he.useMemo=function(M,O){return $.H.useMemo(M,O)},he.useOptimistic=function(M,O){return $.H.useOptimistic(M,O)},he.useReducer=function(M,O,Z){return $.H.useReducer(M,O,Z)},he.useRef=function(M){return $.H.useRef(M)},he.useState=function(M){return $.H.useState(M)},he.useSyncExternalStore=function(M,O,Z){return $.H.useSyncExternalStore(M,O,Z)},he.useTransition=function(){return $.H.useTransition()},he.version="19.2.7",he}var hx;function tf(){return hx||(hx=1,vd.exports=Ky()),vd.exports}var j=tf(),bd={exports:{}},Dr={},yd={exports:{}},gd={};/**
|
|
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 px;function Xy(){return px||(px=1,(function(a){function i(B,J){var re=B.length;B.push(J);e:for(;0<re;){var ye=re-1>>>1,ge=B[ye];if(0<d(ge,J))B[ye]=J,B[re]=ge,re=ye;else break e}}function s(B){return B.length===0?null:B[0]}function u(B){if(B.length===0)return null;var J=B[0],re=B.pop();if(re!==J){B[0]=re;e:for(var ye=0,ge=B.length,M=ge>>>1;ye<M;){var O=2*(ye+1)-1,Z=B[O],I=O+1,X=B[I];if(0>d(Z,re))I<ge&&0>d(X,Z)?(B[ye]=X,B[I]=re,ye=I):(B[ye]=Z,B[O]=re,ye=O);else if(I<ge&&0>d(X,re))B[ye]=X,B[I]=re,ye=I;else break e}}return J}function d(B,J){var re=B.sortIndex-J.sortIndex;return re!==0?re:B.id-J.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,v=h.now();a.unstable_now=function(){return h.now()-v}}var p=[],x=[],g=1,y=null,E=3,C=!1,A=!1,z=!1,U=!1,k=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function H(B){for(var J=s(x);J!==null;){if(J.callback===null)u(x);else if(J.startTime<=B)u(x),J.sortIndex=J.expirationTime,i(p,J);else break;J=s(x)}}function V(B){if(z=!1,H(B),!A)if(s(p)!==null)A=!0,P||(P=!0,me());else{var J=s(x);J!==null&&ue(V,J.startTime-B)}}var P=!1,$=-1,ee=5,le=-1;function oe(){return U?!0:!(a.unstable_now()-le<ee)}function F(){if(U=!1,P){var B=a.unstable_now();le=B;var J=!0;try{e:{A=!1,z&&(z=!1,G($),$=-1),C=!0;var re=E;try{t:{for(H(B),y=s(p);y!==null&&!(y.expirationTime>B&&oe());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,E=y.priorityLevel;var ge=ye(y.expirationTime<=B);if(B=a.unstable_now(),typeof ge=="function"){y.callback=ge,H(B),J=!0;break t}y===s(p)&&u(p),H(B)}else u(p);y=s(p)}if(y!==null)J=!0;else{var M=s(x);M!==null&&ue(V,M.startTime-B),J=!1}}break e}finally{y=null,E=re,C=!1}J=void 0}}finally{J?me():P=!1}}}var me;if(typeof K=="function")me=function(){K(F)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Te=pe.port2;pe.port1.onmessage=F,me=function(){Te.postMessage(null)}}else me=function(){k(F,0)};function ue(B,J){$=k(function(){B(a.unstable_now())},J)}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(B){B.callback=null},a.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<B?Math.floor(1e3/B):5},a.unstable_getCurrentPriorityLevel=function(){return E},a.unstable_next=function(B){switch(E){case 1:case 2:case 3:var J=3;break;default:J=E}var re=E;E=J;try{return B()}finally{E=re}},a.unstable_requestPaint=function(){U=!0},a.unstable_runWithPriority=function(B,J){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var re=E;E=B;try{return J()}finally{E=re}},a.unstable_scheduleCallback=function(B,J,re){var ye=a.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?ye+re:ye):re=ye,B){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=re+ge,B={id:g++,callback:J,priorityLevel:B,startTime:re,expirationTime:ge,sortIndex:-1},re>ye?(B.sortIndex=re,i(x,B),s(p)===null&&B===s(x)&&(z?(G($),$=-1):z=!0,ue(V,re-ye))):(B.sortIndex=ge,i(p,B),A||C||(A=!0,P||(P=!0,me()))),B},a.unstable_shouldYield=oe,a.unstable_wrapCallback=function(B){var J=E;return function(){var re=E;E=J;try{return B.apply(this,arguments)}finally{E=re}}}})(gd)),gd}var xx;function Vy(){return xx||(xx=1,yd.exports=Xy()),yd.exports}var jd={exports:{}},ht={};/**
|
|
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 vx;function Zy(){if(vx)return ht;vx=1;var a=tf();function i(p){var x="https://react.dev/errors/"+p;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)x+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var u={d:{f:s,r:function(){throw Error(i(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(p,x,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:y==null?null:""+y,children:p,containerInfo:x,implementation:g}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(p,x){if(p==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,ht.createPortal=function(p,x){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(i(299));return m(p,x,null,g)},ht.flushSync=function(p){var x=h.T,g=u.p;try{if(h.T=null,u.p=2,p)return p()}finally{h.T=x,u.p=g,u.d.f()}},ht.preconnect=function(p,x){typeof p=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,u.d.C(p,x))},ht.prefetchDNS=function(p){typeof p=="string"&&u.d.D(p)},ht.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var g=x.as,y=v(g,x.crossOrigin),E=typeof x.integrity=="string"?x.integrity:void 0,C=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;g==="style"?u.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:E,fetchPriority:C}):g==="script"&&u.d.X(p,{crossOrigin:y,integrity:E,fetchPriority:C,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},ht.preinitModule=function(p,x){if(typeof p=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var g=v(x.as,x.crossOrigin);u.d.M(p,{crossOrigin:g,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&u.d.M(p)},ht.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var g=x.as,y=v(g,x.crossOrigin);u.d.L(p,g,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},ht.preloadModule=function(p,x){if(typeof p=="string")if(x){var g=v(x.as,x.crossOrigin);u.d.m(p,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:g,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else u.d.m(p)},ht.requestFormReset=function(p){u.d.r(p)},ht.unstable_batchedUpdates=function(p,x){return p(x)},ht.useFormState=function(p,x,g){return h.H.useFormState(p,x,g)},ht.useFormStatus=function(){return h.H.useHostTransitionStatus()},ht.version="19.2.7",ht}var bx;function $y(){if(bx)return jd.exports;bx=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(),jd.exports=Zy(),jd.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 yx;function Jy(){if(yx)return Dr;yx=1;var a=Vy(),i=tf(),s=$y();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 v(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 x(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,b=o.child;b;){if(b===l){f=!0,l=o,n=c;break}if(b===n){f=!0,n=o,l=c;break}b=b.sibling}if(!f){for(b=c.child;b;){if(b===l){f=!0,l=c,n=o;break}if(b===n){f=!0,n=c,l=o;break}b=b.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 y=Object.assign,E=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),K=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function Te(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 k:return"Profiler";case U:return"StrictMode";case V:return"Suspense";case P:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case K:return e.displayName||"Context";case G: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 $:return t=e.displayName||null,t!==null?t:Te(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return Te(e(t))}catch{}}return null}var ue=Array.isArray,B=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ye=[],ge=-1;function M(e){return{current:e}}function O(e){0>ge||(e.current=ye[ge],ye[ge]=null,ge--)}function Z(e,t){ge++,ye[ge]=e.current,e.current=t}var I=M(null),X=M(null),ae=M(null),W=M(null);function Ee(e,t){switch(Z(ae,t),Z(X,e),Z(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Op(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Op(t),e=Dp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(I),Z(I,e)}function Re(){O(I),O(X),O(ae)}function ml(e){e.memoizedState!==null&&Z(W,e);var t=I.current,l=Dp(t,e.type);t!==l&&(Z(X,e),Z(I,l))}function ea(e){X.current===e&&(O(I),O(X)),W.current===e&&(O(W),Ar._currentValue=re)}var Nn,wt;function ut(e){if(Nn===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Nn=t&&t[1]||"",wt=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Nn+e+wt}var Mn=!1;function ta(e,t){if(!e||Mn)return"";Mn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(L){var D=L}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(L){D=L}e.call(Y.prototype)}}else{try{throw Error()}catch(L){D=L}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(L){if(L&&D&&typeof L.stack=="string")return[L.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],b=c[1];if(f&&b){var S=f.split(`
|
|
44
|
+
`),_=b.split(`
|
|
45
|
+
`);for(o=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;o<_.length&&!_[o].includes("DetermineComponentFrameRoot");)o++;if(n===S.length||o===_.length)for(n=S.length-1,o=_.length-1;1<=n&&0<=o&&S[n]!==_[o];)o--;for(;1<=n&&0<=o;n--,o--)if(S[n]!==_[o]){if(n!==1||o!==1)do if(n--,o--,0>o||S[n]!==_[o]){var q=`
|
|
46
|
+
`+S[n].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=n&&0<=o);break}}}finally{Mn=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ut(l):""}function eu(e,t){switch(e.tag){case 26:case 27:case 5:return ut(e.type);case 16:return ut("Lazy");case 13:return e.child!==t&&t!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return ta(e.type,!1);case 11:return ta(e.type.render,!1);case 1:return ta(e.type,!0);case 31:return ut("Activity");default:return""}}function wn(e){try{var t="",l=null;do t+=eu(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var hl=Object.prototype.hasOwnProperty,qa=a.unstable_scheduleCallback,la=a.unstable_cancelCallback,as=a.unstable_shouldYield,ns=a.unstable_requestPaint,bt=a.unstable_now,tu=a.unstable_getCurrentPriorityLevel,is=a.unstable_ImmediatePriority,rs=a.unstable_UserBlockingPriority,Cn=a.unstable_NormalPriority,lu=a.unstable_LowPriority,ss=a.unstable_IdlePriority,au=a.log,nu=a.unstable_setDisableYieldValue,Qa=null,yt=null;function pl(e){if(typeof au=="function"&&nu(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Qa,e)}catch{}}var gt=Math.clz32?Math.clz32:cs,os=Math.log,us=Math.LN2;function cs(e){return e>>>=0,e===0?32:31-(os(e)/us|0)|0}var Ya=256,Ga=262144,Ka=4194304;function xl(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 Xa(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 b=n&134217727;return b!==0?(n=b&~c,n!==0?o=xl(n):(f&=b,f!==0?o=xl(f):l||(l=b&~e,l!==0&&(o=xl(l))))):(b=n&~c,b!==0?o=xl(b):f!==0?o=xl(f):l||(l=n&~e,l!==0&&(o=xl(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 aa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ds(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 qi(){var e=Ka;return Ka<<=1,(Ka&62914560)===0&&(Ka=4194304),e}function Tn(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function He(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 b=e.entanglements,S=e.expirationTimes,_=e.hiddenUpdates;for(l=f&~l;0<l;){var q=31-gt(l),Y=1<<q;b[q]=0,S[q]=-1;var D=_[q];if(D!==null)for(_[q]=null,q=0;q<D.length;q++){var L=D[q];L!==null&&(L.lane&=-536870913)}l&=~Y}n!==0&&Dt(e,n,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function Dt(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-gt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function na(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-gt(l),o=1<<n;o&t|e[n]&t&&(e[n]|=t),l&=~o}}function Qi(e,t){var l=t&-t;return l=(l&42)!==0?1:En(l),(l&(e.suspendedLanes|t))!==0?0:l}function En(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 An(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yi(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:ax(e.type))}function Gi(e,t){var l=J.p;try{return J.p=e,t()}finally{J.p=l}}var it=Math.random().toString(36).slice(2),qe="__reactFiber$"+it,Pe="__reactProps$"+it,zn="__reactContainer$"+it,iu="__reactEvents$"+it,A0="__reactListeners$"+it,z0="__reactHandles$"+it,gf="__reactResources$"+it,Ki="__reactMarker$"+it;function ru(e){delete e[qe],delete e[Pe],delete e[iu],delete e[A0],delete e[z0]}function Rn(e){var t=e[qe];if(t)return t;for(var l=e.parentNode;l;){if(t=l[zn]||l[qe]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Qp(e);e!==null;){if(l=e[qe])return l;e=Qp(e)}return t}e=l,l=e.parentNode}return null}function _n(e){if(e=e[qe]||e[zn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Xi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function On(e){var t=e[gf];return t||(t=e[gf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function rt(e){e[Ki]=!0}var jf=new Set,Sf={};function Va(e,t){Dn(e,t),Dn(e+"Capture",t)}function Dn(e,t){for(Sf[e]=t,e=0;e<t.length;e++)jf.add(t[e])}var R0=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]*$"),Nf={},Mf={};function _0(e){return hl.call(Mf,e)?!0:hl.call(Nf,e)?!1:R0.test(e)?Mf[e]=!0:(Nf[e]=!0,!1)}function fs(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 ms(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 wl(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 Vt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function O0(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 su(e){if(!e._valueTracker){var t=wf(e)?"checked":"value";e._valueTracker=O0(e,t,""+e[t])}}function Cf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=wf(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function hs(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 Zt(e){return e.replace(D0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ou(e,t,l,n,o,c,f,b){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=""+Vt(t)):e.value!==""+Vt(t)&&(e.value=""+Vt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?uu(e,f,Vt(t)):l!=null?uu(e,f,Vt(l)):n!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Vt(b):e.removeAttribute("name")}function Tf(e,t,l,n,o,c,f,b){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)){su(e);return}l=l!=null?""+Vt(l):"",t=t!=null?""+Vt(t):l,b||t===e.value||(e.value=t),e.defaultValue=t}n=n??o,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=b?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),su(e)}function uu(e,t,l){t==="number"&&hs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function kn(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=""+Vt(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 Ef(e,t,l){if(t!=null&&(t=""+Vt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Vt(l):""}function Af(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(u(92));if(ue(n)){if(1<n.length)throw Error(u(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Vt(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),su(e)}function Un(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var k0=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 zf(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||k0.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Rf(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&&zf(e,o,n)}else for(var c in t)t.hasOwnProperty(c)&&zf(e,c,t[c])}function cu(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 U0=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"]]),B0=/^[\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 ps(e){return B0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Cl(){}var du=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bn=null,Ln=null;function _f(e){var t=_n(e);if(t&&(e=t.stateNode)){var l=e[Pe]||null;e:switch(e=t.stateNode,t.type){case"input":if(ou(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="'+Zt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var o=n[Pe]||null;if(!o)throw Error(u(90));ou(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&&Cf(n)}break e;case"textarea":Ef(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&kn(e,!!l.multiple,t,!1)}}}var mu=!1;function Of(e,t,l){if(mu)return e(t,l);mu=!0;try{var n=e(t);return n}finally{if(mu=!1,(Bn!==null||Ln!==null)&&(lo(),Bn&&(t=Bn,e=Ln,Ln=Bn=null,_f(t),e)))for(t=0;t<e.length;t++)_f(e[t])}}function Vi(e,t){var l=e.stateNode;if(l===null)return null;var n=l[Pe]||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 Tl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hu=!1;if(Tl)try{var Zi={};Object.defineProperty(Zi,"passive",{get:function(){hu=!0}}),window.addEventListener("test",Zi,Zi),window.removeEventListener("test",Zi,Zi)}catch{hu=!1}var ia=null,pu=null,xs=null;function Df(){if(xs)return xs;var e,t=pu,l=t.length,n,o="value"in ia?ia.value:ia.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 xs=o.slice(e,1<n?1-n:void 0)}function vs(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 bs(){return!0}function kf(){return!1}function Ct(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 b in e)e.hasOwnProperty(b)&&(l=e[b],this[b]=l?l(c):c[b]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?bs:kf,this.isPropagationStopped=kf,this}return y(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=bs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=bs)},persist:function(){},isPersistent:bs}),t}var Za={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ys=Ct(Za),$i=y({},Za,{view:0,detail:0}),L0=Ct($i),xu,vu,Ji,gs=y({},$i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yu,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!==Ji&&(Ji&&e.type==="mousemove"?(xu=e.screenX-Ji.screenX,vu=e.screenY-Ji.screenY):vu=xu=0,Ji=e),xu)},movementY:function(e){return"movementY"in e?e.movementY:vu}}),Uf=Ct(gs),H0=y({},gs,{dataTransfer:0}),q0=Ct(H0),Q0=y({},$i,{relatedTarget:0}),bu=Ct(Q0),Y0=y({},Za,{animationName:0,elapsedTime:0,pseudoElement:0}),G0=Ct(Y0),K0=y({},Za,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),X0=Ct(K0),V0=y({},Za,{data:0}),Bf=Ct(V0),Z0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$0={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 F0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=J0[e])?!!t[e]:!1}function yu(){return F0}var W0=y({},$i,{key:function(e){if(e.key){var t=Z0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yu,charCode:function(e){return e.type==="keypress"?vs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P0=Ct(W0),I0=y({},gs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lf=Ct(I0),eb=y({},$i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yu}),tb=Ct(eb),lb=y({},Za,{propertyName:0,elapsedTime:0,pseudoElement:0}),ab=Ct(lb),nb=y({},gs,{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}),ib=Ct(nb),rb=y({},Za,{newState:0,oldState:0}),sb=Ct(rb),ob=[9,13,27,32],gu=Tl&&"CompositionEvent"in window,Fi=null;Tl&&"documentMode"in document&&(Fi=document.documentMode);var ub=Tl&&"TextEvent"in window&&!Fi,Hf=Tl&&(!gu||Fi&&8<Fi&&11>=Fi),qf=" ",Qf=!1;function Yf(e,t){switch(e){case"keyup":return ob.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hn=!1;function cb(e,t){switch(e){case"compositionend":return Gf(t);case"keypress":return t.which!==32?null:(Qf=!0,qf);case"textInput":return e=t.data,e===qf&&Qf?null:e;default:return null}}function db(e,t){if(Hn)return e==="compositionend"||!gu&&Yf(e,t)?(e=Df(),xs=pu=ia=null,Hn=!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 Hf&&t.locale!=="ko"?null:t.data;default:return null}}var fb={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 Kf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fb[e.type]:t==="textarea"}function Xf(e,t,l,n){Bn?Ln?Ln.push(n):Ln=[n]:Bn=n,t=uo(t,"onChange"),0<t.length&&(l=new ys("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var Wi=null,Pi=null;function mb(e){Tp(e,0)}function js(e){var t=Xi(e);if(Cf(t))return e}function Vf(e,t){if(e==="change")return t}var Zf=!1;if(Tl){var ju;if(Tl){var Su="oninput"in document;if(!Su){var $f=document.createElement("div");$f.setAttribute("oninput","return;"),Su=typeof $f.oninput=="function"}ju=Su}else ju=!1;Zf=ju&&(!document.documentMode||9<document.documentMode)}function Jf(){Wi&&(Wi.detachEvent("onpropertychange",Ff),Pi=Wi=null)}function Ff(e){if(e.propertyName==="value"&&js(Pi)){var t=[];Xf(t,Pi,e,fu(e)),Of(mb,t)}}function hb(e,t,l){e==="focusin"?(Jf(),Wi=t,Pi=l,Wi.attachEvent("onpropertychange",Ff)):e==="focusout"&&Jf()}function pb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return js(Pi)}function xb(e,t){if(e==="click")return js(t)}function vb(e,t){if(e==="input"||e==="change")return js(t)}function bb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:bb;function Ii(e,t){if(kt(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(!hl.call(t,o)||!kt(e[o],t[o]))return!1}return!0}function Wf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pf(e,t){var l=Wf(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=Wf(l)}}function If(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?If(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function em(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=hs(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=hs(e.document)}return t}function Nu(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 yb=Tl&&"documentMode"in document&&11>=document.documentMode,qn=null,Mu=null,er=null,wu=!1;function tm(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;wu||qn==null||qn!==hs(n)||(n=qn,"selectionStart"in n&&Nu(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}),er&&Ii(er,n)||(er=n,n=uo(Mu,"onSelect"),0<n.length&&(t=new ys("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=qn)))}function $a(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Qn={animationend:$a("Animation","AnimationEnd"),animationiteration:$a("Animation","AnimationIteration"),animationstart:$a("Animation","AnimationStart"),transitionrun:$a("Transition","TransitionRun"),transitionstart:$a("Transition","TransitionStart"),transitioncancel:$a("Transition","TransitionCancel"),transitionend:$a("Transition","TransitionEnd")},Cu={},lm={};Tl&&(lm=document.createElement("div").style,"AnimationEvent"in window||(delete Qn.animationend.animation,delete Qn.animationiteration.animation,delete Qn.animationstart.animation),"TransitionEvent"in window||delete Qn.transitionend.transition);function Ja(e){if(Cu[e])return Cu[e];if(!Qn[e])return e;var t=Qn[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in lm)return Cu[e]=t[l];return e}var am=Ja("animationend"),nm=Ja("animationiteration"),im=Ja("animationstart"),gb=Ja("transitionrun"),jb=Ja("transitionstart"),Sb=Ja("transitioncancel"),rm=Ja("transitionend"),sm=new Map,Tu="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(" ");Tu.push("scrollEnd");function nl(e,t){sm.set(e,t),Va(t,[e])}var Ss=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)},$t=[],Yn=0,Eu=0;function Ns(){for(var e=Yn,t=Eu=Yn=0;t<e;){var l=$t[t];$t[t++]=null;var n=$t[t];$t[t++]=null;var o=$t[t];$t[t++]=null;var c=$t[t];if($t[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&&om(l,o,c)}}function Ms(e,t,l,n){$t[Yn++]=e,$t[Yn++]=t,$t[Yn++]=l,$t[Yn++]=n,Eu|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Au(e,t,l,n){return Ms(e,t,l,n),ws(e)}function Fa(e,t){return Ms(e,null,null,t),ws(e)}function om(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-gt(l),e=c.hiddenUpdates,n=e[o],n===null?e[o]=[t]:n.push(t),t.lane=l|536870912),c):null}function ws(e){if(50<Sr)throw Sr=0,Lc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gn={};function Nb(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 Ut(e,t,l,n){return new Nb(e,t,l,n)}function zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function El(e,t){var l=e.alternate;return l===null?(l=Ut(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 um(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 Cs(e,t,l,n,o,c){var f=0;if(n=e,typeof e=="function")zu(e)&&(f=1);else if(typeof e=="string")f=Ey(e,l,I.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Ut(31,l,t,o),e.elementType=le,e.lanes=c,e;case z:return Wa(l.children,o,c,t);case U:f=8,o|=24;break;case k:return e=Ut(12,l,t,o|2),e.elementType=k,e.lanes=c,e;case V:return e=Ut(13,l,t,o),e.elementType=V,e.lanes=c,e;case P:return e=Ut(19,l,t,o),e.elementType=P,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:f=10;break e;case G:f=9;break e;case H:f=11;break e;case $:f=14;break e;case ee:f=16,n=null;break e}f=29,l=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Ut(f,l,t,o),t.elementType=e,t.type=n,t.lanes=c,t}function Wa(e,t,l,n){return e=Ut(7,e,n,t),e.lanes=l,e}function Ru(e,t,l){return e=Ut(6,e,null,t),e.lanes=l,e}function cm(e){var t=Ut(18,null,null,0);return t.stateNode=e,t}function _u(e,t,l){return t=Ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var dm=new WeakMap;function Jt(e,t){if(typeof e=="object"&&e!==null){var l=dm.get(e);return l!==void 0?l:(t={value:e,source:t,stack:wn(t)},dm.set(e,t),t)}return{value:e,source:t,stack:wn(t)}}var Kn=[],Xn=0,Ts=null,tr=0,Ft=[],Wt=0,ra=null,vl=1,bl="";function Al(e,t){Kn[Xn++]=tr,Kn[Xn++]=Ts,Ts=e,tr=t}function fm(e,t,l){Ft[Wt++]=vl,Ft[Wt++]=bl,Ft[Wt++]=ra,ra=e;var n=vl;e=bl;var o=32-gt(n)-1;n&=~(1<<o),l+=1;var c=32-gt(t)+o;if(30<c){var f=o-o%5;c=(n&(1<<f)-1).toString(32),n>>=f,o-=f,vl=1<<32-gt(t)+o|l<<o|n,bl=c+e}else vl=1<<c|l<<o|n,bl=e}function Ou(e){e.return!==null&&(Al(e,1),fm(e,1,0))}function Du(e){for(;e===Ts;)Ts=Kn[--Xn],Kn[Xn]=null,tr=Kn[--Xn],Kn[Xn]=null;for(;e===ra;)ra=Ft[--Wt],Ft[Wt]=null,bl=Ft[--Wt],Ft[Wt]=null,vl=Ft[--Wt],Ft[Wt]=null}function mm(e,t){Ft[Wt++]=vl,Ft[Wt++]=bl,Ft[Wt++]=ra,vl=t.id,bl=t.overflow,ra=e}var ct=null,Ye=null,we=!1,sa=null,Pt=!1,ku=Error(u(519));function oa(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lr(Jt(t,e)),ku}function hm(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[qe]=e,t[Pe]=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<Mr.length;l++)Se(Mr[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),Tf(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),Af(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||Rp(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=Cl),t=!0):t=!1,t||oa(e,!0)}function pm(e){for(ct=e.return;ct;)switch(ct.tag){case 5:case 31:case 13:Pt=!1;return;case 27:case 3:Pt=!0;return;default:ct=ct.return}}function Vn(e){if(e!==ct)return!1;if(!we)return pm(e),we=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Ic(e.type,e.memoizedProps)),l=!l),l&&Ye&&oa(e),pm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ye=qp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ye=qp(e)}else t===27?(t=Ye,Sa(e.type)?(e=nd,nd=null,Ye=e):Ye=t):Ye=ct?el(e.stateNode.nextSibling):null;return!0}function Pa(){Ye=ct=null,we=!1}function Uu(){var e=sa;return e!==null&&(zt===null?zt=e:zt.push.apply(zt,e),sa=null),e}function lr(e){sa===null?sa=[e]:sa.push(e)}var Bu=M(null),Ia=null,zl=null;function ua(e,t,l){Z(Bu,t._currentValue),t._currentValue=l}function Rl(e){e._currentValue=Bu.current,O(Bu)}function Lu(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 Hu(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 b=c;c=o;for(var S=0;S<t.length;S++)if(b.context===t[S]){c.lanes|=l,b=c.alternate,b!==null&&(b.lanes|=l),Lu(c.return,l,e),n||(f=null);break e}c=b.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),Lu(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 Zn(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 b=o.type;kt(o.pendingProps.value,f.value)||(e!==null?e.push(b):e=[b])}}else if(o===W.current){if(f=o.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Ar):e=[Ar])}o=o.return}e!==null&&Hu(t,e,l,n),t.flags|=262144}function Es(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function en(e){Ia=e,zl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dt(e){return xm(Ia,e)}function As(e,t){return Ia===null&&en(e),xm(e,t)}function xm(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},zl===null){if(e===null)throw Error(u(308));zl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zl=zl.next=t;return l}var Mb=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()})}},wb=a.unstable_scheduleCallback,Cb=a.unstable_NormalPriority,Ie={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qu(){return{controller:new Mb,data:new Map,refCount:0}}function ar(e){e.refCount--,e.refCount===0&&wb(Cb,function(){e.controller.abort()})}var nr=null,Qu=0,$n=0,Jn=null;function Tb(e,t){if(nr===null){var l=nr=[];Qu=0,$n=Kc(),Jn={status:"pending",value:void 0,then:function(n){l.push(n)}}}return Qu++,t.then(vm,vm),t}function vm(){if(--Qu===0&&nr!==null){Jn!==null&&(Jn.status="fulfilled");var e=nr;nr=null,$n=0,Jn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Eb(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=B.S;B.S=function(e,t){tp=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Tb(e,t),bm!==null&&bm(e,t)};var tn=M(null);function Yu(){var e=tn.current;return e!==null?e:Qe.pooledCache}function zs(e,t){t===null?Z(tn,tn.current):Z(tn,t.pool)}function ym(){var e=Yu();return e===null?null:{parent:Ie._currentValue,pool:e}}var Fn=Error(u(460)),Gu=Error(u(474)),Rs=Error(u(542)),_s={then:function(){}};function gm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jm(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Cl,Cl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Nm(e),e;default:if(typeof t.status=="string")t.then(Cl,Cl);else{if(e=Qe,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,Nm(e),e}throw an=t,Fn}}function ln(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(an=l,Fn):l}}var an=null;function Sm(){if(an===null)throw Error(u(459));var e=an;return an=null,e}function Nm(e){if(e===Fn||e===Rs)throw Error(u(483))}var Wn=null,ir=0;function Os(e){var t=ir;return ir+=1,Wn===null&&(Wn=[]),jm(Wn,e,t)}function rr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ds(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 Mm(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=El(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 b(T,w,R,Q){return w===null||w.tag!==6?(w=Ru(R,T.mode,Q),w.return=T,w):(w=o(w,R),w.return=T,w)}function S(T,w,R,Q){var de=R.type;return de===z?q(T,w,R.props.children,Q,R.key):w!==null&&(w.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ee&&ln(de)===w.type)?(w=o(w,R.props),rr(w,R),w.return=T,w):(w=Cs(R.type,R.key,R.props,null,T.mode,Q),rr(w,R),w.return=T,w)}function _(T,w,R,Q){return w===null||w.tag!==4||w.stateNode.containerInfo!==R.containerInfo||w.stateNode.implementation!==R.implementation?(w=_u(R,T.mode,Q),w.return=T,w):(w=o(w,R.children||[]),w.return=T,w)}function q(T,w,R,Q,de){return w===null||w.tag!==7?(w=Wa(R,T.mode,Q,de),w.return=T,w):(w=o(w,R),w.return=T,w)}function Y(T,w,R){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Ru(""+w,T.mode,R),w.return=T,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case C:return R=Cs(w.type,w.key,w.props,null,T.mode,R),rr(R,w),R.return=T,R;case A:return w=_u(w,T.mode,R),w.return=T,w;case ee:return w=ln(w),Y(T,w,R)}if(ue(w)||me(w))return w=Wa(w,T.mode,R,null),w.return=T,w;if(typeof w.then=="function")return Y(T,Os(w),R);if(w.$$typeof===K)return Y(T,As(T,w),R);Ds(T,w)}return null}function D(T,w,R,Q){var de=w!==null?w.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return de!==null?null:b(T,w,""+R,Q);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case C:return R.key===de?S(T,w,R,Q):null;case A:return R.key===de?_(T,w,R,Q):null;case ee:return R=ln(R),D(T,w,R,Q)}if(ue(R)||me(R))return de!==null?null:q(T,w,R,Q,null);if(typeof R.then=="function")return D(T,w,Os(R),Q);if(R.$$typeof===K)return D(T,w,As(T,R),Q);Ds(T,R)}return null}function L(T,w,R,Q,de){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return T=T.get(R)||null,b(w,T,""+Q,de);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case C:return T=T.get(Q.key===null?R:Q.key)||null,S(w,T,Q,de);case A:return T=T.get(Q.key===null?R:Q.key)||null,_(w,T,Q,de);case ee:return Q=ln(Q),L(T,w,R,Q,de)}if(ue(Q)||me(Q))return T=T.get(R)||null,q(w,T,Q,de,null);if(typeof Q.then=="function")return L(T,w,R,Os(Q),de);if(Q.$$typeof===K)return L(T,w,R,As(w,Q),de);Ds(w,Q)}return null}function ne(T,w,R,Q){for(var de=null,Ae=null,se=w,ve=w=0,Me=null;se!==null&&ve<R.length;ve++){se.index>ve?(Me=se,se=null):Me=se.sibling;var ze=D(T,se,R[ve],Q);if(ze===null){se===null&&(se=Me);break}e&&se&&ze.alternate===null&&t(T,se),w=c(ze,w,ve),Ae===null?de=ze:Ae.sibling=ze,Ae=ze,se=Me}if(ve===R.length)return l(T,se),we&&Al(T,ve),de;if(se===null){for(;ve<R.length;ve++)se=Y(T,R[ve],Q),se!==null&&(w=c(se,w,ve),Ae===null?de=se:Ae.sibling=se,Ae=se);return we&&Al(T,ve),de}for(se=n(se);ve<R.length;ve++)Me=L(se,T,ve,R[ve],Q),Me!==null&&(e&&Me.alternate!==null&&se.delete(Me.key===null?ve:Me.key),w=c(Me,w,ve),Ae===null?de=Me:Ae.sibling=Me,Ae=Me);return e&&se.forEach(function(Ta){return t(T,Ta)}),we&&Al(T,ve),de}function fe(T,w,R,Q){if(R==null)throw Error(u(151));for(var de=null,Ae=null,se=w,ve=w=0,Me=null,ze=R.next();se!==null&&!ze.done;ve++,ze=R.next()){se.index>ve?(Me=se,se=null):Me=se.sibling;var Ta=D(T,se,ze.value,Q);if(Ta===null){se===null&&(se=Me);break}e&&se&&Ta.alternate===null&&t(T,se),w=c(Ta,w,ve),Ae===null?de=Ta:Ae.sibling=Ta,Ae=Ta,se=Me}if(ze.done)return l(T,se),we&&Al(T,ve),de;if(se===null){for(;!ze.done;ve++,ze=R.next())ze=Y(T,ze.value,Q),ze!==null&&(w=c(ze,w,ve),Ae===null?de=ze:Ae.sibling=ze,Ae=ze);return we&&Al(T,ve),de}for(se=n(se);!ze.done;ve++,ze=R.next())ze=L(se,T,ve,ze.value,Q),ze!==null&&(e&&ze.alternate!==null&&se.delete(ze.key===null?ve:ze.key),w=c(ze,w,ve),Ae===null?de=ze:Ae.sibling=ze,Ae=ze);return e&&se.forEach(function(Hy){return t(T,Hy)}),we&&Al(T,ve),de}function Le(T,w,R,Q){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 de=R.key;w!==null;){if(w.key===de){if(de=R.type,de===z){if(w.tag===7){l(T,w.sibling),Q=o(w,R.props.children),Q.return=T,T=Q;break e}}else if(w.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===ee&&ln(de)===w.type){l(T,w.sibling),Q=o(w,R.props),rr(Q,R),Q.return=T,T=Q;break e}l(T,w);break}else t(T,w);w=w.sibling}R.type===z?(Q=Wa(R.props.children,T.mode,Q,R.key),Q.return=T,T=Q):(Q=Cs(R.type,R.key,R.props,null,T.mode,Q),rr(Q,R),Q.return=T,T=Q)}return f(T);case A:e:{for(de=R.key;w!==null;){if(w.key===de)if(w.tag===4&&w.stateNode.containerInfo===R.containerInfo&&w.stateNode.implementation===R.implementation){l(T,w.sibling),Q=o(w,R.children||[]),Q.return=T,T=Q;break e}else{l(T,w);break}else t(T,w);w=w.sibling}Q=_u(R,T.mode,Q),Q.return=T,T=Q}return f(T);case ee:return R=ln(R),Le(T,w,R,Q)}if(ue(R))return ne(T,w,R,Q);if(me(R)){if(de=me(R),typeof de!="function")throw Error(u(150));return R=de.call(R),fe(T,w,R,Q)}if(typeof R.then=="function")return Le(T,w,Os(R),Q);if(R.$$typeof===K)return Le(T,w,As(T,R),Q);Ds(T,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,w!==null&&w.tag===6?(l(T,w.sibling),Q=o(w,R),Q.return=T,T=Q):(l(T,w),Q=Ru(R,T.mode,Q),Q.return=T,T=Q),f(T)):l(T,w)}return function(T,w,R,Q){try{ir=0;var de=Le(T,w,R,Q);return Wn=null,de}catch(se){if(se===Fn||se===Rs)throw se;var Ae=Ut(29,se,null,T.mode);return Ae.lanes=Q,Ae.return=T,Ae}finally{}}}var nn=Mm(!0),wm=Mm(!1),ca=!1;function Ku(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xu(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 da(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fa(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=ws(e),om(e,null,l),t}return Ms(e,n,t,l),ws(e)}function sr(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,na(e,l)}}function Vu(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 Zu=!1;function or(){if(Zu){var e=Jn;if(e!==null)throw e}}function ur(e,t,l,n){Zu=!1;var o=e.updateQueue;ca=!1;var c=o.firstBaseUpdate,f=o.lastBaseUpdate,b=o.shared.pending;if(b!==null){o.shared.pending=null;var S=b,_=S.next;S.next=null,f===null?c=_:f.next=_,f=S;var q=e.alternate;q!==null&&(q=q.updateQueue,b=q.lastBaseUpdate,b!==f&&(b===null?q.firstBaseUpdate=_:b.next=_,q.lastBaseUpdate=S))}if(c!==null){var Y=o.baseState;f=0,q=_=S=null,b=c;do{var D=b.lane&-536870913,L=D!==b.lane;if(L?(Ne&D)===D:(n&D)===D){D!==0&&D===$n&&(Zu=!0),q!==null&&(q=q.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ne=e,fe=b;D=t;var Le=l;switch(fe.tag){case 1:if(ne=fe.payload,typeof ne=="function"){Y=ne.call(Le,Y,D);break e}Y=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=fe.payload,D=typeof ne=="function"?ne.call(Le,Y,D):ne,D==null)break e;Y=y({},Y,D);break e;case 2:ca=!0}}D=b.callback,D!==null&&(e.flags|=64,L&&(e.flags|=8192),L=o.callbacks,L===null?o.callbacks=[D]:L.push(D))}else L={lane:D,tag:b.tag,payload:b.payload,callback:b.callback,next:null},q===null?(_=q=L,S=Y):q=q.next=L,f|=D;if(b=b.next,b===null){if(b=o.shared.pending,b===null)break;L=b,b=L.next,L.next=null,o.lastBaseUpdate=L,o.shared.pending=null}}while(!0);q===null&&(S=Y),o.baseState=S,o.firstBaseUpdate=_,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),va|=f,e.lanes=f,e.memoizedState=Y}}function Cm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Tm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Cm(l[e],t)}var Pn=M(null),ks=M(0);function Em(e,t){e=ql,Z(ks,e),Z(Pn,t),ql=e|t.baseLanes}function $u(){Z(ks,ql),Z(Pn,Pn.current)}function Ju(){ql=ks.current,O(Pn),O(ks)}var Bt=M(null),It=null;function ma(e){var t=e.alternate;Z(Fe,Fe.current&1),Z(Bt,e),It===null&&(t===null||Pn.current!==null||t.memoizedState!==null)&&(It=e)}function Fu(e){Z(Fe,Fe.current),Z(Bt,e),It===null&&(It=e)}function Am(e){e.tag===22?(Z(Fe,Fe.current),Z(Bt,e),It===null&&(It=e)):ha()}function ha(){Z(Fe,Fe.current),Z(Bt,Bt.current)}function Lt(e){O(Bt),It===e&&(It=null),O(Fe)}var Fe=M(0);function Us(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||ld(l)||ad(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 _l=0,xe=null,Ue=null,et=null,Bs=!1,In=!1,rn=!1,Ls=0,cr=0,ei=null,Ab=0;function Ze(){throw Error(u(321))}function Wu(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!kt(e[l],t[l]))return!1;return!0}function Pu(e,t,l,n,o,c){return _l=c,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?fh:mc,rn=!1,c=l(n,o),rn=!1,In&&(c=Rm(t,l,n,o)),zm(e),c}function zm(e){B.H=mr;var t=Ue!==null&&Ue.next!==null;if(_l=0,et=Ue=xe=null,Bs=!1,cr=0,ei=null,t)throw Error(u(300));e===null||tt||(e=e.dependencies,e!==null&&Es(e)&&(tt=!0))}function Rm(e,t,l,n){xe=e;var o=0;do{if(In&&(ei=null),cr=0,In=!1,25<=o)throw Error(u(301));if(o+=1,et=Ue=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}B.H=mh,c=t(l,n)}while(In);return c}function zb(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?dr(t):t,e=e.useState()[0],(Ue!==null?Ue.memoizedState:null)!==e&&(xe.flags|=1024),t}function Iu(){var e=Ls!==0;return Ls=0,e}function ec(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function tc(e){if(Bs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bs=!1}_l=0,et=Ue=xe=null,In=!1,cr=Ls=0,ei=null}function jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?xe.memoizedState=et=e:et=et.next=e,et}function We(){if(Ue===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=et===null?xe.memoizedState:et.next;if(t!==null)et=t,Ue=e;else{if(e===null)throw xe.alternate===null?Error(u(467)):Error(u(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},et===null?xe.memoizedState=et=e:et=et.next=e}return et}function Hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dr(e){var t=cr;return cr+=1,ei===null&&(ei=[]),e=jm(ei,e,t),t=xe,(et===null?t.memoizedState:et.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?fh:mc),e}function qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return dr(e);if(e.$$typeof===K)return dt(e)}throw Error(u(438,String(e)))}function lc(e){var t=null,l=xe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=xe.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=Hs(),xe.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]=oe;return t.index++,l}function Ol(e,t){return typeof t=="function"?t(e):t}function Qs(e){var t=We();return ac(t,Ue,e)}function ac(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 b=f=null,S=null,_=t,q=!1;do{var Y=_.lane&-536870913;if(Y!==_.lane?(Ne&Y)===Y:(_l&Y)===Y){var D=_.revertLane;if(D===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),Y===$n&&(q=!0);else if((_l&D)===D){_=_.next,D===$n&&(q=!0);continue}else Y={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},S===null?(b=S=Y,f=c):S=S.next=Y,xe.lanes|=D,va|=D;Y=_.action,rn&&l(c,Y),c=_.hasEagerState?_.eagerState:l(c,Y)}else D={lane:Y,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},S===null?(b=S=D,f=c):S=S.next=D,xe.lanes|=Y,va|=Y;_=_.next}while(_!==null&&_!==t);if(S===null?f=c:S.next=b,!kt(c,e.memoizedState)&&(tt=!0,q&&(l=Jn,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 nc(e){var t=We(),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);kt(c,t.memoizedState)||(tt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),l.lastRenderedState=c}return[c,n]}function _m(e,t,l){var n=xe,o=We(),c=we;if(c){if(l===void 0)throw Error(u(407));l=l()}else l=t();var f=!kt((Ue||o).memoizedState,l);if(f&&(o.memoizedState=l,tt=!0),o=o.queue,sc(km.bind(null,n,o,e),[e]),o.getSnapshot!==t||f||et!==null&&et.memoizedState.tag&1){if(n.flags|=2048,ti(9,{destroy:void 0},Dm.bind(null,n,o,l,t),null),Qe===null)throw Error(u(349));c||(_l&127)!==0||Om(n,t,l)}return l}function Om(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=xe.updateQueue,t===null?(t=Hs(),xe.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,Um(t)&&Bm(e)}function km(e,t,l){return l(function(){Um(t)&&Bm(e)})}function Um(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!kt(e,l)}catch{return!0}}function Bm(e){var t=Fa(e,2);t!==null&&Rt(t,e,2)}function ic(e){var t=jt();if(typeof e=="function"){var l=e;if(e=l(),rn){pl(!0);try{l()}finally{pl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:e},t}function Lm(e,t,l,n){return e.baseState=l,ac(e,Ue,typeof n=="function"?n:Ol)}function Rb(e,t,l,n,o){if(Ks(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)}};B.T!==null?l(!0):c.isTransition=!1,n(c),l=t.pending,l===null?(c.next=t.pending=c,Hm(t,c)):(c.next=l.next,t.pending=l.next=c)}}function Hm(e,t){var l=t.action,n=t.payload,o=e.state;if(t.isTransition){var c=B.T,f={};B.T=f;try{var b=l(o,n),S=B.S;S!==null&&S(f,b),qm(e,t,b)}catch(_){rc(e,t,_)}finally{c!==null&&f.types!==null&&(c.types=f.types),B.T=c}}else try{c=l(o,n),qm(e,t,c)}catch(_){rc(e,t,_)}}function qm(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Qm(e,t,n)},function(n){return rc(e,t,n)}):Qm(e,t,l)}function Qm(e,t,l){t.status="fulfilled",t.value=l,Ym(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Hm(e,l)))}function rc(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Ym(t),t=t.next;while(t!==n)}e.action=null}function Ym(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Gm(e,t){return t}function Km(e,t){if(we){var l=Qe.formState;if(l!==null){e:{var n=xe;if(we){if(Ye){t:{for(var o=Ye,c=Pt;o.nodeType!==8;){if(!c){o=null;break t}if(o=el(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Ye=el(o.nextSibling),n=o.data==="F!";break e}}oa(n)}n=!1}n&&(t=l[0])}}return l=jt(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gm,lastRenderedState:t},l.queue=n,l=uh.bind(null,xe,n),n.dispatch=l,n=ic(!1),c=fc.bind(null,xe,!1,n.queue),n=jt(),o={state:t,dispatch:null,action:e,pending:null},n.queue=o,l=Rb.bind(null,xe,o,c,l),o.dispatch=l,n.memoizedState=e,[t,l,!1]}function Xm(e){var t=We();return Vm(t,Ue,e)}function Vm(e,t,l){if(t=ac(e,t,Gm)[0],e=Qs(Ol)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=dr(t)}catch(f){throw f===Fn?Rs:f}else n=t;t=We();var o=t.queue,c=o.dispatch;return l!==t.memoizedState&&(xe.flags|=2048,ti(9,{destroy:void 0},_b.bind(null,o,l),null)),[n,c,e]}function _b(e,t){e.action=t}function Zm(e){var t=We(),l=Ue;if(l!==null)return Vm(t,l,e);We(),t=t.memoizedState,l=We();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function ti(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Hs(),xe.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 $m(){return We().memoizedState}function Ys(e,t,l,n){var o=jt();xe.flags|=e,o.memoizedState=ti(1|t,{destroy:void 0},l,n===void 0?null:n)}function Gs(e,t,l,n){var o=We();n=n===void 0?null:n;var c=o.memoizedState.inst;Ue!==null&&n!==null&&Wu(n,Ue.memoizedState.deps)?o.memoizedState=ti(t,c,l,n):(xe.flags|=e,o.memoizedState=ti(1|t,c,l,n))}function Jm(e,t){Ys(8390656,8,e,t)}function sc(e,t){Gs(2048,8,e,t)}function Ob(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Hs(),xe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Fm(e){var t=We().memoizedState;return Ob({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Wm(e,t){return Gs(4,2,e,t)}function Pm(e,t){return Gs(4,4,e,t)}function Im(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 eh(e,t,l){l=l!=null?l.concat([e]):null,Gs(4,4,Im.bind(null,t,e),l)}function oc(){}function th(e,t){var l=We();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&Wu(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function lh(e,t){var l=We();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&Wu(t,n[1]))return n[0];if(n=e(),rn){pl(!0);try{e()}finally{pl(!1)}}return l.memoizedState=[n,t],n}function uc(e,t,l){return l===void 0||(_l&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=ap(),xe.lanes|=e,va|=e,l)}function ah(e,t,l,n){return kt(l,t)?l:Pn.current!==null?(e=uc(e,l,n),kt(e,t)||(tt=!0),e):(_l&42)===0||(_l&1073741824)!==0&&(Ne&261930)===0?(tt=!0,e.memoizedState=l):(e=ap(),xe.lanes|=e,va|=e,t)}function nh(e,t,l,n,o){var c=J.p;J.p=c!==0&&8>c?c:8;var f=B.T,b={};B.T=b,fc(e,!1,t,l);try{var S=o(),_=B.S;if(_!==null&&_(b,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var q=Eb(S,n);fr(e,t,q,Qt(e))}else fr(e,t,n,Qt(e))}catch(Y){fr(e,t,{then:function(){},status:"rejected",reason:Y},Qt())}finally{J.p=c,f!==null&&b.types!==null&&(f.types=b.types),B.T=f}}function Db(){}function cc(e,t,l,n){if(e.tag!==5)throw Error(u(476));var o=ih(e).queue;nh(e,o,t,re,l===null?Db:function(){return rh(e),l(n)})}function ih(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:re},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rh(e){var t=ih(e);t.next===null&&(t=e.alternate.memoizedState),fr(e,t.next.queue,{},Qt())}function dc(){return dt(Ar)}function sh(){return We().memoizedState}function oh(){return We().memoizedState}function kb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Qt();e=da(l);var n=fa(t,e,l);n!==null&&(Rt(n,t,l),sr(n,t,l)),t={cache:qu()},e.payload=t;return}t=t.return}}function Ub(e,t,l){var n=Qt();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ks(e)?ch(t,l):(l=Au(e,t,l,n),l!==null&&(Rt(l,e,n),dh(l,t,n)))}function uh(e,t,l){var n=Qt();fr(e,t,l,n)}function fr(e,t,l,n){var o={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ks(e))ch(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,b=c(f,l);if(o.hasEagerState=!0,o.eagerState=b,kt(b,f))return Ms(e,t,o,0),Qe===null&&Ns(),!1}catch{}finally{}if(l=Au(e,t,o,n),l!==null)return Rt(l,e,n),dh(l,t,n),!0}return!1}function fc(e,t,l,n){if(n={lane:2,revertLane:Kc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ks(e)){if(t)throw Error(u(479))}else t=Au(e,l,n,2),t!==null&&Rt(t,e,2)}function Ks(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function ch(e,t){In=Bs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function dh(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,na(e,l)}}var mr={readContext:dt,use:qs,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};mr.useEffectEvent=Ze;var fh={readContext:dt,use:qs,useCallback:function(e,t){return jt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:Jm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ys(4194308,4,Im.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ys(4194308,4,e,t)},useInsertionEffect:function(e,t){Ys(4,2,e,t)},useMemo:function(e,t){var l=jt();t=t===void 0?null:t;var n=e();if(rn){pl(!0);try{e()}finally{pl(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=jt();if(l!==void 0){var o=l(t);if(rn){pl(!0);try{l(t)}finally{pl(!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=Ub.bind(null,xe,e),[n.memoizedState,e]},useRef:function(e){var t=jt();return e={current:e},t.memoizedState=e},useState:function(e){e=ic(e);var t=e.queue,l=uh.bind(null,xe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:oc,useDeferredValue:function(e,t){var l=jt();return uc(l,e,t)},useTransition:function(){var e=ic(!1);return e=nh.bind(null,xe,e.queue,!0,!1),jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=xe,o=jt();if(we){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Qe===null)throw Error(u(349));(Ne&127)!==0||Om(n,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Jm(km.bind(null,n,c,e),[e]),n.flags|=2048,ti(9,{destroy:void 0},Dm.bind(null,n,c,l,t),null),l},useId:function(){var e=jt(),t=Qe.identifierPrefix;if(we){var l=bl,n=vl;l=(n&~(1<<32-gt(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ls++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Ab++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dc,useFormState:Km,useActionState:Km,useOptimistic:function(e){var t=jt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=fc.bind(null,xe,!0,l),l.dispatch=t,[e,t]},useMemoCache:lc,useCacheRefresh:function(){return jt().memoizedState=kb.bind(null,xe)},useEffectEvent:function(e){var t=jt(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},mc={readContext:dt,use:qs,useCallback:th,useContext:dt,useEffect:sc,useImperativeHandle:eh,useInsertionEffect:Wm,useLayoutEffect:Pm,useMemo:lh,useReducer:Qs,useRef:$m,useState:function(){return Qs(Ol)},useDebugValue:oc,useDeferredValue:function(e,t){var l=We();return ah(l,Ue.memoizedState,e,t)},useTransition:function(){var e=Qs(Ol)[0],t=We().memoizedState;return[typeof e=="boolean"?e:dr(e),t]},useSyncExternalStore:_m,useId:sh,useHostTransitionStatus:dc,useFormState:Xm,useActionState:Xm,useOptimistic:function(e,t){var l=We();return Lm(l,Ue,e,t)},useMemoCache:lc,useCacheRefresh:oh};mc.useEffectEvent=Fm;var mh={readContext:dt,use:qs,useCallback:th,useContext:dt,useEffect:sc,useImperativeHandle:eh,useInsertionEffect:Wm,useLayoutEffect:Pm,useMemo:lh,useReducer:nc,useRef:$m,useState:function(){return nc(Ol)},useDebugValue:oc,useDeferredValue:function(e,t){var l=We();return Ue===null?uc(l,e,t):ah(l,Ue.memoizedState,e,t)},useTransition:function(){var e=nc(Ol)[0],t=We().memoizedState;return[typeof e=="boolean"?e:dr(e),t]},useSyncExternalStore:_m,useId:sh,useHostTransitionStatus:dc,useFormState:Zm,useActionState:Zm,useOptimistic:function(e,t){var l=We();return Ue!==null?Lm(l,Ue,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:lc,useCacheRefresh:oh};mh.useEffectEvent=Fm;function hc(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:y({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var pc={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=Qt(),o=da(n);o.payload=t,l!=null&&(o.callback=l),t=fa(e,o,n),t!==null&&(Rt(t,e,n),sr(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=Qt(),o=da(n);o.tag=1,o.payload=t,l!=null&&(o.callback=l),t=fa(e,o,n),t!==null&&(Rt(t,e,n),sr(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Qt(),n=da(l);n.tag=2,t!=null&&(n.callback=t),t=fa(e,n,l),t!==null&&(Rt(t,e,l),sr(t,e,l))}};function hh(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?!Ii(l,n)||!Ii(o,c):!0}function ph(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&&pc.enqueueReplaceState(t,t.state,null)}function sn(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=y({},l));for(var o in e)l[o]===void 0&&(l[o]=e[o])}return l}function xh(e){Ss(e)}function vh(e){console.error(e)}function bh(e){Ss(e)}function Xs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function yh(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 xc(e,t,l){return l=da(l),l.tag=3,l.payload={element:null},l.callback=function(){Xs(e,t)},l}function gh(e){return e=da(e),e.tag=3,e}function jh(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(){yh(t,l,n)}}var f=l.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){yh(t,l,n),typeof o!="function"&&(ba===null?ba=new Set([this]):ba.add(this));var b=n.stack;this.componentDidCatch(n.value,{componentStack:b!==null?b:""})})}function Bb(e,t,l,n,o){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Zn(t,l,o,!0),l=Bt.current,l!==null){switch(l.tag){case 31:case 13:return It===null?ao():l.alternate===null&&$e===0&&($e=3),l.flags&=-257,l.flags|=65536,l.lanes=o,n===_s?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),Qc(e,n,o)),!1;case 22:return l.flags|=65536,n===_s?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)),Qc(e,n,o)),!1}throw Error(u(435,l.tag))}return Qc(e,n,o),ao(),!1}if(we)return t=Bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,n!==ku&&(e=Error(u(422),{cause:n}),lr(Jt(e,l)))):(n!==ku&&(t=Error(u(423),{cause:n}),lr(Jt(t,l))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,n=Jt(n,l),o=xc(e.stateNode,n,o),Vu(e,o),$e!==4&&($e=2)),!1;var c=Error(u(520),{cause:n});if(c=Jt(c,l),jr===null?jr=[c]:jr.push(c),$e!==4&&($e=2),t===null)return!0;n=Jt(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=o&-o,l.lanes|=e,e=xc(l.stateNode,n,e),Vu(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"&&(ba===null||!ba.has(c))))return l.flags|=65536,o&=-o,l.lanes|=o,o=gh(o),jh(o,e,l,n),Vu(l,o),!1}l=l.return}while(l!==null);return!1}var vc=Error(u(461)),tt=!1;function ft(e,t,l,n){t.child=e===null?wm(t,null,l,n):nn(t,e.child,l,n)}function Sh(e,t,l,n,o){l=l.render;var c=t.ref;if("ref"in n){var f={};for(var b in n)b!=="ref"&&(f[b]=n[b])}else f=n;return en(t),n=Pu(e,t,l,f,c,o),b=Iu(),e!==null&&!tt?(ec(e,t,o),Dl(e,t,o)):(we&&b&&Ou(t),t.flags|=1,ft(e,t,n,o),t.child)}function Nh(e,t,l,n,o){if(e===null){var c=l.type;return typeof c=="function"&&!zu(c)&&c.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=c,Mh(e,t,c,n,o)):(e=Cs(l.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!wc(e,o)){var f=c.memoizedProps;if(l=l.compare,l=l!==null?l:Ii,l(f,n)&&e.ref===t.ref)return Dl(e,t,o)}return t.flags|=1,e=El(c,n),e.ref=t.ref,e.return=t,t.child=e}function Mh(e,t,l,n,o){if(e!==null){var c=e.memoizedProps;if(Ii(c,n)&&e.ref===t.ref)if(tt=!1,t.pendingProps=n=c,wc(e,o))(e.flags&131072)!==0&&(tt=!0);else return t.lanes=e.lanes,Dl(e,t,o)}return bc(e,t,l,n,o)}function wh(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 Ch(e,t,c,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&zs(t,c!==null?c.cachePool:null),c!==null?Em(t,c):$u(),Am(t);else return n=t.lanes=536870912,Ch(e,t,c!==null?c.baseLanes|l:l,l,n)}else c!==null?(zs(t,c.cachePool),Em(t,c),ha(),t.memoizedState=null):(e!==null&&zs(t,null),$u(),ha());return ft(e,t,o,l),t.child}function hr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ch(e,t,l,n,o){var c=Yu();return c=c===null?null:{parent:Ie._currentValue,pool:c},t.memoizedState={baseLanes:l,cachePool:c},e!==null&&zs(t,null),$u(),Am(t),e!==null&&Zn(e,t,n,!0),t.childLanes=o,null}function Vs(e,t){return t=$s({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Th(e,t,l){return nn(t,e.child,null,l),e=Vs(t,t.pendingProps),e.flags|=2,Lt(t),t.memoizedState=null,e}function Lb(e,t,l){var n=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(n.mode==="hidden")return e=Vs(t,n),t.lanes=536870912,hr(null,e);if(Fu(t),(e=Ye)?(e=Hp(e,Pt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:vl,overflow:bl}:null,retryLane:536870912,hydrationErrors:null},l=cm(e),l.return=t,t.child=l,ct=t,Ye=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return Vs(t,n)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(Fu(t),o)if(t.flags&256)t.flags&=-257,t=Th(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(tt||Zn(e,t,l,!1),o=(l&e.childLanes)!==0,tt||o){if(n=Qe,n!==null&&(f=Qi(n,l),f!==0&&f!==c.retryLane))throw c.retryLane=f,Fa(e,f),Rt(n,e,f),vc;ao(),t=Th(e,t,l)}else e=c.treeContext,Ye=el(f.nextSibling),ct=t,we=!0,sa=null,Pt=!1,e!==null&&mm(t,e),t=Vs(t,n),t.flags|=4096;return t}return e=El(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Zs(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 bc(e,t,l,n,o){return en(t),l=Pu(e,t,l,n,void 0,o),n=Iu(),e!==null&&!tt?(ec(e,t,o),Dl(e,t,o)):(we&&n&&Ou(t),t.flags|=1,ft(e,t,l,o),t.child)}function Eh(e,t,l,n,o,c){return en(t),t.updateQueue=null,l=Rm(t,n,l,o),zm(e),n=Iu(),e!==null&&!tt?(ec(e,t,c),Dl(e,t,c)):(we&&n&&Ou(t),t.flags|=1,ft(e,t,l,c),t.child)}function Ah(e,t,l,n,o){if(en(t),t.stateNode===null){var c=Gn,f=l.contextType;typeof f=="object"&&f!==null&&(c=dt(f)),c=new l(n,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=pc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=n,c.state=t.memoizedState,c.refs={},Ku(t),f=l.contextType,c.context=typeof f=="object"&&f!==null?dt(f):Gn,c.state=t.memoizedState,f=l.getDerivedStateFromProps,typeof f=="function"&&(hc(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&&pc.enqueueReplaceState(c,c.state,null),ur(t,n,c,o),or(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){c=t.stateNode;var b=t.memoizedProps,S=sn(l,b);c.props=S;var _=c.context,q=l.contextType;f=Gn,typeof q=="object"&&q!==null&&(f=dt(q));var Y=l.getDerivedStateFromProps;q=typeof Y=="function"||typeof c.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(b||_!==f)&&ph(t,c,n,f),ca=!1;var D=t.memoizedState;c.state=D,ur(t,n,c,o),or(),_=t.memoizedState,b||D!==_||ca?(typeof Y=="function"&&(hc(t,l,Y,n),_=t.memoizedState),(S=ca||hh(t,l,S,n,D,_,f))?(q||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=_),c.props=n,c.state=_,c.context=f,n=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{c=t.stateNode,Xu(e,t),f=t.memoizedProps,q=sn(l,f),c.props=q,Y=t.pendingProps,D=c.context,_=l.contextType,S=Gn,typeof _=="object"&&_!==null&&(S=dt(_)),b=l.getDerivedStateFromProps,(_=typeof b=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==Y||D!==S)&&ph(t,c,n,S),ca=!1,D=t.memoizedState,c.state=D,ur(t,n,c,o),or();var L=t.memoizedState;f!==Y||D!==L||ca||e!==null&&e.dependencies!==null&&Es(e.dependencies)?(typeof b=="function"&&(hc(t,l,b,n),L=t.memoizedState),(q=ca||hh(t,l,q,n,D,L,S)||e!==null&&e.dependencies!==null&&Es(e.dependencies))?(_||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(n,L,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(n,L,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=L),c.props=n,c.state=L,c.context=S,n=q):(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,Zs(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=nn(t,e.child,null,o),t.child=nn(t,null,l,o)):ft(e,t,l,o),t.memoizedState=c.state,e=t.child):e=Dl(e,t,o),e}function zh(e,t,l,n){return Pa(),t.flags|=256,ft(e,t,l,n),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ym()}}function jc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=qt),e}function Rh(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:(Fe.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(o?ma(t):ha(),(e=Ye)?(e=Hp(e,Pt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:vl,overflow:bl}:null,retryLane:536870912,hydrationErrors:null},l=cm(e),l.return=t,t.child=l,ct=t,Ye=null)):e=null,e===null)throw oa(t);return ad(e)?t.lanes=32:t.lanes=536870912,null}var b=n.children;return n=n.fallback,o?(ha(),o=t.mode,b=$s({mode:"hidden",children:b},o),n=Wa(n,o,l,null),b.return=t,n.return=t,b.sibling=n,t.child=b,n=t.child,n.memoizedState=gc(l),n.childLanes=jc(e,f,l),t.memoizedState=yc,hr(null,n)):(ma(t),Sc(t,b))}var S=e.memoizedState;if(S!==null&&(b=S.dehydrated,b!==null)){if(c)t.flags&256?(ma(t),t.flags&=-257,t=Nc(e,t,l)):t.memoizedState!==null?(ha(),t.child=e.child,t.flags|=128,t=null):(ha(),b=n.fallback,o=t.mode,n=$s({mode:"visible",children:n.children},o),b=Wa(b,o,l,null),b.flags|=2,n.return=t,b.return=t,n.sibling=b,t.child=n,nn(t,e.child,null,l),n=t.child,n.memoizedState=gc(l),n.childLanes=jc(e,f,l),t.memoizedState=yc,t=hr(null,n));else if(ma(t),ad(b)){if(f=b.nextSibling&&b.nextSibling.dataset,f)var _=f.dgst;f=_,n=Error(u(419)),n.stack="",n.digest=f,lr({value:n,source:null,stack:null}),t=Nc(e,t,l)}else if(tt||Zn(e,t,l,!1),f=(l&e.childLanes)!==0,tt||f){if(f=Qe,f!==null&&(n=Qi(f,l),n!==0&&n!==S.retryLane))throw S.retryLane=n,Fa(e,n),Rt(f,e,n),vc;ld(b)||ao(),t=Nc(e,t,l)}else ld(b)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Ye=el(b.nextSibling),ct=t,we=!0,sa=null,Pt=!1,e!==null&&mm(t,e),t=Sc(t,n.children),t.flags|=4096);return t}return o?(ha(),b=n.fallback,o=t.mode,S=e.child,_=S.sibling,n=El(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,_!==null?b=El(_,b):(b=Wa(b,o,l,null),b.flags|=2),b.return=t,n.return=t,n.sibling=b,t.child=n,hr(null,n),n=t.child,b=e.child.memoizedState,b===null?b=gc(l):(o=b.cachePool,o!==null?(S=Ie._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=ym(),b={baseLanes:b.baseLanes|l,cachePool:o}),n.memoizedState=b,n.childLanes=jc(e,f,l),t.memoizedState=yc,hr(e.child,n)):(ma(t),l=e.child,e=l.sibling,l=El(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 Sc(e,t){return t=$s({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function $s(e,t){return e=Ut(22,e,null,t),e.lanes=0,e}function Nc(e,t,l){return nn(t,e.child,null,l),e=Sc(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),Lu(e.return,t,l)}function Mc(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 Oh(e,t,l){var n=t.pendingProps,o=n.revealOrder,c=n.tail;n=n.children;var f=Fe.current,b=(f&2)!==0;if(b?(f=f&1|2,t.flags|=128):f&=1,Z(Fe,f),ft(e,t,n,l),n=we?tr:0,!b&&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&&Us(e)===null&&(o=l),l=l.sibling;l=o,l===null?(o=t.child,t.child=null):(o=l.sibling,l.sibling=null),Mc(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&&Us(e)===null){t.child=o;break}e=o.sibling,o.sibling=l,l=o,o=e}Mc(t,!0,l,null,c,n);break;case"together":Mc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Dl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),va|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Zn(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=El(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=El(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Es(e)))}function Hb(e,t,l){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),ua(t,Ie,e.memoizedState.cache),Pa();break;case 27:case 5:ml(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fu(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ma(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Rh(e,t,l):(ma(t),e=Dl(e,t,l),e!==null?e.sibling:null);ma(t);break;case 19:var o=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Zn(e,t,l,!1),n=(l&t.childLanes)!==0),o){if(n)return Oh(e,t,l);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Z(Fe,Fe.current),n)break;return null;case 22:return t.lanes=0,wh(e,t,l,t.pendingProps);case 24:ua(t,Ie,e.memoizedState.cache)}return Dl(e,t,l)}function Dh(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)tt=!0;else{if(!wc(e,l)&&(t.flags&128)===0)return tt=!1,Hb(e,t,l);tt=(e.flags&131072)!==0}else tt=!1,we&&(t.flags&1048576)!==0&&fm(t,tr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ln(t.elementType),t.type=e,typeof e=="function")zu(e)?(n=sn(e,n),t.tag=1,t=Ah(null,t,e,n,l)):(t.tag=0,t=bc(null,t,e,n,l));else{if(e!=null){var o=e.$$typeof;if(o===H){t.tag=11,t=Sh(null,t,e,n,l);break e}else if(o===$){t.tag=14,t=Nh(null,t,e,n,l);break e}}throw t=Te(e)||e,Error(u(306,t,""))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,o=sn(n,t.pendingProps),Ah(e,t,n,o,l);case 3:e:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var c=t.memoizedState;o=c.element,Xu(e,t),ur(t,n,null,l);var f=t.memoizedState;if(n=f.cache,ua(t,Ie,n),n!==c.cache&&Hu(t,[Ie],l,!0),or(),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=zh(e,t,n,l);break e}else if(n!==o){o=Jt(Error(u(424)),t),lr(o),t=zh(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(Ye=el(e.firstChild),ct=t,we=!0,sa=null,Pt=!0,l=wm(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Pa(),n===o){t=Dl(e,t,l);break e}ft(e,t,n,l)}t=t.child}return t;case 26:return Zs(e,t),e===null?(l=Xp(t.type,null,t.pendingProps,null))?t.memoizedState=l:we||(l=t.type,e=t.pendingProps,n=co(ae.current).createElement(l),n[qe]=t,n[Pe]=e,mt(n,l,e),rt(n),t.stateNode=n):t.memoizedState=Xp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ml(t),e===null&&we&&(n=t.stateNode=Yp(t.type,t.pendingProps,ae.current),ct=t,Pt=!0,o=Ye,Sa(t.type)?(nd=o,Ye=el(n.firstChild)):Ye=o),ft(e,t,t.pendingProps.children,l),Zs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((o=n=Ye)&&(n=py(n,t.type,t.pendingProps,Pt),n!==null?(t.stateNode=n,ct=t,Ye=el(n.firstChild),Pt=!1,o=!0):o=!1),o||oa(t)),ml(t),o=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,n=c.children,Ic(o,c)?n=null:f!==null&&Ic(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=Pu(e,t,zb,null,null,l),Ar._currentValue=o),Zs(e,t),ft(e,t,n,l),t.child;case 6:return e===null&&we&&((e=l=Ye)&&(l=xy(l,t.pendingProps,Pt),l!==null?(t.stateNode=l,ct=t,Ye=null,e=!0):e=!1),e||oa(t)),null;case 13:return Rh(e,t,l);case 4:return Ee(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=nn(t,null,n,l):ft(e,t,n,l),t.child;case 11:return Sh(e,t,t.type,t.pendingProps,l);case 7:return ft(e,t,t.pendingProps,l),t.child;case 8:return ft(e,t,t.pendingProps.children,l),t.child;case 12:return ft(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,ua(t,t.type,n.value),ft(e,t,n.children,l),t.child;case 9:return o=t.type._context,n=t.pendingProps.children,en(t),o=dt(o),n=n(o),t.flags|=1,ft(e,t,n,l),t.child;case 14:return Nh(e,t,t.type,t.pendingProps,l);case 15:return Mh(e,t,t.type,t.pendingProps,l);case 19:return Oh(e,t,l);case 31:return Lb(e,t,l);case 22:return wh(e,t,l,t.pendingProps);case 24:return en(t),n=dt(Ie),e===null?(o=Yu(),o===null&&(o=Qe,c=qu(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=l),o=c),t.memoizedState={parent:n,cache:o},Ku(t),ua(t,Ie,o)):((e.lanes&l)!==0&&(Xu(e,t),ur(t,null,null,l),or()),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),ua(t,Ie,n)):(n=c.cache,ua(t,Ie,n),n!==o.cache&&Hu(t,[Ie],l,!0))),ft(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 Cc(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(sp())e.flags|=8192;else throw an=_s,Gu}else e.flags&=-16777217}function kh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fp(t))if(sp())e.flags|=8192;else throw an=_s,Gu}function Js(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qi():536870912,e.lanes|=t,ii|=t)}function pr(e,t){if(!we)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 Ge(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 qb(e,t,l){var n=t.pendingProps;switch(Du(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return Ge(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Rl(Ie),Re(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Vn(t)?kl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Uu())),Ge(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(kl(t),c!==null?(Ge(t),kh(t,c)):(Ge(t),Cc(t,o,null,n,l))):c?c!==e.memoizedState?(kl(t),Ge(t),kh(t,c)):(Ge(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&kl(t),Ge(t),Cc(t,o,e,n,l)),null;case 27:if(ea(t),l=ae.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 Ge(t),null}e=I.current,Vn(t)?hm(t):(e=Yp(o,n,l),t.stateNode=e,kl(t))}return Ge(t),null;case 5:if(ea(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 Ge(t),null}if(c=I.current,Vn(t))hm(t);else{var f=co(ae.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[qe]=t,c[Pe]=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(mt(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 Ge(t),Cc(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=ae.current,Vn(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,o=ct,o!==null)switch(o.tag){case 27:case 5:n=o.memoizedProps}e[qe]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Rp(e.nodeValue,l)),e||oa(t,!0)}else e=co(e).createTextNode(n),e[qe]=t,t.stateNode=e}return Ge(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=Vn(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[qe]=t}else Pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),e=!1}else l=Uu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Lt(t),t):(Lt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ge(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Vn(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[qe]=t}else Pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),o=!1}else o=Uu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Lt(t),t):(Lt(t),null)}return Lt(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),Js(t,t.updateQueue),Ge(t),null);case 4:return Re(),e===null&&$c(t.stateNode.containerInfo),Ge(t),null;case 10:return Rl(t.type),Ge(t),null;case 19:if(O(Fe),n=t.memoizedState,n===null)return Ge(t),null;if(o=(t.flags&128)!==0,c=n.rendering,c===null)if(o)pr(n,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Us(e),c!==null){for(t.flags|=128,pr(n,!1),e=c.updateQueue,t.updateQueue=e,Js(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)um(l,e),l=l.sibling;return Z(Fe,Fe.current&1|2),we&&Al(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&bt()>eo&&(t.flags|=128,o=!0,pr(n,!1),t.lanes=4194304)}else{if(!o)if(e=Us(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Js(t,e),pr(n,!0),n.tail===null&&n.tailMode==="hidden"&&!c.alternate&&!we)return Ge(t),null}else 2*bt()-n.renderingStartTime>eo&&l!==536870912&&(t.flags|=128,o=!0,pr(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=bt(),e.sibling=null,l=Fe.current,Z(Fe,o?l&1|2:l&1),we&&Al(t,n.treeForkCount),e):(Ge(t),null);case 22:case 23:return Lt(t),Ju(),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&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),l=t.updateQueue,l!==null&&Js(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&&O(tn),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Rl(Ie),Ge(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Qb(e,t){switch(Du(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rl(Ie),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ea(t),null;case 31:if(t.memoizedState!==null){if(Lt(t),t.alternate===null)throw Error(u(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(Fe),null;case 4:return Re(),null;case 10:return Rl(t.type),null;case 22:case 23:return Lt(t),Ju(),e!==null&&O(tn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Rl(Ie),null;case 25:return null;default:return null}}function Uh(e,t){switch(Du(t),t.tag){case 3:Rl(Ie),Re();break;case 26:case 27:case 5:ea(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&Lt(t);break;case 13:Lt(t);break;case 19:O(Fe);break;case 10:Rl(t.type);break;case 22:case 23:Lt(t),Ju(),e!==null&&O(tn);break;case 24:Rl(Ie)}}function xr(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(b){ke(t,t.return,b)}}function pa(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,b=f.destroy;if(b!==void 0){f.destroy=void 0,o=t;var S=l,_=b;try{_()}catch(q){ke(o,S,q)}}}n=n.next}while(n!==c)}}catch(q){ke(t,t.return,q)}}function Bh(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Tm(t,l)}catch(n){ke(e,e.return,n)}}}function Lh(e,t,l){l.props=sn(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){ke(e,t,n)}}function vr(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){ke(e,t,o)}}function yl(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(o){ke(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){ke(e,t,o)}else l.current=null}function Hh(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){ke(e,e.return,o)}}function Tc(e,t,l){try{var n=e.stateNode;uy(n,e.type,l,t),n[Pe]=t}catch(o){ke(e,e.return,o)}}function qh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sa(e.type)||e.tag===4}function Ec(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&&Sa(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 Ac(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=Cl));else if(n!==4&&(n===27&&Sa(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Ac(e,t,l),e=e.sibling;e!==null;)Ac(e,t,l),e=e.sibling}function Fs(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&&Sa(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Fs(e,t,l),e=e.sibling;e!==null;)Fs(e,t,l),e=e.sibling}function Qh(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);mt(t,n,l),t[qe]=e,t[Pe]=l}catch(c){ke(e,e.return,c)}}var Ul=!1,lt=!1,zc=!1,Yh=typeof WeakSet=="function"?WeakSet:Set,st=null;function Yb(e,t){if(e=e.containerInfo,Wc=bo,e=em(e),Nu(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,b=-1,S=-1,_=0,q=0,Y=e,D=null;t:for(;;){for(var L;Y!==l||o!==0&&Y.nodeType!==3||(b=f+o),Y!==c||n!==0&&Y.nodeType!==3||(S=f+n),Y.nodeType===3&&(f+=Y.nodeValue.length),(L=Y.firstChild)!==null;)D=Y,Y=L;for(;;){if(Y===e)break t;if(D===l&&++_===o&&(b=f),D===c&&++q===n&&(S=f),(L=Y.nextSibling)!==null)break;Y=D,D=Y.parentNode}Y=L}l=b===-1||S===-1?null:{start:b,end:S}}else l=null}l=l||{start:0,end:0}}else l=null;for(Pc={focusedElem:e,selectionRange:l},bo=!1,st=t;st!==null;)if(t=st,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,st=e;else for(;st!==null;){switch(t=st,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 ne=sn(l.type,o);e=n.getSnapshotBeforeUpdate(ne,c),n.__reactInternalSnapshotBeforeUpdate=e}catch(fe){ke(l,l.return,fe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)td(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":td(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,st=e;break}st=t.return}}function Gh(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:Ll(e,l),n&4&&xr(5,l);break;case 1:if(Ll(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(f){ke(l,l.return,f)}else{var o=sn(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){ke(l,l.return,f)}}n&64&&Bh(l),n&512&&vr(l,l.return);break;case 3:if(Ll(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{Tm(e,t)}catch(f){ke(l,l.return,f)}}break;case 27:t===null&&n&4&&Qh(l);case 26:case 5:Ll(e,l),t===null&&n&4&&Hh(l),n&512&&vr(l,l.return);break;case 12:Ll(e,l);break;case 31:Ll(e,l),n&4&&Vh(e,l);break;case 13:Ll(e,l),n&4&&Zh(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Wb.bind(null,l),vy(e,l))));break;case 22:if(n=l.memoizedState!==null||Ul,!n){t=t!==null&&t.memoizedState!==null||lt,o=Ul;var c=lt;Ul=n,(lt=t)&&!c?Hl(e,l,(l.subtreeFlags&8772)!==0):Ll(e,l),Ul=o,lt=c}break;case 30:break;default:Ll(e,l)}}function Kh(e){var t=e.alternate;t!==null&&(e.alternate=null,Kh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ru(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 Ke=null,Tt=!1;function Bl(e,t,l){for(l=l.child;l!==null;)Xh(e,t,l),l=l.sibling}function Xh(e,t,l){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Qa,l)}catch{}switch(l.tag){case 26:lt||yl(l,t),Bl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:lt||yl(l,t);var n=Ke,o=Tt;Sa(l.type)&&(Ke=l.stateNode,Tt=!1),Bl(e,t,l),Cr(l.stateNode),Ke=n,Tt=o;break;case 5:lt||yl(l,t);case 6:if(n=Ke,o=Tt,Ke=null,Bl(e,t,l),Ke=n,Tt=o,Ke!==null)if(Tt)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(l.stateNode)}catch(c){ke(l,t,c)}else try{Ke.removeChild(l.stateNode)}catch(c){ke(l,t,c)}break;case 18:Ke!==null&&(Tt?(e=Ke,Bp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),mi(e)):Bp(Ke,l.stateNode));break;case 4:n=Ke,o=Tt,Ke=l.stateNode.containerInfo,Tt=!0,Bl(e,t,l),Ke=n,Tt=o;break;case 0:case 11:case 14:case 15:pa(2,l,t),lt||pa(4,l,t),Bl(e,t,l);break;case 1:lt||(yl(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Lh(l,t,n)),Bl(e,t,l);break;case 21:Bl(e,t,l);break;case 22:lt=(n=lt)||l.memoizedState!==null,Bl(e,t,l),lt=n;break;default:Bl(e,t,l)}}function Vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{mi(e)}catch(l){ke(t,t.return,l)}}}function Zh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{mi(e)}catch(l){ke(t,t.return,l)}}function Gb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yh),t;default:throw Error(u(435,e.tag))}}function Ws(e,t){var l=Gb(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var o=Pb.bind(null,e,n);n.then(o,o)}})}function Et(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,b=f;e:for(;b!==null;){switch(b.tag){case 27:if(Sa(b.type)){Ke=b.stateNode,Tt=!1;break e}break;case 5:Ke=b.stateNode,Tt=!1;break e;case 3:case 4:Ke=b.stateNode.containerInfo,Tt=!0;break e}b=b.return}if(Ke===null)throw Error(u(160));Xh(c,f,o),Ke=null,Tt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)$h(t,e),t=t.sibling}var il=null;function $h(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Et(t,e),At(e),n&4&&(pa(3,e,e.return),xr(3,e),pa(5,e,e.return));break;case 1:Et(t,e),At(e),n&512&&(lt||l===null||yl(l,l.return)),n&64&&Ul&&(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=il;if(Et(t,e),At(e),n&512&&(lt||l===null||yl(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[Ki]||c[qe]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(n),o.head.insertBefore(c,o.querySelector("head > title"))),mt(c,n,l),c[qe]=e,rt(c),n=c;break e;case"link":var f=$p("link","href",o).get(n+(l.href||""));if(f){for(var b=0;b<f.length;b++)if(c=f[b],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(b,1);break t}}c=o.createElement(n),mt(c,n,l),o.head.appendChild(c);break;case"meta":if(f=$p("meta","content",o).get(n+(l.content||""))){for(b=0;b<f.length;b++)if(c=f[b],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(b,1);break t}}c=o.createElement(n),mt(c,n,l),o.head.appendChild(c);break;default:throw Error(u(468,n))}c[qe]=e,rt(c),n=c}e.stateNode=n}else Jp(o,e.type,e.stateNode);else e.stateNode=Zp(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):Zp(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Tc(e,e.memoizedProps,l.memoizedProps)}break;case 27:Et(t,e),At(e),n&512&&(lt||l===null||yl(l,l.return)),l!==null&&n&4&&Tc(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Et(t,e),At(e),n&512&&(lt||l===null||yl(l,l.return)),e.flags&32){o=e.stateNode;try{Un(o,"")}catch(ne){ke(e,e.return,ne)}}n&4&&e.stateNode!=null&&(o=e.memoizedProps,Tc(e,o,l!==null?l.memoizedProps:o)),n&1024&&(zc=!0);break;case 6:if(Et(t,e),At(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(ne){ke(e,e.return,ne)}}break;case 3:if(ho=null,o=il,il=fo(t.containerInfo),Et(t,e),il=o,At(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{mi(t.containerInfo)}catch(ne){ke(e,e.return,ne)}zc&&(zc=!1,Jh(e));break;case 4:n=il,il=fo(e.stateNode.containerInfo),Et(t,e),At(e),il=n;break;case 12:Et(t,e),At(e);break;case 31:Et(t,e),At(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ws(e,n)));break;case 13:Et(t,e),At(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Is=bt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ws(e,n)));break;case 22:o=e.memoizedState!==null;var S=l!==null&&l.memoizedState!==null,_=Ul,q=lt;if(Ul=_||o,lt=q||S,Et(t,e),lt=q,Ul=_,At(e),n&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(l===null||S||Ul||lt||on(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{b=S.stateNode;var Y=S.memoizedProps.style,D=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;b.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(ne){ke(S,S.return,ne)}}}else if(t.tag===6){if(l===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(ne){ke(S,S.return,ne)}}}else if(t.tag===18){if(l===null){S=t;try{var L=S.stateNode;o?Lp(L,!0):Lp(S.stateNode,!1)}catch(ne){ke(S,S.return,ne)}}}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,Ws(e,l))));break;case 19:Et(t,e),At(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ws(e,n)));break;case 30:break;case 21:break;default:Et(t,e),At(e)}}function At(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=Ec(e);Fs(e,c,o);break;case 5:var f=l.stateNode;l.flags&32&&(Un(f,""),l.flags&=-33);var b=Ec(e);Fs(e,b,f);break;case 3:case 4:var S=l.stateNode.containerInfo,_=Ec(e);Ac(e,_,S);break;default:throw Error(u(161))}}catch(q){ke(e,e.return,q)}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 Ll(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Gh(e,t.alternate,t),t=t.sibling}function on(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pa(4,t,t.return),on(t);break;case 1:yl(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Lh(t,t.return,l),on(t);break;case 27:Cr(t.stateNode);case 26:case 5:yl(t,t.return),on(t);break;case 22:t.memoizedState===null&&on(t);break;case 30:on(t);break;default:on(t)}e=e.sibling}}function Hl(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:Hl(o,c,l),xr(4,c);break;case 1:if(Hl(o,c,l),n=c,o=n.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(_){ke(n,n.return,_)}if(n=c,o=n.updateQueue,o!==null){var b=n.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)Cm(S[o],b)}catch(_){ke(n,n.return,_)}}l&&f&64&&Bh(c),vr(c,c.return);break;case 27:Qh(c);case 26:case 5:Hl(o,c,l),l&&n===null&&f&4&&Hh(c),vr(c,c.return);break;case 12:Hl(o,c,l);break;case 31:Hl(o,c,l),l&&f&4&&Vh(o,c);break;case 13:Hl(o,c,l),l&&f&4&&Zh(o,c);break;case 22:c.memoizedState===null&&Hl(o,c,l),vr(c,c.return);break;case 30:break;default:Hl(o,c,l)}t=t.sibling}}function Rc(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&&ar(l))}function _c(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ar(e))}function rl(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fh(e,t,l,n),t=t.sibling}function Fh(e,t,l,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:rl(e,t,l,n),o&2048&&xr(9,t);break;case 1:rl(e,t,l,n);break;case 3:rl(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&&ar(e)));break;case 12:if(o&2048){rl(e,t,l,n),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,b=c.onPostCommit;typeof b=="function"&&b(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){ke(t,t.return,S)}}else rl(e,t,l,n);break;case 31:rl(e,t,l,n);break;case 13:rl(e,t,l,n);break;case 23:break;case 22:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?rl(e,t,l,n):br(e,t):c._visibility&2?rl(e,t,l,n):(c._visibility|=2,li(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Rc(f,t);break;case 24:rl(e,t,l,n),o&2048&&_c(t.alternate,t);break;default:rl(e,t,l,n)}}function li(e,t,l,n,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,b=l,S=n,_=f.flags;switch(f.tag){case 0:case 11:case 15:li(c,f,b,S,o),xr(8,f);break;case 23:break;case 22:var q=f.stateNode;f.memoizedState!==null?q._visibility&2?li(c,f,b,S,o):br(c,f):(q._visibility|=2,li(c,f,b,S,o)),o&&_&2048&&Rc(f.alternate,f);break;case 24:li(c,f,b,S,o),o&&_&2048&&_c(f.alternate,f);break;default:li(c,f,b,S,o)}t=t.sibling}}function br(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:br(l,n),o&2048&&Rc(n.alternate,n);break;case 24:br(l,n),o&2048&&_c(n.alternate,n);break;default:br(l,n)}t=t.sibling}}var yr=8192;function ai(e,t,l){if(e.subtreeFlags&yr)for(e=e.child;e!==null;)Wh(e,t,l),e=e.sibling}function Wh(e,t,l){switch(e.tag){case 26:ai(e,t,l),e.flags&yr&&e.memoizedState!==null&&Ay(l,il,e.memoizedState,e.memoizedProps);break;case 5:ai(e,t,l);break;case 3:case 4:var n=il;il=fo(e.stateNode.containerInfo),ai(e,t,l),il=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=yr,yr=16777216,ai(e,t,l),yr=n):ai(e,t,l));break;default:ai(e,t,l)}}function Ph(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 gr(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];st=n,ep(n,e)}Ph(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ih(e),e=e.sibling}function Ih(e){switch(e.tag){case 0:case 11:case 15:gr(e),e.flags&2048&&pa(9,e,e.return);break;case 3:gr(e);break;case 12:gr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ps(e)):gr(e);break;default:gr(e)}}function Ps(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];st=n,ep(n,e)}Ph(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pa(8,t,t.return),Ps(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ps(t));break;default:Ps(t)}e=e.sibling}}function ep(e,t){for(;st!==null;){var l=st;switch(l.tag){case 0:case 11:case 15:pa(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:ar(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,st=n;else e:for(l=e;st!==null;){n=st;var o=n.sibling,c=n.return;if(Kh(n),n===l){st=null;break e}if(o!==null){o.return=c,st=o;break e}st=c}}}var Kb={getCacheForType:function(e){var t=dt(Ie),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return dt(Ie).controller.signal}},Xb=typeof WeakMap=="function"?WeakMap:Map,_e=0,Qe=null,je=null,Ne=0,De=0,Ht=null,xa=!1,ni=!1,Oc=!1,ql=0,$e=0,va=0,un=0,Dc=0,qt=0,ii=0,jr=null,zt=null,kc=!1,Is=0,tp=0,eo=1/0,to=null,ba=null,at=0,ya=null,ri=null,Ql=0,Uc=0,Bc=null,lp=null,Sr=0,Lc=null;function Qt(){return(_e&2)!==0&&Ne!==0?Ne&-Ne:B.T!==null?Kc():Yi()}function ap(){if(qt===0)if((Ne&536870912)===0||we){var e=Ga;Ga<<=1,(Ga&3932160)===0&&(Ga=262144),qt=e}else qt=536870912;return e=Bt.current,e!==null&&(e.flags|=32),qt}function Rt(e,t,l){(e===Qe&&(De===2||De===9)||e.cancelPendingCommit!==null)&&(si(e,0),ga(e,Ne,qt,!1)),ie(e,l),((_e&2)===0||e!==Qe)&&(e===Qe&&((_e&2)===0&&(un|=l),$e===4&&ga(e,Ne,qt,!1)),gl(e))}function np(e,t,l){if((_e&6)!==0)throw Error(u(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||aa(e,t),o=n?$b(e,t):qc(e,t,!0),c=n;do{if(o===0){ni&&!n&&ga(e,t,0,!1);break}else{if(l=e.current.alternate,c&&!Vb(l)){o=qc(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 b=e;o=jr;var S=b.current.memoizedState.isDehydrated;if(S&&(si(b,f).flags|=256),f=qc(b,f,!1),f!==2){if(Oc&&!S){b.errorRecoveryDisabledLanes|=c,un|=c,o=4;break e}c=zt,zt=o,c!==null&&(zt===null?zt=c:zt.push.apply(zt,c))}o=f}if(c=!1,o!==2)continue}}if(o===1){si(e,0),ga(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:ga(n,t,qt,!xa);break e;case 2:zt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=Is+300-bt(),10<o)){if(ga(n,t,qt,!xa),Xa(n,0,!0)!==0)break e;Ql=t,n.timeoutHandle=kp(ip.bind(null,n,l,zt,to,kc,t,qt,un,ii,xa,c,"Throttled",-0,0),o);break e}ip(n,l,zt,to,kc,t,qt,un,ii,xa,c,null,-0,0)}}break}while(!0);gl(e)}function ip(e,t,l,n,o,c,f,b,S,_,q,Y,D,L){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cl},Wh(t,c,Y);var ne=(c&62914560)===c?Is-bt():(c&4194048)===c?tp-bt():0;if(ne=zy(Y,ne),ne!==null){Ql=c,e.cancelPendingCommit=ne(mp.bind(null,e,t,c,l,n,o,f,b,S,q,Y,null,D,L)),ga(e,c,f,!_);return}}mp(e,t,c,l,n,o,f,b,S)}function Vb(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(!kt(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 ga(e,t,l,n){t&=~Dc,t&=~un,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var c=31-gt(o),f=1<<c;n[c]=-1,o&=~f}l!==0&&Dt(e,l,t)}function lo(){return(_e&6)===0?(Nr(0),!1):!0}function Hc(){if(je!==null){if(De===0)var e=je.return;else e=je,zl=Ia=null,tc(e),Wn=null,ir=0,e=je;for(;e!==null;)Uh(e.alternate,e),e=e.return;je=null}}function si(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,fy(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Ql=0,Hc(),Qe=e,je=l=El(e.current,null),Ne=t,De=0,Ht=null,xa=!1,ni=aa(e,t),Oc=!1,ii=qt=Dc=un=va=$e=0,zt=jr=null,kc=!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-gt(n),c=1<<o;t|=e[o],n&=~c}return ql=t,Ns(),l}function rp(e,t){xe=null,B.H=mr,t===Fn||t===Rs?(t=Sm(),De=3):t===Gu?(t=Sm(),De=4):De=t===vc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ht=t,je===null&&($e=1,Xs(e,Jt(t,e.current)))}function sp(){var e=Bt.current;return e===null?!0:(Ne&4194048)===Ne?It===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===It:!1}function op(){var e=B.H;return B.H=mr,e===null?mr:e}function up(){var e=B.A;return B.A=Kb,e}function ao(){$e=4,xa||(Ne&4194048)!==Ne&&Bt.current!==null||(ni=!0),(va&134217727)===0&&(un&134217727)===0||Qe===null||ga(Qe,Ne,qt,!1)}function qc(e,t,l){var n=_e;_e|=2;var o=op(),c=up();(Qe!==e||Ne!==t)&&(to=null,si(e,t)),t=!1;var f=$e;e:do try{if(De!==0&&je!==null){var b=je,S=Ht;switch(De){case 8:Hc(),f=6;break e;case 3:case 2:case 9:case 6:Bt.current===null&&(t=!0);var _=De;if(De=0,Ht=null,oi(e,b,S,_),l&&ni){f=0;break e}break;default:_=De,De=0,Ht=null,oi(e,b,S,_)}}Zb(),f=$e;break}catch(q){rp(e,q)}while(!0);return t&&e.shellSuspendCounter++,zl=Ia=null,_e=n,B.H=o,B.A=c,je===null&&(Qe=null,Ne=0,Ns()),f}function Zb(){for(;je!==null;)cp(je)}function $b(e,t){var l=_e;_e|=2;var n=op(),o=up();Qe!==e||Ne!==t?(to=null,eo=bt()+500,si(e,t)):ni=aa(e,t);e:do try{if(De!==0&&je!==null){t=je;var c=Ht;t:switch(De){case 1:De=0,Ht=null,oi(e,t,c,1);break;case 2:case 9:if(gm(c)){De=0,Ht=null,dp(t);break}t=function(){De!==2&&De!==9||Qe!==e||(De=7),gl(e)},c.then(t,t);break e;case 3:De=7;break e;case 4:De=5;break e;case 7:gm(c)?(De=0,Ht=null,dp(t)):(De=0,Ht=null,oi(e,t,c,7));break;case 5:var f=null;switch(je.tag){case 26:f=je.memoizedState;case 5:case 27:var b=je;if(f?Fp(f):b.stateNode.complete){De=0,Ht=null;var S=b.sibling;if(S!==null)je=S;else{var _=b.return;_!==null?(je=_,no(_)):je=null}break t}}De=0,Ht=null,oi(e,t,c,5);break;case 6:De=0,Ht=null,oi(e,t,c,6);break;case 8:Hc(),$e=6;break e;default:throw Error(u(462))}}Jb();break}catch(q){rp(e,q)}while(!0);return zl=Ia=null,B.H=n,B.A=o,_e=l,je!==null?0:(Qe=null,Ne=0,Ns(),$e)}function Jb(){for(;je!==null&&!as();)cp(je)}function cp(e){var t=Dh(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?no(e):je=t}function dp(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Eh(l,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=Eh(l,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:tc(t);default:Uh(l,t),t=je=um(t,ql),t=Dh(l,t,ql)}e.memoizedProps=e.pendingProps,t===null?no(e):je=t}function oi(e,t,l,n){zl=Ia=null,tc(t),Wn=null,ir=0;var o=t.return;try{if(Bb(e,o,t,l,Ne)){$e=1,Xs(e,Jt(l,e.current)),je=null;return}}catch(c){if(o!==null)throw je=o,c;$e=1,Xs(e,Jt(l,e.current)),je=null;return}t.flags&32768?(we||n===1?e=!0:ni||(Ne&536870912)!==0?e=!1:(xa=e=!0,(n===2||n===9||n===3||n===6)&&(n=Bt.current,n!==null&&n.tag===13&&(n.flags|=16384))),fp(t,e)):no(t)}function no(e){var t=e;do{if((t.flags&32768)!==0){fp(t,xa);return}e=t.return;var l=qb(t.alternate,t,ql);if(l!==null){je=l;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);$e===0&&($e=5)}function fp(e,t){do{var l=Qb(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);$e=6,je=null}function mp(e,t,l,n,o,c,f,b,S){e.cancelPendingCommit=null;do io();while(at!==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|=Eu,He(e,l,c,f,b,S),e===Qe&&(je=Qe=null,Ne=0),ri=t,ya=e,Ql=l,Uc=c,Bc=o,lp=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ib(Cn,function(){return bp(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=B.T,B.T=null,o=J.p,J.p=2,f=_e,_e|=4;try{Yb(e,t,l)}finally{_e=f,J.p=o,B.T=n}}at=1,hp(),pp(),xp()}}function hp(){if(at===1){at=0;var e=ya,t=ri,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var n=J.p;J.p=2;var o=_e;_e|=4;try{$h(t,e);var c=Pc,f=em(e.containerInfo),b=c.focusedElem,S=c.selectionRange;if(f!==b&&b&&b.ownerDocument&&If(b.ownerDocument.documentElement,b)){if(S!==null&&Nu(b)){var _=S.start,q=S.end;if(q===void 0&&(q=_),"selectionStart"in b)b.selectionStart=_,b.selectionEnd=Math.min(q,b.value.length);else{var Y=b.ownerDocument||document,D=Y&&Y.defaultView||window;if(D.getSelection){var L=D.getSelection(),ne=b.textContent.length,fe=Math.min(S.start,ne),Le=S.end===void 0?fe:Math.min(S.end,ne);!L.extend&&fe>Le&&(f=Le,Le=fe,fe=f);var T=Pf(b,fe),w=Pf(b,Le);if(T&&w&&(L.rangeCount!==1||L.anchorNode!==T.node||L.anchorOffset!==T.offset||L.focusNode!==w.node||L.focusOffset!==w.offset)){var R=Y.createRange();R.setStart(T.node,T.offset),L.removeAllRanges(),fe>Le?(L.addRange(R),L.extend(w.node,w.offset)):(R.setEnd(w.node,w.offset),L.addRange(R))}}}}for(Y=[],L=b;L=L.parentNode;)L.nodeType===1&&Y.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<Y.length;b++){var Q=Y[b];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}bo=!!Wc,Pc=Wc=null}finally{_e=o,J.p=n,B.T=l}}e.current=t,at=2}}function pp(){if(at===2){at=0;var e=ya,t=ri,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var n=J.p;J.p=2;var o=_e;_e|=4;try{Gh(e,t.alternate,t)}finally{_e=o,J.p=n,B.T=l}}at=3}}function xp(){if(at===4||at===3){at=0,ns();var e=ya,t=ri,l=Ql,n=lp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?at=5:(at=0,ri=ya=null,vp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(ba=null),An(l),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Qa,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=B.T,o=J.p,J.p=2,B.T=null;try{for(var c=e.onRecoverableError,f=0;f<n.length;f++){var b=n[f];c(b.value,{componentStack:b.stack})}}finally{B.T=t,J.p=o}}(Ql&3)!==0&&io(),gl(e),o=e.pendingLanes,(l&261930)!==0&&(o&42)!==0?e===Lc?Sr++:(Sr=0,Lc=e):Sr=0,Nr(0)}}function vp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ar(t)))}function io(){return hp(),pp(),xp(),bp()}function bp(){if(at!==5)return!1;var e=ya,t=Uc;Uc=0;var l=An(Ql),n=B.T,o=J.p;try{J.p=32>l?32:l,B.T=null,l=Bc,Bc=null;var c=ya,f=Ql;if(at=0,ri=ya=null,Ql=0,(_e&6)!==0)throw Error(u(331));var b=_e;if(_e|=4,Ih(c.current),Fh(c,c.current,f,l),_e=b,Nr(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Qa,c)}catch{}return!0}finally{J.p=o,B.T=n,vp(e,t)}}function yp(e,t,l){t=Jt(l,t),t=xc(e.stateNode,t,2),e=fa(e,t,2),e!==null&&(ie(e,2),gl(e))}function ke(e,t,l){if(e.tag===3)yp(e,e,l);else for(;t!==null;){if(t.tag===3){yp(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ba===null||!ba.has(n))){e=Jt(l,e),l=gh(2),n=fa(t,l,2),n!==null&&(jh(l,n,t,e),ie(n,2),gl(n));break}}t=t.return}}function Qc(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new Xb;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)||(Oc=!0,o.add(l),e=Fb.bind(null,e,t,l),t.then(e,e))}function Fb(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Qe===e&&(Ne&l)===l&&($e===4||$e===3&&(Ne&62914560)===Ne&&300>bt()-Is?(_e&2)===0&&si(e,0):Dc|=l,ii===Ne&&(ii=0)),gl(e)}function gp(e,t){t===0&&(t=qi()),e=Fa(e,t),e!==null&&(ie(e,t),gl(e))}function Wb(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),gp(e,l)}function Pb(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),gp(e,l)}function Ib(e,t){return qa(e,t)}var ro=null,ui=null,Yc=!1,so=!1,Gc=!1,ja=0;function gl(e){e!==ui&&e.next===null&&(ui===null?ro=ui=e:ui=ui.next=e),so=!0,Yc||(Yc=!0,ty())}function Nr(e,t){if(!Gc&&so){Gc=!0;do for(var l=!1,n=ro;n!==null;){if(e!==0){var o=n.pendingLanes;if(o===0)var c=0;else{var f=n.suspendedLanes,b=n.pingedLanes;c=(1<<31-gt(42|e)+1)-1,c&=o&~(f&~b),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,Mp(n,c))}else c=Ne,c=Xa(n,n===Qe?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(c&3)===0||aa(n,c)||(l=!0,Mp(n,c));n=n.next}while(l);Gc=!1}}function ey(){jp()}function jp(){so=Yc=!1;var e=0;ja!==0&&dy()&&(e=ja);for(var t=bt(),l=null,n=ro;n!==null;){var o=n.next,c=Sp(n,t);c===0?(n.next=null,l===null?ro=o:l.next=o,o===null&&(ui=l)):(l=n,(e!==0||(c&3)!==0)&&(so=!0)),n=o}at!==0&&at!==5||Nr(e),ja!==0&&(ja=0)}function Sp(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-gt(c),b=1<<f,S=o[f];S===-1?((b&l)===0||(b&n)!==0)&&(o[f]=ds(b,t)):S<=t&&(e.expiredLanes|=b),c&=~b}if(t=Qe,l=Ne,l=Xa(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(De===2||De===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&la(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||aa(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&la(n),An(l)){case 2:case 8:l=rs;break;case 32:l=Cn;break;case 268435456:l=ss;break;default:l=Cn}return n=Np.bind(null,e),l=qa(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&la(n),e.callbackPriority=2,e.callbackNode=null,2}function Np(e,t){if(at!==0&&at!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(io()&&e.callbackNode!==l)return null;var n=Ne;return n=Xa(e,e===Qe?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(np(e,n,t),Sp(e,bt()),e.callbackNode!=null&&e.callbackNode===l?Np.bind(null,e):null)}function Mp(e,t){if(io())return null;np(e,t,!0)}function ty(){my(function(){(_e&6)!==0?qa(is,ey):jp()})}function Kc(){if(ja===0){var e=$n;e===0&&(e=Ya,Ya<<=1,(Ya&261888)===0&&(Ya=256)),ja=e}return ja}function wp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ps(""+e)}function Cp(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 ly(e,t,l,n,o){if(t==="submit"&&l&&l.stateNode===o){var c=wp((o[Pe]||null).action),f=n.submitter;f&&(t=(t=f[Pe]||null)?wp(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var b=new ys("action","action",null,n,o);e.push({event:b,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(ja!==0){var S=f?Cp(o,f):new FormData(o);cc(l,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(b.preventDefault(),S=f?Cp(o,f):new FormData(o),cc(l,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var Xc=0;Xc<Tu.length;Xc++){var Vc=Tu[Xc],ay=Vc.toLowerCase(),ny=Vc[0].toUpperCase()+Vc.slice(1);nl(ay,"on"+ny)}nl(am,"onAnimationEnd"),nl(nm,"onAnimationIteration"),nl(im,"onAnimationStart"),nl("dblclick","onDoubleClick"),nl("focusin","onFocus"),nl("focusout","onBlur"),nl(gb,"onTransitionRun"),nl(jb,"onTransitionStart"),nl(Sb,"onTransitionCancel"),nl(rm,"onTransitionEnd"),Dn("onMouseEnter",["mouseout","mouseover"]),Dn("onMouseLeave",["mouseout","mouseover"]),Dn("onPointerEnter",["pointerout","pointerover"]),Dn("onPointerLeave",["pointerout","pointerover"]),Va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Va("onBeforeInput",["compositionend","keypress","textInput","paste"]),Va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mr="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(" "),iy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mr));function Tp(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 b=n[f],S=b.instance,_=b.currentTarget;if(b=b.listener,S!==c&&o.isPropagationStopped())break e;c=b,o.currentTarget=_;try{c(o)}catch(q){Ss(q)}o.currentTarget=null,c=S}else for(f=0;f<n.length;f++){if(b=n[f],S=b.instance,_=b.currentTarget,b=b.listener,S!==c&&o.isPropagationStopped())break e;c=b,o.currentTarget=_;try{c(o)}catch(q){Ss(q)}o.currentTarget=null,c=S}}}}function Se(e,t){var l=t[iu];l===void 0&&(l=t[iu]=new Set);var n=e+"__bubble";l.has(n)||(Ep(t,e,2,!1),l.add(n))}function Zc(e,t,l){var n=0;t&&(n|=4),Ep(l,e,n,t)}var oo="_reactListening"+Math.random().toString(36).slice(2);function $c(e){if(!e[oo]){e[oo]=!0,jf.forEach(function(l){l!=="selectionchange"&&(iy.has(l)||Zc(l,!1,e),Zc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oo]||(t[oo]=!0,Zc("selectionchange",!1,t))}}function Ep(e,t,l,n){switch(ax(t)){case 2:var o=Oy;break;case 8:o=Dy;break;default:o=ud}l=o.bind(null,t,l,e),o=void 0,!hu||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 Jc(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 b=n.stateNode.containerInfo;if(b===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(;b!==null;){if(f=Rn(b),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){n=c=f;continue e}b=b.parentNode}}n=n.return}Of(function(){var _=c,q=fu(l),Y=[];e:{var D=sm.get(e);if(D!==void 0){var L=ys,ne=e;switch(e){case"keypress":if(vs(l)===0)break e;case"keydown":case"keyup":L=P0;break;case"focusin":ne="focus",L=bu;break;case"focusout":ne="blur",L=bu;break;case"beforeblur":case"afterblur":L=bu;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":L=Uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=q0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=tb;break;case am:case nm:case im:L=G0;break;case rm:L=ab;break;case"scroll":case"scrollend":L=L0;break;case"wheel":L=ib;break;case"copy":case"cut":case"paste":L=X0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Lf;break;case"toggle":case"beforetoggle":L=sb}var fe=(t&4)!==0,Le=!fe&&(e==="scroll"||e==="scrollend"),T=fe?D!==null?D+"Capture":null:D;fe=[];for(var w=_,R;w!==null;){var Q=w;if(R=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||R===null||T===null||(Q=Vi(w,T),Q!=null&&fe.push(wr(w,Q,R))),Le)break;w=w.return}0<fe.length&&(D=new L(D,ne,null,l,q),Y.push({event:D,listeners:fe}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",D&&l!==du&&(ne=l.relatedTarget||l.fromElement)&&(Rn(ne)||ne[zn]))break e;if((L||D)&&(D=q.window===q?q:(D=q.ownerDocument)?D.defaultView||D.parentWindow:window,L?(ne=l.relatedTarget||l.toElement,L=_,ne=ne?Rn(ne):null,ne!==null&&(Le=m(ne),fe=ne.tag,ne!==Le||fe!==5&&fe!==27&&fe!==6)&&(ne=null)):(L=null,ne=_),L!==ne)){if(fe=Uf,Q="onMouseLeave",T="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(fe=Lf,Q="onPointerLeave",T="onPointerEnter",w="pointer"),Le=L==null?D:Xi(L),R=ne==null?D:Xi(ne),D=new fe(Q,w+"leave",L,l,q),D.target=Le,D.relatedTarget=R,Q=null,Rn(q)===_&&(fe=new fe(T,w+"enter",ne,l,q),fe.target=R,fe.relatedTarget=Le,Q=fe),Le=Q,L&&ne)t:{for(fe=ry,T=L,w=ne,R=0,Q=T;Q;Q=fe(Q))R++;Q=0;for(var de=w;de;de=fe(de))Q++;for(;0<R-Q;)T=fe(T),R--;for(;0<Q-R;)w=fe(w),Q--;for(;R--;){if(T===w||w!==null&&T===w.alternate){fe=T;break t}T=fe(T),w=fe(w)}fe=null}else fe=null;L!==null&&Ap(Y,D,L,fe,!1),ne!==null&&Le!==null&&Ap(Y,Le,ne,fe,!0)}}e:{if(D=_?Xi(_):window,L=D.nodeName&&D.nodeName.toLowerCase(),L==="select"||L==="input"&&D.type==="file")var Ae=Vf;else if(Kf(D))if(Zf)Ae=vb;else{Ae=pb;var se=hb}else L=D.nodeName,!L||L.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?_&&cu(_.elementType)&&(Ae=Vf):Ae=xb;if(Ae&&(Ae=Ae(e,_))){Xf(Y,Ae,l,q);break e}se&&se(e,D,_),e==="focusout"&&_&&D.type==="number"&&_.memoizedProps.value!=null&&uu(D,"number",D.value)}switch(se=_?Xi(_):window,e){case"focusin":(Kf(se)||se.contentEditable==="true")&&(qn=se,Mu=_,er=null);break;case"focusout":er=Mu=qn=null;break;case"mousedown":wu=!0;break;case"contextmenu":case"mouseup":case"dragend":wu=!1,tm(Y,l,q);break;case"selectionchange":if(yb)break;case"keydown":case"keyup":tm(Y,l,q)}var ve;if(gu)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 Hn?Yf(e,l)&&(Me="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Me="onCompositionStart");Me&&(Hf&&l.locale!=="ko"&&(Hn||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Hn&&(ve=Df()):(ia=q,pu="value"in ia?ia.value:ia.textContent,Hn=!0)),se=uo(_,Me),0<se.length&&(Me=new Bf(Me,e,null,l,q),Y.push({event:Me,listeners:se}),ve?Me.data=ve:(ve=Gf(l),ve!==null&&(Me.data=ve)))),(ve=ub?cb(e,l):db(e,l))&&(Me=uo(_,"onBeforeInput"),0<Me.length&&(se=new Bf("onBeforeInput","beforeinput",null,l,q),Y.push({event:se,listeners:Me}),se.data=ve)),ly(Y,e,_,l,q)}Tp(Y,t)})}function wr(e,t,l){return{instance:e,listener:t,currentTarget:l}}function uo(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=Vi(e,l),o!=null&&n.unshift(wr(e,o,c)),o=Vi(e,t),o!=null&&n.push(wr(e,o,c))),e.tag===3)return n;e=e.return}return[]}function ry(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ap(e,t,l,n,o){for(var c=t._reactName,f=[];l!==null&&l!==n;){var b=l,S=b.alternate,_=b.stateNode;if(b=b.tag,S!==null&&S===n)break;b!==5&&b!==26&&b!==27||_===null||(S=_,o?(_=Vi(l,c),_!=null&&f.unshift(wr(l,_,S))):o||(_=Vi(l,c),_!=null&&f.push(wr(l,_,S)))),l=l.return}f.length!==0&&e.push({event:t,listeners:f})}var sy=/\r\n?/g,oy=/\u0000|\uFFFD/g;function zp(e){return(typeof e=="string"?e:""+e).replace(sy,`
|
|
49
|
+
`).replace(oy,"")}function Rp(e,t){return t=zp(t),zp(e)===t}function Be(e,t,l,n,o,c){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Un(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Un(e,""+n);break;case"className":ms(e,"class",n);break;case"tabIndex":ms(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ms(e,l,n);break;case"style":Rf(e,n,c);break;case"data":if(t!=="object"){ms(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=ps(""+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"&&Be(e,t,"name",o.name,o,null),Be(e,t,"formEncType",o.formEncType,o,null),Be(e,t,"formMethod",o.formMethod,o,null),Be(e,t,"formTarget",o.formTarget,o,null)):(Be(e,t,"encType",o.encType,o,null),Be(e,t,"method",o.method,o,null),Be(e,t,"target",o.target,o,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=ps(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=Cl);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=ps(""+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),fs(e,"popover",n);break;case"xlinkActuate":wl(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":wl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":wl(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":wl(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":wl(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":wl(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":wl(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":wl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":wl(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":fs(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=U0.get(l)||l,fs(e,l,n))}}function Fc(e,t,l,n,o,c){switch(l){case"style":Rf(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"?Un(e,n):(typeof n=="number"||typeof n=="bigint")&&Un(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=Cl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sf.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[Pe]||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,""):fs(e,l,n)}}}function mt(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:Be(e,t,c,f,l,null)}}o&&Be(e,t,"srcSet",l.srcSet,l,null),n&&Be(e,t,"src",l.src,l,null);return;case"input":Se("invalid",e);var b=c=f=o=null,S=null,_=null;for(n in l)if(l.hasOwnProperty(n)){var q=l[n];if(q!=null)switch(n){case"name":o=q;break;case"type":f=q;break;case"checked":S=q;break;case"defaultChecked":_=q;break;case"value":c=q;break;case"defaultValue":b=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:Be(e,t,n,q,l,null)}}Tf(e,c,b,S,_,f,o,!1);return;case"select":Se("invalid",e),n=f=c=null;for(o in l)if(l.hasOwnProperty(o)&&(b=l[o],b!=null))switch(o){case"value":c=b;break;case"defaultValue":f=b;break;case"multiple":n=b;default:Be(e,t,o,b,l,null)}t=c,l=f,e.multiple=!!n,t!=null?kn(e,!!n,t,!1):l!=null&&kn(e,!!n,l,!0);return;case"textarea":Se("invalid",e),c=o=n=null;for(f in l)if(l.hasOwnProperty(f)&&(b=l[f],b!=null))switch(f){case"value":n=b;break;case"defaultValue":o=b;break;case"children":c=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(u(91));break;default:Be(e,t,f,b,l,null)}Af(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:Be(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<Mr.length;n++)Se(Mr[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(_ in l)if(l.hasOwnProperty(_)&&(n=l[_],n!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Be(e,t,_,n,l,null)}return;default:if(cu(t)){for(q in l)l.hasOwnProperty(q)&&(n=l[q],n!==void 0&&Fc(e,t,q,n,l,void 0));return}}for(b in l)l.hasOwnProperty(b)&&(n=l[b],n!=null&&Be(e,t,b,n,l,null))}function uy(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,b=null,S=null,_=null,q=null;for(L in l){var Y=l[L];if(l.hasOwnProperty(L)&&Y!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":S=Y;default:n.hasOwnProperty(L)||Be(e,t,L,null,n,Y)}}for(var D in n){var L=n[D];if(Y=l[D],n.hasOwnProperty(D)&&(L!=null||Y!=null))switch(D){case"type":c=L;break;case"name":o=L;break;case"checked":_=L;break;case"defaultChecked":q=L;break;case"value":f=L;break;case"defaultValue":b=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:L!==Y&&Be(e,t,D,L,n,Y)}}ou(e,f,b,S,_,q,c,o);return;case"select":L=f=b=D=null;for(c in l)if(S=l[c],l.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":L=S;default:n.hasOwnProperty(c)||Be(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":b=c;break;case"multiple":f=c;default:c!==S&&Be(e,t,o,c,n,S)}t=b,l=f,n=L,D!=null?kn(e,!!l,D,!1):!!n!=!!l&&(t!=null?kn(e,!!l,t,!0):kn(e,!!l,l?[]:"",!1));return;case"textarea":L=D=null;for(b in l)if(o=l[b],l.hasOwnProperty(b)&&o!=null&&!n.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Be(e,t,b,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":L=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&Be(e,t,f,o,n,c)}Ef(e,D,L);return;case"option":for(var ne in l)if(D=l[ne],l.hasOwnProperty(ne)&&D!=null&&!n.hasOwnProperty(ne))switch(ne){case"selected":e.selected=!1;break;default:Be(e,t,ne,null,n,D)}for(S in n)if(D=n[S],L=l[S],n.hasOwnProperty(S)&&D!==L&&(D!=null||L!=null))switch(S){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Be(e,t,S,D,n,L)}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 fe in l)D=l[fe],l.hasOwnProperty(fe)&&D!=null&&!n.hasOwnProperty(fe)&&Be(e,t,fe,null,n,D);for(_ in n)if(D=n[_],L=l[_],n.hasOwnProperty(_)&&D!==L&&(D!=null||L!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:Be(e,t,_,D,n,L)}return;default:if(cu(t)){for(var Le in l)D=l[Le],l.hasOwnProperty(Le)&&D!==void 0&&!n.hasOwnProperty(Le)&&Fc(e,t,Le,void 0,n,D);for(q in n)D=n[q],L=l[q],!n.hasOwnProperty(q)||D===L||D===void 0&&L===void 0||Fc(e,t,q,D,n,L);return}}for(var T in l)D=l[T],l.hasOwnProperty(T)&&D!=null&&!n.hasOwnProperty(T)&&Be(e,t,T,null,n,D);for(Y in n)D=n[Y],L=l[Y],!n.hasOwnProperty(Y)||D===L||D==null&&L==null||Be(e,t,Y,D,n,L)}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 cy(){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,b=o.duration;if(c&&b&&_p(f)){for(f=0,b=o.responseEnd,n+=1;n<l.length;n++){var S=l[n],_=S.startTime;if(_>b)break;var q=S.transferSize,Y=S.initiatorType;q&&_p(Y)&&(S=S.responseEnd,f+=q*(S<b?1:(b-_)/(S-_)))}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 Wc=null,Pc=null;function co(e){return e.nodeType===9?e:e.ownerDocument}function Op(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 Ic(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 ed=null;function dy(){var e=window.event;return e&&e.type==="popstate"?e===ed?!1:(ed=e,!0):(ed=null,!1)}var kp=typeof setTimeout=="function"?setTimeout:void 0,fy=typeof clearTimeout=="function"?clearTimeout:void 0,Up=typeof Promise=="function"?Promise:void 0,my=typeof queueMicrotask=="function"?queueMicrotask:typeof Up<"u"?function(e){return Up.resolve(null).then(e).catch(hy)}:kp;function hy(e){setTimeout(function(){throw e})}function Sa(e){return e==="head"}function Bp(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),mi(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Cr(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Cr(l);for(var c=l.firstChild;c;){var f=c.nextSibling,b=c.nodeName;c[Ki]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&c.rel.toLowerCase()==="stylesheet"||l.removeChild(c),c=f}}else l==="body"&&Cr(e.ownerDocument.body);l=o}while(l);mi(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 td(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":td(l),ru(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function py(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[Ki])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=el(e.nextSibling),e===null)break}return null}function xy(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=el(e.nextSibling),e===null))return null;return e}function Hp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=el(e.nextSibling),e===null))return null;return e}function ld(e){return e.data==="$?"||e.data==="$~"}function ad(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function vy(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 el(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 nd=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 el(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Qp(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 Yp(e,t,l){switch(t=co(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 Cr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ru(e)}var tl=new Map,Gp=new Set;function fo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Yl=J.d;J.d={f:by,r:yy,D:gy,C:jy,L:Sy,m:Ny,X:wy,S:My,M:Cy};function by(){var e=Yl.f(),t=lo();return e||t}function yy(e){var t=_n(e);t!==null&&t.tag===5&&t.type==="form"?rh(t):Yl.r(e)}var ci=typeof document>"u"?null:document;function Kp(e,t,l){var n=ci;if(n&&typeof t=="string"&&t){var o=Zt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Gp.has(o)||(Gp.add(o),e={rel:e,crossOrigin:l,href:t},n.querySelector(o)===null&&(t=n.createElement("link"),mt(t,"link",e),rt(t),n.head.appendChild(t)))}}function gy(e){Yl.D(e),Kp("dns-prefetch",e,null)}function jy(e,t){Yl.C(e,t),Kp("preconnect",e,t)}function Sy(e,t,l){Yl.L(e,t,l);var n=ci;if(n&&e&&t){var o='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Zt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Zt(l.imageSizes)+'"]')):o+='[href="'+Zt(e)+'"]';var c=o;switch(t){case"style":c=di(e);break;case"script":c=fi(e)}tl.has(c)||(e=y({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),tl.set(c,e),n.querySelector(o)!==null||t==="style"&&n.querySelector(Tr(c))||t==="script"&&n.querySelector(Er(c))||(t=n.createElement("link"),mt(t,"link",e),rt(t),n.head.appendChild(t)))}}function Ny(e,t){Yl.m(e,t);var l=ci;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Zt(n)+'"][href="'+Zt(e)+'"]',c=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=fi(e)}if(!tl.has(c)&&(e=y({rel:"modulepreload",href:e},t),tl.set(c,e),l.querySelector(o)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Er(c)))return}n=l.createElement("link"),mt(n,"link",e),rt(n),l.head.appendChild(n)}}}function My(e,t,l){Yl.S(e,t,l);var n=ci;if(n&&e){var o=On(n).hoistableStyles,c=di(e);t=t||"default";var f=o.get(c);if(!f){var b={loading:0,preload:null};if(f=n.querySelector(Tr(c)))b.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},l),(l=tl.get(c))&&id(e,l);var S=f=n.createElement("link");rt(S),mt(S,"link",e),S._p=new Promise(function(_,q){S.onload=_,S.onerror=q}),S.addEventListener("load",function(){b.loading|=1}),S.addEventListener("error",function(){b.loading|=2}),b.loading|=4,mo(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:b},o.set(c,f)}}}function wy(e,t){Yl.X(e,t);var l=ci;if(l&&e){var n=On(l).hoistableScripts,o=fi(e),c=n.get(o);c||(c=l.querySelector(Er(o)),c||(e=y({src:e,async:!0},t),(t=tl.get(o))&&rd(e,t),c=l.createElement("script"),rt(c),mt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function Cy(e,t){Yl.M(e,t);var l=ci;if(l&&e){var n=On(l).hoistableScripts,o=fi(e),c=n.get(o);c||(c=l.querySelector(Er(o)),c||(e=y({src:e,async:!0,type:"module"},t),(t=tl.get(o))&&rd(e,t),c=l.createElement("script"),rt(c),mt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function Xp(e,t,l,n){var o=(o=ae.current)?fo(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=di(l.href),l=On(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=di(l.href);var c=On(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(Tr(e)))&&!c._p&&(f.instance=c,f.state.loading=5),tl.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},tl.set(e,l),c||Ty(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=fi(l),l=On(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 di(e){return'href="'+Zt(e)+'"'}function Tr(e){return'link[rel="stylesheet"]['+e+"]"}function Vp(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Ty(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}),mt(t,"link",l),rt(t),e.head.appendChild(t))}function fi(e){return'[src="'+Zt(e)+'"]'}function Er(e){return"script[async]"+e}function Zp(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Zt(l.href)+'"]');if(n)return t.instance=n,rt(n),n;var o=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),rt(n),mt(n,"style",o),mo(n,l.precedence,e),t.instance=n;case"stylesheet":o=di(l.href);var c=e.querySelector(Tr(o));if(c)return t.state.loading|=4,t.instance=c,rt(c),c;n=Vp(l),(o=tl.get(o))&&id(n,o),c=(e.ownerDocument||e).createElement("link"),rt(c);var f=c;return f._p=new Promise(function(b,S){f.onload=b,f.onerror=S}),mt(c,"link",n),t.state.loading|=4,mo(c,l.precedence,e),t.instance=c;case"script":return c=fi(l.src),(o=e.querySelector(Er(c)))?(t.instance=o,rt(o),o):(n=l,(o=tl.get(c))&&(n=y({},l),rd(n,o)),e=e.ownerDocument||e,o=e.createElement("script"),rt(o),mt(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,mo(n,l.precedence,e));return t.instance}function mo(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 b=n[f];if(b.dataset.precedence===t)c=b;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 id(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ho=null;function $p(e,t,l){if(ho===null){var n=new Map,o=ho=new Map;o.set(l,n)}else o=ho,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[Ki]||c[qe]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var b=n.get(f);b?b.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 Ey(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 Fp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ay(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=di(n.href),c=t.querySelector(Tr(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=po.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,rt(c);return}c=t.ownerDocument||t,n=Vp(n),(o=tl.get(o))&&id(n,o),c=c.createElement("link"),rt(c);var f=c;f._p=new Promise(function(b,S){f.onload=b,f.onerror=S}),mt(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=po.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var sd=0;function zy(e,t){return e.stylesheets&&e.count===0&&vo(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&sd===0&&(sd=62500*cy());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>sd?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(o)}}:null}function po(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xo=null;function vo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xo=new Map,t.forEach(Ry,e),xo=null,po.call(e))}function Ry(e,t){if(!(t.state.loading&4)){var l=xo.get(e);if(l)var n=l.get(null);else{l=new Map,xo.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=po.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 Ar={$$typeof:K,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function _y(e,t,l,n,o,c,f,b,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=Tn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tn(0),this.hiddenUpdates=Tn(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 Wp(e,t,l,n,o,c,f,b,S,_,q,Y){return e=new _y(e,t,l,f,S,_,q,Y,b),t=1,c===!0&&(t|=24),c=Ut(3,null,null,t),e.current=c,c.stateNode=e,t=qu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:n,isDehydrated:l,cache:t},Ku(c),e}function Pp(e){return e?(e=Gn,e):Gn}function Ip(e,t,l,n,o,c){o=Pp(o),n.context===null?n.context=o:n.pendingContext=o,n=da(t),n.payload={element:l},c=c===void 0?null:c,c!==null&&(n.callback=c),l=fa(e,n,t),l!==null&&(Rt(l,e,t),sr(l,e,t))}function ex(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function od(e,t){ex(e,t),(e=e.alternate)&&ex(e,t)}function tx(e){if(e.tag===13||e.tag===31){var t=Fa(e,67108864);t!==null&&Rt(t,e,67108864),od(e,67108864)}}function lx(e){if(e.tag===13||e.tag===31){var t=Qt();t=En(t);var l=Fa(e,t);l!==null&&Rt(l,e,t),od(e,t)}}var bo=!0;function Oy(e,t,l,n){var o=B.T;B.T=null;var c=J.p;try{J.p=2,ud(e,t,l,n)}finally{J.p=c,B.T=o}}function Dy(e,t,l,n){var o=B.T;B.T=null;var c=J.p;try{J.p=8,ud(e,t,l,n)}finally{J.p=c,B.T=o}}function ud(e,t,l,n){if(bo){var o=cd(n);if(o===null)Jc(e,t,n,yo,l),nx(e,n);else if(Uy(o,e,t,l,n))n.stopPropagation();else if(nx(e,n),t&4&&-1<ky.indexOf(e)){for(;o!==null;){var c=_n(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=xl(c.pendingLanes);if(f!==0){var b=c;for(b.pendingLanes|=2,b.entangledLanes|=2;f;){var S=1<<31-gt(f);b.entanglements[1]|=S,f&=~S}gl(c),(_e&6)===0&&(eo=bt()+500,Nr(0))}}break;case 31:case 13:b=Fa(c,2),b!==null&&Rt(b,c,2),lo(),od(c,2)}if(c=cd(n),c===null&&Jc(e,t,n,yo,l),c===o)break;o=c}o!==null&&n.stopPropagation()}else Jc(e,t,n,null,l)}}function cd(e){return e=fu(e),dd(e)}var yo=null;function dd(e){if(yo=null,e=Rn(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=v(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 yo=e,null}function ax(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(tu()){case is:return 2;case rs:return 8;case Cn:case lu:return 32;case ss:return 268435456;default:return 32}default:return 32}}var fd=!1,Na=null,Ma=null,wa=null,zr=new Map,Rr=new Map,Ca=[],ky="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 nx(e,t){switch(e){case"focusin":case"focusout":Na=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":wa=null;break;case"pointerover":case"pointerout":zr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rr.delete(t.pointerId)}}function _r(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=_n(t),t!==null&&tx(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Uy(e,t,l,n,o){switch(t){case"focusin":return Na=_r(Na,e,t,l,n,o),!0;case"dragenter":return Ma=_r(Ma,e,t,l,n,o),!0;case"mouseover":return wa=_r(wa,e,t,l,n,o),!0;case"pointerover":var c=o.pointerId;return zr.set(c,_r(zr.get(c)||null,e,t,l,n,o)),!0;case"gotpointercapture":return c=o.pointerId,Rr.set(c,_r(Rr.get(c)||null,e,t,l,n,o)),!0}return!1}function ix(e){var t=Rn(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,Gi(e.priority,function(){lx(l)});return}}else if(t===31){if(t=v(l),t!==null){e.blockedOn=t,Gi(e.priority,function(){lx(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 go(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=cd(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);du=n,l.target.dispatchEvent(n),du=null}else return t=_n(l),t!==null&&tx(t),e.blockedOn=l,!1;t.shift()}return!0}function rx(e,t,l){go(e)&&l.delete(t)}function By(){fd=!1,Na!==null&&go(Na)&&(Na=null),Ma!==null&&go(Ma)&&(Ma=null),wa!==null&&go(wa)&&(wa=null),zr.forEach(rx),Rr.forEach(rx)}function jo(e,t){e.blockedOn===t&&(e.blockedOn=null,fd||(fd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,By)))}var So=null;function sx(e){So!==e&&(So=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){So===e&&(So=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(dd(n||l)===null)continue;break}var c=_n(l);c!==null&&(e.splice(t,3),t-=3,cc(c,{pending:!0,data:o,method:l.method,action:n},n,o))}}))}function mi(e){function t(S){return jo(S,e)}Na!==null&&jo(Na,e),Ma!==null&&jo(Ma,e),wa!==null&&jo(wa,e),zr.forEach(t),Rr.forEach(t);for(var l=0;l<Ca.length;l++){var n=Ca[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ca.length&&(l=Ca[0],l.blockedOn===null);)ix(l),l.blockedOn===null&&Ca.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[Pe]||null;if(typeof c=="function")f||sx(l);else if(f){var b=null;if(c&&c.hasAttribute("formAction")){if(o=c,f=c[Pe]||null)b=f.formAction;else if(dd(o)!==null)continue}else b=f.action;typeof b=="function"?l[n+1]=b:(l.splice(n,3),n-=3),sx(l)}}}function ox(){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 md(e){this._internalRoot=e}No.prototype.render=md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,n=Qt();Ip(l,n,e,t,null,null)},No.prototype.unmount=md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ip(e.current,2,null,e,null,null),lo(),t[zn]=null}};function No(e){this._internalRoot=e}No.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yi();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ca.length&&t!==0&&t<Ca[l].priority;l++);Ca.splice(l,0,e),l===0&&ix(e)}};var ux=i.version;if(ux!=="19.2.7")throw Error(u(527,ux,"19.2.7"));J.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=x(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Ly={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mo.isDisabled&&Mo.supportsFiber)try{Qa=Mo.inject(Ly),yt=Mo}catch{}}return Dr.createRoot=function(e,t){if(!d(e))throw Error(u(299));var l=!1,n="",o=xh,c=vh,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=Wp(e,1,!1,null,null,l,n,null,o,c,f,ox),e[zn]=t.current,$c(e),new md(t)},Dr.hydrateRoot=function(e,t,l){if(!d(e))throw Error(u(299));var n=!1,o="",c=xh,f=vh,b=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&&(b=l.onRecoverableError),l.formState!==void 0&&(S=l.formState)),t=Wp(e,1,!0,t,l??null,n,o,S,c,f,b,ox),t.context=Pp(null),l=t.current,n=Qt(),n=En(n),o=da(n),o.callback=null,fa(l,o,n),l=n,t.current.lanes=l,ie(t,l),gl(t),e[zn]=t.current,$c(e),new No(t)},Dr.version="19.2.7",Dr}var gx;function Fy(){if(gx)return bd.exports;gx=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(),bd.exports=Jy(),bd.exports}var Wy=Fy();/**
|
|
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 jx="popstate";function Sx(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function Py(a={}){function i(u,d){var x;let m=(x=d.state)==null?void 0:x.masked,{pathname:h,search:v,hash:p}=m||u.location;return _d("",{pathname:h,search:v,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 s(u,d){return typeof d=="string"?d:Yr(d)}return eg(i,s,null,a)}function Ve(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function Ml(a,i){if(!a){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Iy(){return Math.random().toString(36).substring(2,10)}function Nx(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,s=null,u,d){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof i=="string"?ki(i):i,state:s,key:i&&i.key||u||Iy(),mask:d}}function Yr({pathname:a="/",search:i="",hash:s=""}){return i&&i!=="?"&&(a+=i.charAt(0)==="?"?i:"?"+i),s&&s!=="#"&&(a+=s.charAt(0)==="#"?s:"#"+s),a}function ki(a){let i={};if(a){let s=a.indexOf("#");s>=0&&(i.hash=a.substring(s),a=a.substring(0,s));let u=a.indexOf("?");u>=0&&(i.search=a.substring(u),a=a.substring(0,u)),a&&(i.pathname=a)}return i}function eg(a,i,s,u={}){let{window:d=document.defaultView,v5Compat:m=!1}=u,h=d.history,v="POP",p=null,x=g();x==null&&(x=0,h.replaceState({...h.state,idx:x},""));function g(){return(h.state||{idx:null}).idx}function y(){v="POP";let U=g(),k=U==null?null:U-x;x=U,p&&p({action:v,location:z.location,delta:k})}function E(U,k){v="PUSH";let G=Sx(U)?U:_d(z.location,U,k);x=g()+1;let K=Nx(G,x),H=z.createHref(G.mask||G);try{h.pushState(K,"",H)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(H)}m&&p&&p({action:v,location:z.location,delta:1})}function C(U,k){v="REPLACE";let G=Sx(U)?U:_d(z.location,U,k);x=g();let K=Nx(G,x),H=z.createHref(G.mask||G);h.replaceState(K,"",H),m&&p&&p({action:v,location:z.location,delta:0})}function A(U){return tg(d,U)}let z={get action(){return v},get location(){return a(d,h)},listen(U){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(jx,y),p=U,()=>{d.removeEventListener(jx,y),p=null}},createHref(U){return i(d,U)},createURL:A,encodeLocation(U){let k=A(U);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:E,replace:C,go(U){return h.go(U)}};return z}function tg(a,i,s=!1){let u="http://localhost";a&&(u=a.location.origin!=="null"?a.location.origin:a.location.href),Ve(u,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:Yr(i);return d=d.replace(/ $/,"%20"),!s&&d.startsWith("//")&&(d=u+d),new URL(d,u)}function pv(a,i,s="/"){return lg(a,i,s,!1)}function lg(a,i,s,u,d){let m=typeof i=="string"?ki(i):i,h=Fl(m.pathname||"/",s);if(h==null)return null;let v=ag(a),p=null,x=pg(h);for(let g=0;p==null&&g<v.length;++g)p=mg(v[g],x,u);return p}function ag(a){let i=xv(a);return ng(i),i}function xv(a,i=[],s=[],u="",d=!1){let m=(h,v,p=d,x)=>{let g={relativePath:x===void 0?h.path||"":x,caseSensitive:h.caseSensitive===!0,childrenIndex:v,route:h};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(u)&&p)return;Ve(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 y=ul([u,g.relativePath]),E=s.concat(g);h.children&&h.children.length>0&&(Ve(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),xv(h.children,i,E,y,p)),!(h.path==null&&!h.index)&&i.push({path:y,score:dg(y,h.index),routesMeta:E})};return a.forEach((h,v)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))m(h,v);else for(let x of vv(h.path))m(h,v,!0,x)}),i}function vv(a){let i=a.split("/");if(i.length===0)return[];let[s,...u]=i,d=s.endsWith("?"),m=s.replace(/\?$/,"");if(u.length===0)return d?[m,""]:[m];let h=vv(u.join("/")),v=[];return v.push(...h.map(p=>p===""?m:[m,p].join("/"))),d&&v.push(...h),v.map(p=>a.startsWith("/")&&p===""?"/":p)}function ng(a){a.sort((i,s)=>i.score!==s.score?s.score-i.score:fg(i.routesMeta.map(u=>u.childrenIndex),s.routesMeta.map(u=>u.childrenIndex)))}var ig=/^:[\w-]+$/,rg=3,sg=2,og=1,ug=10,cg=-2,Mx=a=>a==="*";function dg(a,i){let s=a.split("/"),u=s.length;return s.some(Mx)&&(u+=cg),i&&(u+=sg),s.filter(d=>!Mx(d)).reduce((d,m)=>d+(ig.test(m)?rg:m===""?og:ug),u)}function fg(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 mg(a,i,s=!1){let{routesMeta:u}=a,d={},m="/",h=[];for(let v=0;v<u.length;++v){let p=u[v],x=v===u.length-1,g=m==="/"?i:i.slice(m.length)||"/",y=Bo({path:p.relativePath,caseSensitive:p.caseSensitive,end:x},g),E=p.route;if(!y&&x&&s&&!u[u.length-1].route.index&&(y=Bo({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!y)return null;Object.assign(d,y.params),h.push({params:d,pathname:ul([m,y.pathname]),pathnameBase:yg(ul([m,y.pathnameBase])),route:E}),y.pathnameBase!=="/"&&(m=ul([m,y.pathnameBase]))}return h}function Bo(a,i){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[s,u]=hg(a.path,a.caseSensitive,a.end),d=i.match(s);if(!d)return null;let m=d[0],h=m.replace(/(.)\/+$/,"$1"),v=d.slice(1);return{params:u.reduce((x,{paramName:g,isOptional:y},E)=>{if(g==="*"){let A=v[E]||"";h=m.slice(0,m.length-A.length).replace(/(.)\/+$/,"$1")}const C=v[E];return y&&!C?x[g]=void 0:x[g]=(C||"").replace(/%2F/g,"/"),x},{}),pathname:m,pathnameBase:h,pattern:a}}function hg(a,i=!1,s=!0){Ml(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,v,p,x,g)=>{if(u.push({paramName:v,isOptional:p!=null}),p){let y=g.charAt(x+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(u.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),u]}function pg(a){try{return a.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Ml(!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 Fl(a,i){if(i==="/")return a;if(!a.toLowerCase().startsWith(i.toLowerCase()))return null;let s=i.endsWith("/")?i.length-1:i.length,u=a.charAt(s);return u&&u!=="/"?null:a.slice(s)||"/"}var xg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function vg(a,i="/"){let{pathname:s,search:u="",hash:d=""}=typeof a=="string"?ki(a):a,m;return s?(s=yv(s),s.startsWith("/")?m=wx(s.substring(1),"/"):m=wx(s,i)):m=i,{pathname:m,search:gg(u),hash:jg(d)}}function wx(a,i){let s=Lo(i).split("/");return a.split("/").forEach(d=>{d===".."?s.length>1&&s.pop():d!=="."&&s.push(d)}),s.length>1?s.join("/"):"/"}function Sd(a,i,s,u){return`Cannot include a '${a}' character in a manually specified \`to.${i}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${s}\` 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,s)=>s===0||i.route.path&&i.route.path.length>0)}function bv(a){let i=bg(a);return i.map((s,u)=>u===i.length-1?s.pathname:s.pathnameBase)}function lf(a,i,s,u=!1){let d;typeof a=="string"?d=ki(a):(d={...a},Ve(!d.pathname||!d.pathname.includes("?"),Sd("?","pathname","search",d)),Ve(!d.pathname||!d.pathname.includes("#"),Sd("#","pathname","hash",d)),Ve(!d.search||!d.search.includes("#"),Sd("#","search","hash",d)));let m=a===""||d.pathname==="",h=m?"/":d.pathname,v;if(h==null)v=s;else{let y=i.length-1;if(!u&&h.startsWith("..")){let E=h.split("/");for(;E[0]==="..";)E.shift(),y-=1;d.pathname=E.join("/")}v=y>=0?i[y]:"/"}let p=vg(d,v),x=h&&h!=="/"&&h.endsWith("/"),g=(m||h===".")&&s.endsWith("/");return!p.pathname.endsWith("/")&&(x||g)&&(p.pathname+="/"),p}var yv=a=>a.replace(/\/\/+/g,"/"),ul=a=>yv(a.join("/")),Lo=a=>a.replace(/\/+$/,""),yg=a=>Lo(a).replace(/^\/*/,"/"),gg=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,jg=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Sg=class{constructor(a,i,s,u=!1){this.status=a,this.statusText=i||"",this.internal=u,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Ng(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Mg(a){let i=a.map(s=>s.route.path).filter(Boolean);return ul(i)||"/"}var gv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jv(a,i){let s=a;if(typeof s!="string"||!xg.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let u=s,d=!1;if(gv)try{let m=new URL(window.location.href),h=s.startsWith("//")?new URL(m.protocol+s):new URL(s),v=Fl(h.pathname,i);h.origin===m.origin&&v!=null?s=v+h.search+h.hash:d=!0}catch{Ml(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Sv=["POST","PUT","PATCH","DELETE"];new Set(Sv);var wg=["GET",...Sv];new Set(wg);var Ui=j.createContext(null);Ui.displayName="DataRouter";var Xo=j.createContext(null);Xo.displayName="DataRouterState";var Nv=j.createContext(!1);function Cg(){return j.useContext(Nv)}var Mv=j.createContext({isTransitioning:!1});Mv.displayName="ViewTransition";var Tg=j.createContext(new Map);Tg.displayName="Fetchers";var Eg=j.createContext(null);Eg.displayName="Await";var al=j.createContext(null);al.displayName="Navigation";var Wr=j.createContext(null);Wr.displayName="Location";var Pl=j.createContext({outlet:null,matches:[],isDataRoute:!1});Pl.displayName="Route";var af=j.createContext(null);af.displayName="RouteError";var wv="REACT_ROUTER_ERROR",Ag="REDIRECT",zg="ROUTE_ERROR_RESPONSE";function Rg(a){if(a.startsWith(`${wv}:${Ag}:{`))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(`${wv}:${zg}:{`))try{let i=JSON.parse(a.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new Sg(i.status,i.statusText,i.data)}catch{}}function Og(a,{relative:i}={}){Ve(Pr(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:u}=j.useContext(al),{hash:d,pathname:m,search:h}=Ir(a,{relative:i}),v=m;return s!=="/"&&(v=m==="/"?s:ul([s,m])),u.createHref({pathname:v,search:h,hash:d})}function Pr(){return j.useContext(Wr)!=null}function Il(){return Ve(Pr(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Wr).location}var Cv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Tv(a){j.useContext(al).static||j.useLayoutEffect(a)}function Dg(){let{isDataRoute:a}=j.useContext(Pl);return a?Zg():kg()}function kg(){Ve(Pr(),"useNavigate() may be used only in the context of a <Router> component.");let a=j.useContext(Ui),{basename:i,navigator:s}=j.useContext(al),{matches:u}=j.useContext(Pl),{pathname:d}=Il(),m=JSON.stringify(bv(u)),h=j.useRef(!1);return Tv(()=>{h.current=!0}),j.useCallback((p,x={})=>{if(Ml(h.current,Cv),!h.current)return;if(typeof p=="number"){s.go(p);return}let g=lf(p,JSON.parse(m),d,x.relative==="path");a==null&&i!=="/"&&(g.pathname=g.pathname==="/"?i:ul([i,g.pathname])),(x.replace?s.replace:s.push)(g,x.state,x)},[i,s,m,d,a])}j.createContext(null);function Ir(a,{relative:i}={}){let{matches:s}=j.useContext(Pl),{pathname:u}=Il(),d=JSON.stringify(bv(s));return j.useMemo(()=>lf(a,JSON.parse(d),u,i==="path"),[a,d,u,i])}function Ug(a,i){return Ev(a,i)}function Ev(a,i,s){var U;Ve(Pr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=j.useContext(al),{matches:d}=j.useContext(Pl),m=d[d.length-1],h=m?m.params:{},v=m?m.pathname:"/",p=m?m.pathnameBase:"/",x=m&&m.route;{let k=x&&x.path||"";zv(v,!x||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${v}" (under <Route path="${k}">) 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="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=Il(),y;if(i){let k=typeof i=="string"?ki(i):i;Ve(p==="/"||((U=k.pathname)==null?void 0:U.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 "${k.pathname}" was given in the \`location\` prop.`),y=k}else y=g;let E=y.pathname||"/",C=E;if(p!=="/"){let k=p.replace(/^\//,"").split("/");C="/"+E.replace(/^\//,"").split("/").slice(k.length).join("/")}let A=s&&s.state.matches.length?s.state.matches.map(k=>Object.assign(k,{route:s.manifest[k.route.id]||k.route})):pv(a,{pathname:C});Ml(x||A!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Ml(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 "${y.pathname}${y.search}${y.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=Qg(A&&A.map(k=>Object.assign({},k,{params:Object.assign({},h,k.params),pathname:ul([p,u.encodeLocation?u.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:ul([p,u.encodeLocation?u.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),d,s);return i&&z?j.createElement(Wr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},z):z}function Bg(){let a=Vg(),i=Ng(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),s=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),s?j.createElement("pre",{style:d},s):null,h)}var Lg=j.createElement(Bg,null),Av=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 s=_g(a.digest);s&&(a=s)}let i=a!==void 0?j.createElement(Pl.Provider,{value:this.props.routeContext},j.createElement(af.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?j.createElement(Hg,{error:a},i):i}};Av.contextType=Nv;var Nd=new WeakMap;function Hg({children:a,error:i}){let{basename:s}=j.useContext(al);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let u=Rg(i.digest);if(u){let d=Nd.get(i);if(d)throw d;let m=jv(u.location,s);if(gv&&!Nd.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 Nd.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:s}){let u=j.useContext(Ui);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),j.createElement(Pl.Provider,{value:a},s)}function Qg(a,i=[],s){let u=s==null?void 0:s.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(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);Ve(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,v=-1;if(s&&u){h=u.renderFallback;for(let g=0;g<d.length;g++){let y=d[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(v=g),y.route.id){let{loaderData:E,errors:C}=u,A=y.route.loader&&!E.hasOwnProperty(y.route.id)&&(!C||C[y.route.id]===void 0);if(y.route.lazy||A){s.isStatic&&(h=!0),v>=0?d=d.slice(0,v+1):d=[d[0]];break}}}}let p=s==null?void 0:s.onError,x=u&&p?(g,y)=>{var E,C;p(g,{location:u.location,params:((C=(E=u.matches)==null?void 0:E[0])==null?void 0:C.params)??{},pattern:Mg(u.matches),errorInfo:y})}:void 0;return d.reduceRight((g,y,E)=>{let C,A=!1,z=null,U=null;u&&(C=m&&y.route.id?m[y.route.id]:void 0,z=y.route.errorElement||Lg,h&&(v<0&&E===0?(zv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,U=null):v===E&&(A=!0,U=y.route.hydrateFallbackElement||null)));let k=i.concat(d.slice(0,E+1)),G=()=>{let K;return C?K=z:A?K=U:y.route.Component?K=j.createElement(y.route.Component,null):y.route.element?K=y.route.element:K=g,j.createElement(qg,{match:y,routeContext:{outlet:g,matches:k,isDataRoute:u!=null},children:K})};return u&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?j.createElement(Av,{location:u.location,revalidation:u.revalidation,component:z,error:C,children:G(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:x}):G()},null)}function nf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yg(a){let i=j.useContext(Ui);return Ve(i,nf(a)),i}function Gg(a){let i=j.useContext(Xo);return Ve(i,nf(a)),i}function Kg(a){let i=j.useContext(Pl);return Ve(i,nf(a)),i}function rf(a){let i=Kg(a),s=i.matches[i.matches.length-1];return Ve(s.route.id,`${a} can only be used on routes that contain a unique "id"`),s.route.id}function Xg(){return rf("useRouteId")}function Vg(){var u;let a=j.useContext(af),i=Gg("useRouteError"),s=rf("useRouteError");return a!==void 0?a:(u=i.errors)==null?void 0:u[s]}function Zg(){let{router:a}=Yg("useNavigate"),i=rf("useNavigate"),s=j.useRef(!1);return Tv(()=>{s.current=!0}),j.useCallback(async(d,m={})=>{Ml(s.current,Cv),s.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:i,...m}))},[a,i])}var Cx={};function zv(a,i,s){!i&&!Cx[a]&&(Cx[a]=!0,Ml(!1,s))}j.memo($g);function $g({routes:a,manifest:i,future:s,state:u,isStatic:d,onError:m}){return Ev(a,void 0,{manifest:i,state:u,isStatic:d,onError:m})}function bi(a){Ve(!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:s,navigationType:u="POP",navigator:d,static:m=!1,useTransitions:h}){Ve(!Pr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let v=a.replace(/^\/*/,"/"),p=j.useMemo(()=>({basename:v,navigator:d,static:m,useTransitions:h,future:{}}),[v,d,m,h]);typeof s=="string"&&(s=ki(s));let{pathname:x="/",search:g="",hash:y="",state:E=null,key:C="default",mask:A}=s,z=j.useMemo(()=>{let U=Fl(x,v);return U==null?null:{location:{pathname:U,search:g,hash:y,state:E,key:C,mask:A},navigationType:u}},[v,x,g,y,E,C,u,A]);return Ml(z!=null,`<Router basename="${v}"> is not able to match the URL "${x}${g}${y}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:j.createElement(al.Provider,{value:p},j.createElement(Wr.Provider,{children:i,value:z}))}function Fg({children:a,location:i}){return Ug(Od(a),i)}function Od(a,i=[]){let s=[];return j.Children.forEach(a,(u,d)=>{if(!j.isValidElement(u))return;let m=[...i,d];if(u.type===j.Fragment){s.push.apply(s,Od(u.props.children,m));return}Ve(u.type===bi,`[${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>`),Ve(!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=Od(u.props.children,m)),s.push(h)}),s}var Oo="get",Do="application/x-www-form-urlencoded";function Vo(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function Wg(a){return Vo(a)&&a.tagName.toLowerCase()==="button"}function Pg(a){return Vo(a)&&a.tagName.toLowerCase()==="form"}function Ig(a){return Vo(a)&&a.tagName.toLowerCase()==="input"}function e1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function t1(a,i){return a.button===0&&(!i||i==="_self")&&!e1(a)}var Co=null;function l1(){if(Co===null)try{new FormData(document.createElement("form"),0),Co=!1}catch{Co=!0}return Co}var a1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Md(a){return a!=null&&!a1.has(a)?(Ml(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Do}"`),null):a}function n1(a,i){let s,u,d,m,h;if(Pg(a)){let v=a.getAttribute("action");u=v?Fl(v,i):null,s=a.getAttribute("method")||Oo,d=Md(a.getAttribute("enctype"))||Do,m=new FormData(a)}else if(Wg(a)||Ig(a)&&(a.type==="submit"||a.type==="image")){let v=a.form;if(v==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=a.getAttribute("formaction")||v.getAttribute("action");if(u=p?Fl(p,i):null,s=a.getAttribute("formmethod")||v.getAttribute("method")||Oo,d=Md(a.getAttribute("formenctype"))||Md(v.getAttribute("enctype"))||Do,m=new FormData(v,a),!l1()){let{name:x,type:g,value:y}=a;if(g==="image"){let E=x?`${x}.`:"";m.append(`${E}x`,"0"),m.append(`${E}y`,"0")}else x&&m.append(x,y)}}else{if(Vo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Oo,u=null,d=Do,h=a}return m&&d==="text/plain"&&(h=m,m=void 0),{action:u,method:s.toLowerCase(),encType:d,formData:m,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function sf(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function Rv(a,i,s,u){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return s?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:i&&Fl(d.pathname,i)==="/"?d.pathname=`${Lo(i)}/_root.${u}`:d.pathname=`${Lo(d.pathname)}.${u}`,d}async function i1(a,i){if(a.id in i)return i[a.id];try{let s=await import(a.module);return i[a.id]=s,s}catch(s){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function r1(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 s1(a,i,s){let u=await Promise.all(a.map(async d=>{let m=i.routes[d.route.id];if(m){let h=await i1(m,s);return h.links?h.links():[]}return[]}));return d1(u.flat(1).filter(r1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Tx(a,i,s,u,d,m){let h=(p,x)=>s[x]?p.route.id!==s[x].route.id:!0,v=(p,x)=>{var g;return s[x].pathname!==p.pathname||((g=s[x].route.path)==null?void 0:g.endsWith("*"))&&s[x].params["*"]!==p.params["*"]};return m==="assets"?i.filter((p,x)=>h(p,x)||v(p,x)):m==="data"?i.filter((p,x)=>{var y;let g=u.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(h(p,x)||v(p,x))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((y=s[0])==null?void 0:y.params)||{},nextUrl:new URL(a,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function o1(a,i,{includeHydrateFallback:s}={}){return u1(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)),s&&d.hydrateFallbackModule&&(m=m.concat(d.hydrateFallbackModule)),d.imports&&(m=m.concat(d.imports)),m}).flat(1))}function u1(a){return[...new Set(a)]}function c1(a){let i={},s=Object.keys(a).sort();for(let u of s)i[u]=a[u];return i}function d1(a,i){let s=new Set;return new Set(i),a.reduce((u,d)=>{let m=JSON.stringify(c1(d));return s.has(m)||(s.add(m),u.push({key:m,link:d})),u},[])}function of(){let a=j.useContext(Ui);return sf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function f1(){let a=j.useContext(Xo);return sf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var uf=j.createContext(void 0);uf.displayName="FrameworkContext";function cf(){let a=j.useContext(uf);return sf(a,"You must render this element inside a <HydratedRouter> element"),a}function m1(a,i){let s=j.useContext(uf),[u,d]=j.useState(!1),[m,h]=j.useState(!1),{onFocus:v,onBlur:p,onMouseEnter:x,onMouseLeave:g,onTouchStart:y}=i,E=j.useRef(null);j.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let z=k=>{k.forEach(G=>{h(G.isIntersecting)})},U=new IntersectionObserver(z,{threshold:.5});return E.current&&U.observe(E.current),()=>{U.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 s?a!=="intent"?[m,E,{}]:[m,E,{onFocus:kr(v,C),onBlur:kr(p,A),onMouseEnter:kr(x,C),onMouseLeave:kr(g,A),onTouchStart:kr(y,C)}]:[!1,E,{}]}function kr(a,i){return s=>{a&&a(s),s.defaultPrevented||i(s)}}function h1({page:a,...i}){let s=Cg(),{router:u}=of(),d=j.useMemo(()=>pv(u.routes,a,u.basename),[u.routes,a,u.basename]);return d?s?j.createElement(x1,{page:a,matches:d,...i}):j.createElement(v1,{page:a,matches:d,...i}):null}function p1(a){let{manifest:i,routeModules:s}=cf(),[u,d]=j.useState([]);return j.useEffect(()=>{let m=!1;return s1(a,i,s).then(h=>{m||d(h)}),()=>{m=!0}},[a,i,s]),u}function x1({page:a,matches:i,...s}){let u=Il(),{future:d}=cf(),{basename:m}=of(),h=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let v=Rv(a,m,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,x=[];for(let g of i)typeof g.route.shouldRevalidate=="function"?p=!0:x.push(g.route.id);return p&&x.length>0&&v.searchParams.set("_routes",x.join(",")),[v.pathname+v.search]},[m,d.v8_trailingSlashAwareDataRequests,a,u,i]);return j.createElement(j.Fragment,null,h.map(v=>j.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...s})))}function v1({page:a,matches:i,...s}){let u=Il(),{future:d,manifest:m,routeModules:h}=cf(),{basename:v}=of(),{loaderData:p,matches:x}=f1(),g=j.useMemo(()=>Tx(a,i,x,m,u,"data"),[a,i,x,m,u]),y=j.useMemo(()=>Tx(a,i,x,m,u,"assets"),[a,i,x,m,u]),E=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let z=new Set,U=!1;if(i.forEach(G=>{var H;let K=m.routes[G.route.id];!K||!K.hasLoader||(!g.some(V=>V.route.id===G.route.id)&&G.route.id in p&&((H=h[G.route.id])!=null&&H.shouldRevalidate)||K.hasClientLoader?U=!0:z.add(G.route.id))}),z.size===0)return[];let k=Rv(a,v,d.v8_trailingSlashAwareDataRequests,"data");return U&&z.size>0&&k.searchParams.set("_routes",i.filter(G=>z.has(G.route.id)).map(G=>G.route.id).join(",")),[k.pathname+k.search]},[v,d.v8_trailingSlashAwareDataRequests,p,u,m,g,i,a,h]),C=j.useMemo(()=>o1(y,m),[y,m]),A=p1(y);return j.createElement(j.Fragment,null,E.map(z=>j.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...s})),C.map(z=>j.createElement("link",{key:z,rel:"modulepreload",href:z,...s})),A.map(({key:z,link:U})=>j.createElement("link",{key:z,nonce:s.nonce,...U,crossOrigin:U.crossOrigin??s.crossOrigin})))}function b1(...a){return i=>{a.forEach(s=>{typeof s=="function"?s(i):s!=null&&(s.current=i)})}}var y1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{y1&&(window.__reactRouterVersion="7.17.0")}catch{}function g1({basename:a,children:i,useTransitions:s,window:u}){let d=j.useRef();d.current==null&&(d.current=Py({window:u,v5Compat:!0}));let m=d.current,[h,v]=j.useState({action:m.action,location:m.location}),p=j.useCallback(x=>{s===!1?v(x):j.startTransition(()=>v(x))},[s]);return j.useLayoutEffect(()=>m.listen(p),[m,p]),j.createElement(Jg,{basename:a,children:i,location:h.location,navigationType:h.action,navigator:m,useTransitions:s})}var _v=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,es=j.forwardRef(function({onClick:i,discover:s="render",prefetch:u="none",relative:d,reloadDocument:m,replace:h,mask:v,state:p,target:x,to:g,preventScrollReset:y,viewTransition:E,defaultShouldRevalidate:C,...A},z){let{basename:U,navigator:k,useTransitions:G}=j.useContext(al),K=typeof g=="string"&&_v.test(g),H=jv(g,U);g=H.to;let V=Og(g,{relative:d}),P=Il(),$=null;if(v){let ue=lf(v,[],P.mask?P.mask.pathname:"/",!0);U!=="/"&&(ue.pathname=ue.pathname==="/"?U:ul([U,ue.pathname])),$=k.createHref(ue)}let[ee,le,oe]=m1(u,A),F=N1(g,{replace:h,mask:v,state:p,target:x,preventScrollReset:y,relative:d,viewTransition:E,defaultShouldRevalidate:C,useTransitions:G});function me(ue){i&&i(ue),ue.defaultPrevented||F(ue)}let pe=!(H.isExternal||m),Te=j.createElement("a",{...A,...oe,href:(pe?$:void 0)||H.absoluteURL||V,onClick:pe?me:i,ref:b1(z,le),target:x,"data-discover":!K&&s==="render"?"true":void 0});return ee&&!K?j.createElement(j.Fragment,null,Te,j.createElement(h1,{page:V})):Te});es.displayName="Link";var df=j.forwardRef(function({"aria-current":i="page",caseSensitive:s=!1,className:u="",end:d=!1,style:m,to:h,viewTransition:v,children:p,...x},g){let y=Ir(h,{relative:x.relative}),E=Il(),C=j.useContext(Xo),{navigator:A,basename:z}=j.useContext(al),U=C!=null&&E1(y)&&v===!0,k=A.encodeLocation?A.encodeLocation(y).pathname:y.pathname,G=E.pathname,K=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;s||(G=G.toLowerCase(),K=K?K.toLowerCase():null,k=k.toLowerCase()),K&&z&&(K=Fl(K,z)||K);const H=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let V=G===k||!d&&G.startsWith(k)&&G.charAt(H)==="/",P=K!=null&&(K===k||!d&&K.startsWith(k)&&K.charAt(k.length)==="/"),$={isActive:V,isPending:P,isTransitioning:U},ee=V?i:void 0,le;typeof u=="function"?le=u($):le=[u,V?"active":null,P?"pending":null,U?"transitioning":null].filter(Boolean).join(" ");let oe=typeof m=="function"?m($):m;return j.createElement(es,{...x,"aria-current":ee,className:le,ref:g,style:oe,to:h,viewTransition:v},typeof p=="function"?p($):p)});df.displayName="NavLink";var j1=j.forwardRef(({discover:a="render",fetcherKey:i,navigate:s,reloadDocument:u,replace:d,state:m,method:h=Oo,action:v,onSubmit:p,relative:x,preventScrollReset:g,viewTransition:y,defaultShouldRevalidate:E,...C},A)=>{let{useTransitions:z}=j.useContext(al),U=C1(),k=T1(v,{relative:x}),G=h.toLowerCase()==="get"?"get":"post",K=typeof v=="string"&&_v.test(v),H=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let P=V.nativeEvent.submitter,$=(P==null?void 0:P.getAttribute("formmethod"))||h,ee=()=>U(P||V.currentTarget,{fetcherKey:i,method:$,navigate:s,replace:d,state:m,relative:x,preventScrollReset:g,viewTransition:y,defaultShouldRevalidate:E});z&&s!==!1?j.startTransition(()=>ee()):ee()};return j.createElement("form",{ref:A,method:G,action:k,onSubmit:u?p:H,...C,"data-discover":!K&&a==="render"?"true":void 0})});j1.displayName="Form";function S1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ov(a){let i=j.useContext(Ui);return Ve(i,S1(a)),i}function N1(a,{target:i,replace:s,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:v,defaultShouldRevalidate:p,useTransitions:x}={}){let g=Dg(),y=Il(),E=Ir(a,{relative:h});return j.useCallback(C=>{if(t1(C,i)){C.preventDefault();let A=s!==void 0?s:Yr(y)===Yr(E),z=()=>g(a,{replace:A,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:v,defaultShouldRevalidate:p});x?j.startTransition(()=>z()):z()}},[y,g,E,s,u,d,i,a,m,h,v,p,x])}var M1=0,w1=()=>`__${String(++M1)}__`;function C1(){let{router:a}=Ov("useSubmit"),{basename:i}=j.useContext(al),s=Xg(),u=a.fetch,d=a.navigate;return j.useCallback(async(m,h={})=>{let{action:v,method:p,encType:x,formData:g,body:y}=n1(m,i);if(h.navigate===!1){let E=h.fetcherKey||w1();await u(E,s,h.action||v,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:y,formMethod:h.method||p,formEncType:h.encType||x,flushSync:h.flushSync})}else await d(h.action||v,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:y,formMethod:h.method||p,formEncType:h.encType||x,replace:h.replace,state:h.state,fromRouteId:s,flushSync:h.flushSync,viewTransition:h.viewTransition})},[u,d,i,s])}function T1(a,{relative:i}={}){let{basename:s}=j.useContext(al),u=j.useContext(Pl);Ve(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),m={...Ir(a||".",{relative:i})},h=Il();if(a==null){m.search=h.search;let v=new URLSearchParams(m.search),p=v.getAll("index");if(p.some(g=>g==="")){v.delete("index"),p.filter(y=>y).forEach(y=>v.append("index",y));let g=v.toString();m.search=g?`?${g}`:""}}return(!a||a===".")&&d.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(m.pathname=m.pathname==="/"?s:ul([s,m.pathname])),Yr(m)}function E1(a,{relative:i}={}){let s=j.useContext(Mv);Ve(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Ov("useViewTransitionState"),d=Ir(a,{relative:i});if(!s.isTransitioning)return!1;let m=Fl(s.currentLocation.pathname,u)||s.currentLocation.pathname,h=Fl(s.nextLocation.pathname,u)||s.nextLocation.pathname;return Bo(d.pathname,h)!=null||Bo(d.pathname,m)!=null}var Bi=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(){}},fn,Aa,gi,nv,A1=(nv=class extends Bi{constructor(){super();ce(this,fn);ce(this,Aa);ce(this,gi);te(this,gi,i=>{if(typeof window<"u"&&window.addEventListener){const s=()=>i();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){N(this,Aa)||this.setEventListener(N(this,gi))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,Aa))==null||i.call(this),te(this,Aa,void 0))}setEventListener(i){var s;te(this,gi,i),(s=N(this,Aa))==null||s.call(this),te(this,Aa,i(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(i){N(this,fn)!==i&&(te(this,fn,i),this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(s=>{s(i)})}isFocused(){var i;return typeof N(this,fn)=="boolean"?N(this,fn):((i=globalThis.document)==null?void 0:i.visibilityState)!=="hidden"}},fn=new WeakMap,Aa=new WeakMap,gi=new WeakMap,nv),ff=new A1,z1={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},za,ef,iv,R1=(iv=class{constructor(){ce(this,za,z1);ce(this,ef,!1)}setTimeoutProvider(a){te(this,za,a)}setTimeout(a,i){return N(this,za).setTimeout(a,i)}clearTimeout(a){N(this,za).clearTimeout(a)}setInterval(a,i){return N(this,za).setInterval(a,i)}clearInterval(a){N(this,za).clearInterval(a)}},za=new WeakMap,ef=new WeakMap,iv),dn=new R1;function _1(a){setTimeout(a,0)}var O1=typeof window>"u"||"Deno"in globalThis;function Nt(){}function D1(a,i){return typeof a=="function"?a(i):a}function Dd(a){return typeof a=="number"&&a>=0&&a!==1/0}function Dv(a,i){return Math.max(a+(i||0)-Date.now(),0)}function La(a,i){return typeof a=="function"?a(i):a}function Gt(a,i){return typeof a=="function"?a(i):a}function Ex(a,i){const{type:s="all",exact:u,fetchStatus:d,predicate:m,queryKey:h,stale:v}=a;if(h){if(u){if(i.queryHash!==mf(h,i.options))return!1}else if(!Gr(i.queryKey,h))return!1}if(s!=="all"){const p=i.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof v=="boolean"&&i.isStale()!==v||d&&d!==i.state.fetchStatus||m&&!m(i))}function Ax(a,i){const{exact:s,status:u,predicate:d,mutationKey:m}=a;if(m){if(!i.options.mutationKey)return!1;if(s){if(Sn(i.options.mutationKey)!==Sn(m))return!1}else if(!Gr(i.options.mutationKey,m))return!1}return!(u&&i.state.status!==u||d&&!d(i))}function mf(a,i){return((i==null?void 0:i.queryKeyHashFn)||Sn)(a)}function Sn(a){return JSON.stringify(a,(i,s)=>kd(s)?Object.keys(s).sort().reduce((u,d)=>(u[d]=s[d],u),{}):s)}function Gr(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(s=>Gr(a[s],i[s])):!1}var k1=Object.prototype.hasOwnProperty;function kv(a,i,s=0){if(a===i)return a;if(s>500)return i;const u=zx(a)&&zx(i);if(!u&&!(kd(a)&&kd(i)))return i;const m=(u?a:Object.keys(a)).length,h=u?i:Object.keys(i),v=h.length,p=u?new Array(v):{};let x=0;for(let g=0;g<v;g++){const y=u?g:h[g],E=a[y],C=i[y];if(E===C){p[y]=E,(u?g<m:k1.call(a,y))&&x++;continue}if(E===null||C===null||typeof E!="object"||typeof C!="object"){p[y]=C;continue}const A=kv(E,C,s+1);p[y]=A,A===E&&x++}return m===v&&x===m?a:p}function Ho(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const s in a)if(a[s]!==i[s])return!1;return!0}function zx(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function kd(a){if(!Rx(a))return!1;const i=a.constructor;if(i===void 0)return!0;const s=i.prototype;return!(!Rx(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function Rx(a){return Object.prototype.toString.call(a)==="[object Object]"}function U1(a){return new Promise(i=>{dn.setTimeout(i,a)})}function Ud(a,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(a,i):s.structuralSharing!==!1?kv(a,i):i}function B1(a,i,s=0){const u=[...a,i];return s&&u.length>s?u.slice(1):u}function L1(a,i,s=0){const u=[i,...a];return s&&u.length>s?u.slice(0,-1):u}var hf=Symbol();function Uv(a,i){return!a.queryFn&&(i!=null&&i.initialPromise)?()=>i.initialPromise:!a.queryFn||a.queryFn===hf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function pf(a,i){return typeof a=="function"?a(...i):!!a}function H1(a,i,s){let u=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??(d=i()),u||(u=!0,d.aborted?s():d.addEventListener("abort",s,{once:!0})),d)}),a}var Kr=(()=>{let a=()=>O1;return{isServer(){return a()},setIsServer(i){a=i}}})();function Bd(){let a,i;const s=new Promise((d,m)=>{a=d,i=m});s.status="pending",s.catch(()=>{});function u(d){Object.assign(s,d),delete s.resolve,delete s.reject}return s.resolve=d=>{u({status:"fulfilled",value:d}),a(d)},s.reject=d=>{u({status:"rejected",reason:d}),i(d)},s}var q1=_1;function Q1(){let a=[],i=0,s=v=>{v()},u=v=>{v()},d=q1;const m=v=>{i?a.push(v):d(()=>{s(v)})},h=()=>{const v=a;a=[],v.length&&d(()=>{u(()=>{v.forEach(p=>{s(p)})})})};return{batch:v=>{let p;i++;try{p=v()}finally{i--,i||h()}return p},batchCalls:v=>(...p)=>{m(()=>{v(...p)})},schedule:m,setNotifyFunction:v=>{s=v},setBatchNotifyFunction:v=>{u=v},setScheduler:v=>{d=v}}}var nt=Q1(),ji,Ra,Si,rv,Y1=(rv=class extends Bi{constructor(){super();ce(this,ji,!0);ce(this,Ra);ce(this,Si);te(this,Si,i=>{if(typeof window<"u"&&window.addEventListener){const s=()=>i(!0),u=()=>i(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",u)}}})}onSubscribe(){N(this,Ra)||this.setEventListener(N(this,Si))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,Ra))==null||i.call(this),te(this,Ra,void 0))}setEventListener(i){var s;te(this,Si,i),(s=N(this,Ra))==null||s.call(this),te(this,Ra,i(this.setOnline.bind(this)))}setOnline(i){N(this,ji)!==i&&(te(this,ji,i),this.listeners.forEach(u=>{u(i)}))}isOnline(){return N(this,ji)}},ji=new WeakMap,Ra=new WeakMap,Si=new WeakMap,rv),qo=new Y1;function G1(a){return Math.min(1e3*2**a,3e4)}function Bv(a){return(a??"online")==="online"?qo.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 Lv(a){let i=!1,s=0,u;const d=Bd(),m=()=>d.status!=="pending",h=z=>{var U;if(!m()){const k=new Ld(z);E(k),(U=a.onCancel)==null||U.call(a,k)}},v=()=>{i=!0},p=()=>{i=!1},x=()=>ff.isFocused()&&(a.networkMode==="always"||qo.isOnline())&&a.canRun(),g=()=>Bv(a.networkMode)&&a.canRun(),y=z=>{m()||(u==null||u(),d.resolve(z))},E=z=>{m()||(u==null||u(),d.reject(z))},C=()=>new Promise(z=>{var U;u=k=>{(m()||x())&&z(k)},(U=a.onPause)==null||U.call(a)}).then(()=>{var z;u=void 0,m()||(z=a.onContinue)==null||z.call(a)}),A=()=>{if(m())return;let z;const U=s===0?a.initialPromise:void 0;try{z=U??a.fn()}catch(k){z=Promise.reject(k)}Promise.resolve(z).then(y).catch(k=>{var P;if(m())return;const G=a.retry??(Kr.isServer()?0:3),K=a.retryDelay??G1,H=typeof K=="function"?K(s,k):K,V=G===!0||typeof G=="number"&&s<G||typeof G=="function"&&G(s,k);if(i||!V){E(k);return}s++,(P=a.onFail)==null||P.call(a,s,k),U1(H).then(()=>x()?void 0:C()).then(()=>{i?E(k):A()})})};return{promise:d,status:()=>d.status,cancel:h,continue:()=>(u==null||u(),d),cancelRetry:v,continueRetry:p,canStart:g,start:()=>(g()?A():C().then(A),d)}}var mn,sv,Hv=(sv=class{constructor(){ce(this,mn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dd(this.gcTime)&&te(this,mn,dn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Kr.isServer()?1/0:300*1e3))}clearGcTimeout(){N(this,mn)!==void 0&&(dn.clearTimeout(N(this,mn)),te(this,mn,void 0))}},mn=new WeakMap,sv);function K1(a){return{onFetch:(i,s)=>{var g,y,E,C,A;const u=i.options,d=(E=(y=(g=i.fetchOptions)==null?void 0:g.meta)==null?void 0:y.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 v={pages:[],pageParams:[]},p=0;const x=async()=>{let z=!1;const U=K=>{H1(K,()=>i.signal,()=>z=!0)},k=Uv(i.options,i.fetchOptions),G=async(K,H,V)=>{if(z)return Promise.reject(i.signal.reason);if(H==null&&K.pages.length)return Promise.resolve(K);const $=(()=>{const F={client:i.client,queryKey:i.queryKey,pageParam:H,direction:V?"backward":"forward",meta:i.options.meta};return U(F),F})(),ee=await k($),{maxPages:le}=i.options,oe=V?L1:B1;return{pages:oe(K.pages,ee,le),pageParams:oe(K.pageParams,H,le)}};if(d&&m.length){const K=d==="backward",H=K?X1:_x,V={pages:m,pageParams:h},P=H(u,V);v=await G(V,P,K)}else{const K=a??m.length;do{const H=p===0?h[0]??u.initialPageParam:_x(u,v);if(p>0&&H==null)break;v=await G(v,H),p++}while(p<K)}return v};i.options.persister?i.fetchFn=()=>{var z,U;return(U=(z=i.options).persister)==null?void 0:U.call(z,x,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s)}:i.fetchFn=x}}}function _x(a,{pages:i,pageParams:s}){const u=i.length-1;return i.length>0?a.getNextPageParam(i[u],i,s[u],s):void 0}function X1(a,{pages:i,pageParams:s}){var u;return i.length>0?(u=a.getPreviousPageParam)==null?void 0:u.call(a,i[0],i,s[0],s):void 0}var Ni,hn,Mi,ll,pn,ot,Vr,xn,Yt,qv,Gl,ov,V1=(ov=class extends Hv{constructor(i){super();ce(this,Yt);ce(this,Ni);ce(this,hn);ce(this,Mi);ce(this,ll);ce(this,pn);ce(this,ot);ce(this,Vr);ce(this,xn);te(this,xn,!1),te(this,Vr,i.defaultOptions),this.setOptions(i.options),this.observers=[],te(this,pn,i.client),te(this,ll,N(this,pn).getQueryCache()),this.queryKey=i.queryKey,this.queryHash=i.queryHash,te(this,hn,Dx(this.options)),this.state=i.state??N(this,hn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,Ni)}get promise(){var i;return(i=N(this,ot))==null?void 0:i.promise}setOptions(i){if(this.options={...N(this,Vr),...i},i!=null&&i._type&&te(this,Ni,i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Dx(this.options);s.data!==void 0&&(this.setState(Ox(s.data,s.dataUpdatedAt)),te(this,hn,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,ll).remove(this)}setData(i,s){const u=Ud(this.state.data,i,this.options);return be(this,Yt,Gl).call(this,{data:u,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),u}setState(i){be(this,Yt,Gl).call(this,{type:"setState",state:i})}cancel(i){var u,d;const s=(u=N(this,ot))==null?void 0:u.promise;return(d=N(this,ot))==null||d.cancel(i),s?s.then(Nt).catch(Nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,hn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>Gt(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>La(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:!Dv(this.state.dataUpdatedAt,i)}onFocus(){var s;const i=this.observers.find(u=>u.shouldFetchOnWindowFocus());i==null||i.refetch({cancelRefetch:!1}),(s=N(this,ot))==null||s.continue()}onOnline(){var s;const i=this.observers.find(u=>u.shouldFetchOnReconnect());i==null||i.refetch({cancelRefetch:!1}),(s=N(this,ot))==null||s.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),N(this,ll).notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(s=>s!==i),this.observers.length||(N(this,ot)&&(N(this,xn)||be(this,Yt,qv).call(this)?N(this,ot).cancel({revert:!0}):N(this,ot).cancelRetry()),this.scheduleGc()),N(this,ll).notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||be(this,Yt,Gl).call(this,{type:"invalidate"})}async fetch(i,s){var x,g,y,E,C,A,z,U,k,G,K;if(this.state.fetchStatus!=="idle"&&((x=N(this,ot))==null?void 0:x.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(N(this,ot))return N(this,ot).continueRetry(),N(this,ot).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:()=>(te(this,xn,!0),u.signal)})},m=()=>{const H=Uv(this.options,s),P=(()=>{const $={client:N(this,pn),queryKey:this.queryKey,meta:this.meta};return d($),$})();return te(this,xn,!1),this.options.persister?this.options.persister(H,P,this):H(P)},v=(()=>{const H={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:N(this,pn),state:this.state,fetchFn:m};return d(H),H})(),p=N(this,Ni)==="infinite"?K1(this.options.pages):this.options.behavior;p==null||p.onFetch(v,this),te(this,Mi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=v.fetchOptions)==null?void 0:g.meta))&&be(this,Yt,Gl).call(this,{type:"fetch",meta:(y=v.fetchOptions)==null?void 0:y.meta}),te(this,ot,Lv({initialPromise:s==null?void 0:s.initialPromise,fn:v.fetchFn,onCancel:H=>{H instanceof Ld&&H.revert&&this.setState({...N(this,Mi),fetchStatus:"idle"}),u.abort()},onFail:(H,V)=>{be(this,Yt,Gl).call(this,{type:"failed",failureCount:H,error:V})},onPause:()=>{be(this,Yt,Gl).call(this,{type:"pause"})},onContinue:()=>{be(this,Yt,Gl).call(this,{type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode,canRun:()=>!0}));try{const H=await N(this,ot).start();if(H===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(H),(C=(E=N(this,ll).config).onSuccess)==null||C.call(E,H,this),(z=(A=N(this,ll).config).onSettled)==null||z.call(A,H,this.state.error,this),H}catch(H){if(H instanceof Ld){if(H.silent)return N(this,ot).promise;if(H.revert){if(this.state.data===void 0)throw H;return this.state.data}}throw be(this,Yt,Gl).call(this,{type:"error",error:H}),(k=(U=N(this,ll).config).onError)==null||k.call(U,H,this),(K=(G=N(this,ll).config).onSettled)==null||K.call(G,this.state.data,H,this),H}finally{this.scheduleGc()}}},Ni=new WeakMap,hn=new WeakMap,Mi=new WeakMap,ll=new WeakMap,pn=new WeakMap,ot=new WeakMap,Vr=new WeakMap,xn=new WeakMap,Yt=new WeakSet,qv=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Gl=function(i){const s=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,...Qv(u.data,this.options),fetchMeta:i.meta??null};case"success":const d={...u,...Ox(i.data,i.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return te(this,Mi,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=s(this.state),nt.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),N(this,ll).notify({query:this,type:"updated",action:i})})},ov);function Qv(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Bv(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function Ox(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Dx(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,s=i!==void 0,u=s?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var _t,Ce,Zr,St,vn,wi,Xl,_a,$r,Ci,Ti,bn,yn,Oa,Ei,Oe,qr,Hd,qd,Qd,Yd,Gd,Kd,Xd,Yv,uv,Z1=(uv=class extends Bi{constructor(i,s){super();ce(this,Oe);ce(this,_t);ce(this,Ce);ce(this,Zr);ce(this,St);ce(this,vn);ce(this,wi);ce(this,Xl);ce(this,_a);ce(this,$r);ce(this,Ci);ce(this,Ti);ce(this,bn);ce(this,yn);ce(this,Oa);ce(this,Ei,new Set);this.options=s,te(this,_t,i),te(this,_a,null),te(this,Xl,Bd()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ce).addObserver(this),kx(N(this,Ce),this.options)?be(this,Oe,qr).call(this):this.updateResult(),be(this,Oe,Yd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vd(N(this,Ce),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vd(N(this,Ce),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,be(this,Oe,Gd).call(this),be(this,Oe,Kd).call(this),N(this,Ce).removeObserver(this)}setOptions(i){const s=this.options,u=N(this,Ce);if(this.options=N(this,_t).defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Gt(this.options.enabled,N(this,Ce))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");be(this,Oe,Xd).call(this),N(this,Ce).setOptions(this.options),s._defaulted&&!Ho(this.options,s)&&N(this,_t).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ce),observer:this});const d=this.hasListeners();d&&Ux(N(this,Ce),u,this.options,s)&&be(this,Oe,qr).call(this),this.updateResult(),d&&(N(this,Ce)!==u||Gt(this.options.enabled,N(this,Ce))!==Gt(s.enabled,N(this,Ce))||La(this.options.staleTime,N(this,Ce))!==La(s.staleTime,N(this,Ce)))&&be(this,Oe,Hd).call(this);const m=be(this,Oe,qd).call(this);d&&(N(this,Ce)!==u||Gt(this.options.enabled,N(this,Ce))!==Gt(s.enabled,N(this,Ce))||m!==N(this,Oa))&&be(this,Oe,Qd).call(this,m)}getOptimisticResult(i){const s=N(this,_t).getQueryCache().build(N(this,_t),i),u=this.createResult(s,i);return J1(this,u)&&(te(this,St,u),te(this,wi,this.options),te(this,vn,N(this,Ce).state)),u}getCurrentResult(){return N(this,St)}trackResult(i,s){return new Proxy(i,{get:(u,d)=>(this.trackProp(d),s==null||s(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Xl).status==="pending"&&N(this,Xl).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(i){N(this,Ei).add(i)}getCurrentQuery(){return N(this,Ce)}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const s=N(this,_t).defaultQueryOptions(i),u=N(this,_t).getQueryCache().build(N(this,_t),s);return u.fetch().then(()=>this.createResult(u,s))}fetch(i){return be(this,Oe,qr).call(this,{...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,St)))}createResult(i,s){var le;const u=N(this,Ce),d=this.options,m=N(this,St),h=N(this,vn),v=N(this,wi),x=i!==u?i.state:N(this,Zr),{state:g}=i;let y={...g},E=!1,C;if(s._optimisticResults){const oe=this.hasListeners(),F=!oe&&kx(i,s),me=oe&&Ux(i,u,s,d);(F||me)&&(y={...y,...Qv(g.data,i.options)}),s._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:A,errorUpdatedAt:z,status:U}=y;C=y.data;let k=!1;if(s.placeholderData!==void 0&&C===void 0&&U==="pending"){let oe;m!=null&&m.isPlaceholderData&&s.placeholderData===(v==null?void 0:v.placeholderData)?(oe=m.data,k=!0):oe=typeof s.placeholderData=="function"?s.placeholderData((le=N(this,Ti))==null?void 0:le.state.data,N(this,Ti)):s.placeholderData,oe!==void 0&&(U="success",C=Ud(m==null?void 0:m.data,oe,s),E=!0)}if(s.select&&C!==void 0&&!k)if(m&&C===(h==null?void 0:h.data)&&s.select===N(this,$r))C=N(this,Ci);else try{te(this,$r,s.select),C=s.select(C),C=Ud(m==null?void 0:m.data,C,s),te(this,Ci,C),te(this,_a,null)}catch(oe){te(this,_a,oe)}N(this,_a)&&(A=N(this,_a),C=N(this,Ci),z=Date.now(),U="error");const G=y.fetchStatus==="fetching",K=U==="pending",H=U==="error",V=K&&G,P=C!==void 0,ee={status:U,fetchStatus:y.fetchStatus,isPending:K,isSuccess:U==="success",isError:H,isInitialLoading:V,isLoading:V,data:C,dataUpdatedAt:y.dataUpdatedAt,error:A,errorUpdatedAt:z,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:y.dataUpdateCount>x.dataUpdateCount||y.errorUpdateCount>x.errorUpdateCount,isFetching:G,isRefetching:G&&!K,isLoadingError:H&&!P,isPaused:y.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:H&&P,isStale:xf(i,s),refetch:this.refetch,promise:N(this,Xl),isEnabled:Gt(s.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const oe=ee.data!==void 0,F=ee.status==="error"&&!oe,me=ue=>{F?ue.reject(ee.error):oe&&ue.resolve(ee.data)},pe=()=>{const ue=te(this,Xl,ee.promise=Bd());me(ue)},Te=N(this,Xl);switch(Te.status){case"pending":i.queryHash===u.queryHash&&me(Te);break;case"fulfilled":(F||ee.data!==Te.value)&&pe();break;case"rejected":(!F||ee.error!==Te.reason)&&pe();break}}return ee}updateResult(){const i=N(this,St),s=this.createResult(N(this,Ce),this.options);if(te(this,vn,N(this,Ce).state),te(this,wi,this.options),N(this,vn).data!==void 0&&te(this,Ti,N(this,Ce)),Ho(s,i))return;te(this,St,s);const u=()=>{if(!i)return!0;const{notifyOnChangeProps:d}=this.options,m=typeof d=="function"?d():d;if(m==="all"||!m&&!N(this,Ei).size)return!0;const h=new Set(m??N(this,Ei));return this.options.throwOnError&&h.add("error"),Object.keys(N(this,St)).some(v=>{const p=v;return N(this,St)[p]!==i[p]&&h.has(p)})};be(this,Oe,Yv).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&be(this,Oe,Yd).call(this)}},_t=new WeakMap,Ce=new WeakMap,Zr=new WeakMap,St=new WeakMap,vn=new WeakMap,wi=new WeakMap,Xl=new WeakMap,_a=new WeakMap,$r=new WeakMap,Ci=new WeakMap,Ti=new WeakMap,bn=new WeakMap,yn=new WeakMap,Oa=new WeakMap,Ei=new WeakMap,Oe=new WeakSet,qr=function(i){be(this,Oe,Xd).call(this);let s=N(this,Ce).fetch(this.options,i);return i!=null&&i.throwOnError||(s=s.catch(Nt)),s},Hd=function(){be(this,Oe,Gd).call(this);const i=La(this.options.staleTime,N(this,Ce));if(Kr.isServer()||N(this,St).isStale||!Dd(i))return;const u=Dv(N(this,St).dataUpdatedAt,i)+1;te(this,bn,dn.setTimeout(()=>{N(this,St).isStale||this.updateResult()},u))},qd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ce)):this.options.refetchInterval)??!1},Qd=function(i){be(this,Oe,Kd).call(this),te(this,Oa,i),!(Kr.isServer()||Gt(this.options.enabled,N(this,Ce))===!1||!Dd(N(this,Oa))||N(this,Oa)===0)&&te(this,yn,dn.setInterval(()=>{(this.options.refetchIntervalInBackground||ff.isFocused())&&be(this,Oe,qr).call(this)},N(this,Oa)))},Yd=function(){be(this,Oe,Hd).call(this),be(this,Oe,Qd).call(this,be(this,Oe,qd).call(this))},Gd=function(){N(this,bn)!==void 0&&(dn.clearTimeout(N(this,bn)),te(this,bn,void 0))},Kd=function(){N(this,yn)!==void 0&&(dn.clearInterval(N(this,yn)),te(this,yn,void 0))},Xd=function(){const i=N(this,_t).getQueryCache().build(N(this,_t),this.options);if(i===N(this,Ce))return;const s=N(this,Ce);te(this,Ce,i),te(this,Zr,i.state),this.hasListeners()&&(s==null||s.removeObserver(this),i.addObserver(this))},Yv=function(i){nt.batch(()=>{i.listeners&&this.listeners.forEach(s=>{s(N(this,St))}),N(this,_t).getQueryCache().notify({query:N(this,Ce),type:"observerResultsUpdated"})})},uv);function $1(a,i){return Gt(i.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&Gt(i.retryOnMount,a)===!1)}function kx(a,i){return $1(a,i)||a.state.data!==void 0&&Vd(a,i,i.refetchOnMount)}function Vd(a,i,s){if(Gt(i.enabled,a)!==!1&&La(i.staleTime,a)!=="static"){const u=typeof s=="function"?s(a):s;return u==="always"||u!==!1&&xf(a,i)}return!1}function Ux(a,i,s,u){return(a!==i||Gt(u.enabled,a)===!1)&&(!s.suspense||a.state.status!=="error")&&xf(a,s)}function xf(a,i){return Gt(i.enabled,a)!==!1&&a.isStaleByTime(La(i.staleTime,a))}function J1(a,i){return!Ho(a.getCurrentResult(),i)}var Jr,jl,pt,gn,Sl,Ea,cv,F1=(cv=class extends Hv{constructor(i){super();ce(this,Sl);ce(this,Jr);ce(this,jl);ce(this,pt);ce(this,gn);te(this,Jr,i.client),this.mutationId=i.mutationId,te(this,pt,i.mutationCache),te(this,jl,[]),this.state=i.state||Gv(),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,jl).includes(i)||(N(this,jl).push(i),this.clearGcTimeout(),N(this,pt).notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){te(this,jl,N(this,jl).filter(s=>s!==i)),this.scheduleGc(),N(this,pt).notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){N(this,jl).length||(this.state.status==="pending"?this.scheduleGc():N(this,pt).remove(this))}continue(){var i;return((i=N(this,gn))==null?void 0:i.continue())??this.execute(this.state.variables)}async execute(i){var h,v,p,x,g,y,E,C,A,z,U,k,G,K,H,V,P,$;const s=()=>{be(this,Sl,Ea).call(this,{type:"continue"})},u={client:N(this,Jr),meta:this.options.meta,mutationKey:this.options.mutationKey};te(this,gn,Lv({fn:()=>this.options.mutationFn?this.options.mutationFn(i,u):Promise.reject(new Error("No mutationFn found")),onFail:(ee,le)=>{be(this,Sl,Ea).call(this,{type:"failed",failureCount:ee,error:le})},onPause:()=>{be(this,Sl,Ea).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,pt).canRun(this)}));const d=this.state.status==="pending",m=!N(this,gn).canStart();try{if(d)s();else{be(this,Sl,Ea).call(this,{type:"pending",variables:i,isPaused:m}),N(this,pt).config.onMutate&&await N(this,pt).config.onMutate(i,this,u);const le=await((v=(h=this.options).onMutate)==null?void 0:v.call(h,i,u));le!==this.state.context&&be(this,Sl,Ea).call(this,{type:"pending",context:le,variables:i,isPaused:m})}const ee=await N(this,gn).start();return await((x=(p=N(this,pt).config).onSuccess)==null?void 0:x.call(p,ee,i,this.state.context,this,u)),await((y=(g=this.options).onSuccess)==null?void 0:y.call(g,ee,i,this.state.context,u)),await((C=(E=N(this,pt).config).onSettled)==null?void 0:C.call(E,ee,null,this.state.variables,this.state.context,this,u)),await((z=(A=this.options).onSettled)==null?void 0:z.call(A,ee,null,i,this.state.context,u)),be(this,Sl,Ea).call(this,{type:"success",data:ee}),ee}catch(ee){try{await((k=(U=N(this,pt).config).onError)==null?void 0:k.call(U,ee,i,this.state.context,this,u))}catch(le){Promise.reject(le)}try{await((K=(G=this.options).onError)==null?void 0:K.call(G,ee,i,this.state.context,u))}catch(le){Promise.reject(le)}try{await((V=(H=N(this,pt).config).onSettled)==null?void 0:V.call(H,void 0,ee,this.state.variables,this.state.context,this,u))}catch(le){Promise.reject(le)}try{await(($=(P=this.options).onSettled)==null?void 0:$.call(P,void 0,ee,i,this.state.context,u))}catch(le){Promise.reject(le)}throw be(this,Sl,Ea).call(this,{type:"error",error:ee}),ee}finally{N(this,pt).runNext(this)}}},Jr=new WeakMap,jl=new WeakMap,pt=new WeakMap,gn=new WeakMap,Sl=new WeakSet,Ea=function(i){const s=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=s(this.state),nt.batch(()=>{N(this,jl).forEach(u=>{u.onMutationUpdate(i)}),N(this,pt).notify({mutation:this,type:"updated",action:i})})},cv);function Gv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vl,sl,Fr,dv,W1=(dv=class extends Bi{constructor(i={}){super();ce(this,Vl);ce(this,sl);ce(this,Fr);this.config=i,te(this,Vl,new Set),te(this,sl,new Map),te(this,Fr,0)}build(i,s,u){const d=new F1({client:i,mutationCache:this,mutationId:++wo(this,Fr)._,options:i.defaultMutationOptions(s),state:u});return this.add(d),d}add(i){N(this,Vl).add(i);const s=To(i);if(typeof s=="string"){const u=N(this,sl).get(s);u?u.push(i):N(this,sl).set(s,[i])}this.notify({type:"added",mutation:i})}remove(i){if(N(this,Vl).delete(i)){const s=To(i);if(typeof s=="string"){const u=N(this,sl).get(s);if(u)if(u.length>1){const d=u.indexOf(i);d!==-1&&u.splice(d,1)}else u[0]===i&&N(this,sl).delete(s)}}this.notify({type:"removed",mutation:i})}canRun(i){const s=To(i);if(typeof s=="string"){const u=N(this,sl).get(s),d=u==null?void 0:u.find(m=>m.state.status==="pending");return!d||d===i}else return!0}runNext(i){var u;const s=To(i);if(typeof s=="string"){const d=(u=N(this,sl).get(s))==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(){nt.batch(()=>{N(this,Vl).forEach(i=>{this.notify({type:"removed",mutation:i})}),N(this,Vl).clear(),N(this,sl).clear()})}getAll(){return Array.from(N(this,Vl))}find(i){const s={exact:!0,...i};return this.getAll().find(u=>Ax(s,u))}findAll(i={}){return this.getAll().filter(s=>Ax(i,s))}notify(i){nt.batch(()=>{this.listeners.forEach(s=>{s(i)})})}resumePausedMutations(){const i=this.getAll().filter(s=>s.state.isPaused);return nt.batch(()=>Promise.all(i.map(s=>s.continue().catch(Nt))))}},Vl=new WeakMap,sl=new WeakMap,Fr=new WeakMap,dv);function To(a){var i;return(i=a.options.scope)==null?void 0:i.id}var Zl,Da,Ot,$l,Jl,ko,Zd,fv,P1=(fv=class extends Bi{constructor(s,u){super();ce(this,Jl);ce(this,Zl);ce(this,Da);ce(this,Ot);ce(this,$l);te(this,Zl,s),this.setOptions(u),this.bindMethods(),be(this,Jl,ko).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var d;const u=this.options;this.options=N(this,Zl).defaultMutationOptions(s),Ho(this.options,u)||N(this,Zl).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,Ot),observer:this}),u!=null&&u.mutationKey&&this.options.mutationKey&&Sn(u.mutationKey)!==Sn(this.options.mutationKey)?this.reset():((d=N(this,Ot))==null?void 0:d.state.status)==="pending"&&N(this,Ot).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=N(this,Ot))==null||s.removeObserver(this)}onMutationUpdate(s){be(this,Jl,ko).call(this),be(this,Jl,Zd).call(this,s)}getCurrentResult(){return N(this,Da)}reset(){var s;(s=N(this,Ot))==null||s.removeObserver(this),te(this,Ot,void 0),be(this,Jl,ko).call(this),be(this,Jl,Zd).call(this)}mutate(s,u){var d;return te(this,$l,u),(d=N(this,Ot))==null||d.removeObserver(this),te(this,Ot,N(this,Zl).getMutationCache().build(N(this,Zl),this.options)),N(this,Ot).addObserver(this),N(this,Ot).execute(s)}},Zl=new WeakMap,Da=new WeakMap,Ot=new WeakMap,$l=new WeakMap,Jl=new WeakSet,ko=function(){var u;const s=((u=N(this,Ot))==null?void 0:u.state)??Gv();te(this,Da,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},Zd=function(s){nt.batch(()=>{var u,d,m,h,v,p,x,g;if(N(this,$l)&&this.hasListeners()){const y=N(this,Da).variables,E=N(this,Da).context,C={client:N(this,Zl),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(d=(u=N(this,$l)).onSuccess)==null||d.call(u,s.data,y,E,C)}catch(A){Promise.reject(A)}try{(h=(m=N(this,$l)).onSettled)==null||h.call(m,s.data,null,y,E,C)}catch(A){Promise.reject(A)}}else if((s==null?void 0:s.type)==="error"){try{(p=(v=N(this,$l)).onError)==null||p.call(v,s.error,y,E,C)}catch(A){Promise.reject(A)}try{(g=(x=N(this,$l)).onSettled)==null||g.call(x,void 0,s.error,y,E,C)}catch(A){Promise.reject(A)}}}this.listeners.forEach(y=>{y(N(this,Da))})})},fv),Nl,mv,I1=(mv=class extends Bi{constructor(i={}){super();ce(this,Nl);this.config=i,te(this,Nl,new Map)}build(i,s,u){const d=s.queryKey,m=s.queryHash??mf(d,s);let h=this.get(m);return h||(h=new V1({client:i,queryKey:d,queryHash:m,options:i.defaultQueryOptions(s),state:u,defaultOptions:i.getQueryDefaults(d)}),this.add(h)),h}add(i){N(this,Nl).has(i.queryHash)||(N(this,Nl).set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const s=N(this,Nl).get(i.queryHash);s&&(i.destroy(),s===i&&N(this,Nl).delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){nt.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return N(this,Nl).get(i)}getAll(){return[...N(this,Nl).values()]}find(i){const s={exact:!0,...i};return this.getAll().find(u=>Ex(s,u))}findAll(i={}){const s=this.getAll();return Object.keys(i).length>0?s.filter(u=>Ex(i,u)):s}notify(i){nt.batch(()=>{this.listeners.forEach(s=>{s(i)})})}onFocus(){nt.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){nt.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},Nl=new WeakMap,mv),Je,ka,Ua,Ai,zi,Ba,Ri,_i,hv,e2=(hv=class{constructor(a={}){ce(this,Je);ce(this,ka);ce(this,Ua);ce(this,Ai);ce(this,zi);ce(this,Ba);ce(this,Ri);ce(this,_i);te(this,Je,a.queryCache||new I1),te(this,ka,a.mutationCache||new W1),te(this,Ua,a.defaultOptions||{}),te(this,Ai,new Map),te(this,zi,new Map),te(this,Ba,0)}mount(){wo(this,Ba)._++,N(this,Ba)===1&&(te(this,Ri,ff.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,Je).onFocus())})),te(this,_i,qo.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,Je).onOnline())})))}unmount(){var a,i;wo(this,Ba)._--,N(this,Ba)===0&&((a=N(this,Ri))==null||a.call(this),te(this,Ri,void 0),(i=N(this,_i))==null||i.call(this),te(this,_i,void 0))}isFetching(a){return N(this,Je).findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return N(this,ka).findAll({...a,status:"pending"}).length}getQueryData(a){var s;const i=this.defaultQueryOptions({queryKey:a});return(s=N(this,Je).get(i.queryHash))==null?void 0:s.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),s=N(this,Je).build(this,i),u=s.state.data;return u===void 0?this.fetchQuery(a):(a.revalidateIfStale&&s.isStaleByTime(La(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(u))}getQueriesData(a){return N(this,Je).findAll(a).map(({queryKey:i,state:s})=>{const u=s.data;return[i,u]})}setQueryData(a,i,s){const u=this.defaultQueryOptions({queryKey:a}),d=N(this,Je).get(u.queryHash),m=d==null?void 0:d.state.data,h=D1(i,m);if(h!==void 0)return N(this,Je).build(this,u).setData(h,{...s,manual:!0})}setQueriesData(a,i,s){return nt.batch(()=>N(this,Je).findAll(a).map(({queryKey:u})=>[u,this.setQueryData(u,i,s)]))}getQueryState(a){var s;const i=this.defaultQueryOptions({queryKey:a});return(s=N(this,Je).get(i.queryHash))==null?void 0:s.state}removeQueries(a){const i=N(this,Je);nt.batch(()=>{i.findAll(a).forEach(s=>{i.remove(s)})})}resetQueries(a,i){const s=N(this,Je);return nt.batch(()=>(s.findAll(a).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const s={revert:!0,...i},u=nt.batch(()=>N(this,Je).findAll(a).map(d=>d.cancel(s)));return Promise.all(u).then(Nt).catch(Nt)}invalidateQueries(a,i={}){return nt.batch(()=>(N(this,Je).findAll(a).forEach(s=>{s.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 s={...i,cancelRefetch:i.cancelRefetch??!0},u=nt.batch(()=>N(this,Je).findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let m=d.fetch(void 0,s);return s.throwOnError||(m=m.catch(Nt)),d.state.fetchStatus==="paused"?Promise.resolve():m}));return Promise.all(u).then(Nt)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const s=N(this,Je).build(this,i);return s.isStaleByTime(La(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Nt).catch(Nt)}fetchInfiniteQuery(a){return a._type="infinite",this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Nt).catch(Nt)}ensureInfiniteQueryData(a){return a._type="infinite",this.ensureQueryData(a)}resumePausedMutations(){return qo.isOnline()?N(this,ka).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,Je)}getMutationCache(){return N(this,ka)}getDefaultOptions(){return N(this,Ua)}setDefaultOptions(a){te(this,Ua,a)}setQueryDefaults(a,i){N(this,Ai).set(Sn(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...N(this,Ai).values()],s={};return i.forEach(u=>{Gr(a,u.queryKey)&&Object.assign(s,u.defaultOptions)}),s}setMutationDefaults(a,i){N(this,zi).set(Sn(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...N(this,zi).values()],s={};return i.forEach(u=>{Gr(a,u.mutationKey)&&Object.assign(s,u.defaultOptions)}),s}defaultQueryOptions(a){if(a._defaulted)return a;const i={...N(this,Ua).queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=mf(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===hf&&(i.enabled=!1),i}defaultMutationOptions(a){return a!=null&&a._defaulted?a:{...N(this,Ua).mutations,...(a==null?void 0:a.mutationKey)&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){N(this,Je).clear(),N(this,ka).clear()}},Je=new WeakMap,ka=new WeakMap,Ua=new WeakMap,Ai=new WeakMap,zi=new WeakMap,Ba=new WeakMap,Ri=new WeakMap,_i=new WeakMap,hv),Kv=j.createContext(void 0),ts=a=>{const i=j.useContext(Kv);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},t2=({client:a,children:i})=>(j.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),r.jsx(Kv.Provider,{value:a,children:i})),Xv=j.createContext(!1),l2=()=>j.useContext(Xv);Xv.Provider;function a2(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var n2=j.createContext(a2()),i2=()=>j.useContext(n2),r2=(a,i,s)=>{const u=s!=null&&s.state.error&&typeof a.throwOnError=="function"?pf(a.throwOnError,[s.state.error,s]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||u)&&(i.isReset()||(a.retryOnMount=!1))},s2=a=>{j.useEffect(()=>{a.clearReset()},[a])},o2=({result:a,errorResetBoundary:i,throwOnError:s,query:u,suspense:d})=>a.isError&&!i.isReset()&&!a.isFetching&&u&&(d&&a.data===void 0||pf(s,[a.error,u])),u2=a=>{if(a.suspense){const s=d=>d==="static"?d:Math.max(d??1e3,1e3),u=a.staleTime;a.staleTime=typeof u=="function"?(...d)=>s(u(...d)):s(u),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},c2=(a,i)=>a.isLoading&&a.isFetching&&!i,d2=(a,i)=>(a==null?void 0:a.suspense)&&i.isPending,Bx=(a,i,s)=>i.fetchOptimistic(a).catch(()=>{s.clearReset()});function f2(a,i,s){var C,A,z,U;const u=l2(),d=i2(),m=ts(),h=m.defaultQueryOptions(a);(A=(C=m.getDefaultOptions().queries)==null?void 0:C._experimental_beforeQuery)==null||A.call(C,h);const v=m.getQueryCache().get(h.queryHash),p=a.subscribed!==!1;h._optimisticResults=u?"isRestoring":p?"optimistic":void 0,u2(h),r2(h,d,v),s2(d);const x=!m.getQueryCache().get(h.queryHash),[g]=j.useState(()=>new i(m,h)),y=g.getOptimisticResult(h),E=!u&&p;if(j.useSyncExternalStore(j.useCallback(k=>{const G=E?g.subscribe(nt.batchCalls(k)):Nt;return g.updateResult(),G},[g,E]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),j.useEffect(()=>{g.setOptions(h)},[h,g]),d2(h,y))throw Bx(h,g,d);if(o2({result:y,errorResetBoundary:d,throwOnError:h.throwOnError,query:v,suspense:h.suspense}))throw y.error;if((U=(z=m.getDefaultOptions().queries)==null?void 0:z._experimental_afterQuery)==null||U.call(z,h,y),h.experimental_prefetchInRender&&!Kr.isServer()&&c2(y,u)){const k=x?Bx(h,g,d):v==null?void 0:v.promise;k==null||k.catch(Nt).finally(()=>{g.updateResult()})}return h.notifyOnChangeProps?y:g.trackResult(y)}function dl(a,i){return f2(a,Z1)}function Li(a,i){const s=ts(),[u]=j.useState(()=>new P1(s,a));j.useEffect(()=>{u.setOptions(a)},[u,a]);const d=j.useSyncExternalStore(j.useCallback(h=>u.subscribe(nt.batchCalls(h)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),m=j.useCallback((h,v)=>{u.mutate(h,v).catch(Nt)},[u]);if(d.error&&pf(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 Vv=(...a)=>a.filter((i,s,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===s).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 m2=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 h2=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,s,u)=>u?u.toUpperCase():s.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 Lx=a=>{const i=h2(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 wd={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 p2=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},x2=j.createContext({}),v2=()=>j.useContext(x2),b2=j.forwardRef(({color:a,size:i,strokeWidth:s,absoluteStrokeWidth:u,className:d="",children:m,iconNode:h,...v},p)=>{const{size:x=24,strokeWidth:g=2,absoluteStrokeWidth:y=!1,color:E="currentColor",className:C=""}=v2()??{},A=u??y?Number(s??g)*24/Number(i??x):s??g;return j.createElement("svg",{ref:p,...wd,width:i??x??wd.width,height:i??x??wd.height,stroke:a??E,strokeWidth:A,className:Vv("lucide",C,d),...!m&&!p2(v)&&{"aria-hidden":"true"},...v},[...h.map(([z,U])=>j.createElement(z,U)),...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 Xe=(a,i)=>{const s=j.forwardRef(({className:u,...d},m)=>j.createElement(b2,{ref:m,iconNode:i,className:Vv(`lucide-${m2(Lx(a))}`,`lucide-${a}`,u),...d}));return s.displayName=Lx(a),s};/**
|
|
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 y2=[["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"}]],Hx=Xe("activity",y2);/**
|
|
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 g2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Zo=Xe("arrow-right",g2);/**
|
|
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 j2=[["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"}]],qx=Xe("boxes",j2);/**
|
|
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 S2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Kt=Xe("check",S2);/**
|
|
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 N2=[["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"}]],$d=Xe("circle-dashed",N2);/**
|
|
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 M2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],w2=Xe("clock-3",M2);/**
|
|
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 C2=[["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"}]],T2=Xe("copy",C2);/**
|
|
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 E2=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Oi=Xe("credit-card",E2);/**
|
|
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 A2=[["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"}]],z2=Xe("database",A2);/**
|
|
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 R2=[["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"}]],Zv=Xe("git-branch",R2);/**
|
|
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 _2=[["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"}]],O2=Xe("landmark",_2);/**
|
|
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=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xt=Xe("loader-circle",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 k2=[["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"}]],U2=Xe("lock-keyhole",k2);/**
|
|
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 B2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jd=Xe("plus",B2);/**
|
|
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 L2=[["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"}]],H2=Xe("receipt-text",L2);/**
|
|
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 q2=[["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"}]],Q2=Xe("refresh-cw",q2);/**
|
|
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 Y2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$o=Xe("search",Y2);/**
|
|
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 G2=[["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"}]],K2=Xe("shield-check",G2);/**
|
|
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 X2=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],V2=Xe("smartphone",X2);/**
|
|
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 Z2=[["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"}]],$v=Xe("timer",Z2);/**
|
|
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 $2=[["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"}]],Jv=Xe("trash-2",$2);/**
|
|
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 J2=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],F2=Xe("trending-up",J2);/**
|
|
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 W2=[["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"}]],cn=Xe("wallet-cards",W2);/**
|
|
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 P2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xr=Xe("x",P2);class Fv extends Error{constructor(s,u,d){super(s);hd(this,"status");hd(this,"code");this.status=u,this.code=d}}async function fl(a){var s,u;const i=await fetch(a);if(!i.ok){const d=await i.json().catch(()=>({}));throw new Fv(((s=d.error)==null?void 0:s.message)??`${a} returned ${i.status}`,i.status,(u=d.error)==null?void 0:u.code)}return i.json()}async function Ha(a,i,s){var d,m;const u=await fetch(i,{method:a,headers:s?{"content-type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Fv(((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 Jo(){return dl({queryKey:["ledger","inferences"],queryFn:()=>fl("/ledger/inferences"),refetchInterval:1e4})}function I2(){return dl({queryKey:["ledger","purchases"],queryFn:()=>fl("/ledger/purchases"),refetchInterval:1e4})}function Wv(){return dl({queryKey:["payments"],queryFn:()=>fl("/payments"),refetchInterval:1e4})}function Pv(){const a=ts();return Li({mutationFn:()=>Ha("POST","/payments/clawtip/activate"),onSuccess:()=>{a.invalidateQueries({queryKey:["payments"]})}})}function Iv(){return Li({mutationFn:()=>Ha("POST","/payments/clawtip/recharge")})}function e0(){return dl({queryKey:["routing","strategy"],queryFn:()=>fl("/routing/strategy")})}function t0(){const a=ts();return Li({mutationFn:i=>Ha("PUT","/routing/strategy",i),onSuccess:()=>{a.invalidateQueries({queryKey:["routing","strategy"]})}})}function ej(a){const i=new URLSearchParams;for(const[s,u]of Object.entries(a))u!=null&&u!==""&&i.set(s,tj(u));return dl({queryKey:["routing","preview",i.toString()],queryFn:()=>fl(`/routing/preview?${i.toString()}`),enabled:!1})}function tj(a){return Array.isArray(a)?a.join(","):typeof a=="object"&&a!==null?Object.entries(a).map(([i,s])=>`${i}:${s}`).join(","):String(a)}function l0(){return dl({queryKey:["sellers"],queryFn:()=>fl("/sellers"),refetchInterval:3e4})}function vf(){return dl({queryKey:["models"],queryFn:()=>fl("/models"),refetchInterval:3e4})}function lj(){return dl({queryKey:["prewarm","focus-set"],queryFn:()=>fl("/v1.2/prewarm").then(a=>({ok:!0,focusSet:a.focusSet??[],source:"historical"}))})}async function Uo(a){const i=Array.isArray(a)?{models:a}:a;return Ha("PUT","/prewarm/focus-set",i)}function a0(){return dl({queryKey:["status"],queryFn:()=>fl("/status"),refetchInterval:5e3})}function vt({children:a,className:i=""}){return r.jsx("div",{className:["rounded-[12px] border border-[var(--color-line-2)] bg-white shadow-[0_12px_36px_rgba(60,41,112,0.08)]",i].join(" "),children:a})}function ls({tone:a="lavender",children:i}){const s={lavender:"bg-[var(--color-lavender)] text-[var(--color-purple)]",green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",red:"bg-rose-50 text-rose-700",blue:"bg-indigo-50 text-indigo-700",gray:"bg-slate-100 text-slate-600"};return r.jsxs("span",{className:["inline-flex items-center gap-1.5 text-[0.78rem] font-medium px-2.5 py-0.5 rounded-full",s[a]??s.lavender].join(" "),children:[r.jsx("span",{className:"size-1.5 rounded-full bg-current"}),i]})}const Ur=a=>a<10?`0${a}`:`${a}`;function Xt(a){if(!a)return"—";const i=new Date(a);return Number.isNaN(i.getTime())?"—":`${i.getFullYear()}-${Ur(i.getMonth()+1)}-${Ur(i.getDate())} ${Ur(i.getHours())}:${Ur(i.getMinutes())}:${Ur(i.getSeconds())}`}function n0({inferences:a,modelsResponse:i,sellersResponse:s,previewPlan:u,activeModelId:d}){const m=ij(i,s),h=[...a].sort(uj),v=new Map,p=new Map;let x=0,g=0,y=0;for(const C of h){const A=C.modelId||"unknown",z=C.sellerKey||"unknown",U=ol(C.promptTokens)??0,k=ol(C.completionTokens)??0,G=U+k,K=ol(C.billedMicros)??0;x+=1,g+=G,y+=K;const H=v.get(A)??rj(A);H.entries.push(C),H.requestCount+=1,H.inputTokens+=U,H.outputTokens+=k,H.totalSpendMicros+=K,H.touchedSellers.add(z),H.sellerCounts.set(z,(H.sellerCounts.get(z)??0)+1),H.fallbackCount+=ol(C.fallbackCount)??0;const V=ol(C.ttftMs);V!==void 0&&(H.ttftTotal+=V,H.ttftCount+=1);const P=ol(C.durationMs);P!==void 0&&(H.durationTotal+=P,H.durationCount+=1),v.set(A,H);const $=p.get(z)??{requestCount:0,totalTokens:0};$.requestCount+=1,$.totalTokens+=G,p.set(z,$)}const E=Array.from(v.values()).map(C=>aj(C,p,m)).sort(cj);if(E.length===0){const C=nj(d,u,m);C&&E.push(C)}return{rows:E,totalRequests:x,totalTokens:g,totalSpendMicros:y}}function aj(a,i,s){const u=a.entries[a.entries.length-1],d=(u==null?void 0:u.sellerKey)||"unknown",m=i0(d,s),h=a.sellerCounts.get(d)??0,v=i.get(d),p=s.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:(v==null?void 0:v.requestCount)??h,inputTokens:a.inputTokens,outputTokens:a.outputTokens,totalTokens:a.inputTokens+a.outputTokens,currentSellerTokens:(v==null?void 0:v.totalTokens)??0,totalSpendMicros:a.totalSpendMicros,avgTtftMs:Qx(a.ttftTotal,a.ttftCount),avgDurationMs:Qx(a.durationTotal,a.durationCount),lastTtftMs:ol(u==null?void 0:u.ttftMs),lastDurationMs:ol(u==null?void 0:u.durationMs),selectedAt:sj(a.entries,d),lastSellerSwitchAt:oj(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 nj(a,i,s){var p,x,g;const u=(p=i==null?void 0:i.routes)==null?void 0:p[0];if(!u||!a)return;const d=i0(u.seller.id,s,u),m=ol(u.metrics.ttftMs)??ol(u.metrics.avgLatencyMs),h=ol(u.metrics.avgInferenceMs),v=s.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:((x=i.routes)==null?void 0:x.map(y=>y.seller.id))??[],touchedSellerCount:((g=i.routes)==null?void 0:g.length)??1,inputPriceMicrosPer1m:v==null?void 0:v.inputPriceMicrosPer1m,outputPriceMicrosPer1m:v==null?void 0:v.outputPriceMicrosPer1m}}function ij(a,i){const s=new Map;for(const u of(a==null?void 0:a.data)??[]){const d=s.get(u.sellerId)??new Set;d.add(u.id),s.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(s.entries()).map(([u,d])=>[u,d.size]))}}function rj(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 sj(a,i){var s;for(let u=a.length-1;u>=0;u-=1){const d=a[u];if(d.sellerKey!==i)return(s=a[u+1])==null?void 0:s.createdAt;if(u===0)return d.createdAt}}function oj(a){let i;for(let s=1;s<a.length;s+=1)a[s].sellerKey!==a[s-1].sellerKey&&(i=a[s].createdAt);return i}function i0(a,i,s){const u=i.catalogById.get(a),d=i.registryById.get(a),m=(s==null?void 0:s.metrics.discountRatio)??(u==null?void 0:u.discountRatio);return{name:mj((s==null?void 0:s.seller.name)??(u==null?void 0:u.name)??(d==null?void 0:d.name)??a),url:(s==null?void 0:s.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)??"unknown",paymentMethods:(u==null?void 0:u.paymentMethods)??(d==null?void 0:d.paymentMethods)??(s==null?void 0:s.seller.paymentMethods)??[],discount:dj(m),serviceFee:fj(u==null?void 0:u.serviceFeeRatio),modelCount:(u==null?void 0:u.modelCount)??i.modelCountsBySellerId.get(a)}}function uj(a,i){return Qo(a.createdAt)-Qo(i.createdAt)}function cj(a,i){return Qo(i.lastAccessAt)-Qo(a.lastAccessAt)}function Qo(a){if(!a)return 0;const i=new Date(a).getTime();return Number.isNaN(i)?0:i}function Qx(a,i){return i>0?a/i:void 0}function ol(a){return Number.isFinite(a)?a:void 0}function dj(a){return Number.isFinite(a)?`${Math.round(Math.max(0,1-a)*100)}%`:"—"}function fj(a){return Number.isFinite(a)?`${Math.round(a*100)}%`:"—"}function mj(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function Yx(){var oe,F,me,pe,Te,ue,B,J,re,ye,ge,M,O,Z,I,X,ae;const[a,i]=j.useState(null),s=a0(),u=e0(),d=Wv(),m=Pv(),h=Iv(),v=d.refetch,p=m.reset,x=Jo(),g=l0(),y=vf(),E=((oe=x.data)==null?void 0:oe.inferences)??[],C=((F=d.data)==null?void 0:F.payments)??[],A=new Set((((me=y.data)==null?void 0:me.data)??[]).map(W=>W.id)).size,z=((pe=g.data)==null?void 0:pe.sellers.length)??((ue=(Te=y.data)==null?void 0:Te.sellers)==null?void 0:ue.length)??0,U=j.useMemo(()=>wj(E),[E]),k=j.useMemo(()=>Cj(C,E),[E,C]),G=j.useMemo(()=>n0({inferences:E,modelsResponse:y.data,sellersResponse:g.data}),[E,y.data,g.data]),H=C.some(W=>cl(W.method)==="clawtip"&&(W.enabled||u0(W.config,"walletConfigPresent")))||((B=m.data)==null?void 0:B.walletConfigPresent)===!0,V=((J=s.data)==null?void 0:J.status)==="running"&&!s.isError,P=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),$=((re=u.data)==null?void 0:re.strategy.mode)??((ye=s.data)==null?void 0:ye.sellerRoutingMode)??"—",ee=((ge=u.data)==null?void 0:ge.strategy.scorer)??((M=s.data)==null?void 0:M.sellerRoutingScorer)??"—",le=()=>{i(null),m.reset(),h.reset()};return j.useEffect(()=>{if((a==null?void 0:a.kind)!=="activate"||cl(a.method)!=="clawtip"||H)return;const W=window.setInterval(()=>{v()},1500);return()=>window.clearInterval(W)},[H,a==null?void 0:a.kind,a==null?void 0:a.method,v]),j.useEffect(()=>{(a==null?void 0:a.kind)==="activate"&&cl(a.method)==="clawtip"&&H&&(i(null),p())},[H,a==null?void 0:a.kind,a==null?void 0:a.method,p]),r.jsxs("div",{className:"min-w-0 overflow-x-hidden space-y-3",children:[r.jsxs("section",{className:"grid grid-cols-2 gap-2.5 md:grid-cols-3 xl:grid-cols-6",children:[r.jsx(pi,{to:"/routing",icon:r.jsx(Zv,{className:"size-4"}),label:"Router",value:$,note:`${ee} scorer`,tone:"router"}),r.jsx(pi,{to:"/ledger",icon:r.jsx(Hx,{className:"size-4"}),label:"Today requests",value:U.todayRequestCount.toLocaleString(),note:`${U.totalRequestCount.toLocaleString()} total`,tone:"requests"}),r.jsx(pi,{to:"/ledger",icon:r.jsx(Oi,{className:"size-4"}),label:"Spend today",value:Qr(U.todaySpendMicros,4),note:`${Qr(U.totalSpendMicros,4)} total`,tone:"spend"}),r.jsx(pi,{to:"/ledger",icon:r.jsx(qx,{className:"size-4"}),label:"Today tokens",value:Kl(U.todayInputTokens+U.todayOutputTokens),note:`In ${Kl(U.todayInputTokens)} / Out ${Kl(U.todayOutputTokens)}`,tone:"todayTokens"}),r.jsx(pi,{to:"/ledger",icon:r.jsx(Hx,{className:"size-4"}),label:"Total tokens",value:Kl(U.inputTokens+U.outputTokens),note:`In ${Kl(U.inputTokens)} / Out ${Kl(U.outputTokens)}`,tone:"tokens"}),r.jsx(pi,{to:"/routing",icon:r.jsx(qx,{className:"size-4"}),label:"Models / Sellers",value:`${A}`,note:`${z} sellers`,tone:"capacity"})]}),r.jsx("section",{className:"grid min-w-0 gap-3",children:r.jsxs("div",{className:"min-w-0 space-y-3",children:[r.jsx(hj,{rows:G.rows,totalRequests:G.totalRequests,totalTokens:G.totalTokens}),r.jsxs(vt,{className:"p-3.5",children:[r.jsx("div",{className:"flex items-start justify-between gap-4",children:r.jsx("div",{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h2",{className:"text-[1rem] font-semibold text-[var(--color-ink)]",children:"Payment management"}),r.jsx(ls,{tone:C.some(W=>W.enabled)?"green":"amber",children:C.some(W=>W.enabled)?"configured":"not configured"})]})})}),r.jsx("div",{className:"mt-2 min-w-0 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-white",children:k.map(W=>r.jsx(xj,{...W,onActivate:()=>{i({kind:"activate",method:W.method}),W.method==="clawtip"&&m.mutate()},onRecharge:()=>{i({kind:"recharge",method:W.method}),W.method==="clawtip"&&h.mutate()}},W.method))})]}),r.jsxs(vt,{className:"p-3",children:[r.jsxs("div",{className:"mb-2 flex min-w-0 flex-col gap-2",children:[r.jsx("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx(F2,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),r.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"TokenUsage"})]})}),r.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:[U.modelUsage.map(W=>r.jsx(Sj,{model:W.model,color:W.color},W.model)),r.jsx(Gx,{label:"in"}),r.jsx(Gx,{label:"out",dashed:!0})]})]}),r.jsxs("div",{className:"grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_190px]",children:[r.jsx(yj,{days:U.days,series:U.modelUsage}),r.jsxs("div",{className:"grid gap-3",children:[r.jsx(gj,{days:U.days,values:U.cost,total:Qr(U.weeklySpendMicros)}),r.jsx(jj,{values:U.thirtyDaySpend,total:Qr(U.totalSpendMicros)})]})]})]})]})}),r.jsx(Nj,{checkedAt:P,healthy:V,pid:(O=s.data)==null?void 0:O.pid,status:(Z=s.data)==null?void 0:Z.status,proxyPort:(I=s.data)==null?void 0:I.proxyPort,controlPort:(X=s.data)==null?void 0:X.controlPort,registryUrl:(ae=s.data)==null?void 0:ae.sellerRegistryUrl}),a?r.jsx(bj,{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:le}):null]})}function hj({rows:a,totalRequests:i,totalTokens:s}){var d;const u=a.slice(0,3);return r.jsxs(vt,{className:"overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-3.5 py-3",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx(Zv,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),r.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"Recent model routes"})]}),r.jsx(es,{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"})]}),r.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:[r.jsx(Eo,{label:"Requests",value:i.toLocaleString()}),r.jsx(Eo,{label:"Tokens",value:Kl(s)}),r.jsx(Eo,{label:"Models",value:a.length.toLocaleString()}),r.jsx(Eo,{label:"Latest",value:s0((d=a[0])==null?void 0:d.lastAccessAt)})]}),u.length>0?r.jsx("div",{className:"divide-y divide-[var(--color-line-2)]",children:u.map(m=>r.jsx(pj,{row:m},`${m.modelId}-${m.currentSellerId}`))}):r.jsx("div",{className:"px-3.5 py-7 text-center text-[0.82rem] text-[var(--color-muted)]",children:"No model traffic yet."})]})}function Eo({label:a,value:i}){return r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[0.65rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),r.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:i})]})}function pj({row:a}){const i=a.lastSellerSwitchAt??a.selectedAt;return r.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:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),r.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:[r.jsx("span",{className:"truncate",children:a.currentSellerName}),r.jsx("span",{className:"font-mono",children:a.currentSellerStatus})]})]}),r.jsxs("div",{className:"grid min-w-0 grid-cols-2 gap-1.5 sm:grid-cols-3 lg:grid-cols-6",children:[r.jsx(hi,{label:"In",value:Kl(a.inputTokens),tone:"blue",title:`Input tokens: ${a.inputTokens.toLocaleString()}`}),r.jsx(hi,{label:"Out",value:Kl(a.outputTokens),tone:"amber",title:`Output tokens: ${a.outputTokens.toLocaleString()}`}),r.jsx(hi,{label:"TTFT",value:Ao(a.lastTtftMs??a.avgTtftMs),tone:"purple",title:`Time to first token: ${Ao(a.lastTtftMs??a.avgTtftMs)}`}),r.jsx(hi,{label:"Total",value:Ao(a.lastDurationMs??a.avgDurationMs),tone:"slate",title:`Total inference duration: ${Ao(a.lastDurationMs??a.avgDurationMs)}`}),r.jsx(hi,{label:"Disc",value:a.sellerDiscount,tone:"green",title:`Seller discount: ${a.sellerDiscount}`}),r.jsx(hi,{label:"Switch",value:s0(i),tone:"slate",title:`Last seller switch: ${Xt(i)}`})]})]})}function hi({label:a,value:i,tone:s,title:u}){const d={purple:"bg-[var(--color-lavender)] text-[var(--color-purple)]",green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",blue:"bg-blue-50 text-blue-700",slate:"bg-slate-50 text-slate-700"}[s];return r.jsxs("div",{className:["min-w-0 rounded-[8px] px-2 py-1",d].join(" "),title:u??`${a}: ${i}`,children:[r.jsx("div",{className:"text-[0.58rem] font-semibold uppercase tracking-wider opacity-70",children:a}),r.jsx("div",{className:"truncate font-mono text-[0.76rem] font-semibold",children:i})]})}function pi({to:a,icon:i,label:s,value:u,note:d,tone:m}){const h={router:{card:"border border-[var(--color-lavender-2)] bg-white shadow-[0_14px_30px_rgba(124,61,240,0.14)] hover:border-[var(--color-purple)] before:bg-[var(--color-purple)]",icon:"bg-[var(--color-lavender)] text-[var(--color-purple)]",label:"text-[var(--color-purple)]/72",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},requests:{card:"border border-emerald-100 bg-white shadow-[0_10px_24px_rgba(16,185,129,0.08)] hover:border-emerald-200 before:bg-emerald-500",icon:"bg-emerald-50 text-emerald-700",label:"text-emerald-700/72",value:"text-[var(--color-ink)]",note:"text-emerald-950/58"},spend:{card:"border border-teal-100 bg-white shadow-[0_10px_24px_rgba(15,118,110,0.08)] hover:border-teal-200 before:bg-teal-600",icon:"bg-teal-50 text-teal-700",label:"text-teal-700/72",value:"text-[var(--color-ink)]",note:"text-teal-900/62"},todayTokens:{card:"border border-amber-100 bg-white shadow-[0_10px_24px_rgba(245,158,11,0.08)] hover:border-amber-200 before:bg-amber-500",icon:"bg-amber-50 text-amber-700",label:"text-amber-800/70",value:"text-[var(--color-ink)]",note:"text-amber-950/58"},tokens:{card:"border border-violet-100 bg-white shadow-[0_10px_24px_rgba(124,61,240,0.08)] hover:border-violet-200 before:bg-[var(--color-purple)]",icon:"bg-[var(--color-lavender)] text-[var(--color-purple)]",label:"text-[var(--color-purple)]/72",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},capacity:{card:"border border-amber-100 bg-white shadow-[0_10px_24px_rgba(245,158,11,0.08)] hover:border-amber-200 before:bg-amber-500",icon:"bg-amber-50 text-amber-700",label:"text-amber-800/70",value:"text-[var(--color-ink)]",note:"text-amber-950/58"}}[m];return r.jsxs(es,{to:a,"aria-label":`Open ${s}`,className:["relative block min-h-[94px] overflow-hidden rounded-[10px] 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-purple)]",h.card].join(" "),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:`grid size-7 place-items-center rounded-[8px] ${h.icon}`,children:i}),r.jsx("span",{className:["text-right text-[0.66rem] font-semibold uppercase leading-3",h.label].join(" "),children:s})]}),r.jsx("div",{className:["mt-2 text-[1.25rem] font-semibold leading-none",h.value].join(" "),children:u}),r.jsx("div",{className:["mt-1.5 truncate text-[0.72rem]",h.note].join(" "),children:d})]})}function xj({name:a,method:i,balance:s,status:u,note:d,action:m,icon:h,balanceHidden:v,onActivate:p,onRecharge:x}){const g=u==="Bound",y=g&&v&&cl(i)==="clawtip";return r.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:[r.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[r.jsx(vj,{method:i,icon:h,bound:g}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:a}),d?r.jsx("div",{className:"mt-0.5 truncate text-[0.74rem] text-[var(--color-muted)]",children:d}):null]})})]}),y?r.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:x,"aria-label":"Scan with JD app to view ClawTip wallet balance",title:"Scan with JD app to view wallet balance",children:[r.jsx(U2,{className:"size-3.5"}),"••••"]}):r.jsx("div",{className:"font-mono text-[0.9rem] font-semibold text-[var(--color-ink)]",children:s}),r.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?x:p,"aria-label":m,title:`${m} ${a}`,children:m})]})}function vj({method:a,icon:i,bound:s}){return cl(a)==="clawtip"?r.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"}):r.jsx("div",{className:["grid size-8 shrink-0 place-items-center rounded-[8px] text-[0.8rem] font-bold",s?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:i})}function bj({modal:a,methods:i,qr:s,loading:u,error:d,onClose:m}){const h=a.kind==="recharge",v=i.find(z=>z.method===a.method),p=h&&cl(a.method)==="clawtip",x=Cd(v==null?void 0:v.config,"resourceUrl"),g=Cd(v==null?void 0:v.config,"walletConfigPath"),y=Cd(v==null?void 0:v.config,"orderNo"),E=(s==null?void 0:s.walletConfigPresent)===!0||u0(v==null?void 0:v.config,"walletConfigPresent"),C=!h&&!!(s!=null&&s.qrImageUrl)&&!E&&!d,A=(v==null?void 0:v.name)??r0(a.method);return r.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:r.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:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:p?"ClawTip wallet QR":h?`Recharge ${A}`:`Activate ${A}`}),r.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."})]}),r.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:r.jsx(Xr,{className:"size-4"})})]}),r.jsxs("div",{className:"mt-5 flex flex-col gap-4",children:[r.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:s!=null&&s.qrImageUrl?r.jsx("img",{className:"max-h-[72vh] w-full object-contain",src:s.qrImageUrl,alt:`${A} ${h?"recharge":"activation"} QR code`}):r.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?r.jsx(xt,{className:"size-5 animate-spin text-[var(--color-purple)]"}):null,r.jsx("span",{children:u?"Generating ClawTip QR...":"QR image unavailable"})]})}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[r.jsx(Br,{label:"Method",value:A}),r.jsx(Br,{label:"Wallet",value:E?"bound":"waiting",warn:!E}),s!=null&&s.orderNo||y?r.jsx(Br,{label:"Order",value:(s==null?void 0:s.orderNo)??y??""}):null,s!=null&&s.walletConfigPath||g?r.jsx(Br,{label:"Config",value:Ej((s==null?void 0:s.walletConfigPath)??g??"")}):null,s!=null&&s.clawtipId?r.jsx(Br,{label:"Device",value:s.clawtipId}):null]}),d?r.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,s!=null&&s.qrImageUrl?r.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.":r.jsxs("span",{className:"flex items-start gap-2",children:[C?r.jsx(xt,{className:"mt-0.5 size-4 shrink-0 animate-spin"}):null,r.jsx("span",{children:E?"Wallet bound. Closing...":"Scan with JD app. TokenBuddy is waiting for the local wallet config."})]})}):null,s!=null&&s.resourceUrl||x?r.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:(s==null?void 0:s.resourceUrl)??x,target:"_blank",rel:"noreferrer",children:o0((s==null?void 0:s.resourceUrl)??x??"")}):!(s!=null&&s.qrImageUrl)&&!u&&!d?r.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 ",r.jsx("span",{className:"font-mono",children:"tb init"})," to bind this payment method."]}):null]})]})]})})}function yj({days:a,series:i}){const d={top:14,right:18,bottom:26,left:26},m=i.flatMap(x=>[...x.input,...x.output]),h=Math.max(1,...m),v=x=>d.left+x*(680-d.left-d.right)/Math.max(1,a.length-1),p=x=>d.top+(1-x/h)*(150-d.top-d.bottom);return r.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:r.jsxs("svg",{className:"h-[160px] w-full",viewBox:"0 0 680 150",role:"img","aria-label":"Daily model input and output usage lines",children:[[.25,.5,.75,1].map(x=>r.jsx("line",{x1:d.left,x2:680-d.right,y1:d.top+(1-x)*(150-d.top-d.bottom),y2:d.top+(1-x)*(150-d.top-d.bottom),stroke:"#eee9fb",strokeWidth:"1"},x)),a.map((x,g)=>r.jsx("text",{x:v(g),y:143,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[10px]",children:x},x)),i.map(x=>r.jsxs("g",{children:[r.jsx("path",{d:Fd(x.input.map((g,y)=>[v(y),p(g)])),fill:"none",stroke:x.color,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:Fd(x.output.map((g,y)=>[v(y),p(g)])),fill:"none",stroke:x.color,strokeWidth:"2.4",strokeDasharray:"5 5",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.75"}),x.input.map((g,y)=>r.jsx("circle",{cx:v(y),cy:p(g),r:"2.7",fill:x.color},`${x.model}-input-${y}`)),x.output.map((g,y)=>r.jsx("circle",{cx:v(y),cy:p(g),r:"2.2",fill:"#fff",stroke:x.color,strokeWidth:"1.8"},`${x.model}-output-${y}`))]},x.model)),i.length===0?r.jsx("text",{x:680/2,y:150/2,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[12px]",children:"No token usage yet"}):null]})})}function gj({days:a,values:i,total:s}){const m={top:10,right:8,bottom:16,left:8},h=Math.max(1,...i),v=x=>m.left+x*(190-m.left-m.right)/Math.max(1,i.length-1),p=x=>m.top+(1-x/h)*(72-m.top-m.bottom);return r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[r.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[r.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"Cost curve"}),r.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:s})]}),r.jsxs("svg",{className:"h-[66px] w-full",viewBox:"0 0 190 72",role:"img","aria-label":"Daily cost curve",children:[r.jsx("path",{d:Fd(i.map((x,g)=>[v(g),p(x)])),fill:"none",stroke:"#f59e0b",strokeWidth:"3",strokeLinecap:"round"}),i.map((x,g)=>r.jsx("circle",{cx:v(g),cy:p(x),r:"2.4",fill:"#f59e0b"},a[g]))]})]})}function jj({values:a,total:i}){const s=Math.max(1,...a);return r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[r.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"30 day spend"}),r.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:i})]}),r.jsx("div",{className:"flex h-[60px] items-end gap-1",children:a.map((u,d)=>r.jsx("span",{className:"flex-1 rounded-t-[3px] bg-[var(--color-purple)]/75",style:{height:`${Math.max(8,u/s*100)}%`}},d))})]})}function Fd(a){return a.length===0?"":a.length===1?`M ${a[0][0]} ${a[0][1]}`:a.reduce((i,s,u)=>{if(u===0)return`M ${s[0]} ${s[1]}`;const d=a[u-1],m=(d[0]+s[0])/2;return`${i} C ${m} ${d[1]}, ${m} ${s[1]}, ${s[0]} ${s[1]}`},"")}function Sj({model:a,color:i}){return r.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:[r.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:i}}),r.jsx("span",{className:"truncate font-mono text-[0.68rem]",children:a})]})}function Gx({label:a,dashed:i=!1}){return r.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:[r.jsx("span",{className:["h-px w-4 border-t border-[var(--color-ink)]",i?"border-dashed":""].join(" ")}),r.jsx("span",{className:"font-mono text-[0.68rem]",children:a})]})}function Br({label:a,value:i,warn:s=!1}){return r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:a}),r.jsx("div",{className:["font-mono text-[0.94rem] font-semibold",s?"text-amber-700":"text-[var(--color-ink)]"].join(" "),children:i})]})}function Nj({checkedAt:a,healthy:i,pid:s,status:u,proxyPort:d,controlPort:m,registryUrl:h}){const v=[{icon:"D",label:"Daemon",value:s?`pid ${s}`:u??"unknown",tone:i?"green":"amber"},{icon:"P",label:"Proxy",value:d?`:${d}`:"—",tone:"blue"},{icon:"C",label:"Control",value:m?`:${m}`:"—",tone:"purple"},{icon:"R",label:"Registry",value:h?o0(h):"—",tone:"amber"}];return r.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-2 shadow-[0_12px_28px_rgba(41,31,84,0.06)]",children:[r.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 py-1 text-[0.72rem] font-medium text-[var(--color-muted)]",children:[r.jsx(Q2,{className:"size-3.5"}),a]}),v.map(p=>r.jsx(Mj,{...p},p.label))]})}function Mj({icon:a,label:i,value:s,tone:u}){const d={green:"bg-emerald-50 text-emerald-700",blue:"bg-blue-50 text-blue-700",purple:"bg-[var(--color-lavender)] text-[var(--color-purple)]",amber:"bg-amber-50 text-amber-700"}[u];return r.jsxs("div",{className:"inline-flex min-w-0 max-w-full items-center gap-2 rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 py-1",children:[r.jsx("span",{className:["grid size-5 shrink-0 place-items-center rounded-[6px] text-[0.62rem] font-bold",d].join(" "),children:a}),r.jsx("span",{className:"text-[0.72rem] font-semibold text-[var(--color-ink)]",children:i}),r.jsx("span",{className:"min-w-0 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:s})]})}function wj(a){const i=Kx(7),s=Kx(30),u=Wd(new Date),d=new Set(i.map(H=>H.key)),m=new Map(s.map((H,V)=>[H.key,V])),h=["#7c3df0","#0f9f7a","#2563eb","#f59e0b"],v=new Map,p=i.map(()=>0),x=s.map(()=>0);let g=0,y=0,E=0,C=0,A=0,z=0,U=0,k=0,G=0;for(const H of a){const V=Wd(new Date(H.createdAt)),P=H.billedMicros??0,$=H.promptTokens??0,ee=H.completionTokens??0;G+=1,y+=P,C+=$,A+=ee,V===u&&(k+=1,g+=P,z+=$,U+=ee);const le=i.findIndex(F=>F.key===V);if(le>=0){E+=P,p[le]+=P/1e6;const F=v.get(H.modelId)??{input:i.map(()=>0),output:i.map(()=>0),total:0};F.input[le]+=$,F.output[le]+=ee,F.total+=$+ee,v.set(H.modelId,F)}else d.has(V)&&(E+=P);const oe=m.get(V);oe!==void 0&&(x[oe]+=P/1e6)}const K=Array.from(v.entries()).sort((H,V)=>V[1].total-H[1].total).slice(0,4).map(([H,V],P)=>({model:H,color:h[P%h.length],input:V.input,output:V.output}));return{days:i.map(H=>H.label),modelUsage:K,cost:p,thirtyDaySpend:x,todaySpendMicros:g,totalSpendMicros:y,weeklySpendMicros:E,inputTokens:C,outputTokens:A,todayInputTokens:z,todayOutputTokens:U,todayRequestCount:k,totalRequestCount:G}}function Cj(a,i){const s=new Map;for(const u of[...i].sort((d,m)=>d.createdAt.localeCompare(m.createdAt)))!u.paymentMethod||u.balanceSnapshotMicros===void 0||s.set(cl(u.paymentMethod),u.balanceSnapshotMicros);return[...a].filter(u=>cl(u.method)!=="mock").sort((u,d)=>Number(d.isDefault)-Number(u.isDefault)||u.method.localeCompare(d.method)).map(u=>{const d=cl(u.method),m=u.enabled||!!(u.config&&Object.keys(u.config).length>0),h=s.get(d),v=d==="clawtip";return{name:r0(u.method),method:u.method,balance:v?"••••":h===void 0?"—":Qr(h),status:u.enabled?"Bound":"Available",note:m?u.isDefault?"Default wallet":"Configured":"Not bound",action:u.enabled?"Recharge":"Activate",icon:Tj(u.method),balanceHidden:v,config:u.config}})}function Kx(a){const i=[],s=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:Wd(d),label:s.format(d)})}return i}function Wd(a){if(Number.isNaN(a.getTime()))return"";const i=a.getFullYear(),s=String(a.getMonth()+1).padStart(2,"0"),u=String(a.getDate()).padStart(2,"0");return`${i}-${s}-${u}`}function r0(a){const i=cl(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(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Tj(a){const i=cl(a);return i==="clawtip"?"C":i==="wechat-pay"?"W":i==="alipay-agent"?"A":i.charAt(0).toUpperCase()||"P"}function cl(a){return a.trim().toLowerCase()}function Qr(a,i=2){return`$${(a/1e6).toFixed(i)}`}function Kl(a){return Intl.NumberFormat("en",{notation:a>=1e4?"compact":"standard",maximumFractionDigits:a>=1e4?1:0}).format(a)}function s0(a){if(!a)return"—";const i=new Date(a);return Number.isNaN(i.getTime())?"—":i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Ao(a){return Number.isFinite(a)?`${Math.round(a)}ms`:"—"}function o0(a){try{const i=new URL(a),s=i.pathname==="/"?"":i.pathname;return`${i.host}${s}`.slice(0,34)}catch{return a.length>34?`${a.slice(0,31)}...`:a}}function Ej(a){const i=a.split("/");return i.length<=3?a:`.../${i.slice(-2).join("/")}`}function Cd(a,i){const s=a==null?void 0:a[i];return typeof s=="string"&&s.length>0?s:void 0}function u0(a,i){return(a==null?void 0:a[i])===!0}const Aj=[{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."}],zj=[{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 Rj(){var ge,M,O,Z,I;const a=e0(),i=t0(),s=l0(),u=vf(),d=lj(),m=Jo(),[h,v]=j.useState({mode:"fullAuto",scorer:"balanced"}),[p,x]=j.useState([]),[g,y]=j.useState(""),[E,C]=j.useState(null),[A,z]=j.useState(null),U=ej({...h,modelId:g}),k=u.data,G=((ge=s.data)==null?void 0:ge.sellers)??[],K=((M=d.data)==null?void 0:M.focusSet)??[],H=j.useMemo(()=>Gj((k==null?void 0:k.data)??[],K),[K,k==null?void 0:k.data]),V=Xj(U.data),P=j.useMemo(()=>Kj(G,k,(V==null?void 0:V.routes)??[]),[k,V==null?void 0:V.routes,G]),$=j.useMemo(()=>p.map(X=>H.find(ae=>ae.id===X)).filter(p0),[H,p]),ee=h.sellerIds??[],le=h.fixedByModel??{},oe=$.length,F=$.filter(X=>h.mode==="fixed"?!!le[X.id]:h.mode==="fixedSet"?ee.length>0:!0).length,me=j.useMemo(()=>{var X;return n0({inferences:((X=m.data)==null?void 0:X.inferences)??[],modelsResponse:k,sellersResponse:s.data,previewPlan:V,activeModelId:g})},[g,(O=m.data)==null?void 0:O.inferences,k,V,s.data]);j.useEffect(()=>{var X;(X=a.data)!=null&&X.strategy&&v(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(W=>H.some(Ee=>Ee.id===W)),ae=X.length>0?X:H.slice(0,2).map(W=>W.id);x(ae),y(ae[0]??"")},[K,H,p.length]),j.useEffect(()=>{!g||p.includes(g)||y(p[0]??"")},[g,p]),j.useEffect(()=>{g&&U.refetch()},[g,h.mode,h.scorer,h.sellerId,(I=h.sellerIds)==null?void 0:I.join(","),Pj(h.fixedByModel)]);async function pe(X){v(X),C(null);try{await i.mutateAsync(X)}catch(ae){C(ae instanceof Error?ae.message:String(ae))}}function Te(X){x(ae=>{if(ae.includes(X)){const Ee=ae.filter(Re=>Re!==X);return g===X&&y(Ee[0]??""),Uo(Ee).catch(()=>{}),Ee}y(X);const W=[...ae,X];return Uo(W).catch(()=>{}),W})}function ue(X){x(ae=>{const W=ae.filter(Ee=>Ee!==X);return g===X&&y(W[0]??""),Uo(W).catch(()=>{}),W})}function B(X){const ae=Vj({...h,mode:X},P,g);pe(ae)}function J(X){pe({...h,scorer:X})}function re(X,ae){const W=h.sellerIds??[],Ee=W.includes(ae)?W.filter(Re=>Re!==ae):[...W,ae];pe({...h,mode:"fixedSet",sellerIds:Ee,sellerId:void 0})}function ye(X,ae){const W={...h.fixedByModel??{},[X]:ae};pe({...h,mode:"fixed",fixedByModel:W,sellerId:void 0,sellerIds:void 0}),y(X),z(null)}return r.jsxs("div",{className:"space-y-5",children:[r.jsx("section",{children:r.jsxs(vt,{className:"p-4",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-line-2)] px-4 py-3",children:[r.jsx("div",{className:"min-w-0 flex-1",children:r.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Models"})}),r.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:[r.jsx(Jd,{size:14}),"Add"]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[$.map(X=>{const ae=g===X.id,W=X.sellerCount>0;return r.jsxs("div",{className:["inline-flex min-h-9 items-center gap-2 rounded-[9px] border px-3 py-1.5 transition-colors",W?"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",ae?"ring-2 ring-[var(--color-lavender-2)] ring-offset-1 ring-offset-white":""].join(" "),children:[r.jsx("button",{type:"button",onClick:()=>y(X.id),className:"flex items-center text-left",children:r.jsx("span",{className:["font-mono text-[0.82rem] font-semibold",W?"text-[var(--color-purple)]":"text-rose-700"].join(" "),children:X.id})}),r.jsx("button",{type:"button",onClick:()=>ue(X.id),className:["inline-flex size-5 items-center justify-center rounded-[6px]",W?"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:r.jsx(Jv,{size:12})})]},X.id)}),$.length===0?r.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?r.jsx("div",{className:"px-3 py-2 text-[0.82rem] text-amber-700",children:"Focus models could not be saved."}):null]})]})}),r.jsx("section",{children:r.jsx(vt,{className:"overflow-hidden",children:r.jsxs("div",{className:"p-5",children:[r.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Strategy"}),r.jsxs("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:[F,"/",Math.max(oe,1)," configured"]})]}),a.isLoading||s.isLoading||u.isLoading?r.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||s.isError||u.isError?r.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?r.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,r.jsx("div",{className:"mb-5 grid grid-cols-1 gap-2 md:grid-cols-3",children:Aj.map(X=>r.jsx(qj,{active:h.mode===X.value,title:X.label,description:X.help,onClick:()=>B(X.value)},X.value))}),r.jsx("div",{className:"rounded-[14px] border border-[var(--color-line-2)] bg-white p-4",children:r.jsx(_j,{mode:h.mode,scorer:h.scorer,selectedModels:$,fixedSetSellers:ee,fixedByModel:le,sellers:P,activeModelId:g,onScorerChange:J,onOpenSellerPicker:z,onToggleFixedSetSeller:re})})]})})}),r.jsx(Oj,{summary:me}),(A==null?void 0:A.kind)==="models"?r.jsx(Lj,{models:H,selectedModelIds:p,onClose:()=>z(null),onToggle:Te}):null,(A==null?void 0:A.kind)==="sellers"?r.jsx(Hj,{modelId:A.modelId,selection:A.selection,selectedSellerIds:A.selection==="single"?le[A.modelId]?[le[A.modelId]]:[]:ee,scorer:h.scorer,sellers:P,onClose:()=>z(null),onToggle:X=>{A.selection==="single"?ye(A.modelId,X):re(A.modelId,X)}}):null]})}function _j({mode:a,scorer:i,selectedModels:s,fixedSetSellers:u,fixedByModel:d,sellers:m,activeModelId:h,onScorerChange:v,onOpenSellerPicker:p,onToggleFixedSetSeller:x}){var E;const g=eS(s,h),y=(E=g[0])==null?void 0:E.id;return a==="fullAuto"?r.jsx("div",{children:r.jsx(Xx,{scorer:i,onChange:v})}):a==="fixedSet"?r.jsxs("div",{className:"space-y-3",children:[r.jsx(Xx,{scorer:i,onChange:v}),r.jsx(Uj,{modelId:y,sellers:m,sellerIds:u,onChoose:C=>p({kind:"sellers",modelId:C,selection:"multi"}),onRemove:C=>{y&&x(y,C)}})]}):r.jsx("div",{className:"space-y-3",children:r.jsx(Bj,{selectedModels:g,activeModelId:h,resolveValue:C=>Wj(d[C],m),onChoose:C=>p({kind:"sellers",modelId:C,selection:"single"})})})}function Oj({summary:a}){return r.jsx("section",{children:r.jsxs(vt,{className:"overflow-hidden",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Model route activity"}),r.jsxs("div",{className:"mt-0.5 font-mono text-[0.74rem] text-[var(--color-muted)]",children:[a.totalRequests.toLocaleString()," requests · ",jn(a.totalTokens)," tokens · ",bf(a.totalSpendMicros)]})]}),r.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:[a.rows.length.toLocaleString()," models"]})]}),r.jsxs("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:[a.rows.map(i=>r.jsx(Dj,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?r.jsx("div",{className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."}):null]}),r.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:r.jsxs("table",{className:"w-full min-w-[1180px] border-collapse text-left text-[0.82rem]",children:[r.jsx("thead",{className:"bg-white/70 text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Model"}),r.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Current node"}),r.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"Node stats"}),r.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"Discount"}),r.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"Speed"}),r.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"Tokens"}),r.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Selected"}),r.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"Last access"})]})}),r.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[a.rows.map(i=>r.jsx(kj,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."})}):null]})]})})]})})}function Dj({row:a}){return r.jsxs("article",{className:"px-4 py-3",children:[r.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"truncate font-mono text-[0.92rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),r.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[r.jsx(yi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?r.jsx(yi,{tone:Yo(a.lastStatus),children:a.lastStatus}):null,a.upstreamStatus?r.jsx(yi,{tone:Yo(a.upstreamStatus),children:a.upstreamStatus}):null]}),a.routeReason?r.jsx("div",{className:"mt-1 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),r.jsxs("div",{className:"min-w-0 text-right",children:[r.jsx("div",{className:"truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),r.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:a.currentSellerId}),r.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):"No payment metadata"})]})]}),r.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[r.jsx(xi,{label:"Node stats",value:a.currentSellerRequests.toLocaleString(),detail:`${a.sellerModelCount===void 0?"—":a.sellerModelCount.toLocaleString()} models · ${a.touchedSellerCount} nodes`}),r.jsx(xi,{label:"Discount",value:a.sellerDiscount,detail:`fee ${a.sellerServiceFee} · ${f0(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)}`,tone:"green"}),r.jsx(xi,{label:"Speed",value:Di(a.lastTtftMs??a.avgTtftMs),detail:`${Di(a.lastDurationMs??a.avgDurationMs)} total`}),r.jsx(xi,{label:"Tokens",value:jn(a.totalTokens),detail:`in ${jn(a.inputTokens)} / out ${jn(a.outputTokens)} · ${bf(a.totalSpendMicros)}`}),r.jsx(xi,{label:"Selected",value:Xt(a.selectedAt),compact:!0}),r.jsx(xi,{label:"Last access",value:Xt(a.lastAccessAt),detail:a.lastRequestId??void 0,compact:!0})]})]})}function xi({label:a,value:i,detail:s,tone:u="default",compact:d=!1}){return r.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[r.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),r.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}),s?r.jsx("div",{className:"mt-0.5 truncate text-[0.68rem] text-[var(--color-muted)]",title:s,children:s}):null]})}function kj({row:a}){return r.jsxs("tr",{className:"align-top transition hover:bg-[var(--color-lavender)]/25",children:[r.jsxs("td",{className:"px-4 py-3",children:[r.jsx("div",{className:"max-w-[230px] truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),r.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[r.jsx(yi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?r.jsx(yi,{tone:Yo(a.lastStatus),children:a.lastStatus}):null,a.upstreamStatus?r.jsx(yi,{tone:Yo(a.upstreamStatus),children:a.upstreamStatus}):null]}),a.routeReason?r.jsx("div",{className:"mt-1 max-w-[240px] truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),r.jsxs("td",{className:"px-4 py-3",children:[r.jsx("div",{className:"max-w-[210px] truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),r.jsx("div",{className:"mt-0.5 max-w-[210px] truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:a.currentSellerId}),r.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):"No payment metadata"})]}),r.jsxs("td",{className:"px-4 py-3 text-right",children:[r.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:a.currentSellerRequests.toLocaleString()}),r.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"node requests"}),r.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[a.sellerModelCount===void 0?"—":a.sellerModelCount.toLocaleString()," models · ",a.touchedSellerCount," nodes"]})]}),r.jsxs("td",{className:"px-4 py-3 text-right",children:[r.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-emerald-700",children:a.sellerDiscount}),r.jsxs("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:["fee ",a.sellerServiceFee]}),r.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:f0(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)})]}),r.jsxs("td",{className:"px-4 py-3 text-right",children:[r.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:Di(a.lastTtftMs??a.avgTtftMs)}),r.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"TTFT"}),r.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[Di(a.lastDurationMs??a.avgDurationMs)," total"]})]}),r.jsxs("td",{className:"px-4 py-3 text-right",children:[r.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:jn(a.totalTokens)}),r.jsxs("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:["in ",jn(a.inputTokens)," / out ",jn(a.outputTokens)]}),r.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:bf(a.totalSpendMicros)})]}),r.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.74rem] text-[var(--color-muted)]",children:Xt(a.selectedAt)}),r.jsxs("td",{className:"whitespace-nowrap px-4 py-3",children:[r.jsx("div",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:Xt(a.lastAccessAt)}),a.lastRequestId?r.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 yi({tone:a,children:i}){const s={green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",red:"bg-rose-50 text-rose-700",gray:"bg-slate-100 text-slate-600"}[a];return r.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.66rem] font-semibold uppercase",s].join(" "),children:i})}function Xx({scorer:a,onChange:i}){return r.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white p-1.5",children:r.jsx("div",{className:"grid grid-cols-1 gap-1.5 md:grid-cols-3",children:zj.map(s=>r.jsxs("button",{type:"button",onClick:()=>i(s.value),"aria-label":`Routing scorer: ${s.label}`,className:["flex min-h-14 items-center gap-2 rounded-[9px] px-3 py-2 text-left transition-colors",a===s.value?"bg-[var(--color-lavender)] text-[var(--color-ink)]":"text-[var(--color-muted)] hover:bg-[var(--color-lavender)]/40"].join(" "),children:[r.jsx(Fo,{active:a===s.value,fixed:!0}),r.jsxs("span",{className:"min-w-0",children:[r.jsx("span",{className:"block text-[0.86rem] font-semibold",children:s.label}),r.jsx("span",{className:"block truncate text-[0.72rem] text-[var(--color-muted)]",children:s.help})]})]},s.value))})})}function Uj({modelId:a,sellers:i,sellerIds:s,onChoose:u,onRemove:d}){if(!a)return r.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=s.map(h=>i.find(v=>v.id===h)).filter(p0);return r.jsxs("div",{className:"overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-white",children:[r.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:[r.jsx("div",{className:"min-w-0 flex-1",children:r.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Sellers"})}),r.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?r.jsx("div",{className:"min-w-0 max-w-full overflow-x-auto",children:r.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[r.jsx("thead",{className:"bg-white/70 text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),r.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"TTFT"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"}),r.jsx("th",{className:"w-10 px-3 py-2 font-semibold"})]})}),r.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:m.map(h=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:h.name}),r.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[r.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:h.discount}),r.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:h.price})]}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:h.markupFee}),r.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:h.paymentMethods.join(", ")}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:Di(h.latencyMs)}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:d0(h.tokensPerSecond)}),r.jsx("td",{className:"px-3 py-2.5 text-right",children:r.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:r.jsx(Jv,{size:14})})})]},h.id))})]})}):r.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 Bj({selectedModels:a,activeModelId:i,resolveValue:s,onChoose:u}){return a.length===0?r.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."}):r.jsx("div",{className:"divide-y divide-[var(--color-line-2)] rounded-[12px] border border-[var(--color-line-2)] bg-white",children:a.map(d=>r.jsxs("div",{className:["flex flex-wrap items-center gap-3 px-3 py-3",i===d.id?"bg-[var(--color-lavender)]/55":""].join(" "),children:[r.jsx("div",{className:"min-w-0 flex-1",children:r.jsx("div",{className:"truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:d.id})}),r.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[r.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:s(d.id)}),r.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 Lj({models:a,selectedModelIds:i,onClose:s,onToggle:u}){const[d,m]=j.useState(""),h=a.filter(v=>h0(d,[v.id,v.paymentMethod,v.enabled?"enabled":"not enabled"]));return r.jsxs(c0,{title:"Add models",onClose:s,children:[r.jsx(m0,{value:d,onChange:m,placeholder:"Search models or payment"}),r.jsx("div",{className:"mt-3 overflow-hidden rounded-[12px] border border-[var(--color-line-2)]",children:r.jsxs("table",{className:"w-full border-collapse text-left text-[0.84rem]",children:[r.jsx("thead",{className:"bg-white/70 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)]",children:r.jsxs("tr",{children:[r.jsx("th",{className:"w-10 px-3 py-2 font-semibold"}),r.jsx("th",{className:"px-3 py-2 font-semibold",children:"Model"}),r.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Sellers"})]})}),r.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[h.map(v=>{const p=i.includes(v.id);return r.jsxs("tr",{onClick:()=>u(v.id),className:["cursor-pointer",p?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35",v.enabled?"":"opacity-60"].join(" "),children:[r.jsx("td",{className:"px-3 py-2.5",children:r.jsx(Fo,{active:p,fixed:!1})}),r.jsx("td",{className:"px-3 py-2.5 font-mono font-semibold text-[var(--color-ink)]",children:v.id}),r.jsx("td",{className:"px-3 py-2.5",children:r.jsx(Qj,{enabled:v.enabled,paymentMethod:v.paymentMethod})}),r.jsx("td",{className:"px-3 py-2.5 text-right text-[var(--color-muted)]",children:v.sellerCount})]},v.id)}),h.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:4,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No models found."})}):null]})]})}),r.jsx("div",{className:"mt-3 flex items-center justify-end border-t border-[var(--color-line-2)] pt-3",children:r.jsx("button",{type:"button",onClick:s,"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 Hj({modelId:a,selection:i,selectedSellerIds:s,scorer:u,sellers:d,onClose:m,onToggle:h}){const[v,p]=j.useState(""),g=Yj(d.filter(y=>y.coverageModelIds.includes(a)),[a],u).filter(y=>h0(v,[y.name,y.id,y.paymentMethods.join(" "),y.health,y.notes.join(" ")]));return r.jsxs(c0,{title:`Choose seller · ${a}`,onClose:m,children:[r.jsx(m0,{value:v,onChange:p,placeholder:"Search sellers, payment, notes"}),r.jsx("div",{className:"mt-3 overflow-hidden rounded-[12px] border border-[var(--color-line-2)]",children:r.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[r.jsx("thead",{className:"bg-white/70 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)]",children:r.jsxs("tr",{children:[r.jsx("th",{className:"w-10 px-3 py-2 font-semibold"}),r.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),r.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"TTFT"}),r.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"})]})}),r.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[g.map(y=>{const E=s.includes(y.id);return r.jsxs("tr",{onClick:()=>h(y.id),className:["cursor-pointer",E?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35"].join(" "),children:[r.jsx("td",{className:"px-3 py-2.5",children:r.jsx(Fo,{active:E,fixed:i==="single"})}),r.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:y.name}),r.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[r.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:y.discount}),r.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:y.price})]}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:y.markupFee}),r.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:y.paymentMethods.join(", ")}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:Di(y.latencyMs)}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:d0(y.tokensPerSecond)})]},y.id)}),g.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:7,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No sellers found."})}):null]})]})})]})}function c0({title:a,children:i,onClose:s}){return r.jsx("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-[#201a38]/35 px-4 py-6 backdrop-blur-sm",children:r.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:[r.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--color-line-2)] px-5 py-4",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:a}),r.jsx("button",{type:"button",onClick:s,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:r.jsx(Xr,{size:16})})]}),r.jsx("div",{className:"max-h-[calc(86dvh-65px)] overflow-auto p-4",children:i})]})})}function qj({active:a,title:i,description:s,onClick:u}){return r.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:[r.jsxs("span",{className:"flex items-center gap-2 font-mono text-[0.86rem] font-semibold",children:[r.jsx(Fo,{active:a,fixed:!0}),i]}),r.jsx("span",{className:"mt-1.5 block text-[0.74rem] leading-snug text-[var(--color-muted)]",children:s})]})}function Qj({enabled:a,paymentMethod:i}){return r.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?r.jsx(K2,{size:12}):r.jsx($d,{size:12}),i," ",a?"enabled":"not enabled"]})}function Fo({active:a,fixed:i}){return r.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:r.jsx(Kt,{size:13,strokeWidth:2.4})})}function Yj(a,i,s){return[...a].sort((u,d)=>{const m=Zx(u,i),h=Zx(d,i);return m!==h?h-m:s==="speed"?Fj(u.latencyMs,d.latencyMs):s==="discount"?Number.parseInt(d.discount,10)-Number.parseInt(u.discount,10):d.healthScore-u.healthScore})}function Gj(a,i){const s=new Map;for(const d of a){const m=s.get(d.id)??{sellerIds:new Set,paymentMethods:new Set};m.sellerIds.add(d.sellerId);for(const h of d.paymentMethods)m.paymentMethods.add(h);s.set(d.id,m)}const u=new Map(i.map((d,m)=>[d,m]));return Array.from(s.entries()).map(([d,m])=>({id:d,paymentMethod:Array.from(m.paymentMethods)[0]??"-",enabled:m.sellerIds.size>0,sellerCount:m.sellerIds.size})).sort((d,m)=>{const h=u.get(d.id),v=u.get(m.id);return h!==void 0||v!==void 0?(h??9999)-(v??9999):d.id.localeCompare(m.id)})}function Kj(a,i,s){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(s.map(h=>[h.seller.id,h]));return a.map((h,v)=>{var A;const p=m.get(h.id),x=d.get(h.id),g=Array.from(new Set(u.filter(z=>z.sellerId===h.id).map(z=>z.id))),y=(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)??(x==null?void 0:x.discountRatio);return{id:h.id,name:Ij(h.name??(x==null?void 0:x.name)??h.id),endpoint:h.url,health:(x==null?void 0:x.status)==="error"||(x==null?void 0:x.status)==="manifest_unavailable"||h.status==="failed"?"offline":h.status==="degraded"?"degraded":"online",healthScore:Number.isFinite(E)?Math.round(E):0,coverageModelIds:g,paymentMethods:(x==null?void 0:x.paymentMethods)??h.paymentMethods??[],discount:$j(C),markupFee:Jj(x==null?void 0:x.serviceFeeRatio),price:p?"preview":"registry",latencyMs:Number.isFinite(y)?Math.round(y):void 0,tokensPerSecond:void 0,notes:[((A=h.supportedProtocols)==null?void 0:A.join(", "))||"no protocols",`registry #${v+1}`]}})}function Xj(a){if(a)return a.plan??{routes:a.routes,mode:a.mode,scorer:a.scorer,reason:a.reason}}function Vj(a,i,s){var u,d;if(a.mode==="fixed"){const m={...a.fixedByModel??{}},h=((u=Zj(i,s))==null?void 0:u.id)||((d=i[0])==null?void 0:d.id);return s&&!m[s]&&h&&(m[s]=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=>!s||h.coverageModelIds.includes(s)).slice(0,2).map(h=>h.id);return{mode:"fixedSet",scorer:a.scorer,sellerIds:m}}return{mode:"fullAuto",scorer:a.scorer}}function Zj(a,i){return a.find(s=>!i||s.coverageModelIds.includes(i))}function $j(a){if(!Number.isFinite(a))return"-";const i=Math.max(0,1-a);return`${Math.round(i*100)}%`}function Jj(a){return Number.isFinite(a)?`${Math.round(a*100)}%`:"-"}function Di(a){return Number.isFinite(a)?`${Math.round(a)}ms`:"-"}function d0(a){return Number.isFinite(a)?`${Math.round(a)}`:"-"}function bf(a,i=4){return`$${(a/1e6).toFixed(i)}`}function jn(a){return Intl.NumberFormat("en",{notation:a>=1e4?"compact":"standard",maximumFractionDigits:a>=1e4?1:0}).format(a)}function f0(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?"—":`${Vx(a)} / ${Vx(i)}`}function Vx(a){return Number.isFinite(a)?`$${(a/1e6).toFixed(4)}`:"—"}function Yo(a){const i=a.toLowerCase();return i==="ok"||i==="success"||i==="settled"||i==="healthy"||i==="completed"?"green":i==="pending"||i==="degraded"||i==="preview"?"amber":i==="error"||i==="failed"||i==="unhealthy"?"red":"gray"}function Zx(a,i){return i.length===0?a.coverageModelIds.length:i.filter(s=>a.coverageModelIds.includes(s)).length}function Fj(a,i){const s=Number.isFinite(a),u=Number.isFinite(i);return s&&u?a-i:s?-1:u?1:0}function Wj(a,i){var s;return a?((s=i.find(u=>u.id===a))==null?void 0:s.name)??a:"Not selected"}function Pj(a){return Object.entries(a??{}).sort(([i],[s])=>i.localeCompare(s)).map(([i,s])=>`${i}:${s}`).join(",")}function Ij(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function m0({value:a,onChange:i,placeholder:s}){return r.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:[r.jsx($o,{size:15}),r.jsx("input",{name:"routing-search",value:a,onChange:u=>i(u.target.value),placeholder:s,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 h0(a,i){const s=a.trim().toLowerCase();return s?i.some(u=>u.toLowerCase().includes(s)):!0}function eS(a,i){return i?[...a].sort((s,u)=>s.id===i?-1:u.id===i?1:0):a}function p0(a){return a!==void 0}function x0({totalItems:a,pageSize:i,page:s,onPageChange:u,onPageSizeChange:d,pageSizeOptions:m=[25,50,100]}){const h=Math.max(1,Math.ceil(a/i)),v=j.useMemo(()=>tS(s,h),[s,h]);if(a===0)return null;const p=(s-1)*i+1,x=Math.min(s*i,a);return r.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:[r.jsxs("div",{className:"text-[var(--color-muted)]",children:["Showing ",r.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:p}),"-",r.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:x})," of"," ",r.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:a})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("label",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"Rows"}),r.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 y=Math.max(1,Number(g.target.value)||25);d==null||d(y),u(1)},children:m.map(g=>r.jsx("option",{value:g,children:g},g))}),r.jsxs("div",{className:"ml-2 flex items-center gap-1",children:[r.jsx("button",{type:"button",disabled:s<=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:"«"}),r.jsx("button",{type:"button",disabled:s<=1,onClick:()=>u(s-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:"‹"}),v.map((g,y)=>g==="…"?r.jsx("span",{className:"px-1.5 text-[var(--color-muted)]",children:"…"},`gap-${y}`):r.jsx("button",{type:"button",onClick:()=>u(g),"aria-label":`Page ${g}`,"aria-current":g===s?"page":void 0,className:g===s?"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)),r.jsx("button",{type:"button",disabled:s>=h,onClick:()=>u(s+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:"›"}),r.jsx("button",{type:"button",disabled:s>=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:"»"}),r.jsx("span",{className:"ml-2 text-[0.78rem] text-[var(--color-muted)]",children:"Go to"}),r.jsx("input",{type:"number",min:1,max:h,defaultValue:s,"aria-label":"Go to page",onKeyDown:g=>{if(g.key==="Enter"){const y=Math.max(1,Math.min(h,Number(g.target.value)||1));u(y)}},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)]"}),r.jsx("span",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"page"})]})]})]})}function tS(a,i){if(i<=7)return Array.from({length:i},(d,m)=>m+1);const s=[],u=d=>{s[s.length-1]!==d&&s.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),s}function lS(){var ge,M;const a=Jo(),i=I2(),[s,u]=j.useState("inferences"),[d,m]=j.useState(""),[h,v]=j.useState("all"),[p,x]=j.useState("all"),[g,y]=j.useState("all"),[E,C]=j.useState("all"),[A,z]=j.useState(1),[U,k]=j.useState(1),[G,K]=j.useState(25),[H,V]=j.useState(null),[P,$]=j.useState(null),ee=a.isLoading||i.isLoading,le=((ge=a.data)==null?void 0:ge.inferences)??[],oe=((M=i.data)==null?void 0:M.purchases)??[],F=d.trim().toLowerCase(),me=j.useMemo(()=>oS(le,oe),[le,oe]),pe=j.useMemo(()=>uS(le),[le]),Te=j.useMemo(()=>cS(oe),[oe]),ue=j.useMemo(()=>le.filter(O=>h!=="all"&&O.status!==h||p!=="all"&&O.modelId!==p?!1:dS(O,F)).sort((O,Z)=>Z.createdAt.localeCompare(O.createdAt)),[le,p,h,F]),B=j.useMemo(()=>oe.filter(O=>g!=="all"&&O.status!==g||E!=="all"&&O.paymentMethod!==E?!1:fS(O,F)).sort((O,Z)=>Z.createdAt.localeCompare(O.createdAt)),[oe,E,g,F]),J=j.useMemo(()=>Jx(ue,A,G),[ue,A,G]),re=j.useMemo(()=>Jx(B,U,G),[B,U,G]),ye=a.isError||i.isError;return j.useEffect(()=>{const O=Math.max(1,Math.ceil(ue.length/G));A>O&&z(O)},[ue.length,A,G]),j.useEffect(()=>{const O=Math.max(1,Math.ceil(B.length/G));U>O&&k(O)},[B.length,G,U]),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("section",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[r.jsx(zo,{icon:r.jsx(H2,{className:"size-5"}),label:"Inference spend",value:Wl(me.inferenceSpendMicros,4),detail:`${me.inferenceCount.toLocaleString()} requests`,tone:"spend"}),r.jsx(zo,{icon:r.jsx(z2,{className:"size-5"}),label:"Token usage",value:Td(me.inputTokens+me.outputTokens),detail:`Input: ${Td(me.inputTokens)} / Output: ${Td(me.outputTokens)}`,tone:"tokens"}),r.jsx(zo,{icon:r.jsx(cn,{className:"size-5"}),label:"Purchase credit",value:Wl(me.purchaseCreditMicros,4),detail:`${me.settledPurchases.toLocaleString()} settled`,tone:"credit"}),r.jsx(zo,{icon:r.jsx(w2,{className:"size-5"}),label:"Average response",value:me.averageDurationMs===void 0?"N/A":`${(me.averageDurationMs/1e3).toFixed(2)}s`,detail:"Completed inference time",tone:"latency"})]}),r.jsxs(vt,{className:"overflow-hidden p-0",children:[r.jsxs("div",{className:"border-b border-[var(--color-line-2)] bg-white px-4 py-3",children:[r.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:"Usage details"})}),r.jsxs("div",{className:"grid grid-cols-2 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-1",children:[r.jsx($x,{label:"Inferences",active:s==="inferences",count:ue.length,onClick:()=>u("inferences"),children:"Inferences"}),r.jsx($x,{label:"Purchases",active:s==="purchases",count:B.length,onClick:()=>u("purchases"),children:"Purchases"})]})]}),r.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-[minmax(220px,1fr)_160px_200px]",children:[r.jsxs("label",{className:"relative block",children:[r.jsx($o,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),r.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:s==="inferences"?"Search request, model, seller...":"Search purchase, method, seller...",onChange:O=>{m(O.target.value),z(1),k(1)}})]}),s==="inferences"?r.jsxs(r.Fragment,{children:[r.jsx(Ro,{label:"Status",value:h,options:pe.statuses,onChange:O=>{v(O),z(1)}}),r.jsx(Ro,{label:"Model",value:p,options:pe.models,onChange:O=>{x(O),z(1)}})]}):r.jsxs(r.Fragment,{children:[r.jsx(Ro,{label:"Status",value:g,options:Te.statuses,onChange:O=>{y(O),k(1)}}),r.jsx(Ro,{label:"Method",value:E,options:Te.methods,onChange:O=>{C(O),k(1)}})]})]})]}),ye?r.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,ee?r.jsx(sS,{}):s==="inferences"?r.jsx(aS,{entries:J,total:ue.length,page:A,pageSize:G,openId:H,onToggle:O=>V(H===O?null:O),onPageChange:z,onPageSizeChange:O=>{K(O),z(1),k(1)}}):r.jsx(nS,{entries:re,total:B.length,page:U,pageSize:G,openId:P,onToggle:O=>$(P===O?null:O),onPageChange:k,onPageSizeChange:O=>{K(O),z(1),k(1)}})]})]})}function zo({icon:a,label:i,value:s,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 r.jsxs(vt,{className:["relative flex min-h-[7rem] items-center gap-4 overflow-hidden px-4 py-4",m.card].join(" "),children:[r.jsx("div",{className:["absolute inset-y-0 left-0 w-1",m.accent].join(" ")}),r.jsx("div",{className:["grid size-11 shrink-0 place-items-center rounded-[10px] shadow-sm",m.icon].join(" "),children:a}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:["text-[0.72rem] font-bold uppercase tracking-[0.08em]",m.label].join(" "),children:i}),r.jsx("div",{className:["mt-1 truncate font-mono text-[1.55rem] font-bold leading-none tracking-normal",m.value].join(" "),children:s}),r.jsx("div",{className:"mt-2 truncate text-[0.76rem] font-medium text-[var(--color-muted)]",children:u})]})]})}function $x({label:a,active:i,count:s,onClick:u,children:d}){return r.jsxs("button",{type:"button",onClick:u,"aria-label":`${a} ledger records, ${s.toLocaleString()} 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:[r.jsx("span",{children:d}),r.jsx("span",{className:"font-mono text-[0.76rem]",children:s.toLocaleString()})]})}function Ro({label:a,value:i,options:s,onChange:u}){return r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"sr-only",children:a}),r.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:[r.jsxs("option",{value:"all",children:["All ",a.toLowerCase()]}),s.map(d=>r.jsx("option",{value:d,children:d},d))]})]})}function aS({entries:a,total:i,page:s,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:v}){return i===0?r.jsx(g0,{label:"inference records"}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>r.jsx(iS,{entry:p,open:d===p.requestId,onToggle:()=>m(p.requestId)},p.requestId))}),r.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:r.jsxs("table",{className:"w-full min-w-[1080px] text-[0.86rem]",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[r.jsx("th",{className:"px-4 py-2.5",children:"When"}),r.jsx("th",{className:"px-4 py-2.5",children:"Request"}),r.jsx("th",{className:"px-4 py-2.5",children:"Model"}),r.jsx("th",{className:"px-4 py-2.5",children:"Seller"}),r.jsx("th",{className:"px-4 py-2.5 text-right",children:"Input"}),r.jsx("th",{className:"px-4 py-2.5 text-right",children:"Output"}),r.jsx("th",{className:"px-4 py-2.5 text-right",children:"Cost"}),r.jsx("th",{className:"px-4 py-2.5 text-right",children:"Latency"}),r.jsx("th",{className:"px-4 py-2.5",children:"Status"})]})}),a.map(p=>r.jsxs("tbody",{children:[r.jsxs("tr",{onClick:()=>m(p.requestId),className:"cursor-pointer border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[r.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:Xt(p.createdAt)}),r.jsx("td",{className:"px-4 py-3",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Wo,{tone:"purple",children:r.jsx($v,{className:"size-4"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"max-w-[180px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.requestId}),r.jsx("div",{className:"mt-0.5 max-w-[180px] truncate text-[0.72rem] text-[var(--color-muted)]",children:p.endpoint})]})]})}),r.jsx("td",{className:"max-w-[190px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),r.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),r.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem]",children:(p.promptTokens??0).toLocaleString()}),r.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem]",children:(p.completionTokens??0).toLocaleString()}),r.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-[var(--color-ink)]",children:Wl(p.billedMicros??0,4)}),r.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] text-[var(--color-muted)]",children:p.durationMs===void 0?"N/A":`${p.durationMs}ms`}),r.jsx("td",{className:"px-4 py-3",children:r.jsx(ls,{tone:Po(p.status),children:p.status})})]}),d===p.requestId?r.jsx("tr",{children:r.jsx("td",{colSpan:9,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:r.jsx(v0,{entry:p})})}):null]},p.requestId))]})}),r.jsx(x0,{totalItems:i,pageSize:u,page:s,onPageChange:h,onPageSizeChange:v})]})}function nS({entries:a,total:i,page:s,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:v}){return i===0?r.jsx(g0,{label:"purchase records"}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>r.jsx(rS,{entry:p,open:d===p.purchaseId,onToggle:()=>m(p.purchaseId)},p.purchaseId))}),r.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:r.jsxs("table",{className:"w-full min-w-[980px] text-[0.86rem]",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[r.jsx("th",{className:"px-4 py-2.5",children:"When"}),r.jsx("th",{className:"px-4 py-2.5",children:"Purchase"}),r.jsx("th",{className:"px-4 py-2.5",children:"Payment method"}),r.jsx("th",{className:"px-4 py-2.5",children:"Model"}),r.jsx("th",{className:"px-4 py-2.5",children:"Seller"}),r.jsx("th",{className:"px-4 py-2.5 text-right",children:"Credit"}),r.jsx("th",{className:"px-4 py-2.5",children:"Status"})]})}),a.map(p=>r.jsxs("tbody",{children:[r.jsxs("tr",{onClick:()=>m(p.purchaseId),className:"cursor-pointer border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[r.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:Xt(p.createdAt)}),r.jsx("td",{className:"px-4 py-3",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Wo,{tone:"green",children:r.jsx(Oi,{className:"size-4"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"max-w-[210px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.purchaseId}),r.jsx("div",{className:"mt-0.5 max-w-[210px] truncate text-[0.72rem] text-[var(--color-muted)]",children:p.paymentReferenceHash??"No reference hash"})]})]})}),r.jsx("td",{className:"px-4 py-3 text-[var(--color-ink)]",children:p.paymentMethod}),r.jsx("td",{className:"max-w-[180px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),r.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),r.jsxs("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-emerald-700",children:["+",Wl(p.creditMicros,4)]}),r.jsx("td",{className:"px-4 py-3",children:r.jsx(ls,{tone:Po(p.status),children:p.status})})]}),d===p.purchaseId?r.jsx("tr",{children:r.jsx("td",{colSpan:7,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:r.jsx(b0,{entry:p})})}):null]},p.purchaseId))]})}),r.jsx(x0,{totalItems:i,pageSize:u,page:s,onPageChange:h,onPageSizeChange:v})]})}function iS({entry:a,open:i,onToggle:s}){return r.jsxs("article",{className:"px-4 py-3",children:[r.jsx("button",{type:"button",onClick:s,"aria-expanded":i,"aria-label":`Inference ${a.requestId}`,className:"block w-full text-left",children:r.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[r.jsx(Wo,{tone:"purple",children:r.jsx($v,{className:"size-4"})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.requestId,children:a.requestId}),r.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.endpoint,children:a.endpoint})]}),r.jsx(ls,{tone:Po(a.status),children:a.status})]}),r.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[r.jsx(Mt,{label:"When",value:Xt(a.createdAt),compact:!0}),r.jsx(Mt,{label:"Model",value:a.modelId}),r.jsx(Mt,{label:"Seller",value:a.sellerKey}),r.jsx(Mt,{label:"Cost",value:Wl(a.billedMicros??0,4),tone:"strong"}),r.jsx(Mt,{label:"Input",value:(a.promptTokens??0).toLocaleString()}),r.jsx(Mt,{label:"Output",value:(a.completionTokens??0).toLocaleString()}),r.jsx(Mt,{label:"Latency",value:a.durationMs===void 0?"N/A":`${a.durationMs}ms`}),r.jsx(Mt,{label:"Route",value:a.routeReason??"N/A"})]})]})]})}),i?r.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:r.jsx(v0,{entry:a})}):null]})}function rS({entry:a,open:i,onToggle:s}){return r.jsxs("article",{className:"px-4 py-3",children:[r.jsx("button",{type:"button",onClick:s,"aria-expanded":i,"aria-label":`Purchase ${a.purchaseId}`,className:"block w-full text-left",children:r.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[r.jsx(Wo,{tone:"green",children:r.jsx(Oi,{className:"size-4"})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.purchaseId,children:a.purchaseId}),r.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.paymentReferenceHash??void 0,children:a.paymentReferenceHash??"No reference hash"})]}),r.jsx(ls,{tone:Po(a.status),children:a.status})]}),r.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[r.jsx(Mt,{label:"When",value:Xt(a.createdAt),compact:!0}),r.jsx(Mt,{label:"Method",value:a.paymentMethod}),r.jsx(Mt,{label:"Model",value:a.modelId}),r.jsx(Mt,{label:"Seller",value:a.sellerKey}),r.jsx(Mt,{label:"Credit",value:`+${Wl(a.creditMicros,4)}`,tone:"green"}),r.jsx(Mt,{label:"Currency",value:a.currency}),r.jsx(Mt,{label:"Completed",value:a.completedAt?Xt(a.completedAt):"N/A",compact:!0})]})]})]})}),i?r.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:r.jsx(b0,{entry:a})}):null]})}function Mt({label:a,value:i,tone:s="default",compact:u=!1}){return r.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[r.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),r.jsx("div",{className:["mt-1 truncate font-mono font-semibold",u?"text-[0.7rem]":"text-[0.84rem]",s==="green"?"text-emerald-700":s==="strong"?"text-[var(--color-ink)]":"text-[var(--color-text)]"].join(" "),title:i,children:i})]})}function Wo({tone:a,children:i}){return r.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 v0({entry:a}){return r.jsx(y0,{rows:[["Request ID",a.requestId],["Created",Xt(a.createdAt)],["Endpoint",a.endpoint],["Payment method",a.paymentMethod??"N/A"],["Route",`${a.routeReason??"N/A"} -> ${a.sellerKey}`],["Fallback chain",a.falloverChain&&a.falloverChain.length>0?a.falloverChain.join(" -> "):"N/A"],["Upstream status",a.upstreamStatus??"N/A"],["TTFT / duration",`${a.ttftMs!==void 0?`${a.ttftMs}ms`:"N/A"} / ${a.durationMs!==void 0?`${a.durationMs}ms`:"N/A"}`],["Input / output tokens",`${(a.promptTokens??0).toLocaleString()} / ${(a.completionTokens??0).toLocaleString()}`],["Billed",Wl(a.billedMicros??0,4)],["Balance after",a.balanceSnapshotMicros!==void 0?Wl(a.balanceSnapshotMicros,4):"N/A"],["Prompt hash",a.promptHash?`${a.promptHash.slice(0,32)}...`:"N/A"],["Response hash",a.responseHash?`${a.responseHash.slice(0,32)}...`:"N/A"],["Price version",a.priceVersion??"N/A"]]})}function b0({entry:a}){return r.jsx(y0,{rows:[["Purchase ID",a.purchaseId],["Created",Xt(a.createdAt)],["Completed",a.completedAt?Xt(a.completedAt):"N/A"],["Payment method",a.paymentMethod],["Payment reference",a.paymentReferenceHash?`${a.paymentReferenceHash.slice(0,32)}...`:"N/A"],["Credit",Wl(a.creditMicros,4)],["Credit micros",a.creditMicros.toLocaleString()],["Currency",a.currency],["Seller",a.sellerKey],["Model",a.modelId]]})}function y0({rows:a}){return r.jsx("div",{className:"grid gap-x-4 gap-y-2 text-[0.84rem] sm:grid-cols-[150px_minmax(0,1fr)]",children:a.map(([i,s])=>r.jsxs("div",{className:"contents",children:[r.jsx("div",{className:"text-[var(--color-muted)]",children:i}),r.jsx("div",{className:"min-w-0 break-all font-mono text-[0.8rem] text-[var(--color-ink)]",children:s})]},i))})}function sS(){return r.jsx("div",{className:"space-y-2 px-4 py-4",children:Array.from({length:7},(a,i)=>r.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-lavender)]/35"},i))})}function g0({label:a}){return r.jsxs("div",{className:"flex min-h-[220px] flex-col items-center justify-center px-6 py-10 text-center",children:[r.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:r.jsx($o,{className:"size-5"})}),r.jsxs("div",{className:"mt-4 font-semibold text-[var(--color-ink)]",children:["No matching ",a]}),r.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 oS(a,i){const s=a.reduce((p,x)=>p+(x.billedMicros??0),0),u=i.reduce((p,x)=>p+x.creditMicros,0),d=a.reduce((p,x)=>p+(x.promptTokens??0),0),m=a.reduce((p,x)=>p+(x.completionTokens??0),0),h=a.map(p=>p.durationMs).filter(p=>p!==void 0),v=h.length===0?void 0:h.reduce((p,x)=>p+x,0)/h.length;return{inferenceCount:a.length,inferenceSpendMicros:s,purchaseCreditMicros:u,inputTokens:d,outputTokens:m,settledPurchases:i.filter(p=>mS(p.status)).length,averageDurationMs:v}}function uS(a){return{statuses:Go(a.map(i=>i.status)),models:Go(a.map(i=>i.modelId))}}function cS(a){return{statuses:Go(a.map(i=>i.status)),methods:Go(a.map(i=>i.paymentMethod))}}function Go(a){return Array.from(new Set(a.filter(Boolean))).sort((i,s)=>i.localeCompare(s))}function dS(a,i){return i?[a.requestId,a.sellerKey,a.modelId,a.endpoint,a.status,a.paymentMethod,a.routeReason,a.upstreamStatus].some(s=>s==null?void 0:s.toLowerCase().includes(i)):!0}function fS(a,i){return i?[a.purchaseId,a.sellerKey,a.modelId,a.paymentMethod,a.status,a.currency,a.paymentReferenceHash].some(s=>s==null?void 0:s.toLowerCase().includes(i)):!0}function Jx(a,i,s){const u=(i-1)*s;return a.slice(u,u+s)}function Po(a){return a==="ok"||a==="settled"||a==="completed"||a==="success"||a==="active"?"green":a==="fallback"||a==="pending"?"amber":a==="failed"||a==="error"||a==="canceled"?"red":"gray"}function mS(a){return a==="settled"||a==="active"||a==="completed"||a==="success"}function Wl(a,i=2){return`$${(a/1e6).toFixed(i)}`}function Td(a){return Intl.NumberFormat("en",{notation:a>=1e4?"compact":"standard",maximumFractionDigits:a>=1e4?1:0}).format(a)}function hS(){return dl({queryKey:["init","state"],queryFn:()=>fl("/init/state"),refetchInterval:1e4})}async function pS(a){return Ha("POST","/init/complete",void 0)}function xS(){return Li({mutationFn:()=>Ha("POST","/init/doctor/run")})}function vS(){return dl({queryKey:["providers","status"],queryFn:()=>fl("/providers/status"),refetchInterval:1e4})}function bS(){return Li({mutationFn:a=>Ha("POST","/providers/install/preview",a)})}function yS(){const a=ts();return Li({mutationFn:i=>Ha("POST","/providers/install/apply",i),onSuccess:()=>{a.invalidateQueries({queryKey:["providers","status"]}),a.invalidateQueries({queryKey:["init","state"]})}})}const gS=[{value:"fullAuto",title:"全自动",body:"自动选择可用供应商。"},{value:"fixedSet",title:"固定供应商组",body:"在指定供应商组内切换。"},{value:"fixed",title:"固定供应商",body:"始终使用指定供应商。"}],jS=[{value:"balanced",title:"平衡模式",body:"综合速度、价格、健康度、余额。"},{value:"speed",title:"速度优先",body:"优先选择更快、吞吐量更高供应商。"},{value:"discount",title:"成本优先",body:"优先选择更低成本供应商。"}],Fx=[{index:1,label:"选择模型",value:"默认模型"},{index:2,label:"绑定钱包",value:"支付方式"},{index:3,label:"配置策略",value:"路由规则"},{index:4,label:"配置工具",value:"终端接入"}],SS=[{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 钱包入口预留"}],NS=["GPT","Claude","Gemini","DeepSeek","Kimi","Qwen","MiniMax","GLM","Doubao","Grok"];function MS(a){const i=new URLSearchParams(a);return i.has("verifyPaymentMethods")?2:(i.has("verifyPickerDom")||i.has("verifyNoIntro")||i.has("verifyCompact"),1)}function wS(){var os,us,cs,Ya,Ga,Ka,xl,Xa,aa,ds,qi,Tn;const[a,i]=j.useState(()=>MS(typeof window>"u"?"":window.location.search)),[s,u]=j.useState([]),[d,m]=j.useState(!1),[h,v]=j.useState(),[p,x]=j.useState(!1),[g,y]=j.useState(!1),[E,C]=j.useState("fullAuto"),[A,z]=j.useState("balanced"),[U,k]=j.useState(""),[G,K]=j.useState([]),[H,V]=j.useState(),[P,$]=j.useState(""),[ee,le]=j.useState([]),[oe,F]=j.useState({}),[me,pe]=j.useState(),[Te,ue]=j.useState(),[B,J]=j.useState(!1),[re,ye]=j.useState(null),[ge,M]=j.useState(!1),[O,Z]=j.useState(),I=hS(),X=a0(),ae=t0(),W=Wv(),Ee=vS(),Re=Pv(),ml=Iv(),ea=bS(),Nn=yS(),wt=xS(),ut=vf(),Mn=Jo(),ta=j.useMemo(()=>{var ie;return AS(((ie=ut.data)==null?void 0:ie.data)??[])},[(os=ut.data)==null?void 0:os.data]),eu=j.useMemo(()=>{var ie,He,Dt;return XS(((ie=ut.data)==null?void 0:ie.sellers)??[],((He=ut.data)==null?void 0:He.data)??[],((Dt=Mn.data)==null?void 0:Dt.inferences)??[])},[(us=Mn.data)==null?void 0:us.inferences,(cs=ut.data)==null?void 0:cs.data,(Ya=ut.data)==null?void 0:Ya.sellers]),wn=j.useMemo(()=>{var ie;return zS(ta,s,((ie=I.data)==null?void 0:ie.recommendedModels)??[])},[(Ga=I.data)==null?void 0:Ga.recommendedModels,ta,s]),hl=j.useMemo(()=>s.length>0?s:wn.map(ie=>ie.id),[wn,s]),qa=`http://127.0.0.1:${((Ka=X.data)==null?void 0:Ka.proxyPort)??((xl=I.data)==null?void 0:xl.runtime.proxyPort)??17821}`,la=j.useMemo(()=>{var ie;return(((ie=Ee.data)==null?void 0:ie.clients)??[]).filter(He=>He.id!=="custom"&&He.detected)},[(Xa=Ee.data)==null?void 0:Xa.clients]),as=((aa=W.data)==null?void 0:aa.payments.filter(ie=>ie.enabled&&Io(ie.method)!=="mock"))??[],ns=j.useMemo(()=>WS(E,A,U,G),[U,G,E,A]),bt=PS({serviceReady:((ds=X.data)==null?void 0:ds.status)==="running",modelCount:ta.length,routingMode:E,paymentReady:as.length>0,configuredTools:((qi=Ee.data)==null?void 0:qi.summary.configuredCount)??0}),tu=((Tn=wt.data)==null?void 0:Tn.checks.map(IS))??bt;j.useEffect(()=>{p||!I.data||(u(I.data.focusSet),x(!0))},[I.data,p]),j.useEffect(()=>{P||s.length===0||$(s[0])},[P,s]),j.useEffect(()=>{g||la.length===0||(le(la.filter(ie=>!ie.configured).map(ie=>ie.id)),y(!0))},[g,la]),j.useEffect(()=>{a!==5||wt.data||wt.error||wt.isPending||wt.mutate()},[a,wt]),j.useEffect(()=>{var Dt;const ie=na=>{na.preventDefault(),ye(na),Z("浏览器已经允许直接安装 TokenBuddy。")},He=()=>{M(!0),ye(null),Z("TokenBuddy 桌面应用已安装。")};return window.addEventListener("beforeinstallprompt",ie),window.addEventListener("appinstalled",He),(Dt=window.matchMedia)!=null&&Dt.call(window,"(display-mode: standalone)").matches&&M(!0),()=>{window.removeEventListener("beforeinstallprompt",ie),window.removeEventListener("appinstalled",He)}},[]);const is=ie=>{v(void 0),u(He=>He.includes(ie)?He.filter(Dt=>Dt!==ie):[...He,ie])},rs=async()=>{m(!0),v(void 0);try{await Uo(s),v("关注模型已保存。后续工具配置会优先参考这些模型。")}catch(ie){v(`保存失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{m(!1)}},Cn=async()=>{if(V(void 0),!ns){V(E==="fixed"?"请选择一个固定供应商。":"请至少选择一个供应商。");return}try{await ae.mutateAsync(ns),V("供应商路由策略已保存。"),i(4)}catch(ie){V(`保存失败:${ie instanceof Error?ie.message:String(ie)}`)}},lu=async()=>{try{await Re.mutateAsync()}catch{}},ss=async()=>{try{await ml.mutateAsync()}catch{}},au=async()=>{pe(void 0);const ie=P||hl[0];if(!ie){pe("请先选择一个默认模型。");return}if(ee.length===0){pe("请选择至少一个要安装的终端工具。");return}try{await ea.mutateAsync({providers:ee,proxyUrl:qa,model:ie,providerSelections:lv(ee,oe,hl,ie)}),pe("已生成安装预览。确认无误后可以写入配置。")}catch(He){pe(`预览失败:${He instanceof Error?He.message:String(He)}`)}},nu=async()=>{pe(void 0);const ie=P||hl[0];if(!ie){pe("请先选择一个默认模型。");return}if(ee.length===0){pe("请选择至少一个要安装的终端工具。");return}try{const He=await Nn.mutateAsync({providers:ee,proxyUrl:qa,model:ie,providerSelections:lv(ee,oe,hl,ie)});pe(`已写入 ${He.applied.length} 个配置文件。`),i(5)}catch(He){pe(`安装失败:${He instanceof Error?He.message:String(He)}`)}},Qa=()=>{X.refetch(),I.refetch(),W.refetch(),Ee.refetch(),ut.refetch(),wt.mutate()},yt=async()=>{ue(void 0),J(!0);try{await pS(),ue("初始化已标记完成。你可以把 TokenBuddy 安装成桌面应用,之后从系统应用入口打开。"),I.refetch()}catch(ie){ue(`完成失败:${ie instanceof Error?ie.message:String(ie)}`)}finally{J(!1)}},pl=async()=>{if(!re){Z("请在浏览器地址栏右侧或菜单里选择“安装应用”。");return}try{Z(void 0),await re.prompt();const ie=await re.userChoice;if(ye(null),ie.outcome==="accepted"){M(!0),Z("TokenBuddy 桌面应用已安装。");return}Z("你可以稍后继续使用浏览器安装入口。")}catch(ie){Z(`安装未完成:${ie instanceof Error?ie.message:String(ie)}`)}},gt=(()=>{var ie,He,Dt,na,Qi,En,An,Yi,Gi;return a<=1?r.jsx(TS,{commonModels:wn,allModels:ta,loading:ut.isLoading,error:ut.error,selectedModels:s,saving:d,saveMessage:h,onToggleModel:is,onSave:rs,onContinue:()=>i(2)}):a===2?r.jsx(HS,{payments:((ie=W.data)==null?void 0:ie.payments)??[],enabledPaymentCount:as.length,loading:W.isLoading,qrUrl:(He=Re.data)==null?void 0:He.qrImageUrl,rechargeQrUrl:(Dt=ml.data)==null?void 0:Dt.qrImageUrl,walletConfigPresent:(na=Re.data)==null?void 0:na.walletConfigPresent,error:Re.error,rechargeError:ml.error,binding:Re.isPending,rechargeLoading:ml.isPending,onBind:lu,onLoadRecharge:ss,onRefreshPayments:()=>{W.refetch()},onBack:()=>i(1),onContinue:()=>i(3)}):a===3?r.jsx(BS,{mode:E,scorer:A,sellers:eu,fixedSellerId:U,fixedSetSellerIds:G,saving:ae.isPending,message:H,onModeChange:C,onScorerChange:z,onFixedSellerChange:k,onToggleFixedSetSeller:it=>{K(qe=>qe.includes(it)?qe.filter(Pe=>Pe!==it):[...qe,it])},onSave:Cn,onBack:()=>i(2)}):a===4?r.jsx(QS,{clients:((Qi=Ee.data)==null?void 0:Qi.clients)??[],candidates:la,loading:Ee.isLoading,selectedProviders:ee,selectedModel:P||hl[0]||"",modelOptions:hl,providerSelections:oe,proxyUrl:qa,previewChanges:(En=ea.data)==null?void 0:En.changes,applying:Nn.isPending,previewing:ea.isPending,message:me,onToggleProvider:it=>{le(qe=>qe.includes(it)?qe.filter(Pe=>Pe!==it):[...qe,it])},onModelChange:$,onProviderSelectionChange:(it,qe)=>{F(Pe=>({...Pe,[it]:qe}))},onPreview:au,onInstall:nu,onBack:()=>i(3)}):a===5?r.jsx(GS,{items:tu,status:(An=wt.data)==null?void 0:An.status,generatedAt:(Yi=wt.data)==null?void 0:Yi.generatedAt,running:wt.isPending,error:wt.error,onRefresh:Qa,onBack:()=>i(4),onContinue:()=>i(6)}):r.jsx(KS,{complete:((Gi=I.data)==null?void 0:Gi.setup.status)==="completed",message:Te,installMessage:O,canInstall:!!re,installed:ge,saving:B,onBack:()=>i(5),onComplete:yt,onInstall:pl})})();return r.jsxs("div",{className:"min-w-0 space-y-3",children:[r.jsx(CS,{activeStep:a,onSelect:i}),r.jsx("div",{className:"min-w-0",children:gt})]})}function CS({activeStep:a,onSelect:i}){return r.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:r.jsx("div",{className:"flex items-stretch gap-2 overflow-x-auto",children:Fx.map(s=>{const u=a===s.index,d=a>s.index;return r.jsxs(j.Fragment,{children:[r.jsxs("button",{type:"button",onClick:()=>i(s.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:[r.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?r.jsx(Kt,{className:"size-3.5"}):r.jsx("span",{className:"size-1.5 rounded-full bg-current"})}),r.jsxs("span",{className:"min-w-0",children:[r.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 ",s.index,":"]}),r.jsx("span",{className:["mt-0.5 block text-[0.82rem] font-semibold",u?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:s.label}),r.jsx("span",{className:"block truncate text-[0.7rem] text-[var(--color-muted)]",children:s.value})]})]}),s.index<Fx.length?r.jsx("div",{className:"hidden min-w-8 items-center justify-center text-[var(--color-purple)]/70 sm:flex",children:r.jsx(Zo,{className:"size-5",strokeWidth:2.6})}):null]},s.index)})})})}function Hi({index:a,title:i,detail:s,meta:u,action:d}){return r.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:[r.jsx("div",{className:"min-w-0",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.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")}),r.jsx("div",{className:"text-[0.92rem] font-semibold text-[var(--color-ink)]",children:i}),s?r.jsx("span",{className:"text-[0.74rem] text-[var(--color-muted)]",children:s}):null,u?r.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?r.jsx("div",{className:"shrink-0",children:d}):null]})}function TS({commonModels:a,allModels:i,loading:s,error:u,selectedModels:d,saving:m,saveMessage:h,onToggleModel:v,onSave:p,onContinue:x}){const[g,y]=j.useState(!1),E=d.map(C=>i.find(A=>A.id===C)??{id:C,sellerCount:0,protocols:[],paymentMethods:[]});return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(vt,{className:"p-3",children:[r.jsx(Hi,{index:1,title:"模型访问",detail:"默认和高频模型",meta:`${d.length} selected`,action:r.jsxs("button",{type:"button",disabled:s||!!u,onClick:()=>y(!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:[r.jsx(Jd,{className:"size-3.5"}),"添加模型"]})}),u?r.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?r.jsxs("button",{type:"button",disabled:s||!!u,onClick:()=>y(!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:[r.jsx("span",{className:"grid size-8 shrink-0 place-items-center rounded-[8px] bg-white text-[var(--color-purple)]",children:r.jsx(Jd,{className:"size-4"})}),r.jsxs("span",{className:"min-w-0",children:[r.jsx("span",{className:"block text-[0.86rem] font-semibold text-[var(--color-ink)]",children:"添加可能使用到的模型"}),r.jsx("span",{className:"mt-0.5 block text-[0.76rem] text-[var(--color-muted)]",children:"至少选择一个模型后才能保存并继续。"})]})]}):r.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:E.map(C=>r.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:[r.jsx("span",{className:"truncate font-mono text-[0.82rem] font-semibold text-[var(--color-purple)]",children:C.id}),r.jsx("span",{className:"rounded-full bg-white/70 px-2 py-0.5 text-[0.68rem] font-semibold text-emerald-700",children:"可用"}),r.jsx("button",{type:"button",onClick:()=>v(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:r.jsx(Xr,{className:"size-3"})})]},C.id))}),r.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:[r.jsxs("div",{className:"min-h-5 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:[s?r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(xt,{className:"size-3.5 animate-spin text-[var(--color-purple)]"})," loading catalog"]}):null,!s&&!u&&d.length===0?r.jsx("span",{children:"请选择至少一个可能使用的模型。"}):null,h?r.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:h}):null]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.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?r.jsx(xt,{className:"size-3.5 animate-spin"}):null,"保存"]}),r.jsxs("button",{type:"button",disabled:d.length===0,onClick:x,className:"inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:["下一步",r.jsx(Zo,{className:"size-3.5"})]})]})]})]}),g?r.jsx(ES,{models:a,allModels:i,selectedModelIds:d,onToggle:v,onClose:()=>y(!1)}):null]})}function ES({models:a,allModels:i,selectedModelIds:s,onToggle:u,onClose:d}){const[m,h]=j.useState("common"),[v,p]=j.useState(""),x=v.trim(),g=m==="common"?a:x?OS(i,x):[],y=m==="common"?"没有可用的推荐模型。":"输入关键词搜索全部可用模型。",E=[{id:"common",label:"推荐模型",hint:"直接勾选"},{id:"all",label:"搜索添加",hint:"全部模型"}];return r.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:r.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:[r.jsxs("div",{className:"flex items-start gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Select models"}),r.jsx("h2",{className:"mt-0.5 text-[1rem] font-semibold text-[var(--color-ink)]",children:"选择可能使用到的模型"}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"推荐模型直接勾选;搜索添加用于查找平台全部模型。"})]}),r.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:[s.length," selected"]}),r.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:r.jsx(Xr,{className:"size-4"})})]}),r.jsxs("div",{className:"border-b border-[var(--color-line-2)] px-4 py-2.5",children:[r.jsx("div",{className:"mb-2 text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"已选模型"}),s.length===0?r.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:"还没有选择模型。"}):r.jsx("div",{className:"flex max-h-[92px] flex-wrap gap-1.5 overflow-y-auto pr-1",children:s.map(C=>r.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:[r.jsx("span",{className:"max-w-[220px] truncate font-mono text-[0.72rem] font-semibold text-[var(--color-purple)]",children:C}),r.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:r.jsx(Xr,{className:"size-3"})})]},C))})]}),r.jsxs("div",{className:"border-b border-[var(--color-line-2)] p-3",children:[r.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:E.map(C=>{const A=m===C.id;return r.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:[r.jsx("span",{className:["block text-[0.84rem] font-semibold",A?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:C.label}),r.jsx("span",{className:"mt-0.5 block text-[0.72rem] text-[var(--color-muted)]",children:C.hint})]},C.id)})}),m==="all"?r.jsxs("label",{className:"relative mt-3 block",children:[r.jsx($o,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),r.jsx("input",{value:v,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]}),r.jsx("div",{className:"min-h-0 max-h-[320px] overflow-y-auto p-3",children:g.length===0?r.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:y}):r.jsx("div",{className:"grid gap-2",children:g.map(C=>{const A=s.includes(C.id);return r.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:[r.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:r.jsx(Kt,{className:"size-3.5"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:C.id}),r.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.72rem] text-[var(--color-muted)]",children:[r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:yf(C.id)}),r.jsx("span",{className:"rounded-full bg-emerald-50 px-2 py-0.5 font-semibold text-emerald-700",children:"可用"}),Pd(C.paymentMethods)?r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:Pd(C.paymentMethods)}):null]})]}),r.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)})})}),r.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:[r.jsxs("div",{className:"text-[0.8rem] leading-5 text-[var(--color-muted)]",children:["已选择 ",r.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:s.length})," 个模型"]}),r.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:["完成选择",r.jsx(Kt,{className:"size-3.5"})]})]})]})})}function AS(a){const i=new Map;for(const s of a){const u=i.get(s.id)??{sellers:new Set,protocols:new Set,paymentMethods:new Set};u.sellers.add(s.sellerId);for(const d of s.supportedProtocols)u.protocols.add(d);for(const d of s.paymentMethods)u.paymentMethods.add(d);i.set(s.id,u)}return Array.from(i.entries()).map(([s,u])=>({id:s,sellerCount:u.sellers.size,protocols:Array.from(u.protocols).sort(),paymentMethods:Array.from(u.paymentMethods).sort()})).sort((s,u)=>u.sellerCount!==s.sellerCount?u.sellerCount-s.sellerCount:s.id.localeCompare(u.id))}function zS(a,i,s){const u=RS(a,s);if(u.length>0)return u.slice(0,14);const d=new Set(i),m=new Map;for(const p of i){const x=a.find(g=>g.id===p);x&&m.set(x.id,x)}const h=a.map(p=>({model:p,rank:DS(p.id)})).filter(p=>p.rank<100).sort((p,x)=>p.rank!==x.rank?p.rank-x.rank:x.model.sellerCount!==p.model.sellerCount?x.model.sellerCount-p.model.sellerCount:p.model.id.localeCompare(x.model.id)),v=new Map;for(const p of h){const x=yf(p.model.id),g=v.get(x)??[];g.push(p),v.set(x,g)}for(const p of NS){const x=p==="GPT"?3:p==="Claude"||p==="Gemini"?2:1;for(const g of(v.get(p)??[]).slice(0,x))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 RS(a,i){const s=new Map;for(const u of i){const d=_S(a,u,s);d&&s.set(d.id,d)}return Array.from(s.values())}function _S(a,i,s){const u=Ed(i);if(!u)return;const d=a.find(m=>Ed(m.id)===u&&!s.has(m.id));return d||a.find(m=>{if(s.has(m.id))return!1;const h=Ed(m.id);return h.includes(u)||u.includes(h)})}function Ed(a){return a.trim().toLowerCase().replace(/_/g,"-")}function OS(a,i){const s=i.trim().toLowerCase();return s?a.filter(u=>[u.id,yf(u.id),...u.paymentMethods].some(d=>d.toLowerCase().includes(s))):a}function DS(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 yf(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 Pd(a){return a.length===0?"":`${kS(a.map(US)).join("、")}`}function kS(a){return Array.from(new Set(a))}function US(a){const i=Io(a);return i.includes("x402")?"X402":i.includes("clawtip")?"ClawTip":i.includes("wallet")?"钱包":i.includes("mock")||i.includes("test")?"测试":"其它"}function Io(a){return a.trim().toLowerCase()}function BS({mode:a,scorer:i,sellers:s,fixedSellerId:u,fixedSetSellerIds:d,saving:m,message:h,onModeChange:v,onScorerChange:p,onFixedSellerChange:x,onToggleFixedSetSeller:g,onSave:y,onBack:E}){const C=a!=="fullAuto";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(vt,{className:"p-3",children:[r.jsx(Hi,{index:3,title:"配置策略",detail:"路由规则",meta:`${T0(a)} / ${nN(i)}`}),r.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-2",children:[r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[r.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"路由模式"}),r.jsx("div",{className:"grid gap-2",children:gS.map(A=>r.jsxs("button",{type:"button",onClick:()=>v(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:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.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:r.jsx(Kt,{className:"size-3"})}),r.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),r.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.value))})]}),r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[r.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"优化目标"}),r.jsx("div",{className:"grid gap-2",children:jS.map(A=>r.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:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.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:r.jsx(Kt,{className:"size-3"})}),r.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),r.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.value))})]})]}),C?r.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[r.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"选择供应商"}),r.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} 个`})]}),s.length===0?r.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:"正在等待供应商目录。你也可以先返回上一步确认模型目录是否已经加载完成。"}):r.jsx(LS,{mode:a,sellers:s,fixedSellerId:u,fixedSetSellerIds:d,onFixedSellerChange:x,onToggleFixedSetSeller:g})]}):r.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 会根据模型、供应商健康度、速度、价格和余额状态自动规划调用路径。"})]}),r.jsx(j0,{backLabel:"上一步:绑定钱包",nextLabel:"下一步:配置工具",saving:m,message:h,onBack:E,onNext:y})]})}function LS({mode:a,sellers:i,fixedSellerId:s,fixedSetSellerIds:u,onFixedSellerChange:d,onToggleFixedSetSeller:m}){const[h,v]=j.useState({key:"status",direction:"asc"}),p=j.useMemo(()=>S0(i,h),[i,h]),x=y=>{v(E=>({key:y,direction:E.key===y&&E.direction==="asc"?"desc":"asc"}))},g=y=>{if(a==="fixed"){d(y);return}m(y)};return r.jsx("div",{className:"mt-2 overflow-hidden rounded-[9px] border border-[var(--color-line-2)]",children:r.jsx("div",{className:"max-h-[300px] overflow-auto",children:r.jsxs("table",{className:"min-w-[760px] w-full border-collapse text-left text-[0.78rem]",children:[r.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:r.jsxs("tr",{children:[r.jsx("th",{className:"w-12 px-2 py-2 font-semibold",children:"选"}),r.jsx(vi,{label:"供应商",sortKey:"name",sort:h,onSort:x}),r.jsx(vi,{label:"状态",sortKey:"status",sort:h,onSort:x}),r.jsx(vi,{label:"模型",sortKey:"models",sort:h,onSort:x,align:"right"}),r.jsx(vi,{label:"价格",sortKey:"price",sort:h,onSort:x}),r.jsx(vi,{label:"折扣",sortKey:"discount",sort:h,onSort:x,align:"right"}),r.jsx(vi,{label:"响应",sortKey:"speed",sort:h,onSort:x,align:"right"}),r.jsx("th",{className:"px-3 py-2 font-semibold",children:"支付"})]})}),r.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:p.map(y=>{const E=a==="fixed"?s===y.id:u.includes(y.id);return r.jsxs("tr",{onClick:()=>g(y.id),className:["cursor-pointer transition hover:bg-[var(--color-lavender)]/45",E?"bg-[var(--color-lavender)]/70":"bg-white"].join(" "),children:[r.jsx("td",{className:"px-2 py-2.5",children:r.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:r.jsx(Kt,{className:"size-3"})})}),r.jsxs("td",{className:"max-w-[210px] px-3 py-2.5",children:[r.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:y.name}),r.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.68rem] text-[var(--color-muted)]",children:y.id})]}),r.jsx("td",{className:"px-3 py-2.5",children:r.jsx("span",{className:["inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-[0.7rem] font-semibold",rN(y.status)].join(" "),children:iN(y.status)})}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-ink)]",children:y.modelCount}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 font-mono text-[0.72rem] text-[var(--color-ink)]",children:ZS(y.minInputPriceMicrosPer1m,y.minOutputPriceMicrosPer1m)}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-purple)]",children:$S(y.discountRatio)}),r.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:JS(y.avgResponseMs,y.avgTtftMs)}),r.jsx("td",{className:"max-w-[150px] px-3 py-2.5",children:r.jsx("div",{className:"truncate text-[0.72rem] text-[var(--color-muted)]",children:Pd(y.paymentMethods)||"—"})})]},y.id)})})]})})})}function vi({label:a,sortKey:i,sort:s,align:u="left",onSort:d}){const m=s.key===i,h=m?s.direction==="asc"?"↑":"↓":"↕";return r.jsx("th",{className:["px-3 py-2 font-semibold",u==="right"?"text-right":"text-left"].join(" "),children:r.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:[r.jsx("span",{children:a}),r.jsx("span",{className:"font-mono text-[0.66rem]",children:h})]})})}function HS({payments:a,enabledPaymentCount:i,loading:s,qrUrl:u,rechargeQrUrl:d,walletConfigPresent:m,error:h,rechargeError:v,binding:p,rechargeLoading:x,onBind:g,onLoadRecharge:y,onRefreshPayments:E,onBack:C,onContinue:A}){const[z,U]=j.useState("clawtip"),[k,G]=j.useState(!1),[K,H]=j.useState(!1),V=a.find(ue=>Io(ue.method)==="clawtip"),P=!!(V!=null&&V.enabled||m||qS(V==null?void 0:V.config,"walletConfigPresent")),$=k&&P,ee=[{method:"clawtip",name:"ClawTip",detail:"JD App 扫码 / 微支付",status:P?"已绑定":"可绑定",available:!0},...SS.map(ue=>({...ue,status:"Coming soon",available:!1}))],le=ee.find(ue=>ue.method===z)??ee[0],oe=le.method==="clawtip",F=oe&&P&&!$,me=$||F||k,pe=()=>{G(!0),g()},Te=()=>{H(!0),y()};return j.useEffect(()=>{if(!oe||!k||P)return;const ue=window.setInterval(E,1500);return()=>window.clearInterval(ue)},[k,P,E,oe]),j.useEffect(()=>{!F||d||x||K||(H(!0),y())},[y,x,d,K,F]),r.jsxs("div",{className:"space-y-3",children:[r.jsxs(vt,{className:"p-3",children:[r.jsx(Hi,{index:2,title:"选择支付方式",detail:"钱包和充值通道",meta:s?"checking":`${i} active`,action:oe&&F?r.jsxs("button",{type:"button",disabled:x,onClick:Te,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[x?r.jsx(xt,{className:"size-3.5 animate-spin"}):r.jsx(Oi,{className:"size-3.5"}),"刷新充值码"]}):oe&&k&&!P?r.jsxs("button",{type:"button",disabled:p,onClick:pe,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?r.jsx(xt,{className:"size-3.5 animate-spin"}):r.jsx(cn,{className:"size-3.5"}),"重新生成"]}):oe?null:r.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"})}),r.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]",children:[r.jsx("div",{className:"grid content-start gap-2",children:ee.map(ue=>{const B=ue.method===le.method;return r.jsxs("button",{type:"button",onClick:()=>U(ue.method),"aria-pressed":B,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",B?"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:[r.jsx("span",{className:["grid size-9 shrink-0 place-items-center rounded-[9px] border",B?"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:Wx(ue.method)}),r.jsxs("span",{className:"min-w-0",children:[r.jsx("span",{className:"block truncate text-[0.86rem] font-semibold text-[var(--color-ink)]",children:ue.name}),r.jsx("span",{className:"mt-0.5 block truncate text-[0.73rem] text-[var(--color-muted)]",children:ue.detail})]}),r.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.68rem] font-semibold",ue.available?"bg-emerald-50 text-emerald-700":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:ue.status})]},ue.method)})}),oe?me?r.jsxs("div",{className:"grid gap-3 xl:grid-cols-[minmax(340px,380px)_minmax(0,1fr)]",children:[r.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:$?r.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:r.jsxs("div",{children:[r.jsx(Kt,{className:"mx-auto size-8 text-emerald-700"}),r.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-emerald-900",children:"绑定成功"}),r.jsx("div",{className:"mt-1 text-[0.78rem] leading-5 text-emerald-800",children:"ClawTip 钱包已经写入本机配置,可以继续配置路由策略。"})]})}):F?d?r.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)]"}):r.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:r.jsxs("div",{children:[x?r.jsx(xt,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):r.jsx(Oi,{className:"mx-auto size-6 text-[var(--color-purple)]"}),r.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:x?"正在加载充值码":"充值码未加载"}),r.jsx("button",{type:"button",disabled:x,onClick:Te,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:"重新加载"})]})}):k&&u?r.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)]"}):k?r.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:r.jsxs("div",{children:[p?r.jsx(xt,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):r.jsx(cn,{className:"mx-auto size-6 text-[var(--color-purple)]"}),r.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:p?"正在生成绑定码":"等待绑定码"}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"生成后使用京东 App 扫码绑定。"})]})}):r.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-4 py-5 text-center",children:r.jsxs("div",{className:"max-w-[260px]",children:[r.jsx(cn,{className:"mx-auto size-7 text-[var(--color-purple)]"}),r.jsx("div",{className:"mt-3 text-[0.9rem] font-semibold text-[var(--color-ink)]",children:"ClawTip 尚未绑定"}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"开始后沿用 tb init 的 ClawTip 绑定流程。"}),r.jsxs("button",{type:"button",disabled:p,onClick:pe,className:"mt-4 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:[p?r.jsx(xt,{className:"size-3.5 animate-spin"}):r.jsx(cn,{className:"size-3.5"}),"开始绑定"]})]})})}),r.jsxs("div",{className:"grid content-start gap-2",children:[r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"ClawTip 钱包"}),r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 text-[0.68rem] font-semibold text-[var(--color-muted)]",children:P?"已绑定":"待绑定"})]}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:$?"绑定已完成,可以继续下一步。":F?"使用京东 App 扫码充值或查看钱包余额。":k&&u?"使用京东 App 扫描二维码完成绑定。":"点击开始绑定后,按现有 tb init 绑定流程等待扫码。"})]}),r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2",children:[r.jsx("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:F?"Recharge QR":"Wallet config"}),r.jsx("div",{className:"mt-1 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:$?"绑定成功":F?d?"充值码已加载":"正在准备充值码":P?"本机配置已检测":"等待本机配置"})]})]})]}):r.jsxs("div",{className:"flex min-h-[120px] flex-col justify-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-4 py-4 sm:flex-row sm:items-center sm:justify-between",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-[0.86rem] font-semibold text-[var(--color-ink)]",children:"ClawTip 尚未绑定"}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"开始后沿用 tb init 的 ClawTip 绑定流程。"})]}),r.jsxs("button",{type:"button",disabled:p,onClick:pe,className:"mt-3 inline-flex h-9 shrink-0 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 sm:mt-0",children:[p?r.jsx(xt,{className:"size-3.5 animate-spin"}):r.jsx(cn,{className:"size-3.5"}),"开始绑定"]})]}):r.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:r.jsxs("div",{className:"max-w-[360px]",children:[r.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:Wx(le.method)}),r.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-[var(--color-ink)]",children:le.name}),r.jsxs("div",{className:"mt-1 text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[le.detail,"。当前版本先通过 ClawTip 完成钱包绑定,后续会在这里接入更多支付流程。"]}),r.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"})]})})]}),oe&&!P&&k&&h?r.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,oe&&F&&v?r.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["加载充值二维码失败:",v instanceof Error?v.message:String(v)]}):null]}),r.jsx(j0,{backLabel:"上一步:模型访问",nextLabel:"下一步:配置策略",message:i>0?"支付方式已可用,可以继续配置路由策略。":"如果你暂时跳过绑定,后续首次购买模型额度时仍需要完成支付配置。",onBack:C,onNext:A})]})}function Wx(a){const i=Io(a);return i==="wechat-pay"?r.jsx(V2,{className:"size-4"}):i==="alipay-agent"?r.jsx(O2,{className:"size-4"}):i==="coinbase-smart-wallet"?r.jsx(Oi,{className:"size-4"}):r.jsx(cn,{className:"size-4"})}function qS(a,i){const s=a==null?void 0:a[i];return s===!0||s==="true"||s===1||s==="1"}function QS({clients:a,candidates:i,loading:s,selectedProviders:u,selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:v,previewChanges:p,applying:x,previewing:g,message:y,onToggleProvider:E,onModelChange:C,onProviderSelectionChange:A,onPreview:z,onInstall:U,onBack:k}){var oe;const G=new Set(i.map(F=>F.id)),K=i.length,H=a.find(F=>F.id==="custom")??w0(v),V=[...a.filter(F=>F.id!=="custom"),{...H,name:"其他工具"}],P=((oe=V[0])==null?void 0:oe.id)??"custom",[$,ee]=j.useState(P),le=V.find(F=>F.id===$)??V[0]??H;return j.useEffect(()=>{var F;V.some(me=>me.id===$)||ee(((F=V[0])==null?void 0:F.id)??"custom")},[$,V]),r.jsxs("div",{className:"space-y-3",children:[r.jsxs(vt,{className:"p-3",children:[r.jsx(Hi,{index:4,title:"配置工具",detail:"终端接入",meta:`${u.length} selected / ${K} detected`,action:s?r.jsx(xt,{className:"size-4 animate-spin text-[var(--color-purple)]"}):null}),r.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,320px)_minmax(0,1fr)]",children:[r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"工具"}),r.jsxs("div",{className:"rounded-full bg-white px-2 py-0.5 text-[0.72rem] text-[var(--color-muted)]",children:[a.length," tools"]})]}),r.jsx("div",{className:"mt-2 grid max-h-[380px] gap-2 overflow-y-auto pr-1",children:V.map(F=>{const me=F.id!=="custom"&&G.has(F.id),pe=u.includes(F.id),Te=le.id===F.id;return r.jsx("button",{type:"button",onClick:()=>ee(F.id),className:["rounded-[10px] border p-2.5 text-left transition",Te?"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:r.jsxs("div",{className:"flex items-start gap-2.5",children:[r.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-[8px] border text-[0.72rem] font-semibold",Te?"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:FS(F.name)}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsx("div",{className:"truncate text-[0.84rem] font-semibold text-[var(--color-ink)]",children:F.name}),pe?r.jsx("span",{className:"rounded-full bg-emerald-50 px-1.5 py-0.5 text-[0.66rem] font-semibold text-emerald-700",children:"安装"}):null]}),r.jsxs("div",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.68rem] text-[var(--color-muted)]",children:[r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:E0(F)}),F.commandName?r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:F.commandName}):null,F.id==="custom"?r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:"复制配置"}):null]})]}),F.id!=="custom"?r.jsx("span",{"aria-hidden":"true",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)] text-transparent",me?"":"opacity-45"].join(" "),children:r.jsx(Kt,{className:"size-3"})}):null]})},F.id)})})]}),r.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:r.jsx(YS,{client:le,selected:u.includes(le.id),installable:le.id!=="custom"&&G.has(le.id),selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:v,onToggleInstall:()=>E(le.id),onModelChange:C,onProviderSelectionChange:A})})]}),p?r.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[r.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"配置文件变更"}),p.length===0?r.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:"没有需要写入的配置变更。"}):r.jsx("div",{className:"mt-2 grid max-h-[180px] gap-2 overflow-y-auto pr-1",children:p.map(F=>r.jsxs("div",{className:"rounded-[9px] border border-[var(--color-line-2)] bg-white p-2.5",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:[r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:sN(F.action)}),r.jsx("span",{children:F.providerId})]}),r.jsx("div",{className:"mt-1 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:F.path}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:F.summary})]},`${F.providerId}:${F.path}:${F.summary}`))})]}):null]}),r.jsxs(vt,{className:"flex flex-col gap-3 p-3 lg:flex-row lg:items-center lg:justify-between",children:[r.jsx("div",{className:"text-[0.84rem] leading-6 text-[var(--color-muted)]",children:y?r.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:y}):null}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",onClick:k,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:"上一步:配置策略"}),r.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?r.jsx(xt,{className:"size-4 animate-spin"}):null,"预览安装"]}),r.jsxs("button",{type:"button",disabled:x||u.length===0,onClick:U,className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[x?r.jsx(xt,{className:"size-4 animate-spin"}):null,"写入配置"]})]})]})]})}function YS({client:a,selected:i,installable:s,selectedModel:u,modelOptions:d,providerSelections:m,proxyUrl:h,onToggleInstall:v,onModelChange:p,onProviderSelectionChange:x}){var E,C,A;if(a.id==="custom"){const z=a.manualConfig??w0(h).manualConfig;return r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ad,{client:a,selected:!1,installable:!1}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Hr,{label:"OpenAI base URL",value:(z==null?void 0:z.openaiBaseUrl)??C0(h)}),r.jsx(Hr,{label:"Anthropic base URL",value:(z==null?void 0:z.anthropicBaseUrl)??h}),r.jsx(Hr,{label:"API key",value:(z==null?void 0:z.apiKey)??"TOKENBUDDY_PROXY"})]}),r.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=M0(m[a.id],d,u),U=(G,K)=>{x(a.id,{...z,fallbackModel:z.fallbackModel||K||u,roles:{...z.roles,[G]:K?{upstreamModel:K,displayName:K}:void 0}})},k=G=>{x(a.id,{...z,fallbackModel:G}),p(G)};return r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ad,{client:a,selected:i,installable:s,onToggleInstall:v}),r.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[r.jsx(Lr,{label:"Fallback",value:z.fallbackModel??u,modelOptions:d,onChange:k}),r.jsx(Lr,{label:"Haiku",value:((E=z.roles.haiku)==null?void 0:E.upstreamModel)??"",modelOptions:d,onChange:G=>U("haiku",G)}),r.jsx(Lr,{label:"Sonnet",value:((C=z.roles.sonnet)==null?void 0:C.upstreamModel)??"",modelOptions:d,onChange:G=>U("sonnet",G)}),r.jsx(Lr,{label:"Opus",value:((A=z.roles.opus)==null?void 0:A.upstreamModel)??"",modelOptions:d,onChange:G=>U("opus",G)})]}),r.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=N0(a.id,m[a.id],u),y=z=>{p(z),x(a.id,{selectionKind:"single-model",protocolPreference:Id(a.id),defaultModel:z})};return r.jsxs("div",{className:"space-y-3",children:[r.jsx(Ad,{client:a,selected:i,installable:s,onToggleInstall:v}),r.jsx(Lr,{label:"模型",value:g.defaultModel,modelOptions:d,onChange:y}),r.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[r.jsx(Hr,{label:"Proxy URL",value:h,compact:!0}),r.jsx(Hr,{label:"API key",value:"TOKENBUDDY_PROXY",compact:!0})]}),a.configPath?r.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 Ad({client:a,selected:i,installable:s,onToggleInstall:u}){return r.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:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("div",{className:"text-[0.9rem] font-semibold text-[var(--color-ink)]",children:a.name}),r.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 text-[0.7rem] text-[var(--color-muted)]",children:E0(a)})]}),r.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:a.reason})]}),a.id!=="custom"?r.jsxs("button",{type:"button",disabled:!s,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?"bg-[var(--color-purple)] text-white hover:bg-[var(--color-purple-2)]":"border border-[var(--color-line-2)] bg-white text-[var(--color-ink)] hover:border-[var(--color-purple)]"].join(" "),children:[r.jsx(Kt,{className:"size-3.5"}),i?"已加入安装":"加入安装"]}):null]})}function Lr({label:a,value:i,modelOptions:s,onChange:u}){return r.jsxs("label",{className:"block",children:[r.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-muted)]",children:a}),r.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:[r.jsx("option",{value:"",children:"请选择模型"}),s.map(d=>r.jsx("option",{value:d,children:d},d))]})]})}function Hr({label:a,value:i,compact:s=!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 r.jsxs("div",{className:["rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2",s?"min-w-0":""].join(" "),children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("div",{className:"text-[0.72rem] font-semibold text-[var(--color-muted)]",children:a}),r.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:[r.jsx(T2,{className:"size-3"}),u?"已复制":"复制"]})]}),r.jsx("div",{className:"mt-1 truncate font-mono text-[0.76rem] text-[var(--color-ink)]",children:i})]})}function GS({items:a,status:i,generatedAt:s,running:u,error:d,onRefresh:m,onBack:h,onContinue:v}){return r.jsx("div",{className:"space-y-3",children:r.jsxs(vt,{className:"p-3",children:[r.jsx(Hi,{index:5,title:"验证网关",detail:"本机状态",meta:u?"checking":av(i),action:r.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?r.jsx(xt,{className:"size-3.5 animate-spin"}):r.jsx($d,{className:"size-3.5"}),"刷新"]})}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[0.76rem] text-[var(--color-muted)]",children:[r.jsx("span",{className:["rounded-full px-2 py-0.5 font-semibold",eN(i)].join(" "),children:u?"正在检查":av(i)}),s?r.jsxs("span",{children:["检查时间:",new Date(s).toLocaleString()]}):r.jsx("span",{children:"等待后端检查。"})]}),d?r.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,r.jsx("div",{className:"mt-3 grid gap-2 xl:grid-cols-2",children:a.map(p=>r.jsxs("div",{className:"flex gap-2.5 rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[r.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-full",lN(p.status)].join(" "),children:p.ok?r.jsx(Kt,{className:"size-3.5"}):r.jsx($d,{className:"size-3.5"})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[0.82rem] font-semibold text-[var(--color-ink)]",children:[p.title,r.jsx("span",{className:["rounded-full px-1.5 py-0.5 text-[0.68rem]",aN(p.status)].join(" "),children:tN(p.status)})]}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:p.body})]})]},p.title))}),r.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:[r.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:"发现异常时返回对应步骤补齐配置。"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.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:"上一步"}),r.jsxs("button",{type:"button",onClick:v,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:["下一步",r.jsx(Zo,{className:"size-3.5"})]})]})]})]})})}function KS({complete:a,message:i,installMessage:s,canInstall:u,installed:d,saving:m,onBack:h,onComplete:v,onInstall:p}){return r.jsx("div",{className:"space-y-3",children:r.jsxs(vt,{className:"p-3",children:[r.jsx(Hi,{index:6,title:a?"初始化完成":"桌面应用",detail:d?"已安装":"可选安装",meta:a?"complete":d?"installed":"optional",action:r.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:[r.jsx(Kt,{className:"size-3.5"}),d?"已安装":"安装应用"]})}),r.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,290px)_minmax(0,1fr)]",children:[r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-3",children:[r.jsx("div",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:d?"TokenBuddy 桌面应用已安装":u?"浏览器支持直接安装":"可从浏览器菜单安装"}),r.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:d?"你可以从系统应用入口打开 TokenBuddy。":u?"点击右上角安装按钮并确认浏览器弹窗。":"在地址栏右侧或浏览器菜单中找到安装应用入口。"}),s?r.jsx("div",{className:"mt-2 text-[0.78rem] font-medium text-[var(--color-ink)]",children:s}):null]}),r.jsx("div",{className:"grid gap-2 lg:grid-cols-3",children:[{title:"安装入口",body:"地址栏或浏览器菜单。"},{title:"应用名称",body:"TokenBuddy。"},{title:"本地服务",body:"继续由 tb-proxyd 提供。"}].map((x,g)=>r.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.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}),r.jsx("span",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:x.title})]}),r.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:x.body})]},x.title))})]}),r.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:[r.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:i?r.jsx("span",{className:"font-medium text-[var(--color-ink)]",children:i}):"完成后可以进入控制台。"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.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:"上一步"}),r.jsxs("button",{type:"button",disabled:m||a,onClick:v,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?r.jsx(xt,{className:"size-3.5 animate-spin"}):r.jsx(Kt,{className:"size-3.5"}),a?"已完成":"完成初始化"]}),r.jsx(es,{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 j0({backLabel:a,nextLabel:i,saving:s=!1,message:u,onBack:d,onNext:m}){return r.jsxs(vt,{className:"flex flex-col gap-2.5 p-3 sm:flex-row sm:items-center sm:justify-between",children:[r.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:u??"配置完成后继续下一步。"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.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}),r.jsxs("button",{type:"button",disabled:s,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:[s?r.jsx(xt,{className:"size-3.5 animate-spin"}):null,i,s?null:r.jsx(Zo,{className:"size-3.5"})]})]})]})}function XS(a,i,s){const u=new Map;for(const h of i){const v=u.get(h.sellerId)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,responseMsSamples:[],ttftMsSamples:[]};v.modelIds.add(h.id);for(const p of h.supportedProtocols)v.protocols.add(p);for(const p of h.paymentMethods)v.paymentMethods.add(p);v.minInputPriceMicrosPer1m=Ix(v.minInputPriceMicrosPer1m,h.inputPriceMicrosPer1m),v.minOutputPriceMicrosPer1m=Ix(v.minOutputPriceMicrosPer1m,h.outputPriceMicrosPer1m),u.set(h.sellerId,v)}for(const h of s){const v=h.sellerKey;if(!v)continue;const p=u.get(v)??{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(v,p)}const d=a.map(h=>{const v=u.get(h.id);return{id:h.id,name:ev(h.name??h.manifestSellerId??h.id),status:h.status,modelCount:h.modelCount??(v==null?void 0:v.modelIds.size)??0,protocols:h.supportedProtocols??Array.from((v==null?void 0:v.protocols)??[]),paymentMethods:h.paymentMethods??Array.from((v==null?void 0:v.paymentMethods)??[]),discountRatio:h.discountRatio,serviceFeeRatio:h.serviceFeeRatio,minInputPriceMicrosPer1m:v==null?void 0:v.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:v==null?void 0:v.minOutputPriceMicrosPer1m,avgResponseMs:_o((v==null?void 0:v.responseMsSamples)??[]),avgTtftMs:_o((v==null?void 0:v.ttftMsSamples)??[])}}),m=new Set(d.map(h=>h.id));for(const[h,v]of u.entries()){if(m.has(h))continue;const p=i.find(x=>x.sellerId===h);d.push({id:h,name:ev((p==null?void 0:p.sellerName)??h),status:"unknown",modelCount:v.modelIds.size,protocols:Array.from(v.protocols).sort(),paymentMethods:Array.from(v.paymentMethods).sort(),minInputPriceMicrosPer1m:v.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:v.minOutputPriceMicrosPer1m,avgResponseMs:_o(v.responseMsSamples),avgTtftMs:_o(v.ttftMsSamples)})}return S0(d,{key:"status",direction:"asc"})}function S0(a,i){const s=i.direction==="asc"?1:-1;return[...a].sort((u,d)=>{const m=VS(u,d,i.key);if(m!==0)return m*s;const h=Ko(u.status)-Ko(d.status);return h!==0?h:d.modelCount!==u.modelCount?d.modelCount-u.modelCount:u.name.localeCompare(d.name)})}function VS(a,i,s){return s==="status"?Ko(a.status)-Ko(i.status):s==="name"?a.name.localeCompare(i.name):s==="models"?a.modelCount-i.modelCount:s==="price"?zd(Px(a),Px(i)):s==="discount"?zd(a.discountRatio,i.discountRatio):zd(a.avgResponseMs??a.avgTtftMs,i.avgResponseMs??i.avgTtftMs)}function Px(a){if(!(!Number.isFinite(a.minInputPriceMicrosPer1m)&&!Number.isFinite(a.minOutputPriceMicrosPer1m)))return(a.minInputPriceMicrosPer1m??0)+(a.minOutputPriceMicrosPer1m??0)}function Ix(a,i){const s=Number.isFinite(a),u=Number.isFinite(i);if(s&&u)return Math.min(a,i);if(s)return a;if(u)return i}function _o(a){const i=a.filter(s=>Number.isFinite(s));if(i.length!==0)return i.reduce((s,u)=>s+u,0)/i.length}function zd(a,i){const s=Number.isFinite(a),u=Number.isFinite(i);return s&&u?a-i:s?-1:u?1:0}function ev(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function ZS(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?"-":`I ${tv(a)} / O ${tv(i)}`}function tv(a){if(!Number.isFinite(a))return"-";const i=a/1e6;return`$${i>=1?i.toFixed(2):i.toFixed(4)}`}function $S(a){if(!Number.isFinite(a))return"-";const i=a;if(i<=0)return"free";const s=Math.max(0,1-i);return s>=.01?`${Math.round(s*100)}% off`:`x${i.toFixed(2)}`}function JS(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 lv(a,i,s,u){const d=u||s[0]||"",m={};for(const h of a)h!=="custom"&&(m[h]=h==="claude-code"?M0(i[h],s,d):N0(h,i[h],d));return m}function N0(a,i,s){return(i==null?void 0:i.selectionKind)==="single-model"?{...i,protocolPreference:i.protocolPreference??Id(a),defaultModel:i.defaultModel||s}:{selectionKind:"single-model",protocolPreference:Id(a),defaultModel:s}}function M0(a,i,s){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=s||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 Id(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 w0(a){return{id:"custom",name:"其他工具",status:"manual",detected:!0,configured:!1,reason:"复制本地推理服务接口到任意 OpenAI 或 Anthropic 兼容客户端。",manualConfig:{openaiBaseUrl:C0(a),anthropicBaseUrl:a,apiKey:"TOKENBUDDY_PROXY"}}}function C0(a){const i=a.replace(/\/+$/,"");return i.endsWith("/v1")?i:`${i}/v1`}function FS(a){const i=a.trim();return i?i.slice(0,1).toUpperCase():"?"}function WS(a,i,s,u){if(a==="fixed"){const d=s.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 PS({serviceReady:a,modelCount:i,routingMode:s,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:`当前策略为${T0(s)},TokenBuddy 会按这个策略规划供应商。`,ok:!!s,status:s?"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 IS(a){return{title:a.label,body:a.message,ok:a.status==="passed"||a.status==="skipped",status:a.status,details:a.details}}function av(a){return a==="passed"?"全部通过":a==="warning"?"存在警告":a==="failed"?"需要修复":"等待检查"}function eN(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 tN(a){return a==="passed"?"通过":a==="warning"?"警告":a==="failed"?"失败":"已跳过"}function lN(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 aN(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 T0(a){return a==="fixed"?"固定供应商":a==="fixedSet"?"固定供应商组":"全自动"}function nN(a){return a==="speed"?"速度优先":a==="discount"?"成本优先":"平衡模式"}function iN(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?"状态正常":["error","failed","unavailable"].includes(i)?"状态异常":["unknown","pending"].includes(i)?"等待检测":`状态:${a}`}function rN(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 Ko(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?0:["unknown","pending"].includes(i)?1:2}function E0(a){return a.configured?"已配置":a.status==="installed"?"已安装":a.status==="manual"?"需要手动配置":a.detected?"已检测到":"未检测到"}function sN(a){return a==="create"?"创建":"更新"}function oN(){return r.jsxs("div",{className:"min-h-full",children:[r.jsxs("nav",{className:"sticky top-0 z-10 flex h-12 items-center gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)] px-3 sm:gap-5 sm:px-6",children:[r.jsx(df,{to:"/overview",className:"group inline-flex shrink-0 items-baseline rounded-[7px] px-1 py-1.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-purple)]","aria-label":"TOKENBUDDY.AI home",children:r.jsxs("span",{className:"relative whitespace-nowrap font-mono text-[0.78rem] font-black uppercase leading-none tracking-[0.14em] text-[var(--color-ink)] after:absolute after:-bottom-1 after:left-0 after:h-0.5 after:w-full after:origin-left after:scale-x-75 after:rounded-full after:bg-[var(--color-purple)] after:opacity-0 after:transition group-hover:after:scale-x-100 group-hover:after:opacity-100 sm:text-[0.86rem]",children:["TOKENBUDDY",r.jsxs("span",{className:"tracking-[0.06em] text-[var(--color-purple)]",children:[r.jsx("span",{className:"text-[var(--color-purple-2)]",children:"."}),"AI"]})]})}),r.jsxs("div",{className:"ml-auto flex min-w-0 gap-0.5 sm:gap-1",children:[r.jsx(Rd,{to:"/overview",children:"Overview"}),r.jsx(Rd,{to:"/routing",children:"Routing"}),r.jsx(Rd,{to:"/ledger",children:"Ledger"})]})]}),r.jsx("main",{className:"mx-auto max-w-[1180px] px-3 py-5 sm:px-6 sm:py-7",children:r.jsxs(Fg,{children:[r.jsx(bi,{path:"/",element:r.jsx(Yx,{})}),r.jsx(bi,{path:"/overview",element:r.jsx(Yx,{})}),r.jsx(bi,{path:"/init",element:r.jsx(wS,{})}),r.jsx(bi,{path:"/routing",element:r.jsx(Rj,{})}),r.jsx(bi,{path:"/ledger",element:r.jsx(lS,{})})]})})]})}function Rd({to:a,children:i}){return r.jsx(df,{to:a,className:({isActive:s})=>["rounded-full px-2 py-1.5 text-[0.82rem] font-medium transition-colors sm:px-3.5 sm:text-[0.92rem]",s?"font-semibold text-[var(--color-ink)] underline decoration-[var(--color-purple)] decoration-2 underline-offset-[10px]":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:i})}function uN(){!("serviceWorker"in navigator)||window.location.port==="5173"||window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}const cN=new e2({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1}}});Wy.createRoot(document.getElementById("root")).render(r.jsx(j.StrictMode,{children:r.jsx(t2,{client:cN,children:r.jsx(g1,{children:r.jsx(oN,{})})})}));uN();
|
|
216
|
+
//# sourceMappingURL=index-BBuXE99D.js.map
|