academic-refchecker 2.0.14__py3-none-any.whl → 2.0.16__py3-none-any.whl
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.
- {academic_refchecker-2.0.14.dist-info → academic_refchecker-2.0.16.dist-info}/METADATA +1 -1
- {academic_refchecker-2.0.14.dist-info → academic_refchecker-2.0.16.dist-info}/RECORD +14 -11
- backend/refchecker_wrapper.py +4 -3
- backend/static/assets/index-B92lKsA8.js +25 -0
- backend/static/assets/index-BuguAhjS.css +1 -0
- backend/static/assets/index-DMZJNrR0.js +25 -0
- backend/static/index.html +2 -2
- refchecker/__version__.py +1 -1
- refchecker/checkers/arxiv_citation.py +125 -35
- refchecker/checkers/semantic_scholar.py +263 -0
- {academic_refchecker-2.0.14.dist-info → academic_refchecker-2.0.16.dist-info}/WHEEL +0 -0
- {academic_refchecker-2.0.14.dist-info → academic_refchecker-2.0.16.dist-info}/entry_points.txt +0 -0
- {academic_refchecker-2.0.14.dist-info → academic_refchecker-2.0.16.dist-info}/licenses/LICENSE +0 -0
- {academic_refchecker-2.0.14.dist-info → academic_refchecker-2.0.16.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function i(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(f){if(f.ep)return;f.ep=!0;const h=i(f);fetch(f.href,h)}})();function ag(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var tc={exports:{}},Wa={};var wh;function rg(){if(wh)return Wa;wh=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function i(o,f,h){var m=null;if(h!==void 0&&(m=""+h),f.key!==void 0&&(m=""+f.key),"key"in f){h={};for(var y in f)y!=="key"&&(h[y]=f[y])}else h=f;return f=h.ref,{$$typeof:r,type:o,key:m,ref:f!==void 0?f:null,props:h}}return Wa.Fragment=c,Wa.jsx=i,Wa.jsxs=i,Wa}var kh;function sg(){return kh||(kh=1,tc.exports=rg()),tc.exports}var u=sg(),lc={exports:{}},ce={};var Nh;function ig(){if(Nh)return ce;Nh=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),z=Symbol.iterator;function Z(_){return _===null||typeof _!="object"?null:(_=z&&_[z]||_["@@iterator"],typeof _=="function"?_:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,N={};function H(_,q,W){this.props=_,this.context=q,this.refs=N,this.updater=W||C}H.prototype.isReactComponent={},H.prototype.setState=function(_,q){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,q,"setState")},H.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function F(){}F.prototype=H.prototype;function V(_,q,W){this.props=_,this.context=q,this.refs=N,this.updater=W||C}var J=V.prototype=new F;J.constructor=V,T(J,H.prototype),J.isPureReactComponent=!0;var B=Array.isArray;function k(){}var X={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function ne(_,q,W){var P=W.ref;return{$$typeof:r,type:_,key:q,ref:P!==void 0?P:null,props:W}}function re(_,q){return ne(_.type,q,_.props)}function ie(_){return typeof _=="object"&&_!==null&&_.$$typeof===r}function oe(_){var q={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(W){return q[W]})}var Ne=/\/+/g;function we(_,q){return typeof _=="object"&&_!==null&&_.key!=null?oe(""+_.key):q.toString(36)}function pe(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(k,k):(_.status="pending",_.then(function(q){_.status==="pending"&&(_.status="fulfilled",_.value=q)},function(q){_.status==="pending"&&(_.status="rejected",_.reason=q)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function A(_,q,W,P,le){var ue=typeof _;(ue==="undefined"||ue==="boolean")&&(_=null);var Ce=!1;if(_===null)Ce=!0;else switch(ue){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(_.$$typeof){case r:case c:Ce=!0;break;case S:return Ce=_._init,A(Ce(_._payload),q,W,P,le)}}if(Ce)return le=le(_),Ce=P===""?"."+we(_,0):P,B(le)?(W="",Ce!=null&&(W=Ce.replace(Ne,"$&/")+"/"),A(le,q,W,"",function(Wt){return Wt})):le!=null&&(ie(le)&&(le=re(le,W+(le.key==null||_&&_.key===le.key?"":(""+le.key).replace(Ne,"$&/")+"/")+Ce)),q.push(le)),1;Ce=0;var et=P===""?".":P+":";if(B(_))for(var Le=0;Le<_.length;Le++)P=_[Le],ue=et+we(P,Le),Ce+=A(P,q,W,ue,le);else if(Le=Z(_),typeof Le=="function")for(_=Le.call(_),Le=0;!(P=_.next()).done;)P=P.value,ue=et+we(P,Le++),Ce+=A(P,q,W,ue,le);else if(ue==="object"){if(typeof _.then=="function")return A(pe(_),q,W,P,le);throw q=String(_),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function E(_,q,W){if(_==null)return _;var P=[],le=0;return A(_,P,"","",function(ue){return q.call(W,ue,le++)}),P}function I(_){if(_._status===-1){var q=_._result;q=q(),q.then(function(W){(_._status===0||_._status===-1)&&(_._status=1,_._result=W)},function(W){(_._status===0||_._status===-1)&&(_._status=2,_._result=W)}),_._status===-1&&(_._status=0,_._result=q)}if(_._status===1)return _._result.default;throw _._result}var ge=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},ye={map:E,forEach:function(_,q,W){E(_,function(){q.apply(this,arguments)},W)},count:function(_){var q=0;return E(_,function(){q++}),q},toArray:function(_){return E(_,function(q){return q})||[]},only:function(_){if(!ie(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return ce.Activity=x,ce.Children=ye,ce.Component=H,ce.Fragment=i,ce.Profiler=f,ce.PureComponent=V,ce.StrictMode=o,ce.Suspense=v,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,ce.__COMPILER_RUNTIME={__proto__:null,c:function(_){return X.H.useMemoCache(_)}},ce.cache=function(_){return function(){return _.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(_,q,W){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var P=T({},_.props),le=_.key;if(q!=null)for(ue in q.key!==void 0&&(le=""+q.key),q)!Q.call(q,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&q.ref===void 0||(P[ue]=q[ue]);var ue=arguments.length-2;if(ue===1)P.children=W;else if(1<ue){for(var Ce=Array(ue),et=0;et<ue;et++)Ce[et]=arguments[et+2];P.children=Ce}return ne(_.type,le,P)},ce.createContext=function(_){return _={$$typeof:m,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:h,_context:_},_},ce.createElement=function(_,q,W){var P,le={},ue=null;if(q!=null)for(P in q.key!==void 0&&(ue=""+q.key),q)Q.call(q,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(le[P]=q[P]);var Ce=arguments.length-2;if(Ce===1)le.children=W;else if(1<Ce){for(var et=Array(Ce),Le=0;Le<Ce;Le++)et[Le]=arguments[Le+2];le.children=et}if(_&&_.defaultProps)for(P in Ce=_.defaultProps,Ce)le[P]===void 0&&(le[P]=Ce[P]);return ne(_,ue,le)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(_){return{$$typeof:y,render:_}},ce.isValidElement=ie,ce.lazy=function(_){return{$$typeof:S,_payload:{_status:-1,_result:_},_init:I}},ce.memo=function(_,q){return{$$typeof:g,type:_,compare:q===void 0?null:q}},ce.startTransition=function(_){var q=X.T,W={};X.T=W;try{var P=_(),le=X.S;le!==null&&le(W,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(k,ge)}catch(ue){ge(ue)}finally{q!==null&&W.types!==null&&(q.types=W.types),X.T=q}},ce.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},ce.use=function(_){return X.H.use(_)},ce.useActionState=function(_,q,W){return X.H.useActionState(_,q,W)},ce.useCallback=function(_,q){return X.H.useCallback(_,q)},ce.useContext=function(_){return X.H.useContext(_)},ce.useDebugValue=function(){},ce.useDeferredValue=function(_,q){return X.H.useDeferredValue(_,q)},ce.useEffect=function(_,q){return X.H.useEffect(_,q)},ce.useEffectEvent=function(_){return X.H.useEffectEvent(_)},ce.useId=function(){return X.H.useId()},ce.useImperativeHandle=function(_,q,W){return X.H.useImperativeHandle(_,q,W)},ce.useInsertionEffect=function(_,q){return X.H.useInsertionEffect(_,q)},ce.useLayoutEffect=function(_,q){return X.H.useLayoutEffect(_,q)},ce.useMemo=function(_,q){return X.H.useMemo(_,q)},ce.useOptimistic=function(_,q){return X.H.useOptimistic(_,q)},ce.useReducer=function(_,q,W){return X.H.useReducer(_,q,W)},ce.useRef=function(_){return X.H.useRef(_)},ce.useState=function(_){return X.H.useState(_)},ce.useSyncExternalStore=function(_,q,W){return X.H.useSyncExternalStore(_,q,W)},ce.useTransition=function(){return X.H.useTransition()},ce.version="19.2.3",ce}var Th;function bc(){return Th||(Th=1,lc.exports=ig()),lc.exports}var K=bc();const Cs=ag(K);var nc={exports:{}},Fa={},ac={exports:{}},rc={};var Ah;function og(){return Ah||(Ah=1,(function(r){function c(A,E){var I=A.length;A.push(E);e:for(;0<I;){var ge=I-1>>>1,ye=A[ge];if(0<f(ye,E))A[ge]=E,A[I]=ye,I=ge;else break e}}function i(A){return A.length===0?null:A[0]}function o(A){if(A.length===0)return null;var E=A[0],I=A.pop();if(I!==E){A[0]=I;e:for(var ge=0,ye=A.length,_=ye>>>1;ge<_;){var q=2*(ge+1)-1,W=A[q],P=q+1,le=A[P];if(0>f(W,I))P<ye&&0>f(le,W)?(A[ge]=le,A[P]=I,ge=P):(A[ge]=W,A[q]=I,ge=q);else if(P<ye&&0>f(le,I))A[ge]=le,A[P]=I,ge=P;else break e}}return E}function f(A,E){var I=A.sortIndex-E.sortIndex;return I!==0?I:A.id-E.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;r.unstable_now=function(){return h.now()}}else{var m=Date,y=m.now();r.unstable_now=function(){return m.now()-y}}var v=[],g=[],S=1,x=null,z=3,Z=!1,C=!1,T=!1,N=!1,H=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function J(A){for(var E=i(g);E!==null;){if(E.callback===null)o(g);else if(E.startTime<=A)o(g),E.sortIndex=E.expirationTime,c(v,E);else break;E=i(g)}}function B(A){if(T=!1,J(A),!C)if(i(v)!==null)C=!0,k||(k=!0,oe());else{var E=i(g);E!==null&&pe(B,E.startTime-A)}}var k=!1,X=-1,Q=5,ne=-1;function re(){return N?!0:!(r.unstable_now()-ne<Q)}function ie(){if(N=!1,k){var A=r.unstable_now();ne=A;var E=!0;try{e:{C=!1,T&&(T=!1,F(X),X=-1),Z=!0;var I=z;try{t:{for(J(A),x=i(v);x!==null&&!(x.expirationTime>A&&re());){var ge=x.callback;if(typeof ge=="function"){x.callback=null,z=x.priorityLevel;var ye=ge(x.expirationTime<=A);if(A=r.unstable_now(),typeof ye=="function"){x.callback=ye,J(A),E=!0;break t}x===i(v)&&o(v),J(A)}else o(v);x=i(v)}if(x!==null)E=!0;else{var _=i(g);_!==null&&pe(B,_.startTime-A),E=!1}}break e}finally{x=null,z=I,Z=!1}E=void 0}}finally{E?oe():k=!1}}}var oe;if(typeof V=="function")oe=function(){V(ie)};else if(typeof MessageChannel<"u"){var Ne=new MessageChannel,we=Ne.port2;Ne.port1.onmessage=ie,oe=function(){we.postMessage(null)}}else oe=function(){H(ie,0)};function pe(A,E){X=H(function(){A(r.unstable_now())},E)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(A){A.callback=null},r.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<A?Math.floor(1e3/A):5},r.unstable_getCurrentPriorityLevel=function(){return z},r.unstable_next=function(A){switch(z){case 1:case 2:case 3:var E=3;break;default:E=z}var I=z;z=E;try{return A()}finally{z=I}},r.unstable_requestPaint=function(){N=!0},r.unstable_runWithPriority=function(A,E){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var I=z;z=A;try{return E()}finally{z=I}},r.unstable_scheduleCallback=function(A,E,I){var ge=r.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?ge+I:ge):I=ge,A){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=I+ye,A={id:S++,callback:E,priorityLevel:A,startTime:I,expirationTime:ye,sortIndex:-1},I>ge?(A.sortIndex=I,c(g,A),i(v)===null&&A===i(g)&&(T?(F(X),X=-1):T=!0,pe(B,I-ge))):(A.sortIndex=ye,c(v,A),C||Z||(C=!0,k||(k=!0,oe()))),A},r.unstable_shouldYield=re,r.unstable_wrapCallback=function(A){var E=z;return function(){var I=z;z=E;try{return A.apply(this,arguments)}finally{z=I}}}})(rc)),rc}var Mh;function cg(){return Mh||(Mh=1,ac.exports=og()),ac.exports}var sc={exports:{}},it={};var zh;function ug(){if(zh)return it;zh=1;var r=bc();function c(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)g+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var o={d:{f:i,r:function(){throw Error(c(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},f=Symbol.for("react.portal");function h(v,g,S){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:x==null?null:""+x,children:v,containerInfo:g,implementation:S}}var m=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return it.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,it.createPortal=function(v,g){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(c(299));return h(v,g,null,S)},it.flushSync=function(v){var g=m.T,S=o.p;try{if(m.T=null,o.p=2,v)return v()}finally{m.T=g,o.p=S,o.d.f()}},it.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(v,g))},it.prefetchDNS=function(v){typeof v=="string"&&o.d.D(v)},it.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var S=g.as,x=y(S,g.crossOrigin),z=typeof g.integrity=="string"?g.integrity:void 0,Z=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;S==="style"?o.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:x,integrity:z,fetchPriority:Z}):S==="script"&&o.d.X(v,{crossOrigin:x,integrity:z,fetchPriority:Z,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},it.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var S=y(g.as,g.crossOrigin);o.d.M(v,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(v)},it.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var S=g.as,x=y(S,g.crossOrigin);o.d.L(v,S,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},it.preloadModule=function(v,g){if(typeof v=="string")if(g){var S=y(g.as,g.crossOrigin);o.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(v)},it.requestFormReset=function(v){o.d.r(v)},it.unstable_batchedUpdates=function(v,g){return v(g)},it.useFormState=function(v,g,S){return m.H.useFormState(v,g,S)},it.useFormStatus=function(){return m.H.useHostTransitionStatus()},it.version="19.2.3",it}var Rh;function fg(){if(Rh)return sc.exports;Rh=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(c){console.error(c)}}return r(),sc.exports=ug(),sc.exports}var Oh;function dg(){if(Oh)return Fa;Oh=1;var r=cg(),c=bc(),i=fg();function o(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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(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 m(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 y(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(h(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,n=t;;){var a=l.return;if(a===null)break;var s=a.alternate;if(s===null){if(n=a.return,n!==null){l=n;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===l)return v(a),e;if(s===n)return v(a),t;s=s.sibling}throw Error(o(188))}if(l.return!==n.return)l=a,n=s;else{for(var d=!1,p=a.child;p;){if(p===l){d=!0,l=a,n=s;break}if(p===n){d=!0,n=a,l=s;break}p=p.sibling}if(!d){for(p=s.child;p;){if(p===l){d=!0,l=s,n=a;break}if(p===n){d=!0,n=s,l=a;break}p=p.sibling}if(!d)throw Error(o(189))}}if(l.alternate!==n)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,z=Symbol.for("react.element"),Z=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),V=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=ie&&e[ie]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Symbol.for("react.client.reference");function we(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case H:return"Profiler";case N:return"StrictMode";case B:return"Suspense";case k:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case V:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case J:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var pe=Array.isArray,A=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ge=[],ye=-1;function _(e){return{current:e}}function q(e){0>ye||(e.current=ge[ye],ge[ye]=null,ye--)}function W(e,t){ye++,ge[ye]=e.current,e.current=t}var P=_(null),le=_(null),ue=_(null),Ce=_(null);function et(e,t){switch(W(ue,t),W(le,e),W(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Wd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(P),W(P,e)}function Le(){q(P),q(le),q(ue)}function Wt(e){e.memoizedState!==null&&W(Ce,e);var t=P.current,l=Wd(t,e.type);t!==l&&(W(le,e),W(P,l))}function vl(e){le.current===e&&(q(P),q(le)),Ce.current===e&&(q(Ce),Qa._currentValue=I)}var la,rr;function Ft(e){if(la===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);la=t&&t[1]||"",rr=-1<l.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+la+e+rr}var na=!1;function he(e,t){if(!e||na)return"";na=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(U){var O=U}Reflect.construct(e,[],$)}else{try{$.call()}catch(U){O=U}e.call($.prototype)}}else{try{throw Error()}catch(U){O=U}($=e())&&typeof $.catch=="function"&&$.catch(function(){})}}catch(U){if(U&&O&&typeof U.stack=="string")return[U.stack,O.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),d=s[0],p=s[1];if(d&&p){var b=d.split(`
|
|
4
|
+
`),R=p.split(`
|
|
5
|
+
`);for(a=n=0;n<b.length&&!b[n].includes("DetermineComponentFrameRoot");)n++;for(;a<R.length&&!R[a].includes("DetermineComponentFrameRoot");)a++;if(n===b.length||a===R.length)for(n=b.length-1,a=R.length-1;1<=n&&0<=a&&b[n]!==R[a];)a--;for(;1<=n&&0<=a;n--,a--)if(b[n]!==R[a]){if(n!==1||a!==1)do if(n--,a--,0>a||b[n]!==R[a]){var Y=`
|
|
6
|
+
`+b[n].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=n&&0<=a);break}}}finally{na=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ft(l):""}function It(e,t){switch(e.tag){case 26:case 27:case 5:return Ft(e.type);case 16:return Ft("Lazy");case 13:return e.child!==t&&t!==null?Ft("Suspense Fallback"):Ft("Suspense");case 19:return Ft("SuspenseList");case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return Ft("Activity");default:return""}}function qt(e){try{var t="",l=null;do t+=It(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
|
|
7
|
+
Error generating stack: `+n.message+`
|
|
8
|
+
`+n.stack}}var Fe=Object.prototype.hasOwnProperty,xt=r.unstable_scheduleCallback,Gl=r.unstable_cancelCallback,Dm=r.unstable_shouldYield,Um=r.unstable_requestPaint,bt=r.unstable_now,Hm=r.unstable_getCurrentPriorityLevel,wc=r.unstable_ImmediatePriority,kc=r.unstable_UserBlockingPriority,sr=r.unstable_NormalPriority,Bm=r.unstable_LowPriority,Nc=r.unstable_IdlePriority,qm=r.log,Ym=r.unstable_setDisableYieldValue,aa=null,St=null;function xl(e){if(typeof qm=="function"&&Ym(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(aa,e)}catch{}}var _t=Math.clz32?Math.clz32:Gm,Vm=Math.log,Xm=Math.LN2;function Gm(e){return e>>>=0,e===0?32:31-(Vm(e)/Xm|0)|0}var ir=256,or=262144,cr=4194304;function $l(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 ur(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var a=0,s=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var p=n&134217727;return p!==0?(n=p&~s,n!==0?a=$l(n):(d&=p,d!==0?a=$l(d):l||(l=p&~e,l!==0&&(a=$l(l))))):(p=n&~s,p!==0?a=$l(p):d!==0?a=$l(d):l||(l=n&~e,l!==0&&(a=$l(l)))),a===0?0:t!==0&&t!==a&&(t&s)===0&&(s=a&-a,l=t&-t,s>=l||s===32&&(l&4194048)!==0)?t:a}function ra(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $m(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 Tc(){var e=cr;return cr<<=1,(cr&62914560)===0&&(cr=4194304),e}function Vs(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function sa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qm(e,t,l,n,a,s){var d=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 p=e.entanglements,b=e.expirationTimes,R=e.hiddenUpdates;for(l=d&~l;0<l;){var Y=31-_t(l),$=1<<Y;p[Y]=0,b[Y]=-1;var O=R[Y];if(O!==null)for(R[Y]=null,Y=0;Y<O.length;Y++){var U=O[Y];U!==null&&(U.lane&=-536870913)}l&=~$}n!==0&&Ac(e,n,0),s!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=s&~(d&~t))}function Ac(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-_t(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function Mc(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-_t(l),a=1<<n;a&t|e[n]&t&&(e[n]|=t),l&=~a}}function zc(e,t){var l=t&-t;return l=(l&42)!==0?1:Xs(l),(l&(e.suspendedLanes|t))!==0?0:l}function Xs(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 Gs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rc(){var e=E.p;return e!==0?e:(e=window.event,e===void 0?32:xh(e.type))}function Oc(e,t){var l=E.p;try{return E.p=e,t()}finally{E.p=l}}var bl=Math.random().toString(36).slice(2),tt="__reactFiber$"+bl,ut="__reactProps$"+bl,mn="__reactContainer$"+bl,$s="__reactEvents$"+bl,Zm="__reactListeners$"+bl,Km="__reactHandles$"+bl,Lc="__reactResources$"+bl,ia="__reactMarker$"+bl;function Qs(e){delete e[tt],delete e[ut],delete e[$s],delete e[Zm],delete e[Km]}function pn(e){var t=e[tt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[mn]||l[tt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=nh(e);e!==null;){if(l=e[tt])return l;e=nh(e)}return t}e=l,l=e.parentNode}return null}function gn(e){if(e=e[tt]||e[mn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function oa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function yn(e){var t=e[Lc];return t||(t=e[Lc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ie(e){e[ia]=!0}var Dc=new Set,Uc={};function Ql(e,t){vn(e,t),vn(e+"Capture",t)}function vn(e,t){for(Uc[e]=t,e=0;e<t.length;e++)Dc.add(t[e])}var Jm=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]*$"),Hc={},Bc={};function Wm(e){return Fe.call(Bc,e)?!0:Fe.call(Hc,e)?!1:Jm.test(e)?Bc[e]=!0:(Hc[e]=!0,!1)}function fr(e,t,l){if(Wm(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 dr(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 Pt(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 At(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fm(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 a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(d){l=""+d,s.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(d){l=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zs(e){if(!e._valueTracker){var t=qc(e)?"checked":"value";e._valueTracker=Fm(e,t,""+e[t])}}function Yc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=qc(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function hr(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 Im=/[\n"\\]/g;function Mt(e){return e.replace(Im,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ks(e,t,l,n,a,s,d,p){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+At(t)):e.value!==""+At(t)&&(e.value=""+At(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Js(e,d,At(t)):l!=null?Js(e,d,At(l)):n!=null&&e.removeAttribute("value"),a==null&&s!=null&&(e.defaultChecked=!!s),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+At(p):e.removeAttribute("name")}function Vc(e,t,l,n,a,s,d,p){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||l!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Zs(e);return}l=l!=null?""+At(l):"",t=t!=null?""+At(t):l,p||t===e.value||(e.value=t),e.defaultValue=t}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=p?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Zs(e)}function Js(e,t,l){t==="number"&&hr(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function xn(e,t,l,n){if(e=e.options,t){t={};for(var a=0;a<l.length;a++)t["$"+l[a]]=!0;for(l=0;l<e.length;l++)a=t.hasOwnProperty("$"+e[l].value),e[l].selected!==a&&(e[l].selected=a),a&&n&&(e[l].defaultSelected=!0)}else{for(l=""+At(l),t=null,a=0;a<e.length;a++){if(e[a].value===l){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Xc(e,t,l){if(t!=null&&(t=""+At(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+At(l):""}function Gc(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(o(92));if(pe(n)){if(1<n.length)throw Error(o(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=At(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),Zs(e)}function bn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Pm=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 $c(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||Pm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Qc(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(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 a in t)n=t[a],t.hasOwnProperty(a)&&l[a]!==n&&$c(e,a,n)}else for(var s in t)t.hasOwnProperty(s)&&$c(e,s,t[s])}function Ws(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 ep=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"]]),tp=/^[\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 mr(e){return tp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function el(){}var Fs=null;function Is(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,_n=null;function Zc(e){var t=gn(e);if(t&&(e=t.stateNode)){var l=e[ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ks(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="'+Mt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var a=n[ut]||null;if(!a)throw Error(o(90));Ks(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&Yc(n)}break e;case"textarea":Xc(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&xn(e,!!l.multiple,t,!1)}}}var Ps=!1;function Kc(e,t,l){if(Ps)return e(t,l);Ps=!0;try{var n=e(t);return n}finally{if(Ps=!1,(Sn!==null||_n!==null)&&(ts(),Sn&&(t=Sn,e=_n,_n=Sn=null,Zc(t),e)))for(t=0;t<e.length;t++)Zc(e[t])}}function ca(e,t){var l=e.stateNode;if(l===null)return null;var n=l[ut]||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(o(231,t,typeof l));return l}var tl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ei=!1;if(tl)try{var ua={};Object.defineProperty(ua,"passive",{get:function(){ei=!0}}),window.addEventListener("test",ua,ua),window.removeEventListener("test",ua,ua)}catch{ei=!1}var Sl=null,ti=null,pr=null;function Jc(){if(pr)return pr;var e,t=ti,l=t.length,n,a="value"in Sl?Sl.value:Sl.textContent,s=a.length;for(e=0;e<l&&t[e]===a[e];e++);var d=l-e;for(n=1;n<=d&&t[l-n]===a[s-n];n++);return pr=a.slice(e,1<n?1-n:void 0)}function gr(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 yr(){return!0}function Wc(){return!1}function ft(e){function t(l,n,a,s,d){this._reactName=l,this._targetInst=a,this.type=n,this.nativeEvent=s,this.target=d,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(l=e[p],this[p]=l?l(s):s[p]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?yr:Wc,this.isPropagationStopped=Wc,this}return x(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=yr)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=yr)},persist:function(){},isPersistent:yr}),t}var Zl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vr=ft(Zl),fa=x({},Zl,{view:0,detail:0}),lp=ft(fa),li,ni,da,xr=x({},fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ri,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!==da&&(da&&e.type==="mousemove"?(li=e.screenX-da.screenX,ni=e.screenY-da.screenY):ni=li=0,da=e),li)},movementY:function(e){return"movementY"in e?e.movementY:ni}}),Fc=ft(xr),np=x({},xr,{dataTransfer:0}),ap=ft(np),rp=x({},fa,{relatedTarget:0}),ai=ft(rp),sp=x({},Zl,{animationName:0,elapsedTime:0,pseudoElement:0}),ip=ft(sp),op=x({},Zl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cp=ft(op),up=x({},Zl,{data:0}),Ic=ft(up),fp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dp={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"},hp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hp[e])?!!t[e]:!1}function ri(){return mp}var pp=x({},fa,{key:function(e){if(e.key){var t=fp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=gr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ri,charCode:function(e){return e.type==="keypress"?gr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gp=ft(pp),yp=x({},xr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pc=ft(yp),vp=x({},fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ri}),xp=ft(vp),bp=x({},Zl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sp=ft(bp),_p=x({},xr,{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}),Cp=ft(_p),jp=x({},Zl,{newState:0,oldState:0}),Ep=ft(jp),wp=[9,13,27,32],si=tl&&"CompositionEvent"in window,ha=null;tl&&"documentMode"in document&&(ha=document.documentMode);var kp=tl&&"TextEvent"in window&&!ha,eu=tl&&(!si||ha&&8<ha&&11>=ha),tu=" ",lu=!1;function nu(e,t){switch(e){case"keyup":return wp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function au(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cn=!1;function Np(e,t){switch(e){case"compositionend":return au(t);case"keypress":return t.which!==32?null:(lu=!0,tu);case"textInput":return e=t.data,e===tu&&lu?null:e;default:return null}}function Tp(e,t){if(Cn)return e==="compositionend"||!si&&nu(e,t)?(e=Jc(),pr=ti=Sl=null,Cn=!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 eu&&t.locale!=="ko"?null:t.data;default:return null}}var Ap={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 ru(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ap[e.type]:t==="textarea"}function su(e,t,l,n){Sn?_n?_n.push(n):_n=[n]:Sn=n,t=os(t,"onChange"),0<t.length&&(l=new vr("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var ma=null,pa=null;function Mp(e){Xd(e,0)}function br(e){var t=oa(e);if(Yc(t))return e}function iu(e,t){if(e==="change")return t}var ou=!1;if(tl){var ii;if(tl){var oi="oninput"in document;if(!oi){var cu=document.createElement("div");cu.setAttribute("oninput","return;"),oi=typeof cu.oninput=="function"}ii=oi}else ii=!1;ou=ii&&(!document.documentMode||9<document.documentMode)}function uu(){ma&&(ma.detachEvent("onpropertychange",fu),pa=ma=null)}function fu(e){if(e.propertyName==="value"&&br(pa)){var t=[];su(t,pa,e,Is(e)),Kc(Mp,t)}}function zp(e,t,l){e==="focusin"?(uu(),ma=t,pa=l,ma.attachEvent("onpropertychange",fu)):e==="focusout"&&uu()}function Rp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return br(pa)}function Op(e,t){if(e==="click")return br(t)}function Lp(e,t){if(e==="input"||e==="change")return br(t)}function Dp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ct=typeof Object.is=="function"?Object.is:Dp;function ga(e,t){if(Ct(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 a=l[n];if(!Fe.call(t,a)||!Ct(e[a],t[a]))return!1}return!0}function du(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hu(e,t){var l=du(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=du(l)}}function mu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=hr(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=hr(e.document)}return t}function ci(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 Up=tl&&"documentMode"in document&&11>=document.documentMode,jn=null,ui=null,ya=null,fi=!1;function gu(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;fi||jn==null||jn!==hr(n)||(n=jn,"selectionStart"in n&&ci(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}),ya&&ga(ya,n)||(ya=n,n=os(ui,"onSelect"),0<n.length&&(t=new vr("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=jn)))}function Kl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var En={animationend:Kl("Animation","AnimationEnd"),animationiteration:Kl("Animation","AnimationIteration"),animationstart:Kl("Animation","AnimationStart"),transitionrun:Kl("Transition","TransitionRun"),transitionstart:Kl("Transition","TransitionStart"),transitioncancel:Kl("Transition","TransitionCancel"),transitionend:Kl("Transition","TransitionEnd")},di={},yu={};tl&&(yu=document.createElement("div").style,"AnimationEvent"in window||(delete En.animationend.animation,delete En.animationiteration.animation,delete En.animationstart.animation),"TransitionEvent"in window||delete En.transitionend.transition);function Jl(e){if(di[e])return di[e];if(!En[e])return e;var t=En[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in yu)return di[e]=t[l];return e}var vu=Jl("animationend"),xu=Jl("animationiteration"),bu=Jl("animationstart"),Hp=Jl("transitionrun"),Bp=Jl("transitionstart"),qp=Jl("transitioncancel"),Su=Jl("transitionend"),_u=new Map,hi="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(" ");hi.push("scrollEnd");function Yt(e,t){_u.set(e,t),Ql(t,[e])}var Sr=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)},zt=[],wn=0,mi=0;function _r(){for(var e=wn,t=mi=wn=0;t<e;){var l=zt[t];zt[t++]=null;var n=zt[t];zt[t++]=null;var a=zt[t];zt[t++]=null;var s=zt[t];if(zt[t++]=null,n!==null&&a!==null){var d=n.pending;d===null?a.next=a:(a.next=d.next,d.next=a),n.pending=a}s!==0&&Cu(l,a,s)}}function Cr(e,t,l,n){zt[wn++]=e,zt[wn++]=t,zt[wn++]=l,zt[wn++]=n,mi|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function pi(e,t,l,n){return Cr(e,t,l,n),jr(e)}function Wl(e,t){return Cr(e,null,null,t),jr(e)}function Cu(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var a=!1,s=e.return;s!==null;)s.childLanes|=l,n=s.alternate,n!==null&&(n.childLanes|=l),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(a=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,a&&t!==null&&(a=31-_t(l),e=s.hiddenUpdates,n=e[a],n===null?e[a]=[t]:n.push(t),t.lane=l|536870912),s):null}function jr(e){if(50<Ba)throw Ba=0,Eo=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kn={};function Yp(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 jt(e,t,l,n){return new Yp(e,t,l,n)}function gi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ll(e,t){var l=e.alternate;return l===null?(l=jt(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 ju(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 Er(e,t,l,n,a,s){var d=0;if(n=e,typeof e=="function")gi(e)&&(d=1);else if(typeof e=="string")d=Q0(e,l,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=jt(31,l,t,a),e.elementType=ne,e.lanes=s,e;case T:return Fl(l.children,a,s,t);case N:d=8,a|=24;break;case H:return e=jt(12,l,t,a|2),e.elementType=H,e.lanes=s,e;case B:return e=jt(13,l,t,a),e.elementType=B,e.lanes=s,e;case k:return e=jt(19,l,t,a),e.elementType=k,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case V:d=10;break e;case F:d=9;break e;case J:d=11;break e;case X:d=14;break e;case Q:d=16,n=null;break e}d=29,l=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=jt(d,l,t,a),t.elementType=e,t.type=n,t.lanes=s,t}function Fl(e,t,l,n){return e=jt(7,e,n,t),e.lanes=l,e}function yi(e,t,l){return e=jt(6,e,null,t),e.lanes=l,e}function Eu(e){var t=jt(18,null,null,0);return t.stateNode=e,t}function vi(e,t,l){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wu=new WeakMap;function Rt(e,t){if(typeof e=="object"&&e!==null){var l=wu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:qt(t)},wu.set(e,t),t)}return{value:e,source:t,stack:qt(t)}}var Nn=[],Tn=0,wr=null,va=0,Ot=[],Lt=0,_l=null,$t=1,Qt="";function nl(e,t){Nn[Tn++]=va,Nn[Tn++]=wr,wr=e,va=t}function ku(e,t,l){Ot[Lt++]=$t,Ot[Lt++]=Qt,Ot[Lt++]=_l,_l=e;var n=$t;e=Qt;var a=32-_t(n)-1;n&=~(1<<a),l+=1;var s=32-_t(t)+a;if(30<s){var d=a-a%5;s=(n&(1<<d)-1).toString(32),n>>=d,a-=d,$t=1<<32-_t(t)+a|l<<a|n,Qt=s+e}else $t=1<<s|l<<a|n,Qt=e}function xi(e){e.return!==null&&(nl(e,1),ku(e,1,0))}function bi(e){for(;e===wr;)wr=Nn[--Tn],Nn[Tn]=null,va=Nn[--Tn],Nn[Tn]=null;for(;e===_l;)_l=Ot[--Lt],Ot[Lt]=null,Qt=Ot[--Lt],Ot[Lt]=null,$t=Ot[--Lt],Ot[Lt]=null}function Nu(e,t){Ot[Lt++]=$t,Ot[Lt++]=Qt,Ot[Lt++]=_l,$t=t.id,Qt=t.overflow,_l=e}var lt=null,De=null,_e=!1,Cl=null,Dt=!1,Si=Error(o(519));function jl(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xa(Rt(t,e)),Si}function Tu(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[tt]=e,t[ut]=n,l){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(l=0;l<Ya.length;l++)xe(Ya[l],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),Vc(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),Gc(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||Zd(t.textContent,l)?(n.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),n.onScroll!=null&&xe("scroll",t),n.onScrollEnd!=null&&xe("scrollend",t),n.onClick!=null&&(t.onclick=el),t=!0):t=!1,t||jl(e,!0)}function Au(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:Dt=!1;return;case 27:case 3:Dt=!0;return;default:lt=lt.return}}function An(e){if(e!==lt)return!1;if(!_e)return Au(e),_e=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||qo(e.type,e.memoizedProps)),l=!l),l&&De&&jl(e),Au(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=lh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=lh(e)}else t===27?(t=De,Hl(e.type)?(e=$o,$o=null,De=e):De=t):De=lt?Ht(e.stateNode.nextSibling):null;return!0}function Il(){De=lt=null,_e=!1}function _i(){var e=Cl;return e!==null&&(pt===null?pt=e:pt.push.apply(pt,e),Cl=null),e}function xa(e){Cl===null?Cl=[e]:Cl.push(e)}var Ci=_(null),Pl=null,al=null;function El(e,t,l){W(Ci,t._currentValue),t._currentValue=l}function rl(e){e._currentValue=Ci.current,q(Ci)}function ji(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 Ei(e,t,l,n){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){var d=a.child;s=s.firstContext;e:for(;s!==null;){var p=s;s=a;for(var b=0;b<t.length;b++)if(p.context===t[b]){s.lanes|=l,p=s.alternate,p!==null&&(p.lanes|=l),ji(s.return,l,e),n||(d=null);break e}s=p.next}}else if(a.tag===18){if(d=a.return,d===null)throw Error(o(341));d.lanes|=l,s=d.alternate,s!==null&&(s.lanes|=l),ji(d,l,e),d=null}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===e){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}}function Mn(e,t,l,n){e=null;for(var a=t,s=!1;a!==null;){if(!s){if((a.flags&524288)!==0)s=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var d=a.alternate;if(d===null)throw Error(o(387));if(d=d.memoizedProps,d!==null){var p=a.type;Ct(a.pendingProps.value,d.value)||(e!==null?e.push(p):e=[p])}}else if(a===Ce.current){if(d=a.alternate,d===null)throw Error(o(387));d.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Qa):e=[Qa])}a=a.return}e!==null&&Ei(t,e,l,n),t.flags|=262144}function kr(e){for(e=e.firstContext;e!==null;){if(!Ct(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function en(e){Pl=e,al=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function nt(e){return Mu(Pl,e)}function Nr(e,t){return Pl===null&&en(e),Mu(e,t)}function Mu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},al===null){if(e===null)throw Error(o(308));al=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else al=al.next=t;return l}var Vp=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()})}},Xp=r.unstable_scheduleCallback,Gp=r.unstable_NormalPriority,$e={$$typeof:V,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wi(){return{controller:new Vp,data:new Map,refCount:0}}function ba(e){e.refCount--,e.refCount===0&&Xp(Gp,function(){e.controller.abort()})}var Sa=null,ki=0,zn=0,Rn=null;function $p(e,t){if(Sa===null){var l=Sa=[];ki=0,zn=Mo(),Rn={status:"pending",value:void 0,then:function(n){l.push(n)}}}return ki++,t.then(zu,zu),t}function zu(){if(--ki===0&&Sa!==null){Rn!==null&&(Rn.status="fulfilled");var e=Sa;Sa=null,zn=0,Rn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Qp(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(a){l.push(a)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var a=0;a<l.length;a++)(0,l[a])(t)},function(a){for(n.status="rejected",n.reason=a,a=0;a<l.length;a++)(0,l[a])(void 0)}),n}var Ru=A.S;A.S=function(e,t){yd=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&$p(e,t),Ru!==null&&Ru(e,t)};var tn=_(null);function Ni(){var e=tn.current;return e!==null?e:Oe.pooledCache}function Tr(e,t){t===null?W(tn,tn.current):W(tn,t.pool)}function Ou(){var e=Ni();return e===null?null:{parent:$e._currentValue,pool:e}}var On=Error(o(460)),Ti=Error(o(474)),Ar=Error(o(542)),Mr={then:function(){}};function Lu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Du(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(el,el),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hu(e),e;default:if(typeof t.status=="string")t.then(el,el);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=n}},function(n){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hu(e),e}throw nn=t,On}}function ln(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(nn=l,On):l}}var nn=null;function Uu(){if(nn===null)throw Error(o(459));var e=nn;return nn=null,e}function Hu(e){if(e===On||e===Ar)throw Error(o(483))}var Ln=null,_a=0;function zr(e){var t=_a;return _a+=1,Ln===null&&(Ln=[]),Du(Ln,e,t)}function Ca(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Rr(e,t){throw t.$$typeof===z?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Bu(e){function t(w,j){if(e){var M=w.deletions;M===null?(w.deletions=[j],w.flags|=16):M.push(j)}}function l(w,j){if(!e)return null;for(;j!==null;)t(w,j),j=j.sibling;return null}function n(w){for(var j=new Map;w!==null;)w.key!==null?j.set(w.key,w):j.set(w.index,w),w=w.sibling;return j}function a(w,j){return w=ll(w,j),w.index=0,w.sibling=null,w}function s(w,j,M){return w.index=M,e?(M=w.alternate,M!==null?(M=M.index,M<j?(w.flags|=67108866,j):M):(w.flags|=67108866,j)):(w.flags|=1048576,j)}function d(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function p(w,j,M,G){return j===null||j.tag!==6?(j=yi(M,w.mode,G),j.return=w,j):(j=a(j,M),j.return=w,j)}function b(w,j,M,G){var ae=M.type;return ae===T?Y(w,j,M.props.children,G,M.key):j!==null&&(j.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===Q&&ln(ae)===j.type)?(j=a(j,M.props),Ca(j,M),j.return=w,j):(j=Er(M.type,M.key,M.props,null,w.mode,G),Ca(j,M),j.return=w,j)}function R(w,j,M,G){return j===null||j.tag!==4||j.stateNode.containerInfo!==M.containerInfo||j.stateNode.implementation!==M.implementation?(j=vi(M,w.mode,G),j.return=w,j):(j=a(j,M.children||[]),j.return=w,j)}function Y(w,j,M,G,ae){return j===null||j.tag!==7?(j=Fl(M,w.mode,G,ae),j.return=w,j):(j=a(j,M),j.return=w,j)}function $(w,j,M){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=yi(""+j,w.mode,M),j.return=w,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Z:return M=Er(j.type,j.key,j.props,null,w.mode,M),Ca(M,j),M.return=w,M;case C:return j=vi(j,w.mode,M),j.return=w,j;case Q:return j=ln(j),$(w,j,M)}if(pe(j)||oe(j))return j=Fl(j,w.mode,M,null),j.return=w,j;if(typeof j.then=="function")return $(w,zr(j),M);if(j.$$typeof===V)return $(w,Nr(w,j),M);Rr(w,j)}return null}function O(w,j,M,G){var ae=j!==null?j.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return ae!==null?null:p(w,j,""+M,G);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case Z:return M.key===ae?b(w,j,M,G):null;case C:return M.key===ae?R(w,j,M,G):null;case Q:return M=ln(M),O(w,j,M,G)}if(pe(M)||oe(M))return ae!==null?null:Y(w,j,M,G,null);if(typeof M.then=="function")return O(w,j,zr(M),G);if(M.$$typeof===V)return O(w,j,Nr(w,M),G);Rr(w,M)}return null}function U(w,j,M,G,ae){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return w=w.get(M)||null,p(j,w,""+G,ae);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case Z:return w=w.get(G.key===null?M:G.key)||null,b(j,w,G,ae);case C:return w=w.get(G.key===null?M:G.key)||null,R(j,w,G,ae);case Q:return G=ln(G),U(w,j,M,G,ae)}if(pe(G)||oe(G))return w=w.get(M)||null,Y(j,w,G,ae,null);if(typeof G.then=="function")return U(w,j,M,zr(G),ae);if(G.$$typeof===V)return U(w,j,M,Nr(j,G),ae);Rr(j,G)}return null}function ee(w,j,M,G){for(var ae=null,je=null,te=j,me=j=0,Se=null;te!==null&&me<M.length;me++){te.index>me?(Se=te,te=null):Se=te.sibling;var Ee=O(w,te,M[me],G);if(Ee===null){te===null&&(te=Se);break}e&&te&&Ee.alternate===null&&t(w,te),j=s(Ee,j,me),je===null?ae=Ee:je.sibling=Ee,je=Ee,te=Se}if(me===M.length)return l(w,te),_e&&nl(w,me),ae;if(te===null){for(;me<M.length;me++)te=$(w,M[me],G),te!==null&&(j=s(te,j,me),je===null?ae=te:je.sibling=te,je=te);return _e&&nl(w,me),ae}for(te=n(te);me<M.length;me++)Se=U(te,w,me,M[me],G),Se!==null&&(e&&Se.alternate!==null&&te.delete(Se.key===null?me:Se.key),j=s(Se,j,me),je===null?ae=Se:je.sibling=Se,je=Se);return e&&te.forEach(function(Xl){return t(w,Xl)}),_e&&nl(w,me),ae}function se(w,j,M,G){if(M==null)throw Error(o(151));for(var ae=null,je=null,te=j,me=j=0,Se=null,Ee=M.next();te!==null&&!Ee.done;me++,Ee=M.next()){te.index>me?(Se=te,te=null):Se=te.sibling;var Xl=O(w,te,Ee.value,G);if(Xl===null){te===null&&(te=Se);break}e&&te&&Xl.alternate===null&&t(w,te),j=s(Xl,j,me),je===null?ae=Xl:je.sibling=Xl,je=Xl,te=Se}if(Ee.done)return l(w,te),_e&&nl(w,me),ae;if(te===null){for(;!Ee.done;me++,Ee=M.next())Ee=$(w,Ee.value,G),Ee!==null&&(j=s(Ee,j,me),je===null?ae=Ee:je.sibling=Ee,je=Ee);return _e&&nl(w,me),ae}for(te=n(te);!Ee.done;me++,Ee=M.next())Ee=U(te,w,me,Ee.value,G),Ee!==null&&(e&&Ee.alternate!==null&&te.delete(Ee.key===null?me:Ee.key),j=s(Ee,j,me),je===null?ae=Ee:je.sibling=Ee,je=Ee);return e&&te.forEach(function(ng){return t(w,ng)}),_e&&nl(w,me),ae}function Re(w,j,M,G){if(typeof M=="object"&&M!==null&&M.type===T&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case Z:e:{for(var ae=M.key;j!==null;){if(j.key===ae){if(ae=M.type,ae===T){if(j.tag===7){l(w,j.sibling),G=a(j,M.props.children),G.return=w,w=G;break e}}else if(j.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===Q&&ln(ae)===j.type){l(w,j.sibling),G=a(j,M.props),Ca(G,M),G.return=w,w=G;break e}l(w,j);break}else t(w,j);j=j.sibling}M.type===T?(G=Fl(M.props.children,w.mode,G,M.key),G.return=w,w=G):(G=Er(M.type,M.key,M.props,null,w.mode,G),Ca(G,M),G.return=w,w=G)}return d(w);case C:e:{for(ae=M.key;j!==null;){if(j.key===ae)if(j.tag===4&&j.stateNode.containerInfo===M.containerInfo&&j.stateNode.implementation===M.implementation){l(w,j.sibling),G=a(j,M.children||[]),G.return=w,w=G;break e}else{l(w,j);break}else t(w,j);j=j.sibling}G=vi(M,w.mode,G),G.return=w,w=G}return d(w);case Q:return M=ln(M),Re(w,j,M,G)}if(pe(M))return ee(w,j,M,G);if(oe(M)){if(ae=oe(M),typeof ae!="function")throw Error(o(150));return M=ae.call(M),se(w,j,M,G)}if(typeof M.then=="function")return Re(w,j,zr(M),G);if(M.$$typeof===V)return Re(w,j,Nr(w,M),G);Rr(w,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,j!==null&&j.tag===6?(l(w,j.sibling),G=a(j,M),G.return=w,w=G):(l(w,j),G=yi(M,w.mode,G),G.return=w,w=G),d(w)):l(w,j)}return function(w,j,M,G){try{_a=0;var ae=Re(w,j,M,G);return Ln=null,ae}catch(te){if(te===On||te===Ar)throw te;var je=jt(29,te,null,w.mode);return je.lanes=G,je.return=w,je}}}var an=Bu(!0),qu=Bu(!1),wl=!1;function Ai(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mi(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 kl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Nl(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ke&2)!==0){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,t=jr(e),Cu(e,null,l),t}return Cr(e,n,t,l),jr(e)}function ja(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,Mc(e,l)}}function zi(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,s=null;if(l=l.firstBaseUpdate,l!==null){do{var d={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};s===null?a=s=d:s=s.next=d,l=l.next}while(l!==null);s===null?a=s=t:s=s.next=t}else a=s=t;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:s,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 Ri=!1;function Ea(){if(Ri){var e=Rn;if(e!==null)throw e}}function wa(e,t,l,n){Ri=!1;var a=e.updateQueue;wl=!1;var s=a.firstBaseUpdate,d=a.lastBaseUpdate,p=a.shared.pending;if(p!==null){a.shared.pending=null;var b=p,R=b.next;b.next=null,d===null?s=R:d.next=R,d=b;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,p=Y.lastBaseUpdate,p!==d&&(p===null?Y.firstBaseUpdate=R:p.next=R,Y.lastBaseUpdate=b))}if(s!==null){var $=a.baseState;d=0,Y=R=b=null,p=s;do{var O=p.lane&-536870913,U=O!==p.lane;if(U?(be&O)===O:(n&O)===O){O!==0&&O===zn&&(Ri=!0),Y!==null&&(Y=Y.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ee=e,se=p;O=t;var Re=l;switch(se.tag){case 1:if(ee=se.payload,typeof ee=="function"){$=ee.call(Re,$,O);break e}$=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=se.payload,O=typeof ee=="function"?ee.call(Re,$,O):ee,O==null)break e;$=x({},$,O);break e;case 2:wl=!0}}O=p.callback,O!==null&&(e.flags|=64,U&&(e.flags|=8192),U=a.callbacks,U===null?a.callbacks=[O]:U.push(O))}else U={lane:O,tag:p.tag,payload:p.payload,callback:p.callback,next:null},Y===null?(R=Y=U,b=$):Y=Y.next=U,d|=O;if(p=p.next,p===null){if(p=a.shared.pending,p===null)break;U=p,p=U.next,U.next=null,a.lastBaseUpdate=U,a.shared.pending=null}}while(!0);Y===null&&(b=$),a.baseState=b,a.firstBaseUpdate=R,a.lastBaseUpdate=Y,s===null&&(a.shared.lanes=0),Rl|=d,e.lanes=d,e.memoizedState=$}}function Yu(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Vu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Yu(l[e],t)}var Dn=_(null),Or=_(0);function Xu(e,t){e=ml,W(Or,e),W(Dn,t),ml=e|t.baseLanes}function Oi(){W(Or,ml),W(Dn,Dn.current)}function Li(){ml=Or.current,q(Dn),q(Or)}var Et=_(null),Ut=null;function Tl(e){var t=e.alternate;W(Ye,Ye.current&1),W(Et,e),Ut===null&&(t===null||Dn.current!==null||t.memoizedState!==null)&&(Ut=e)}function Di(e){W(Ye,Ye.current),W(Et,e),Ut===null&&(Ut=e)}function Gu(e){e.tag===22?(W(Ye,Ye.current),W(Et,e),Ut===null&&(Ut=e)):Al()}function Al(){W(Ye,Ye.current),W(Et,Et.current)}function wt(e){q(Et),Ut===e&&(Ut=null),q(Ye)}var Ye=_(0);function Lr(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Xo(l)||Go(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 sl=0,fe=null,Me=null,Qe=null,Dr=!1,Un=!1,rn=!1,Ur=0,ka=0,Hn=null,Zp=0;function Be(){throw Error(o(321))}function Ui(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Ct(e[l],t[l]))return!1;return!0}function Hi(e,t,l,n,a,s){return sl=s,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Nf:Pi,rn=!1,s=l(n,a),rn=!1,Un&&(s=Qu(t,l,n,a)),$u(e),s}function $u(e){A.H=Aa;var t=Me!==null&&Me.next!==null;if(sl=0,Qe=Me=fe=null,Dr=!1,ka=0,Hn=null,t)throw Error(o(300));e===null||Ze||(e=e.dependencies,e!==null&&kr(e)&&(Ze=!0))}function Qu(e,t,l,n){fe=e;var a=0;do{if(Un&&(Hn=null),ka=0,Un=!1,25<=a)throw Error(o(301));if(a+=1,Qe=Me=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}A.H=Tf,s=t(l,n)}while(Un);return s}function Kp(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?Na(t):t,e=e.useState()[0],(Me!==null?Me.memoizedState:null)!==e&&(fe.flags|=1024),t}function Bi(){var e=Ur!==0;return Ur=0,e}function qi(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Yi(e){if(Dr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Dr=!1}sl=0,Qe=Me=fe=null,Un=!1,ka=Ur=0,Hn=null}function ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?fe.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Ve(){if(Me===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var t=Qe===null?fe.memoizedState:Qe.next;if(t!==null)Qe=t,Me=e;else{if(e===null)throw fe.alternate===null?Error(o(467)):Error(o(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},Qe===null?fe.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Hr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Na(e){var t=ka;return ka+=1,Hn===null&&(Hn=[]),e=Du(Hn,e,t),t=fe,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Nf:Pi),e}function Br(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Na(e);if(e.$$typeof===V)return nt(e)}throw Error(o(438,String(e)))}function Vi(e){var t=null,l=fe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=fe.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Hr(),fe.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]=re;return t.index++,l}function il(e,t){return typeof t=="function"?t(e):t}function qr(e){var t=Ve();return Xi(t,Me,e)}function Xi(e,t,l){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=l;var a=e.baseQueue,s=n.pending;if(s!==null){if(a!==null){var d=a.next;a.next=s.next,s.next=d}t.baseQueue=a=s,n.pending=null}if(s=e.baseState,a===null)e.memoizedState=s;else{t=a.next;var p=d=null,b=null,R=t,Y=!1;do{var $=R.lane&-536870913;if($!==R.lane?(be&$)===$:(sl&$)===$){var O=R.revertLane;if(O===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),$===zn&&(Y=!0);else if((sl&O)===O){R=R.next,O===zn&&(Y=!0);continue}else $={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},b===null?(p=b=$,d=s):b=b.next=$,fe.lanes|=O,Rl|=O;$=R.action,rn&&l(s,$),s=R.hasEagerState?R.eagerState:l(s,$)}else O={lane:$,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},b===null?(p=b=O,d=s):b=b.next=O,fe.lanes|=$,Rl|=$;R=R.next}while(R!==null&&R!==t);if(b===null?d=s:b.next=p,!Ct(s,e.memoizedState)&&(Ze=!0,Y&&(l=Rn,l!==null)))throw l;e.memoizedState=s,e.baseState=d,e.baseQueue=b,n.lastRenderedState=s}return a===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Gi(e){var t=Ve(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var n=l.dispatch,a=l.pending,s=t.memoizedState;if(a!==null){l.pending=null;var d=a=a.next;do s=e(s,d.action),d=d.next;while(d!==a);Ct(s,t.memoizedState)||(Ze=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),l.lastRenderedState=s}return[s,n]}function Zu(e,t,l){var n=fe,a=Ve(),s=_e;if(s){if(l===void 0)throw Error(o(407));l=l()}else l=t();var d=!Ct((Me||a).memoizedState,l);if(d&&(a.memoizedState=l,Ze=!0),a=a.queue,Zi(Wu.bind(null,n,a,e),[e]),a.getSnapshot!==t||d||Qe!==null&&Qe.memoizedState.tag&1){if(n.flags|=2048,Bn(9,{destroy:void 0},Ju.bind(null,n,a,l,t),null),Oe===null)throw Error(o(349));s||(sl&127)!==0||Ku(n,t,l)}return l}function Ku(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=fe.updateQueue,t===null?(t=Hr(),fe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Ju(e,t,l,n){t.value=l,t.getSnapshot=n,Fu(t)&&Iu(e)}function Wu(e,t,l){return l(function(){Fu(t)&&Iu(e)})}function Fu(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Ct(e,l)}catch{return!0}}function Iu(e){var t=Wl(e,2);t!==null&>(t,e,2)}function $i(e){var t=ct();if(typeof e=="function"){var l=e;if(e=l(),rn){xl(!0);try{l()}finally{xl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:e},t}function Pu(e,t,l,n){return e.baseState=l,Xi(e,Me,typeof n=="function"?n:il)}function Jp(e,t,l,n,a){if(Xr(e))throw Error(o(485));if(e=t.action,e!==null){var s={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){s.listeners.push(d)}};A.T!==null?l(!0):s.isTransition=!1,n(s),l=t.pending,l===null?(s.next=t.pending=s,ef(t,s)):(s.next=l.next,t.pending=l.next=s)}}function ef(e,t){var l=t.action,n=t.payload,a=e.state;if(t.isTransition){var s=A.T,d={};A.T=d;try{var p=l(a,n),b=A.S;b!==null&&b(d,p),tf(e,t,p)}catch(R){Qi(e,t,R)}finally{s!==null&&d.types!==null&&(s.types=d.types),A.T=s}}else try{s=l(a,n),tf(e,t,s)}catch(R){Qi(e,t,R)}}function tf(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){lf(e,t,n)},function(n){return Qi(e,t,n)}):lf(e,t,l)}function lf(e,t,l){t.status="fulfilled",t.value=l,nf(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,ef(e,l)))}function Qi(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,nf(t),t=t.next;while(t!==n)}e.action=null}function nf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function af(e,t){return t}function rf(e,t){if(_e){var l=Oe.formState;if(l!==null){e:{var n=fe;if(_e){if(De){t:{for(var a=De,s=Dt;a.nodeType!==8;){if(!s){a=null;break t}if(a=Ht(a.nextSibling),a===null){a=null;break t}}s=a.data,a=s==="F!"||s==="F"?a:null}if(a){De=Ht(a.nextSibling),n=a.data==="F!";break e}}jl(n)}n=!1}n&&(t=l[0])}}return l=ct(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:af,lastRenderedState:t},l.queue=n,l=Ef.bind(null,fe,n),n.dispatch=l,n=$i(!1),s=Ii.bind(null,fe,!1,n.queue),n=ct(),a={state:t,dispatch:null,action:e,pending:null},n.queue=a,l=Jp.bind(null,fe,a,s,l),a.dispatch=l,n.memoizedState=e,[t,l,!1]}function sf(e){var t=Ve();return of(t,Me,e)}function of(e,t,l){if(t=Xi(e,t,af)[0],e=qr(il)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Na(t)}catch(d){throw d===On?Ar:d}else n=t;t=Ve();var a=t.queue,s=a.dispatch;return l!==t.memoizedState&&(fe.flags|=2048,Bn(9,{destroy:void 0},Wp.bind(null,a,l),null)),[n,s,e]}function Wp(e,t){e.action=t}function cf(e){var t=Ve(),l=Me;if(l!==null)return of(t,l,e);Ve(),t=t.memoizedState,l=Ve();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function Bn(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=fe.updateQueue,t===null&&(t=Hr(),fe.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 uf(){return Ve().memoizedState}function Yr(e,t,l,n){var a=ct();fe.flags|=e,a.memoizedState=Bn(1|t,{destroy:void 0},l,n===void 0?null:n)}function Vr(e,t,l,n){var a=Ve();n=n===void 0?null:n;var s=a.memoizedState.inst;Me!==null&&n!==null&&Ui(n,Me.memoizedState.deps)?a.memoizedState=Bn(t,s,l,n):(fe.flags|=e,a.memoizedState=Bn(1|t,s,l,n))}function ff(e,t){Yr(8390656,8,e,t)}function Zi(e,t){Vr(2048,8,e,t)}function Fp(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=Hr(),fe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function df(e){var t=Ve().memoizedState;return Fp({ref:t,nextImpl:e}),function(){if((ke&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function hf(e,t){return Vr(4,2,e,t)}function mf(e,t){return Vr(4,4,e,t)}function pf(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 gf(e,t,l){l=l!=null?l.concat([e]):null,Vr(4,4,pf.bind(null,t,e),l)}function Ki(){}function yf(e,t){var l=Ve();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&Ui(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function vf(e,t){var l=Ve();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&Ui(t,n[1]))return n[0];if(n=e(),rn){xl(!0);try{e()}finally{xl(!1)}}return l.memoizedState=[n,t],n}function Ji(e,t,l){return l===void 0||(sl&1073741824)!==0&&(be&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=xd(),fe.lanes|=e,Rl|=e,l)}function xf(e,t,l,n){return Ct(l,t)?l:Dn.current!==null?(e=Ji(e,l,n),Ct(e,t)||(Ze=!0),e):(sl&42)===0||(sl&1073741824)!==0&&(be&261930)===0?(Ze=!0,e.memoizedState=l):(e=xd(),fe.lanes|=e,Rl|=e,t)}function bf(e,t,l,n,a){var s=E.p;E.p=s!==0&&8>s?s:8;var d=A.T,p={};A.T=p,Ii(e,!1,t,l);try{var b=a(),R=A.S;if(R!==null&&R(p,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var Y=Qp(b,n);Ta(e,t,Y,Tt(e))}else Ta(e,t,n,Tt(e))}catch($){Ta(e,t,{then:function(){},status:"rejected",reason:$},Tt())}finally{E.p=s,d!==null&&p.types!==null&&(d.types=p.types),A.T=d}}function Ip(){}function Wi(e,t,l,n){if(e.tag!==5)throw Error(o(476));var a=Sf(e).queue;bf(e,a,t,I,l===null?Ip:function(){return _f(e),l(n)})}function Sf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:I},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:il,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _f(e){var t=Sf(e);t.next===null&&(t=e.alternate.memoizedState),Ta(e,t.next.queue,{},Tt())}function Fi(){return nt(Qa)}function Cf(){return Ve().memoizedState}function jf(){return Ve().memoizedState}function Pp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Tt();e=kl(l);var n=Nl(t,e,l);n!==null&&(gt(n,t,l),ja(n,t,l)),t={cache:wi()},e.payload=t;return}t=t.return}}function e0(e,t,l){var n=Tt();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Xr(e)?wf(t,l):(l=pi(e,t,l,n),l!==null&&(gt(l,e,n),kf(l,t,n)))}function Ef(e,t,l){var n=Tt();Ta(e,t,l,n)}function Ta(e,t,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Xr(e))wf(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var d=t.lastRenderedState,p=s(d,l);if(a.hasEagerState=!0,a.eagerState=p,Ct(p,d))return Cr(e,t,a,0),Oe===null&&_r(),!1}catch{}if(l=pi(e,t,a,n),l!==null)return gt(l,e,n),kf(l,t,n),!0}return!1}function Ii(e,t,l,n){if(n={lane:2,revertLane:Mo(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Xr(e)){if(t)throw Error(o(479))}else t=pi(e,l,n,2),t!==null&>(t,e,2)}function Xr(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function wf(e,t){Un=Dr=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function kf(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,Mc(e,l)}}var Aa={readContext:nt,use:Br,useCallback:Be,useContext:Be,useEffect:Be,useImperativeHandle:Be,useLayoutEffect:Be,useInsertionEffect:Be,useMemo:Be,useReducer:Be,useRef:Be,useState:Be,useDebugValue:Be,useDeferredValue:Be,useTransition:Be,useSyncExternalStore:Be,useId:Be,useHostTransitionStatus:Be,useFormState:Be,useActionState:Be,useOptimistic:Be,useMemoCache:Be,useCacheRefresh:Be};Aa.useEffectEvent=Be;var Nf={readContext:nt,use:Br,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:nt,useEffect:ff,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Yr(4194308,4,pf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Yr(4194308,4,e,t)},useInsertionEffect:function(e,t){Yr(4,2,e,t)},useMemo:function(e,t){var l=ct();t=t===void 0?null:t;var n=e();if(rn){xl(!0);try{e()}finally{xl(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=ct();if(l!==void 0){var a=l(t);if(rn){xl(!0);try{l(t)}finally{xl(!1)}}}else a=t;return n.memoizedState=n.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},n.queue=e,e=e.dispatch=e0.bind(null,fe,e),[n.memoizedState,e]},useRef:function(e){var t=ct();return e={current:e},t.memoizedState=e},useState:function(e){e=$i(e);var t=e.queue,l=Ef.bind(null,fe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ki,useDeferredValue:function(e,t){var l=ct();return Ji(l,e,t)},useTransition:function(){var e=$i(!1);return e=bf.bind(null,fe,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=fe,a=ct();if(_e){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Oe===null)throw Error(o(349));(be&127)!==0||Ku(n,t,l)}a.memoizedState=l;var s={value:l,getSnapshot:t};return a.queue=s,ff(Wu.bind(null,n,s,e),[e]),n.flags|=2048,Bn(9,{destroy:void 0},Ju.bind(null,n,s,l,t),null),l},useId:function(){var e=ct(),t=Oe.identifierPrefix;if(_e){var l=Qt,n=$t;l=(n&~(1<<32-_t(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ur++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Zp++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Fi,useFormState:rf,useActionState:rf,useOptimistic:function(e){var t=ct();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Ii.bind(null,fe,!0,l),l.dispatch=t,[e,t]},useMemoCache:Vi,useCacheRefresh:function(){return ct().memoizedState=Pp.bind(null,fe)},useEffectEvent:function(e){var t=ct(),l={impl:e};return t.memoizedState=l,function(){if((ke&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},Pi={readContext:nt,use:Br,useCallback:yf,useContext:nt,useEffect:Zi,useImperativeHandle:gf,useInsertionEffect:hf,useLayoutEffect:mf,useMemo:vf,useReducer:qr,useRef:uf,useState:function(){return qr(il)},useDebugValue:Ki,useDeferredValue:function(e,t){var l=Ve();return xf(l,Me.memoizedState,e,t)},useTransition:function(){var e=qr(il)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Na(e),t]},useSyncExternalStore:Zu,useId:Cf,useHostTransitionStatus:Fi,useFormState:sf,useActionState:sf,useOptimistic:function(e,t){var l=Ve();return Pu(l,Me,e,t)},useMemoCache:Vi,useCacheRefresh:jf};Pi.useEffectEvent=df;var Tf={readContext:nt,use:Br,useCallback:yf,useContext:nt,useEffect:Zi,useImperativeHandle:gf,useInsertionEffect:hf,useLayoutEffect:mf,useMemo:vf,useReducer:Gi,useRef:uf,useState:function(){return Gi(il)},useDebugValue:Ki,useDeferredValue:function(e,t){var l=Ve();return Me===null?Ji(l,e,t):xf(l,Me.memoizedState,e,t)},useTransition:function(){var e=Gi(il)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Na(e),t]},useSyncExternalStore:Zu,useId:Cf,useHostTransitionStatus:Fi,useFormState:cf,useActionState:cf,useOptimistic:function(e,t){var l=Ve();return Me!==null?Pu(l,Me,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Vi,useCacheRefresh:jf};Tf.useEffectEvent=df;function eo(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:x({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var to={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=Tt(),a=kl(n);a.payload=t,l!=null&&(a.callback=l),t=Nl(e,a,n),t!==null&&(gt(t,e,n),ja(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=Tt(),a=kl(n);a.tag=1,a.payload=t,l!=null&&(a.callback=l),t=Nl(e,a,n),t!==null&&(gt(t,e,n),ja(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Tt(),n=kl(l);n.tag=2,t!=null&&(n.callback=t),t=Nl(e,n,l),t!==null&&(gt(t,e,l),ja(t,e,l))}};function Af(e,t,l,n,a,s,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,d):t.prototype&&t.prototype.isPureReactComponent?!ga(l,n)||!ga(a,s):!0}function Mf(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&&to.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=x({},l));for(var a in e)l[a]===void 0&&(l[a]=e[a])}return l}function zf(e){Sr(e)}function Rf(e){console.error(e)}function Of(e){Sr(e)}function Gr(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Lf(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function lo(e,t,l){return l=kl(l),l.tag=3,l.payload={element:null},l.callback=function(){Gr(e,t)},l}function Df(e){return e=kl(e),e.tag=3,e}function Uf(e,t,l,n){var a=l.type.getDerivedStateFromError;if(typeof a=="function"){var s=n.value;e.payload=function(){return a(s)},e.callback=function(){Lf(t,l,n)}}var d=l.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Lf(t,l,n),typeof a!="function"&&(Ol===null?Ol=new Set([this]):Ol.add(this));var p=n.stack;this.componentDidCatch(n.value,{componentStack:p!==null?p:""})})}function t0(e,t,l,n,a){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Mn(t,l,a,!0),l=Et.current,l!==null){switch(l.tag){case 31:case 13:return Ut===null?ls():l.alternate===null&&qe===0&&(qe=3),l.flags&=-257,l.flags|=65536,l.lanes=a,n===Mr?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),No(e,n,a)),!1;case 22:return l.flags|=65536,n===Mr?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)),No(e,n,a)),!1}throw Error(o(435,l.tag))}return No(e,n,a),ls(),!1}if(_e)return t=Et.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,n!==Si&&(e=Error(o(422),{cause:n}),xa(Rt(e,l)))):(n!==Si&&(t=Error(o(423),{cause:n}),xa(Rt(t,l))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,n=Rt(n,l),a=lo(e.stateNode,n,a),zi(e,a),qe!==4&&(qe=2)),!1;var s=Error(o(520),{cause:n});if(s=Rt(s,l),Ha===null?Ha=[s]:Ha.push(s),qe!==4&&(qe=2),t===null)return!0;n=Rt(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=a&-a,l.lanes|=e,e=lo(l.stateNode,n,e),zi(l,e),!1;case 1:if(t=l.type,s=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Ol===null||!Ol.has(s))))return l.flags|=65536,a&=-a,l.lanes|=a,a=Df(a),Uf(a,e,l,n),zi(l,a),!1}l=l.return}while(l!==null);return!1}var no=Error(o(461)),Ze=!1;function at(e,t,l,n){t.child=e===null?qu(t,null,l,n):an(t,e.child,l,n)}function Hf(e,t,l,n,a){l=l.render;var s=t.ref;if("ref"in n){var d={};for(var p in n)p!=="ref"&&(d[p]=n[p])}else d=n;return en(t),n=Hi(e,t,l,d,s,a),p=Bi(),e!==null&&!Ze?(qi(e,t,a),ol(e,t,a)):(_e&&p&&xi(t),t.flags|=1,at(e,t,n,a),t.child)}function Bf(e,t,l,n,a){if(e===null){var s=l.type;return typeof s=="function"&&!gi(s)&&s.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=s,qf(e,t,s,n,a)):(e=Er(l.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!fo(e,a)){var d=s.memoizedProps;if(l=l.compare,l=l!==null?l:ga,l(d,n)&&e.ref===t.ref)return ol(e,t,a)}return t.flags|=1,e=ll(s,n),e.ref=t.ref,e.return=t,t.child=e}function qf(e,t,l,n,a){if(e!==null){var s=e.memoizedProps;if(ga(s,n)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=n=s,fo(e,a))(e.flags&131072)!==0&&(Ze=!0);else return t.lanes=e.lanes,ol(e,t,a)}return ao(e,t,l,n,a)}function Yf(e,t,l,n){var a=n.children,s=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(s=s!==null?s.baseLanes|l:l,e!==null){for(n=t.child=e.child,a=0;n!==null;)a=a|n.lanes|n.childLanes,n=n.sibling;n=a&~s}else n=0,t.child=null;return Vf(e,t,s,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Tr(t,s!==null?s.cachePool:null),s!==null?Xu(t,s):Oi(),Gu(t);else return n=t.lanes=536870912,Vf(e,t,s!==null?s.baseLanes|l:l,l,n)}else s!==null?(Tr(t,s.cachePool),Xu(t,s),Al(),t.memoizedState=null):(e!==null&&Tr(t,null),Oi(),Al());return at(e,t,a,l),t.child}function Ma(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vf(e,t,l,n,a){var s=Ni();return s=s===null?null:{parent:$e._currentValue,pool:s},t.memoizedState={baseLanes:l,cachePool:s},e!==null&&Tr(t,null),Oi(),Gu(t),e!==null&&Mn(e,t,n,!0),t.childLanes=a,null}function $r(e,t){return t=Zr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xf(e,t,l){return an(t,e.child,null,l),e=$r(t,t.pendingProps),e.flags|=2,wt(t),t.memoizedState=null,e}function l0(e,t,l){var n=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(_e){if(n.mode==="hidden")return e=$r(t,n),t.lanes=536870912,Ma(null,e);if(Di(t),(e=De)?(e=th(e,Dt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_l!==null?{id:$t,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},l=Eu(e),l.return=t,t.child=l,lt=t,De=null)):e=null,e===null)throw jl(t);return t.lanes=536870912,null}return $r(t,n)}var s=e.memoizedState;if(s!==null){var d=s.dehydrated;if(Di(t),a)if(t.flags&256)t.flags&=-257,t=Xf(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ze||Mn(e,t,l,!1),a=(l&e.childLanes)!==0,Ze||a){if(n=Oe,n!==null&&(d=zc(n,l),d!==0&&d!==s.retryLane))throw s.retryLane=d,Wl(e,d),gt(n,e,d),no;ls(),t=Xf(e,t,l)}else e=s.treeContext,De=Ht(d.nextSibling),lt=t,_e=!0,Cl=null,Dt=!1,e!==null&&Nu(t,e),t=$r(t,n),t.flags|=4096;return t}return e=ll(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qr(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(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function ao(e,t,l,n,a){return en(t),l=Hi(e,t,l,n,void 0,a),n=Bi(),e!==null&&!Ze?(qi(e,t,a),ol(e,t,a)):(_e&&n&&xi(t),t.flags|=1,at(e,t,l,a),t.child)}function Gf(e,t,l,n,a,s){return en(t),t.updateQueue=null,l=Qu(t,n,l,a),$u(e),n=Bi(),e!==null&&!Ze?(qi(e,t,s),ol(e,t,s)):(_e&&n&&xi(t),t.flags|=1,at(e,t,l,s),t.child)}function $f(e,t,l,n,a){if(en(t),t.stateNode===null){var s=kn,d=l.contextType;typeof d=="object"&&d!==null&&(s=nt(d)),s=new l(n,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=to,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=n,s.state=t.memoizedState,s.refs={},Ai(t),d=l.contextType,s.context=typeof d=="object"&&d!==null?nt(d):kn,s.state=t.memoizedState,d=l.getDerivedStateFromProps,typeof d=="function"&&(eo(t,l,d,n),s.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(d=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),d!==s.state&&to.enqueueReplaceState(s,s.state,null),wa(t,n,s,a),Ea(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){s=t.stateNode;var p=t.memoizedProps,b=sn(l,p);s.props=b;var R=s.context,Y=l.contextType;d=kn,typeof Y=="object"&&Y!==null&&(d=nt(Y));var $=l.getDerivedStateFromProps;Y=typeof $=="function"||typeof s.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,Y||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(p||R!==d)&&Mf(t,s,n,d),wl=!1;var O=t.memoizedState;s.state=O,wa(t,n,s,a),Ea(),R=t.memoizedState,p||O!==R||wl?(typeof $=="function"&&(eo(t,l,$,n),R=t.memoizedState),(b=wl||Af(t,l,b,n,O,R,d))?(Y||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=R),s.props=n,s.state=R,s.context=d,n=b):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Mi(e,t),d=t.memoizedProps,Y=sn(l,d),s.props=Y,$=t.pendingProps,O=s.context,R=l.contextType,b=kn,typeof R=="object"&&R!==null&&(b=nt(R)),p=l.getDerivedStateFromProps,(R=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==$||O!==b)&&Mf(t,s,n,b),wl=!1,O=t.memoizedState,s.state=O,wa(t,n,s,a),Ea();var U=t.memoizedState;d!==$||O!==U||wl||e!==null&&e.dependencies!==null&&kr(e.dependencies)?(typeof p=="function"&&(eo(t,l,p,n),U=t.memoizedState),(Y=wl||Af(t,l,Y,n,O,U,b)||e!==null&&e.dependencies!==null&&kr(e.dependencies))?(R||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,U,b),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,U,b)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=U),s.props=n,s.state=U,s.context=b,n=Y):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),n=!1)}return s=n,Qr(e,t),n=(t.flags&128)!==0,s||n?(s=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&n?(t.child=an(t,e.child,null,a),t.child=an(t,null,l,a)):at(e,t,l,a),t.memoizedState=s.state,e=t.child):e=ol(e,t,a),e}function Qf(e,t,l,n){return Il(),t.flags|=256,at(e,t,l,n),t.child}var ro={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function so(e){return{baseLanes:e,cachePool:Ou()}}function io(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Nt),e}function Zf(e,t,l){var n=t.pendingProps,a=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),d&&(a=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(_e){if(a?Tl(t):Al(),(e=De)?(e=th(e,Dt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_l!==null?{id:$t,overflow:Qt}:null,retryLane:536870912,hydrationErrors:null},l=Eu(e),l.return=t,t.child=l,lt=t,De=null)):e=null,e===null)throw jl(t);return Go(e)?t.lanes=32:t.lanes=536870912,null}var p=n.children;return n=n.fallback,a?(Al(),a=t.mode,p=Zr({mode:"hidden",children:p},a),n=Fl(n,a,l,null),p.return=t,n.return=t,p.sibling=n,t.child=p,n=t.child,n.memoizedState=so(l),n.childLanes=io(e,d,l),t.memoizedState=ro,Ma(null,n)):(Tl(t),oo(t,p))}var b=e.memoizedState;if(b!==null&&(p=b.dehydrated,p!==null)){if(s)t.flags&256?(Tl(t),t.flags&=-257,t=co(e,t,l)):t.memoizedState!==null?(Al(),t.child=e.child,t.flags|=128,t=null):(Al(),p=n.fallback,a=t.mode,n=Zr({mode:"visible",children:n.children},a),p=Fl(p,a,l,null),p.flags|=2,n.return=t,p.return=t,n.sibling=p,t.child=n,an(t,e.child,null,l),n=t.child,n.memoizedState=so(l),n.childLanes=io(e,d,l),t.memoizedState=ro,t=Ma(null,n));else if(Tl(t),Go(p)){if(d=p.nextSibling&&p.nextSibling.dataset,d)var R=d.dgst;d=R,n=Error(o(419)),n.stack="",n.digest=d,xa({value:n,source:null,stack:null}),t=co(e,t,l)}else if(Ze||Mn(e,t,l,!1),d=(l&e.childLanes)!==0,Ze||d){if(d=Oe,d!==null&&(n=zc(d,l),n!==0&&n!==b.retryLane))throw b.retryLane=n,Wl(e,n),gt(d,e,n),no;Xo(p)||ls(),t=co(e,t,l)}else Xo(p)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,De=Ht(p.nextSibling),lt=t,_e=!0,Cl=null,Dt=!1,e!==null&&Nu(t,e),t=oo(t,n.children),t.flags|=4096);return t}return a?(Al(),p=n.fallback,a=t.mode,b=e.child,R=b.sibling,n=ll(b,{mode:"hidden",children:n.children}),n.subtreeFlags=b.subtreeFlags&65011712,R!==null?p=ll(R,p):(p=Fl(p,a,l,null),p.flags|=2),p.return=t,n.return=t,n.sibling=p,t.child=n,Ma(null,n),n=t.child,p=e.child.memoizedState,p===null?p=so(l):(a=p.cachePool,a!==null?(b=$e._currentValue,a=a.parent!==b?{parent:b,pool:b}:a):a=Ou(),p={baseLanes:p.baseLanes|l,cachePool:a}),n.memoizedState=p,n.childLanes=io(e,d,l),t.memoizedState=ro,Ma(e.child,n)):(Tl(t),l=e.child,e=l.sibling,l=ll(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=l,t.memoizedState=null,l)}function oo(e,t){return t=Zr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Zr(e,t){return e=jt(22,e,null,t),e.lanes=0,e}function co(e,t,l){return an(t,e.child,null,l),e=oo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Kf(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ji(e.return,t,l)}function uo(e,t,l,n,a,s){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:a,treeForkCount:s}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=l,d.tailMode=a,d.treeForkCount=s)}function Jf(e,t,l){var n=t.pendingProps,a=n.revealOrder,s=n.tail;n=n.children;var d=Ye.current,p=(d&2)!==0;if(p?(d=d&1|2,t.flags|=128):d&=1,W(Ye,d),at(e,t,n,l),n=_e?va:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Kf(e,l,t);else if(e.tag===19)Kf(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(a){case"forwards":for(l=t.child,a=null;l!==null;)e=l.alternate,e!==null&&Lr(e)===null&&(a=l),l=l.sibling;l=a,l===null?(a=t.child,t.child=null):(a=l.sibling,l.sibling=null),uo(t,!1,a,l,s,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Lr(e)===null){t.child=a;break}e=a.sibling,a.sibling=l,l=a,a=e}uo(t,!0,l,null,s,n);break;case"together":uo(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function ol(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Rl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Mn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=ll(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=ll(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function fo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&kr(e)))}function n0(e,t,l){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),El(t,$e,e.memoizedState.cache),Il();break;case 27:case 5:Wt(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:El(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Di(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Tl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Zf(e,t,l):(Tl(t),e=ol(e,t,l),e!==null?e.sibling:null);Tl(t);break;case 19:var a=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Mn(e,t,l,!1),n=(l&t.childLanes)!==0),a){if(n)return Jf(e,t,l);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),W(Ye,Ye.current),n)break;return null;case 22:return t.lanes=0,Yf(e,t,l,t.pendingProps);case 24:El(t,$e,e.memoizedState.cache)}return ol(e,t,l)}function Wf(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ze=!0;else{if(!fo(e,l)&&(t.flags&128)===0)return Ze=!1,n0(e,t,l);Ze=(e.flags&131072)!==0}else Ze=!1,_e&&(t.flags&1048576)!==0&&ku(t,va,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")gi(e)?(n=sn(e,n),t.tag=1,t=$f(null,t,e,n,l)):(t.tag=0,t=ao(null,t,e,n,l));else{if(e!=null){var a=e.$$typeof;if(a===J){t.tag=11,t=Hf(null,t,e,n,l);break e}else if(a===X){t.tag=14,t=Bf(null,t,e,n,l);break e}}throw t=we(e)||e,Error(o(306,t,""))}}return t;case 0:return ao(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,a=sn(n,t.pendingProps),$f(e,t,n,a,l);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var s=t.memoizedState;a=s.element,Mi(e,t),wa(t,n,null,l);var d=t.memoizedState;if(n=d.cache,El(t,$e,n),n!==s.cache&&Ei(t,[$e],l,!0),Ea(),n=d.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=Qf(e,t,n,l);break e}else if(n!==a){a=Rt(Error(o(424)),t),xa(a),t=Qf(e,t,n,l);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,De=Ht(e.firstChild),lt=t,_e=!0,Cl=null,Dt=!0,l=qu(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Il(),n===a){t=ol(e,t,l);break e}at(e,t,n,l)}t=t.child}return t;case 26:return Qr(e,t),e===null?(l=ih(t.type,null,t.pendingProps,null))?t.memoizedState=l:_e||(l=t.type,e=t.pendingProps,n=cs(ue.current).createElement(l),n[tt]=t,n[ut]=e,rt(n,l,e),Ie(n),t.stateNode=n):t.memoizedState=ih(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Wt(t),e===null&&_e&&(n=t.stateNode=ah(t.type,t.pendingProps,ue.current),lt=t,Dt=!0,a=De,Hl(t.type)?($o=a,De=Ht(n.firstChild)):De=a),at(e,t,t.pendingProps.children,l),Qr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&_e&&((a=n=De)&&(n=R0(n,t.type,t.pendingProps,Dt),n!==null?(t.stateNode=n,lt=t,De=Ht(n.firstChild),Dt=!1,a=!0):a=!1),a||jl(t)),Wt(t),a=t.type,s=t.pendingProps,d=e!==null?e.memoizedProps:null,n=s.children,qo(a,s)?n=null:d!==null&&qo(a,d)&&(t.flags|=32),t.memoizedState!==null&&(a=Hi(e,t,Kp,null,null,l),Qa._currentValue=a),Qr(e,t),at(e,t,n,l),t.child;case 6:return e===null&&_e&&((e=l=De)&&(l=O0(l,t.pendingProps,Dt),l!==null?(t.stateNode=l,lt=t,De=null,e=!0):e=!1),e||jl(t)),null;case 13:return Zf(e,t,l);case 4:return et(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=an(t,null,n,l):at(e,t,n,l),t.child;case 11:return Hf(e,t,t.type,t.pendingProps,l);case 7:return at(e,t,t.pendingProps,l),t.child;case 8:return at(e,t,t.pendingProps.children,l),t.child;case 12:return at(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,El(t,t.type,n.value),at(e,t,n.children,l),t.child;case 9:return a=t.type._context,n=t.pendingProps.children,en(t),a=nt(a),n=n(a),t.flags|=1,at(e,t,n,l),t.child;case 14:return Bf(e,t,t.type,t.pendingProps,l);case 15:return qf(e,t,t.type,t.pendingProps,l);case 19:return Jf(e,t,l);case 31:return l0(e,t,l);case 22:return Yf(e,t,l,t.pendingProps);case 24:return en(t),n=nt($e),e===null?(a=Ni(),a===null&&(a=Oe,s=wi(),a.pooledCache=s,s.refCount++,s!==null&&(a.pooledCacheLanes|=l),a=s),t.memoizedState={parent:n,cache:a},Ai(t),El(t,$e,a)):((e.lanes&l)!==0&&(Mi(e,t),wa(t,null,null,l),Ea()),a=e.memoizedState,s=t.memoizedState,a.parent!==n?(a={parent:n,cache:n},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),El(t,$e,n)):(n=s.cache,El(t,$e,n),n!==a.cache&&Ei(t,[$e],l,!0))),at(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function cl(e){e.flags|=4}function ho(e,t,l,n,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Cd())e.flags|=8192;else throw nn=Mr,Ti}else e.flags&=-16777217}function Ff(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!dh(t))if(Cd())e.flags|=8192;else throw nn=Mr,Ti}function Kr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Tc():536870912,e.lanes|=t,Xn|=t)}function za(e,t){if(!_e)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 Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags&65011712,n|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function a0(e,t,l){var n=t.pendingProps;switch(bi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return Ue(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),rl($e),Le(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(An(t)?cl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,_i())),Ue(t),null;case 26:var a=t.type,s=t.memoizedState;return e===null?(cl(t),s!==null?(Ue(t),Ff(t,s)):(Ue(t),ho(t,a,null,n,l))):s?s!==e.memoizedState?(cl(t),Ue(t),Ff(t,s)):(Ue(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&cl(t),Ue(t),ho(t,a,e,n,l)),null;case 27:if(vl(t),l=ue.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&cl(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Ue(t),null}e=P.current,An(t)?Tu(t):(e=ah(a,n,l),t.stateNode=e,cl(t))}return Ue(t),null;case 5:if(vl(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&cl(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return Ue(t),null}if(s=P.current,An(t))Tu(t);else{var d=cs(ue.current);switch(s){case 1:s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":s=d.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":s=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":s=d.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s=typeof n.is=="string"?d.createElement(a,{is:n.is}):d.createElement(a)}}s[tt]=t,s[ut]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=s;e:switch(rt(s,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&cl(t)}}return Ue(t),ho(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&cl(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=ue.current,An(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,a=lt,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Zd(e.nodeValue,l)),e||jl(t,!0)}else e=cs(e).createTextNode(n),e[tt]=t,t.stateNode=e}return Ue(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=An(t),l!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[tt]=t}else Il(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),e=!1}else l=_i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(wt(t),t):(wt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Ue(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=An(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(o(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(317));a[tt]=t}else Il(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ue(t),a=!1}else a=_i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(wt(t),t):(wt(t),null)}return wt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Kr(t,t.updateQueue),Ue(t),null);case 4:return Le(),e===null&&Lo(t.stateNode.containerInfo),Ue(t),null;case 10:return rl(t.type),Ue(t),null;case 19:if(q(Ye),n=t.memoizedState,n===null)return Ue(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)za(n,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Lr(e),s!==null){for(t.flags|=128,za(n,!1),e=s.updateQueue,t.updateQueue=e,Kr(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)ju(l,e),l=l.sibling;return W(Ye,Ye.current&1|2),_e&&nl(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&bt()>Pr&&(t.flags|=128,a=!0,za(n,!1),t.lanes=4194304)}else{if(!a)if(e=Lr(s),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Kr(t,e),za(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!_e)return Ue(t),null}else 2*bt()-n.renderingStartTime>Pr&&l!==536870912&&(t.flags|=128,a=!0,za(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(e=n.last,e!==null?e.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=bt(),e.sibling=null,l=Ye.current,W(Ye,a?l&1|2:l&1),_e&&nl(t,n.treeForkCount),e):(Ue(t),null);case 22:case 23:return wt(t),Li(),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&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),l=t.updateQueue,l!==null&&Kr(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&&q(tn),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),rl($e),Ue(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function r0(e,t){switch(bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rl($e),Le(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return vl(t),null;case 31:if(t.memoizedState!==null){if(wt(t),t.alternate===null)throw Error(o(340));Il()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(wt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Il()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return Le(),null;case 10:return rl(t.type),null;case 22:case 23:return wt(t),Li(),e!==null&&q(tn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return rl($e),null;case 25:return null;default:return null}}function If(e,t){switch(bi(t),t.tag){case 3:rl($e),Le();break;case 26:case 27:case 5:vl(t);break;case 4:Le();break;case 31:t.memoizedState!==null&&wt(t);break;case 13:wt(t);break;case 19:q(Ye);break;case 10:rl(t.type);break;case 22:case 23:wt(t),Li(),e!==null&&q(tn);break;case 24:rl($e)}}function Ra(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&e)===e){n=void 0;var s=l.create,d=l.inst;n=s(),d.destroy=n}l=l.next}while(l!==a)}}catch(p){Ae(t,t.return,p)}}function Ml(e,t,l){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){var d=n.inst,p=d.destroy;if(p!==void 0){d.destroy=void 0,a=t;var b=l,R=p;try{R()}catch(Y){Ae(a,b,Y)}}}n=n.next}while(n!==s)}}catch(Y){Ae(t,t.return,Y)}}function Pf(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Vu(t,l)}catch(n){Ae(e,e.return,n)}}}function ed(e,t,l){l.props=sn(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){Ae(e,t,n)}}function Oa(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(a){Ae(e,t,a)}}function Zt(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){Ae(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){Ae(e,t,a)}else l.current=null}function td(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(a){Ae(e,e.return,a)}}function mo(e,t,l){try{var n=e.stateNode;k0(n,e.type,l,t),n[ut]=t}catch(a){Ae(e,e.return,a)}}function ld(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hl(e.type)||e.tag===4}function po(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ld(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&&Hl(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 go(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=el));else if(n!==4&&(n===27&&Hl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(go(e,t,l),e=e.sibling;e!==null;)go(e,t,l),e=e.sibling}function Jr(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&&Hl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Jr(e,t,l),e=e.sibling;e!==null;)Jr(e,t,l),e=e.sibling}function nd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);rt(t,n,l),t[tt]=e,t[ut]=l}catch(s){Ae(e,e.return,s)}}var ul=!1,Ke=!1,yo=!1,ad=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function s0(e,t){if(e=e.containerInfo,Ho=gs,e=pu(e),ci(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 a=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{l.nodeType,s.nodeType}catch{l=null;break e}var d=0,p=-1,b=-1,R=0,Y=0,$=e,O=null;t:for(;;){for(var U;$!==l||a!==0&&$.nodeType!==3||(p=d+a),$!==s||n!==0&&$.nodeType!==3||(b=d+n),$.nodeType===3&&(d+=$.nodeValue.length),(U=$.firstChild)!==null;)O=$,$=U;for(;;){if($===e)break t;if(O===l&&++R===a&&(p=d),O===s&&++Y===n&&(b=d),(U=$.nextSibling)!==null)break;$=O,O=$.parentNode}$=U}l=p===-1||b===-1?null:{start:p,end:b}}else l=null}l=l||{start:0,end:0}}else l=null;for(Bo={focusedElem:e,selectionRange:l},gs=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){switch(t=Pe,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)a=e[l],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,l=t,a=s.memoizedProps,s=s.memoizedState,n=l.stateNode;try{var ee=sn(l.type,a);e=n.getSnapshotBeforeUpdate(ee,s),n.__reactInternalSnapshotBeforeUpdate=e}catch(se){Ae(l,l.return,se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Vo(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Vo(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Pe=e;break}Pe=t.return}}function rd(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:dl(e,l),n&4&&Ra(5,l);break;case 1:if(dl(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(d){Ae(l,l.return,d)}else{var a=sn(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Ae(l,l.return,d)}}n&64&&Pf(l),n&512&&Oa(l,l.return);break;case 3:if(dl(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{Vu(e,t)}catch(d){Ae(l,l.return,d)}}break;case 27:t===null&&n&4&&nd(l);case 26:case 5:dl(e,l),t===null&&n&4&&td(l),n&512&&Oa(l,l.return);break;case 12:dl(e,l);break;case 31:dl(e,l),n&4&&od(e,l);break;case 13:dl(e,l),n&4&&cd(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=p0.bind(null,l),L0(e,l))));break;case 22:if(n=l.memoizedState!==null||ul,!n){t=t!==null&&t.memoizedState!==null||Ke,a=ul;var s=Ke;ul=n,(Ke=t)&&!s?hl(e,l,(l.subtreeFlags&8772)!==0):dl(e,l),ul=a,Ke=s}break;case 30:break;default:dl(e,l)}}function sd(e){var t=e.alternate;t!==null&&(e.alternate=null,sd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qs(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 He=null,dt=!1;function fl(e,t,l){for(l=l.child;l!==null;)id(e,t,l),l=l.sibling}function id(e,t,l){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(aa,l)}catch{}switch(l.tag){case 26:Ke||Zt(l,t),fl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ke||Zt(l,t);var n=He,a=dt;Hl(l.type)&&(He=l.stateNode,dt=!1),fl(e,t,l),Xa(l.stateNode),He=n,dt=a;break;case 5:Ke||Zt(l,t);case 6:if(n=He,a=dt,He=null,fl(e,t,l),He=n,dt=a,He!==null)if(dt)try{(He.nodeType===9?He.body:He.nodeName==="HTML"?He.ownerDocument.body:He).removeChild(l.stateNode)}catch(s){Ae(l,t,s)}else try{He.removeChild(l.stateNode)}catch(s){Ae(l,t,s)}break;case 18:He!==null&&(dt?(e=He,Pd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Fn(e)):Pd(He,l.stateNode));break;case 4:n=He,a=dt,He=l.stateNode.containerInfo,dt=!0,fl(e,t,l),He=n,dt=a;break;case 0:case 11:case 14:case 15:Ml(2,l,t),Ke||Ml(4,l,t),fl(e,t,l);break;case 1:Ke||(Zt(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&ed(l,t,n)),fl(e,t,l);break;case 21:fl(e,t,l);break;case 22:Ke=(n=Ke)||l.memoizedState!==null,fl(e,t,l),Ke=n;break;default:fl(e,t,l)}}function od(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fn(e)}catch(l){Ae(t,t.return,l)}}}function cd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fn(e)}catch(l){Ae(t,t.return,l)}}function i0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ad),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ad),t;default:throw Error(o(435,e.tag))}}function Wr(e,t){var l=i0(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var a=g0.bind(null,e,n);n.then(a,a)}})}function ht(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n],s=e,d=t,p=d;e:for(;p!==null;){switch(p.tag){case 27:if(Hl(p.type)){He=p.stateNode,dt=!1;break e}break;case 5:He=p.stateNode,dt=!1;break e;case 3:case 4:He=p.stateNode.containerInfo,dt=!0;break e}p=p.return}if(He===null)throw Error(o(160));id(s,d,a),He=null,dt=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ud(t,e),t=t.sibling}var Vt=null;function ud(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ht(t,e),mt(e),n&4&&(Ml(3,e,e.return),Ra(3,e),Ml(5,e,e.return));break;case 1:ht(t,e),mt(e),n&512&&(Ke||l===null||Zt(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 a=Vt;if(ht(t,e),mt(e),n&512&&(Ke||l===null||Zt(l,l.return)),n&4){var s=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,a=a.ownerDocument||a;t:switch(n){case"title":s=a.getElementsByTagName("title")[0],(!s||s[ia]||s[tt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=a.createElement(n),a.head.insertBefore(s,a.querySelector("head > title"))),rt(s,n,l),s[tt]=e,Ie(s),n=s;break e;case"link":var d=uh("link","href",a).get(n+(l.href||""));if(d){for(var p=0;p<d.length;p++)if(s=d[p],s.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&s.getAttribute("rel")===(l.rel==null?null:l.rel)&&s.getAttribute("title")===(l.title==null?null:l.title)&&s.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){d.splice(p,1);break t}}s=a.createElement(n),rt(s,n,l),a.head.appendChild(s);break;case"meta":if(d=uh("meta","content",a).get(n+(l.content||""))){for(p=0;p<d.length;p++)if(s=d[p],s.getAttribute("content")===(l.content==null?null:""+l.content)&&s.getAttribute("name")===(l.name==null?null:l.name)&&s.getAttribute("property")===(l.property==null?null:l.property)&&s.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&s.getAttribute("charset")===(l.charSet==null?null:l.charSet)){d.splice(p,1);break t}}s=a.createElement(n),rt(s,n,l),a.head.appendChild(s);break;default:throw Error(o(468,n))}s[tt]=e,Ie(s),n=s}e.stateNode=n}else fh(a,e.type,e.stateNode);else e.stateNode=ch(a,n,e.memoizedProps);else s!==n?(s===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):s.count--,n===null?fh(a,e.type,e.stateNode):ch(a,n,e.memoizedProps)):n===null&&e.stateNode!==null&&mo(e,e.memoizedProps,l.memoizedProps)}break;case 27:ht(t,e),mt(e),n&512&&(Ke||l===null||Zt(l,l.return)),l!==null&&n&4&&mo(e,e.memoizedProps,l.memoizedProps);break;case 5:if(ht(t,e),mt(e),n&512&&(Ke||l===null||Zt(l,l.return)),e.flags&32){a=e.stateNode;try{bn(a,"")}catch(ee){Ae(e,e.return,ee)}}n&4&&e.stateNode!=null&&(a=e.memoizedProps,mo(e,a,l!==null?l.memoizedProps:a)),n&1024&&(yo=!0);break;case 6:if(ht(t,e),mt(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(ee){Ae(e,e.return,ee)}}break;case 3:if(ds=null,a=Vt,Vt=us(t.containerInfo),ht(t,e),Vt=a,mt(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{Fn(t.containerInfo)}catch(ee){Ae(e,e.return,ee)}yo&&(yo=!1,fd(e));break;case 4:n=Vt,Vt=us(e.stateNode.containerInfo),ht(t,e),mt(e),Vt=n;break;case 12:ht(t,e),mt(e);break;case 31:ht(t,e),mt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Wr(e,n)));break;case 13:ht(t,e),mt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ir=bt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Wr(e,n)));break;case 22:a=e.memoizedState!==null;var b=l!==null&&l.memoizedState!==null,R=ul,Y=Ke;if(ul=R||a,Ke=Y||b,ht(t,e),Ke=Y,ul=R,mt(e),n&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(l===null||b||ul||Ke||on(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){b=l=t;try{if(s=b.stateNode,a)d=s.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{p=b.stateNode;var $=b.memoizedProps.style,O=$!=null&&$.hasOwnProperty("display")?$.display:null;p.style.display=O==null||typeof O=="boolean"?"":(""+O).trim()}}catch(ee){Ae(b,b.return,ee)}}}else if(t.tag===6){if(l===null){b=t;try{b.stateNode.nodeValue=a?"":b.memoizedProps}catch(ee){Ae(b,b.return,ee)}}}else if(t.tag===18){if(l===null){b=t;try{var U=b.stateNode;a?eh(U,!0):eh(b.stateNode,!1)}catch(ee){Ae(b,b.return,ee)}}}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,Wr(e,l))));break;case 19:ht(t,e),mt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Wr(e,n)));break;case 30:break;case 21:break;default:ht(t,e),mt(e)}}function mt(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(ld(n)){l=n;break}n=n.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var a=l.stateNode,s=po(e);Jr(e,s,a);break;case 5:var d=l.stateNode;l.flags&32&&(bn(d,""),l.flags&=-33);var p=po(e);Jr(e,p,d);break;case 3:case 4:var b=l.stateNode.containerInfo,R=po(e);go(e,R,b);break;default:throw Error(o(161))}}catch(Y){Ae(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;fd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function dl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rd(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:Ml(4,t,t.return),on(t);break;case 1:Zt(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&ed(t,t.return,l),on(t);break;case 27:Xa(t.stateNode);case 26:case 5:Zt(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,a=e,s=t,d=s.flags;switch(s.tag){case 0:case 11:case 15:hl(a,s,l),Ra(4,s);break;case 1:if(hl(a,s,l),n=s,a=n.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(R){Ae(n,n.return,R)}if(n=s,a=n.updateQueue,a!==null){var p=n.stateNode;try{var b=a.shared.hiddenCallbacks;if(b!==null)for(a.shared.hiddenCallbacks=null,a=0;a<b.length;a++)Yu(b[a],p)}catch(R){Ae(n,n.return,R)}}l&&d&64&&Pf(s),Oa(s,s.return);break;case 27:nd(s);case 26:case 5:hl(a,s,l),l&&n===null&&d&4&&td(s),Oa(s,s.return);break;case 12:hl(a,s,l);break;case 31:hl(a,s,l),l&&d&4&&od(a,s);break;case 13:hl(a,s,l),l&&d&4&&cd(a,s);break;case 22:s.memoizedState===null&&hl(a,s,l),Oa(s,s.return);break;case 30:break;default:hl(a,s,l)}t=t.sibling}}function vo(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&&ba(l))}function xo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ba(e))}function Xt(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)dd(e,t,l,n),t=t.sibling}function dd(e,t,l,n){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Xt(e,t,l,n),a&2048&&Ra(9,t);break;case 1:Xt(e,t,l,n);break;case 3:Xt(e,t,l,n),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ba(e)));break;case 12:if(a&2048){Xt(e,t,l,n),e=t.stateNode;try{var s=t.memoizedProps,d=s.id,p=s.onPostCommit;typeof p=="function"&&p(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){Ae(t,t.return,b)}}else Xt(e,t,l,n);break;case 31:Xt(e,t,l,n);break;case 13:Xt(e,t,l,n);break;case 23:break;case 22:s=t.stateNode,d=t.alternate,t.memoizedState!==null?s._visibility&2?Xt(e,t,l,n):La(e,t):s._visibility&2?Xt(e,t,l,n):(s._visibility|=2,qn(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),a&2048&&vo(d,t);break;case 24:Xt(e,t,l,n),a&2048&&xo(t.alternate,t);break;default:Xt(e,t,l,n)}}function qn(e,t,l,n,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,d=t,p=l,b=n,R=d.flags;switch(d.tag){case 0:case 11:case 15:qn(s,d,p,b,a),Ra(8,d);break;case 23:break;case 22:var Y=d.stateNode;d.memoizedState!==null?Y._visibility&2?qn(s,d,p,b,a):La(s,d):(Y._visibility|=2,qn(s,d,p,b,a)),a&&R&2048&&vo(d.alternate,d);break;case 24:qn(s,d,p,b,a),a&&R&2048&&xo(d.alternate,d);break;default:qn(s,d,p,b,a)}t=t.sibling}}function La(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,a=n.flags;switch(n.tag){case 22:La(l,n),a&2048&&vo(n.alternate,n);break;case 24:La(l,n),a&2048&&xo(n.alternate,n);break;default:La(l,n)}t=t.sibling}}var Da=8192;function Yn(e,t,l){if(e.subtreeFlags&Da)for(e=e.child;e!==null;)hd(e,t,l),e=e.sibling}function hd(e,t,l){switch(e.tag){case 26:Yn(e,t,l),e.flags&Da&&e.memoizedState!==null&&Z0(l,Vt,e.memoizedState,e.memoizedProps);break;case 5:Yn(e,t,l);break;case 3:case 4:var n=Vt;Vt=us(e.stateNode.containerInfo),Yn(e,t,l),Vt=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Da,Da=16777216,Yn(e,t,l),Da=n):Yn(e,t,l));break;default:Yn(e,t,l)}}function md(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 Ua(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];Pe=n,gd(n,e)}md(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pd(e),e=e.sibling}function pd(e){switch(e.tag){case 0:case 11:case 15:Ua(e),e.flags&2048&&Ml(9,e,e.return);break;case 3:Ua(e);break;case 12:Ua(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fr(e)):Ua(e);break;default:Ua(e)}}function Fr(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];Pe=n,gd(n,e)}md(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ml(8,t,t.return),Fr(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Fr(t));break;default:Fr(t)}e=e.sibling}}function gd(e,t){for(;Pe!==null;){var l=Pe;switch(l.tag){case 0:case 11:case 15:Ml(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:ba(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,Pe=n;else e:for(l=e;Pe!==null;){n=Pe;var a=n.sibling,s=n.return;if(sd(n),n===l){Pe=null;break e}if(a!==null){a.return=s,Pe=a;break e}Pe=s}}}var o0={getCacheForType:function(e){var t=nt($e),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return nt($e).controller.signal}},c0=typeof WeakMap=="function"?WeakMap:Map,ke=0,Oe=null,ve=null,be=0,Te=0,kt=null,zl=!1,Vn=!1,bo=!1,ml=0,qe=0,Rl=0,cn=0,So=0,Nt=0,Xn=0,Ha=null,pt=null,_o=!1,Ir=0,yd=0,Pr=1/0,es=null,Ol=null,We=0,Ll=null,Gn=null,pl=0,Co=0,jo=null,vd=null,Ba=0,Eo=null;function Tt(){return(ke&2)!==0&&be!==0?be&-be:A.T!==null?Mo():Rc()}function xd(){if(Nt===0)if((be&536870912)===0||_e){var e=or;or<<=1,(or&3932160)===0&&(or=262144),Nt=e}else Nt=536870912;return e=Et.current,e!==null&&(e.flags|=32),Nt}function gt(e,t,l){(e===Oe&&(Te===2||Te===9)||e.cancelPendingCommit!==null)&&($n(e,0),Dl(e,be,Nt,!1)),sa(e,l),((ke&2)===0||e!==Oe)&&(e===Oe&&((ke&2)===0&&(cn|=l),qe===4&&Dl(e,be,Nt,!1)),Kt(e))}function bd(e,t,l){if((ke&6)!==0)throw Error(o(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||ra(e,t),a=n?d0(e,t):ko(e,t,!0),s=n;do{if(a===0){Vn&&!n&&Dl(e,t,0,!1);break}else{if(l=e.current.alternate,s&&!u0(l)){a=ko(e,t,!1),s=!1;continue}if(a===2){if(s=t,e.errorRecoveryDisabledLanes&s)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var p=e;a=Ha;var b=p.current.memoizedState.isDehydrated;if(b&&($n(p,d).flags|=256),d=ko(p,d,!1),d!==2){if(bo&&!b){p.errorRecoveryDisabledLanes|=s,cn|=s,a=4;break e}s=pt,pt=a,s!==null&&(pt===null?pt=s:pt.push.apply(pt,s))}a=d}if(s=!1,a!==2)continue}}if(a===1){$n(e,0),Dl(e,t,0,!0);break}e:{switch(n=e,s=a,s){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Dl(n,t,Nt,!zl);break e;case 2:pt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(a=Ir+300-bt(),10<a)){if(Dl(n,t,Nt,!zl),ur(n,0,!0)!==0)break e;pl=t,n.timeoutHandle=Fd(Sd.bind(null,n,l,pt,es,_o,t,Nt,cn,Xn,zl,s,"Throttled",-0,0),a);break e}Sd(n,l,pt,es,_o,t,Nt,cn,Xn,zl,s,null,-0,0)}}break}while(!0);Kt(e)}function Sd(e,t,l,n,a,s,d,p,b,R,Y,$,O,U){if(e.timeoutHandle=-1,$=t.subtreeFlags,$&8192||($&16785408)===16785408){$={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:el},hd(t,s,$);var ee=(s&62914560)===s?Ir-bt():(s&4194048)===s?yd-bt():0;if(ee=K0($,ee),ee!==null){pl=s,e.cancelPendingCommit=ee(Td.bind(null,e,t,s,l,n,a,d,p,b,Y,$,null,O,U)),Dl(e,s,d,!R);return}}Td(e,t,s,l,n,a,d,p,b)}function u0(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 a=l[n],s=a.getSnapshot;a=a.value;try{if(!Ct(s(),a))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 Dl(e,t,l,n){t&=~So,t&=~cn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var a=t;0<a;){var s=31-_t(a),d=1<<s;n[s]=-1,a&=~d}l!==0&&Ac(e,l,t)}function ts(){return(ke&6)===0?(qa(0),!1):!0}function wo(){if(ve!==null){if(Te===0)var e=ve.return;else e=ve,al=Pl=null,Yi(e),Ln=null,_a=0,e=ve;for(;e!==null;)If(e.alternate,e),e=e.return;ve=null}}function $n(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,A0(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),pl=0,wo(),Oe=e,ve=l=ll(e.current,null),be=t,Te=0,kt=null,zl=!1,Vn=ra(e,t),bo=!1,Xn=Nt=So=cn=Rl=qe=0,pt=Ha=null,_o=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-_t(n),s=1<<a;t|=e[a],n&=~s}return ml=t,_r(),l}function _d(e,t){fe=null,A.H=Aa,t===On||t===Ar?(t=Uu(),Te=3):t===Ti?(t=Uu(),Te=4):Te=t===no?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,kt=t,ve===null&&(qe=1,Gr(e,Rt(t,e.current)))}function Cd(){var e=Et.current;return e===null?!0:(be&4194048)===be?Ut===null:(be&62914560)===be||(be&536870912)!==0?e===Ut:!1}function jd(){var e=A.H;return A.H=Aa,e===null?Aa:e}function Ed(){var e=A.A;return A.A=o0,e}function ls(){qe=4,zl||(be&4194048)!==be&&Et.current!==null||(Vn=!0),(Rl&134217727)===0&&(cn&134217727)===0||Oe===null||Dl(Oe,be,Nt,!1)}function ko(e,t,l){var n=ke;ke|=2;var a=jd(),s=Ed();(Oe!==e||be!==t)&&(es=null,$n(e,t)),t=!1;var d=qe;e:do try{if(Te!==0&&ve!==null){var p=ve,b=kt;switch(Te){case 8:wo(),d=6;break e;case 3:case 2:case 9:case 6:Et.current===null&&(t=!0);var R=Te;if(Te=0,kt=null,Qn(e,p,b,R),l&&Vn){d=0;break e}break;default:R=Te,Te=0,kt=null,Qn(e,p,b,R)}}f0(),d=qe;break}catch(Y){_d(e,Y)}while(!0);return t&&e.shellSuspendCounter++,al=Pl=null,ke=n,A.H=a,A.A=s,ve===null&&(Oe=null,be=0,_r()),d}function f0(){for(;ve!==null;)wd(ve)}function d0(e,t){var l=ke;ke|=2;var n=jd(),a=Ed();Oe!==e||be!==t?(es=null,Pr=bt()+500,$n(e,t)):Vn=ra(e,t);e:do try{if(Te!==0&&ve!==null){t=ve;var s=kt;t:switch(Te){case 1:Te=0,kt=null,Qn(e,t,s,1);break;case 2:case 9:if(Lu(s)){Te=0,kt=null,kd(t);break}t=function(){Te!==2&&Te!==9||Oe!==e||(Te=7),Kt(e)},s.then(t,t);break e;case 3:Te=7;break e;case 4:Te=5;break e;case 7:Lu(s)?(Te=0,kt=null,kd(t)):(Te=0,kt=null,Qn(e,t,s,7));break;case 5:var d=null;switch(ve.tag){case 26:d=ve.memoizedState;case 5:case 27:var p=ve;if(d?dh(d):p.stateNode.complete){Te=0,kt=null;var b=p.sibling;if(b!==null)ve=b;else{var R=p.return;R!==null?(ve=R,ns(R)):ve=null}break t}}Te=0,kt=null,Qn(e,t,s,5);break;case 6:Te=0,kt=null,Qn(e,t,s,6);break;case 8:wo(),qe=6;break e;default:throw Error(o(462))}}h0();break}catch(Y){_d(e,Y)}while(!0);return al=Pl=null,A.H=n,A.A=a,ke=l,ve!==null?0:(Oe=null,be=0,_r(),qe)}function h0(){for(;ve!==null&&!Dm();)wd(ve)}function wd(e){var t=Wf(e.alternate,e,ml);e.memoizedProps=e.pendingProps,t===null?ns(e):ve=t}function kd(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Gf(l,t,t.pendingProps,t.type,void 0,be);break;case 11:t=Gf(l,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:Yi(t);default:If(l,t),t=ve=ju(t,ml),t=Wf(l,t,ml)}e.memoizedProps=e.pendingProps,t===null?ns(e):ve=t}function Qn(e,t,l,n){al=Pl=null,Yi(t),Ln=null,_a=0;var a=t.return;try{if(t0(e,a,t,l,be)){qe=1,Gr(e,Rt(l,e.current)),ve=null;return}}catch(s){if(a!==null)throw ve=a,s;qe=1,Gr(e,Rt(l,e.current)),ve=null;return}t.flags&32768?(_e||n===1?e=!0:Vn||(be&536870912)!==0?e=!1:(zl=e=!0,(n===2||n===9||n===3||n===6)&&(n=Et.current,n!==null&&n.tag===13&&(n.flags|=16384))),Nd(t,e)):ns(t)}function ns(e){var t=e;do{if((t.flags&32768)!==0){Nd(t,zl);return}e=t.return;var l=a0(t.alternate,t,ml);if(l!==null){ve=l;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);qe===0&&(qe=5)}function Nd(e,t){do{var l=r0(e.alternate,e);if(l!==null){l.flags&=32767,ve=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ve=e;return}ve=e=l}while(e!==null);qe=6,ve=null}function Td(e,t,l,n,a,s,d,p,b){e.cancelPendingCommit=null;do as();while(We!==0);if((ke&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(s=t.lanes|t.childLanes,s|=mi,Qm(e,l,s,d,p,b),e===Oe&&(ve=Oe=null,be=0),Gn=t,Ll=e,pl=l,Co=s,jo=a,vd=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,y0(sr,function(){return Od(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null,a=E.p,E.p=2,d=ke,ke|=4;try{s0(e,t,l)}finally{ke=d,E.p=a,A.T=n}}We=1,Ad(),Md(),zd()}}function Ad(){if(We===1){We=0;var e=Ll,t=Gn,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=A.T,A.T=null;var n=E.p;E.p=2;var a=ke;ke|=4;try{ud(t,e);var s=Bo,d=pu(e.containerInfo),p=s.focusedElem,b=s.selectionRange;if(d!==p&&p&&p.ownerDocument&&mu(p.ownerDocument.documentElement,p)){if(b!==null&&ci(p)){var R=b.start,Y=b.end;if(Y===void 0&&(Y=R),"selectionStart"in p)p.selectionStart=R,p.selectionEnd=Math.min(Y,p.value.length);else{var $=p.ownerDocument||document,O=$&&$.defaultView||window;if(O.getSelection){var U=O.getSelection(),ee=p.textContent.length,se=Math.min(b.start,ee),Re=b.end===void 0?se:Math.min(b.end,ee);!U.extend&&se>Re&&(d=Re,Re=se,se=d);var w=hu(p,se),j=hu(p,Re);if(w&&j&&(U.rangeCount!==1||U.anchorNode!==w.node||U.anchorOffset!==w.offset||U.focusNode!==j.node||U.focusOffset!==j.offset)){var M=$.createRange();M.setStart(w.node,w.offset),U.removeAllRanges(),se>Re?(U.addRange(M),U.extend(j.node,j.offset)):(M.setEnd(j.node,j.offset),U.addRange(M))}}}}for($=[],U=p;U=U.parentNode;)U.nodeType===1&&$.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<$.length;p++){var G=$[p];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}gs=!!Ho,Bo=Ho=null}finally{ke=a,E.p=n,A.T=l}}e.current=t,We=2}}function Md(){if(We===2){We=0;var e=Ll,t=Gn,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=A.T,A.T=null;var n=E.p;E.p=2;var a=ke;ke|=4;try{rd(e,t.alternate,t)}finally{ke=a,E.p=n,A.T=l}}We=3}}function zd(){if(We===4||We===3){We=0,Um();var e=Ll,t=Gn,l=pl,n=vd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?We=5:(We=0,Gn=Ll=null,Rd(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Ol=null),Gs(l),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(aa,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=A.T,a=E.p,E.p=2,A.T=null;try{for(var s=e.onRecoverableError,d=0;d<n.length;d++){var p=n[d];s(p.value,{componentStack:p.stack})}}finally{A.T=t,E.p=a}}(pl&3)!==0&&as(),Kt(e),a=e.pendingLanes,(l&261930)!==0&&(a&42)!==0?e===Eo?Ba++:(Ba=0,Eo=e):Ba=0,qa(0)}}function Rd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ba(t)))}function as(){return Ad(),Md(),zd(),Od()}function Od(){if(We!==5)return!1;var e=Ll,t=Co;Co=0;var l=Gs(pl),n=A.T,a=E.p;try{E.p=32>l?32:l,A.T=null,l=jo,jo=null;var s=Ll,d=pl;if(We=0,Gn=Ll=null,pl=0,(ke&6)!==0)throw Error(o(331));var p=ke;if(ke|=4,pd(s.current),dd(s,s.current,d,l),ke=p,qa(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(aa,s)}catch{}return!0}finally{E.p=a,A.T=n,Rd(e,t)}}function Ld(e,t,l){t=Rt(l,t),t=lo(e.stateNode,t,2),e=Nl(e,t,2),e!==null&&(sa(e,2),Kt(e))}function Ae(e,t,l){if(e.tag===3)Ld(e,e,l);else for(;t!==null;){if(t.tag===3){Ld(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ol===null||!Ol.has(n))){e=Rt(l,e),l=Df(2),n=Nl(t,l,2),n!==null&&(Uf(l,n,t,e),sa(n,2),Kt(n));break}}t=t.return}}function No(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new c0;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(l)||(bo=!0,a.add(l),e=m0.bind(null,e,t,l),t.then(e,e))}function m0(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Oe===e&&(be&l)===l&&(qe===4||qe===3&&(be&62914560)===be&&300>bt()-Ir?(ke&2)===0&&$n(e,0):So|=l,Xn===be&&(Xn=0)),Kt(e)}function Dd(e,t){t===0&&(t=Tc()),e=Wl(e,t),e!==null&&(sa(e,t),Kt(e))}function p0(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Dd(e,l)}function g0(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Dd(e,l)}function y0(e,t){return xt(e,t)}var rs=null,Zn=null,To=!1,ss=!1,Ao=!1,Ul=0;function Kt(e){e!==Zn&&e.next===null&&(Zn===null?rs=Zn=e:Zn=Zn.next=e),ss=!0,To||(To=!0,x0())}function qa(e,t){if(!Ao&&ss){Ao=!0;do for(var l=!1,n=rs;n!==null;){if(e!==0){var a=n.pendingLanes;if(a===0)var s=0;else{var d=n.suspendedLanes,p=n.pingedLanes;s=(1<<31-_t(42|e)+1)-1,s&=a&~(d&~p),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(l=!0,qd(n,s))}else s=be,s=ur(n,n===Oe?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(s&3)===0||ra(n,s)||(l=!0,qd(n,s));n=n.next}while(l);Ao=!1}}function v0(){Ud()}function Ud(){ss=To=!1;var e=0;Ul!==0&&T0()&&(e=Ul);for(var t=bt(),l=null,n=rs;n!==null;){var a=n.next,s=Hd(n,t);s===0?(n.next=null,l===null?rs=a:l.next=a,a===null&&(Zn=l)):(l=n,(e!==0||(s&3)!==0)&&(ss=!0)),n=a}We!==0&&We!==5||qa(e),Ul!==0&&(Ul=0)}function Hd(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var d=31-_t(s),p=1<<d,b=a[d];b===-1?((p&l)===0||(p&n)!==0)&&(a[d]=$m(p,t)):b<=t&&(e.expiredLanes|=p),s&=~p}if(t=Oe,l=be,l=ur(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(Te===2||Te===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Gl(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ra(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&Gl(n),Gs(l)){case 2:case 8:l=kc;break;case 32:l=sr;break;case 268435456:l=Nc;break;default:l=sr}return n=Bd.bind(null,e),l=xt(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&Gl(n),e.callbackPriority=2,e.callbackNode=null,2}function Bd(e,t){if(We!==0&&We!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(as()&&e.callbackNode!==l)return null;var n=be;return n=ur(e,e===Oe?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(bd(e,n,t),Hd(e,bt()),e.callbackNode!=null&&e.callbackNode===l?Bd.bind(null,e):null)}function qd(e,t){if(as())return null;bd(e,t,!0)}function x0(){M0(function(){(ke&6)!==0?xt(wc,v0):Ud()})}function Mo(){if(Ul===0){var e=zn;e===0&&(e=ir,ir<<=1,(ir&261888)===0&&(ir=256)),Ul=e}return Ul}function Yd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:mr(""+e)}function Vd(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 b0(e,t,l,n,a){if(t==="submit"&&l&&l.stateNode===a){var s=Yd((a[ut]||null).action),d=n.submitter;d&&(t=(t=d[ut]||null)?Yd(t.formAction):d.getAttribute("formAction"),t!==null&&(s=t,d=null));var p=new vr("action","action",null,n,a);e.push({event:p,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ul!==0){var b=d?Vd(a,d):new FormData(a);Wi(l,{pending:!0,data:b,method:a.method,action:s},null,b)}}else typeof s=="function"&&(p.preventDefault(),b=d?Vd(a,d):new FormData(a),Wi(l,{pending:!0,data:b,method:a.method,action:s},s,b))},currentTarget:a}]})}}for(var zo=0;zo<hi.length;zo++){var Ro=hi[zo],S0=Ro.toLowerCase(),_0=Ro[0].toUpperCase()+Ro.slice(1);Yt(S0,"on"+_0)}Yt(vu,"onAnimationEnd"),Yt(xu,"onAnimationIteration"),Yt(bu,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(Hp,"onTransitionRun"),Yt(Bp,"onTransitionStart"),Yt(qp,"onTransitionCancel"),Yt(Su,"onTransitionEnd"),vn("onMouseEnter",["mouseout","mouseover"]),vn("onMouseLeave",["mouseout","mouseover"]),vn("onPointerEnter",["pointerout","pointerover"]),vn("onPointerLeave",["pointerout","pointerover"]),Ql("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ql("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ql("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ql("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ql("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ql("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ya="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(" "),C0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ya));function Xd(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],a=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var d=n.length-1;0<=d;d--){var p=n[d],b=p.instance,R=p.currentTarget;if(p=p.listener,b!==s&&a.isPropagationStopped())break e;s=p,a.currentTarget=R;try{s(a)}catch(Y){Sr(Y)}a.currentTarget=null,s=b}else for(d=0;d<n.length;d++){if(p=n[d],b=p.instance,R=p.currentTarget,p=p.listener,b!==s&&a.isPropagationStopped())break e;s=p,a.currentTarget=R;try{s(a)}catch(Y){Sr(Y)}a.currentTarget=null,s=b}}}}function xe(e,t){var l=t[$s];l===void 0&&(l=t[$s]=new Set);var n=e+"__bubble";l.has(n)||(Gd(t,e,2,!1),l.add(n))}function Oo(e,t,l){var n=0;t&&(n|=4),Gd(l,e,n,t)}var is="_reactListening"+Math.random().toString(36).slice(2);function Lo(e){if(!e[is]){e[is]=!0,Dc.forEach(function(l){l!=="selectionchange"&&(C0.has(l)||Oo(l,!1,e),Oo(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[is]||(t[is]=!0,Oo("selectionchange",!1,t))}}function Gd(e,t,l,n){switch(xh(t)){case 2:var a=F0;break;case 8:a=I0;break;default:a=Wo}l=a.bind(null,t,l,e),a=void 0,!ei||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,l,{capture:!0,passive:a}):e.addEventListener(t,l,!0):a!==void 0?e.addEventListener(t,l,{passive:a}):e.addEventListener(t,l,!1)}function Do(e,t,l,n,a){var s=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var p=n.stateNode.containerInfo;if(p===a)break;if(d===4)for(d=n.return;d!==null;){var b=d.tag;if((b===3||b===4)&&d.stateNode.containerInfo===a)return;d=d.return}for(;p!==null;){if(d=pn(p),d===null)return;if(b=d.tag,b===5||b===6||b===26||b===27){n=s=d;continue e}p=p.parentNode}}n=n.return}Kc(function(){var R=s,Y=Is(l),$=[];e:{var O=_u.get(e);if(O!==void 0){var U=vr,ee=e;switch(e){case"keypress":if(gr(l)===0)break e;case"keydown":case"keyup":U=gp;break;case"focusin":ee="focus",U=ai;break;case"focusout":ee="blur",U=ai;break;case"beforeblur":case"afterblur":U=ai;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":U=Fc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=ap;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=xp;break;case vu:case xu:case bu:U=ip;break;case Su:U=Sp;break;case"scroll":case"scrollend":U=lp;break;case"wheel":U=Cp;break;case"copy":case"cut":case"paste":U=cp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=Pc;break;case"toggle":case"beforetoggle":U=Ep}var se=(t&4)!==0,Re=!se&&(e==="scroll"||e==="scrollend"),w=se?O!==null?O+"Capture":null:O;se=[];for(var j=R,M;j!==null;){var G=j;if(M=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||M===null||w===null||(G=ca(j,w),G!=null&&se.push(Va(j,G,M))),Re)break;j=j.return}0<se.length&&(O=new U(O,ee,null,l,Y),$.push({event:O,listeners:se}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",O&&l!==Fs&&(ee=l.relatedTarget||l.fromElement)&&(pn(ee)||ee[mn]))break e;if((U||O)&&(O=Y.window===Y?Y:(O=Y.ownerDocument)?O.defaultView||O.parentWindow:window,U?(ee=l.relatedTarget||l.toElement,U=R,ee=ee?pn(ee):null,ee!==null&&(Re=h(ee),se=ee.tag,ee!==Re||se!==5&&se!==27&&se!==6)&&(ee=null)):(U=null,ee=R),U!==ee)){if(se=Fc,G="onMouseLeave",w="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(se=Pc,G="onPointerLeave",w="onPointerEnter",j="pointer"),Re=U==null?O:oa(U),M=ee==null?O:oa(ee),O=new se(G,j+"leave",U,l,Y),O.target=Re,O.relatedTarget=M,G=null,pn(Y)===R&&(se=new se(w,j+"enter",ee,l,Y),se.target=M,se.relatedTarget=Re,G=se),Re=G,U&&ee)t:{for(se=j0,w=U,j=ee,M=0,G=w;G;G=se(G))M++;G=0;for(var ae=j;ae;ae=se(ae))G++;for(;0<M-G;)w=se(w),M--;for(;0<G-M;)j=se(j),G--;for(;M--;){if(w===j||j!==null&&w===j.alternate){se=w;break t}w=se(w),j=se(j)}se=null}else se=null;U!==null&&$d($,O,U,se,!1),ee!==null&&Re!==null&&$d($,Re,ee,se,!0)}}e:{if(O=R?oa(R):window,U=O.nodeName&&O.nodeName.toLowerCase(),U==="select"||U==="input"&&O.type==="file")var je=iu;else if(ru(O))if(ou)je=Lp;else{je=Rp;var te=zp}else U=O.nodeName,!U||U.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?R&&Ws(R.elementType)&&(je=iu):je=Op;if(je&&(je=je(e,R))){su($,je,l,Y);break e}te&&te(e,O,R),e==="focusout"&&R&&O.type==="number"&&R.memoizedProps.value!=null&&Js(O,"number",O.value)}switch(te=R?oa(R):window,e){case"focusin":(ru(te)||te.contentEditable==="true")&&(jn=te,ui=R,ya=null);break;case"focusout":ya=ui=jn=null;break;case"mousedown":fi=!0;break;case"contextmenu":case"mouseup":case"dragend":fi=!1,gu($,l,Y);break;case"selectionchange":if(Up)break;case"keydown":case"keyup":gu($,l,Y)}var me;if(si)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Cn?nu(e,l)&&(Se="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Se="onCompositionStart");Se&&(eu&&l.locale!=="ko"&&(Cn||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Cn&&(me=Jc()):(Sl=Y,ti="value"in Sl?Sl.value:Sl.textContent,Cn=!0)),te=os(R,Se),0<te.length&&(Se=new Ic(Se,e,null,l,Y),$.push({event:Se,listeners:te}),me?Se.data=me:(me=au(l),me!==null&&(Se.data=me)))),(me=kp?Np(e,l):Tp(e,l))&&(Se=os(R,"onBeforeInput"),0<Se.length&&(te=new Ic("onBeforeInput","beforeinput",null,l,Y),$.push({event:te,listeners:Se}),te.data=me)),b0($,e,R,l,Y)}Xd($,t)})}function Va(e,t,l){return{instance:e,listener:t,currentTarget:l}}function os(e,t){for(var l=t+"Capture",n=[];e!==null;){var a=e,s=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||s===null||(a=ca(e,l),a!=null&&n.unshift(Va(e,a,s)),a=ca(e,t),a!=null&&n.push(Va(e,a,s))),e.tag===3)return n;e=e.return}return[]}function j0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $d(e,t,l,n,a){for(var s=t._reactName,d=[];l!==null&&l!==n;){var p=l,b=p.alternate,R=p.stateNode;if(p=p.tag,b!==null&&b===n)break;p!==5&&p!==26&&p!==27||R===null||(b=R,a?(R=ca(l,s),R!=null&&d.unshift(Va(l,R,b))):a||(R=ca(l,s),R!=null&&d.push(Va(l,R,b)))),l=l.return}d.length!==0&&e.push({event:t,listeners:d})}var E0=/\r\n?/g,w0=/\u0000|\uFFFD/g;function Qd(e){return(typeof e=="string"?e:""+e).replace(E0,`
|
|
9
|
+
`).replace(w0,"")}function Zd(e,t){return t=Qd(t),Qd(e)===t}function ze(e,t,l,n,a,s){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||bn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&bn(e,""+n);break;case"className":dr(e,"class",n);break;case"tabIndex":dr(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":dr(e,l,n);break;case"style":Qc(e,n,s);break;case"data":if(t!=="object"){dr(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=mr(""+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 s=="function"&&(l==="formAction"?(t!=="input"&&ze(e,t,"name",a.name,a,null),ze(e,t,"formEncType",a.formEncType,a,null),ze(e,t,"formMethod",a.formMethod,a,null),ze(e,t,"formTarget",a.formTarget,a,null)):(ze(e,t,"encType",a.encType,a,null),ze(e,t,"method",a.method,a,null),ze(e,t,"target",a.target,a,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=mr(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=el);break;case"onScroll":n!=null&&xe("scroll",e);break;case"onScrollEnd":n!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(o(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=mr(""+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":xe("beforetoggle",e),xe("toggle",e),fr(e,"popover",n);break;case"xlinkActuate":Pt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Pt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Pt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Pt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Pt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Pt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Pt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":fr(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=ep.get(l)||l,fr(e,l,n))}}function Uo(e,t,l,n,a,s){switch(l){case"style":Qc(e,n,s);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof n=="string"?bn(e,n):(typeof n=="number"||typeof n=="bigint")&&bn(e,""+n);break;case"onScroll":n!=null&&xe("scroll",e);break;case"onScrollEnd":n!=null&&xe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=el);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Uc.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(a=l.endsWith("Capture"),t=l.slice(2,a?l.length-7:void 0),s=e[ut]||null,s=s!=null?s[l]:null,typeof s=="function"&&e.removeEventListener(t,s,a),typeof n=="function")){typeof s!="function"&&s!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,a);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):fr(e,l,n)}}}function rt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var n=!1,a=!1,s;for(s in l)if(l.hasOwnProperty(s)){var d=l[s];if(d!=null)switch(s){case"src":n=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ze(e,t,s,d,l,null)}}a&&ze(e,t,"srcSet",l.srcSet,l,null),n&&ze(e,t,"src",l.src,l,null);return;case"input":xe("invalid",e);var p=s=d=a=null,b=null,R=null;for(n in l)if(l.hasOwnProperty(n)){var Y=l[n];if(Y!=null)switch(n){case"name":a=Y;break;case"type":d=Y;break;case"checked":b=Y;break;case"defaultChecked":R=Y;break;case"value":s=Y;break;case"defaultValue":p=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:ze(e,t,n,Y,l,null)}}Vc(e,s,p,b,R,d,a,!1);return;case"select":xe("invalid",e),n=d=s=null;for(a in l)if(l.hasOwnProperty(a)&&(p=l[a],p!=null))switch(a){case"value":s=p;break;case"defaultValue":d=p;break;case"multiple":n=p;default:ze(e,t,a,p,l,null)}t=s,l=d,e.multiple=!!n,t!=null?xn(e,!!n,t,!1):l!=null&&xn(e,!!n,l,!0);return;case"textarea":xe("invalid",e),s=a=n=null;for(d in l)if(l.hasOwnProperty(d)&&(p=l[d],p!=null))switch(d){case"value":n=p;break;case"defaultValue":a=p;break;case"children":s=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:ze(e,t,d,p,l,null)}Gc(e,n,a,s);return;case"option":for(b in l)l.hasOwnProperty(b)&&(n=l[b],n!=null)&&(b==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":ze(e,t,b,n,l,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(n=0;n<Ya.length;n++)xe(Ya[n],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("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(R in l)if(l.hasOwnProperty(R)&&(n=l[R],n!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ze(e,t,R,n,l,null)}return;default:if(Ws(t)){for(Y in l)l.hasOwnProperty(Y)&&(n=l[Y],n!==void 0&&Uo(e,t,Y,n,l,void 0));return}}for(p in l)l.hasOwnProperty(p)&&(n=l[p],n!=null&&ze(e,t,p,n,l,null))}function k0(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 a=null,s=null,d=null,p=null,b=null,R=null,Y=null;for(U in l){var $=l[U];if(l.hasOwnProperty(U)&&$!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":b=$;default:n.hasOwnProperty(U)||ze(e,t,U,null,n,$)}}for(var O in n){var U=n[O];if($=l[O],n.hasOwnProperty(O)&&(U!=null||$!=null))switch(O){case"type":s=U;break;case"name":a=U;break;case"checked":R=U;break;case"defaultChecked":Y=U;break;case"value":d=U;break;case"defaultValue":p=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(137,t));break;default:U!==$&&ze(e,t,O,U,n,$)}}Ks(e,d,p,b,R,Y,s,a);return;case"select":U=d=p=O=null;for(s in l)if(b=l[s],l.hasOwnProperty(s)&&b!=null)switch(s){case"value":break;case"multiple":U=b;default:n.hasOwnProperty(s)||ze(e,t,s,null,n,b)}for(a in n)if(s=n[a],b=l[a],n.hasOwnProperty(a)&&(s!=null||b!=null))switch(a){case"value":O=s;break;case"defaultValue":p=s;break;case"multiple":d=s;default:s!==b&&ze(e,t,a,s,n,b)}t=p,l=d,n=U,O!=null?xn(e,!!l,O,!1):!!n!=!!l&&(t!=null?xn(e,!!l,t,!0):xn(e,!!l,l?[]:"",!1));return;case"textarea":U=O=null;for(p in l)if(a=l[p],l.hasOwnProperty(p)&&a!=null&&!n.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:ze(e,t,p,null,n,a)}for(d in n)if(a=n[d],s=l[d],n.hasOwnProperty(d)&&(a!=null||s!=null))switch(d){case"value":O=a;break;case"defaultValue":U=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(o(91));break;default:a!==s&&ze(e,t,d,a,n,s)}Xc(e,O,U);return;case"option":for(var ee in l)O=l[ee],l.hasOwnProperty(ee)&&O!=null&&!n.hasOwnProperty(ee)&&(ee==="selected"?e.selected=!1:ze(e,t,ee,null,n,O));for(b in n)O=n[b],U=l[b],n.hasOwnProperty(b)&&O!==U&&(O!=null||U!=null)&&(b==="selected"?e.selected=O&&typeof O!="function"&&typeof O!="symbol":ze(e,t,b,O,n,U));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 se in l)O=l[se],l.hasOwnProperty(se)&&O!=null&&!n.hasOwnProperty(se)&&ze(e,t,se,null,n,O);for(R in n)if(O=n[R],U=l[R],n.hasOwnProperty(R)&&O!==U&&(O!=null||U!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(137,t));break;default:ze(e,t,R,O,n,U)}return;default:if(Ws(t)){for(var Re in l)O=l[Re],l.hasOwnProperty(Re)&&O!==void 0&&!n.hasOwnProperty(Re)&&Uo(e,t,Re,void 0,n,O);for(Y in n)O=n[Y],U=l[Y],!n.hasOwnProperty(Y)||O===U||O===void 0&&U===void 0||Uo(e,t,Y,O,n,U);return}}for(var w in l)O=l[w],l.hasOwnProperty(w)&&O!=null&&!n.hasOwnProperty(w)&&ze(e,t,w,null,n,O);for($ in n)O=n[$],U=l[$],!n.hasOwnProperty($)||O===U||O==null&&U==null||ze(e,t,$,O,n,U)}function Kd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function N0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var a=l[n],s=a.transferSize,d=a.initiatorType,p=a.duration;if(s&&p&&Kd(d)){for(d=0,p=a.responseEnd,n+=1;n<l.length;n++){var b=l[n],R=b.startTime;if(R>p)break;var Y=b.transferSize,$=b.initiatorType;Y&&Kd($)&&(b=b.responseEnd,d+=Y*(b<p?1:(p-R)/(b-R)))}if(--n,t+=8*(s+d)/(a.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 Ho=null,Bo=null;function cs(e){return e.nodeType===9?e:e.ownerDocument}function Jd(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 Wd(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 qo(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 Yo=null;function T0(){var e=window.event;return e&&e.type==="popstate"?e===Yo?!1:(Yo=e,!0):(Yo=null,!1)}var Fd=typeof setTimeout=="function"?setTimeout:void 0,A0=typeof clearTimeout=="function"?clearTimeout:void 0,Id=typeof Promise=="function"?Promise:void 0,M0=typeof queueMicrotask=="function"?queueMicrotask:typeof Id<"u"?function(e){return Id.resolve(null).then(e).catch(z0)}:Fd;function z0(e){setTimeout(function(){throw e})}function Hl(e){return e==="head"}function Pd(e,t){var l=t,n=0;do{var a=l.nextSibling;if(e.removeChild(l),a&&a.nodeType===8)if(l=a.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(a),Fn(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Xa(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Xa(l);for(var s=l.firstChild;s;){var d=s.nextSibling,p=s.nodeName;s[ia]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&s.rel.toLowerCase()==="stylesheet"||l.removeChild(s),s=d}}else l==="body"&&Xa(e.ownerDocument.body);l=a}while(l);Fn(t)}function eh(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 Vo(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":Vo(l),Qs(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function R0(e,t,l,n){for(;e.nodeType===1;){var a=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[ia])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Ht(e.nextSibling),e===null)break}return null}function O0(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Ht(e.nextSibling),e===null))return null;return e}function th(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function Xo(e){return e.data==="$?"||e.data==="$~"}function Go(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function L0(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 Ht(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 $o=null;function lh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Ht(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function nh(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 ah(e,t,l){switch(t=cs(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Xa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qs(e)}var Bt=new Map,rh=new Set;function us(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gl=E.d;E.d={f:D0,r:U0,D:H0,C:B0,L:q0,m:Y0,X:X0,S:V0,M:G0};function D0(){var e=gl.f(),t=ts();return e||t}function U0(e){var t=gn(e);t!==null&&t.tag===5&&t.type==="form"?_f(t):gl.r(e)}var Kn=typeof document>"u"?null:document;function sh(e,t,l){var n=Kn;if(n&&typeof t=="string"&&t){var a=Mt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),rh.has(a)||(rh.add(a),e={rel:e,crossOrigin:l,href:t},n.querySelector(a)===null&&(t=n.createElement("link"),rt(t,"link",e),Ie(t),n.head.appendChild(t)))}}function H0(e){gl.D(e),sh("dns-prefetch",e,null)}function B0(e,t){gl.C(e,t),sh("preconnect",e,t)}function q0(e,t,l){gl.L(e,t,l);var n=Kn;if(n&&e&&t){var a='link[rel="preload"][as="'+Mt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+Mt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+Mt(l.imageSizes)+'"]')):a+='[href="'+Mt(e)+'"]';var s=a;switch(t){case"style":s=Jn(e);break;case"script":s=Wn(e)}Bt.has(s)||(e=x({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Bt.set(s,e),n.querySelector(a)!==null||t==="style"&&n.querySelector(Ga(s))||t==="script"&&n.querySelector($a(s))||(t=n.createElement("link"),rt(t,"link",e),Ie(t),n.head.appendChild(t)))}}function Y0(e,t){gl.m(e,t);var l=Kn;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Mt(n)+'"][href="'+Mt(e)+'"]',s=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Wn(e)}if(!Bt.has(s)&&(e=x({rel:"modulepreload",href:e},t),Bt.set(s,e),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector($a(s)))return}n=l.createElement("link"),rt(n,"link",e),Ie(n),l.head.appendChild(n)}}}function V0(e,t,l){gl.S(e,t,l);var n=Kn;if(n&&e){var a=yn(n).hoistableStyles,s=Jn(e);t=t||"default";var d=a.get(s);if(!d){var p={loading:0,preload:null};if(d=n.querySelector(Ga(s)))p.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Bt.get(s))&&Qo(e,l);var b=d=n.createElement("link");Ie(b),rt(b,"link",e),b._p=new Promise(function(R,Y){b.onload=R,b.onerror=Y}),b.addEventListener("load",function(){p.loading|=1}),b.addEventListener("error",function(){p.loading|=2}),p.loading|=4,fs(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:p},a.set(s,d)}}}function X0(e,t){gl.X(e,t);var l=Kn;if(l&&e){var n=yn(l).hoistableScripts,a=Wn(e),s=n.get(a);s||(s=l.querySelector($a(a)),s||(e=x({src:e,async:!0},t),(t=Bt.get(a))&&Zo(e,t),s=l.createElement("script"),Ie(s),rt(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function G0(e,t){gl.M(e,t);var l=Kn;if(l&&e){var n=yn(l).hoistableScripts,a=Wn(e),s=n.get(a);s||(s=l.querySelector($a(a)),s||(e=x({src:e,async:!0,type:"module"},t),(t=Bt.get(a))&&Zo(e,t),s=l.createElement("script"),Ie(s),rt(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function ih(e,t,l,n){var a=(a=ue.current)?us(a):null;if(!a)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Jn(l.href),l=yn(a).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=Jn(l.href);var s=yn(a).hoistableStyles,d=s.get(e);if(d||(a=a.ownerDocument||a,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,d),(s=a.querySelector(Ga(e)))&&!s._p&&(d.instance=s,d.state.loading=5),Bt.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},Bt.set(e,l),s||$0(a,e,l,d.state))),t&&n===null)throw Error(o(528,""));return d}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wn(l),l=yn(a).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(o(444,e))}}function Jn(e){return'href="'+Mt(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function oh(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function $0(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}),rt(t,"link",l),Ie(t),e.head.appendChild(t))}function Wn(e){return'[src="'+Mt(e)+'"]'}function $a(e){return"script[async]"+e}function ch(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Mt(l.href)+'"]');if(n)return t.instance=n,Ie(n),n;var a=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Ie(n),rt(n,"style",a),fs(n,l.precedence,e),t.instance=n;case"stylesheet":a=Jn(l.href);var s=e.querySelector(Ga(a));if(s)return t.state.loading|=4,t.instance=s,Ie(s),s;n=oh(l),(a=Bt.get(a))&&Qo(n,a),s=(e.ownerDocument||e).createElement("link"),Ie(s);var d=s;return d._p=new Promise(function(p,b){d.onload=p,d.onerror=b}),rt(s,"link",n),t.state.loading|=4,fs(s,l.precedence,e),t.instance=s;case"script":return s=Wn(l.src),(a=e.querySelector($a(s)))?(t.instance=a,Ie(a),a):(n=l,(a=Bt.get(s))&&(n=x({},l),Zo(n,a)),e=e.ownerDocument||e,a=e.createElement("script"),Ie(a),rt(a,"link",n),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,fs(n,l.precedence,e));return t.instance}function fs(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,s=a,d=0;d<n.length;d++){var p=n[d];if(p.dataset.precedence===t)s=p;else if(s!==a)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Qo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ds=null;function uh(e,t,l){if(ds===null){var n=new Map,a=ds=new Map;a.set(l,n)}else a=ds,n=a.get(l),n||(n=new Map,a.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),a=0;a<l.length;a++){var s=l[a];if(!(s[ia]||s[tt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var d=s.getAttribute(t)||"";d=e+d;var p=n.get(d);p?p.push(s):n.set(d,[s])}}return n}function fh(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Q0(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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 dh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Z0(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 a=Jn(n.href),s=t.querySelector(Ga(a));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hs.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=s,Ie(s);return}s=t.ownerDocument||t,n=oh(n),(a=Bt.get(a))&&Qo(n,a),s=s.createElement("link"),Ie(s);var d=s;d._p=new Promise(function(p,b){d.onload=p,d.onerror=b}),rt(s,"link",n),l.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=hs.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Ko=0;function K0(e,t){return e.stylesheets&&e.count===0&&ps(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&ps(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Ko===0&&(Ko=62500*N0());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ps(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Ko?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function hs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ps(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ms=null;function ps(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ms=new Map,t.forEach(J0,e),ms=null,hs.call(e))}function J0(e,t){if(!(t.state.loading&4)){var l=ms.get(e);if(l)var n=l.get(null);else{l=new Map,ms.set(e,l);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var d=a[s];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(l.set(d.dataset.precedence,d),n=d)}n&&l.set(null,n)}a=t.instance,d=a.getAttribute("data-precedence"),s=l.get(d)||n,s===n&&l.set(null,a),l.set(d,a),this.count++,n=hs.bind(this),a.addEventListener("load",n),a.addEventListener("error",n),s?s.parentNode.insertBefore(a,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Qa={$$typeof:V,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function W0(e,t,l,n,a,s,d,p,b){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=Vs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vs(0),this.hiddenUpdates=Vs(null),this.identifierPrefix=n,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function hh(e,t,l,n,a,s,d,p,b,R,Y,$){return e=new W0(e,t,l,d,b,R,Y,$,p),t=1,s===!0&&(t|=24),s=jt(3,null,null,t),e.current=s,s.stateNode=e,t=wi(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:n,isDehydrated:l,cache:t},Ai(s),e}function mh(e){return e?(e=kn,e):kn}function ph(e,t,l,n,a,s){a=mh(a),n.context===null?n.context=a:n.pendingContext=a,n=kl(t),n.payload={element:l},s=s===void 0?null:s,s!==null&&(n.callback=s),l=Nl(e,n,t),l!==null&&(gt(l,e,t),ja(l,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Jo(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function yh(e){if(e.tag===13||e.tag===31){var t=Wl(e,67108864);t!==null&>(t,e,67108864),Jo(e,67108864)}}function vh(e){if(e.tag===13||e.tag===31){var t=Tt();t=Xs(t);var l=Wl(e,t);l!==null&>(l,e,t),Jo(e,t)}}var gs=!0;function F0(e,t,l,n){var a=A.T;A.T=null;var s=E.p;try{E.p=2,Wo(e,t,l,n)}finally{E.p=s,A.T=a}}function I0(e,t,l,n){var a=A.T;A.T=null;var s=E.p;try{E.p=8,Wo(e,t,l,n)}finally{E.p=s,A.T=a}}function Wo(e,t,l,n){if(gs){var a=Fo(n);if(a===null)Do(e,t,n,ys,l),bh(e,n);else if(eg(a,e,t,l,n))n.stopPropagation();else if(bh(e,n),t&4&&-1<P0.indexOf(e)){for(;a!==null;){var s=gn(a);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var d=$l(s.pendingLanes);if(d!==0){var p=s;for(p.pendingLanes|=2,p.entangledLanes|=2;d;){var b=1<<31-_t(d);p.entanglements[1]|=b,d&=~b}Kt(s),(ke&6)===0&&(Pr=bt()+500,qa(0))}}break;case 31:case 13:p=Wl(s,2),p!==null&>(p,s,2),ts(),Jo(s,2)}if(s=Fo(n),s===null&&Do(e,t,n,ys,l),s===a)break;a=s}a!==null&&n.stopPropagation()}else Do(e,t,n,null,l)}}function Fo(e){return e=Is(e),Io(e)}var ys=null;function Io(e){if(ys=null,e=pn(e),e!==null){var t=h(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=m(t),e!==null)return e;e=null}else if(l===31){if(e=y(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 ys=e,null}function xh(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(Hm()){case wc:return 2;case kc:return 8;case sr:case Bm:return 32;case Nc:return 268435456;default:return 32}default:return 32}}var Po=!1,Bl=null,ql=null,Yl=null,Za=new Map,Ka=new Map,Vl=[],P0="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 bh(e,t){switch(e){case"focusin":case"focusout":Bl=null;break;case"dragenter":case"dragleave":ql=null;break;case"mouseover":case"mouseout":Yl=null;break;case"pointerover":case"pointerout":Za.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ka.delete(t.pointerId)}}function Ja(e,t,l,n,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:s,targetContainers:[a]},t!==null&&(t=gn(t),t!==null&&yh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function eg(e,t,l,n,a){switch(t){case"focusin":return Bl=Ja(Bl,e,t,l,n,a),!0;case"dragenter":return ql=Ja(ql,e,t,l,n,a),!0;case"mouseover":return Yl=Ja(Yl,e,t,l,n,a),!0;case"pointerover":var s=a.pointerId;return Za.set(s,Ja(Za.get(s)||null,e,t,l,n,a)),!0;case"gotpointercapture":return s=a.pointerId,Ka.set(s,Ja(Ka.get(s)||null,e,t,l,n,a)),!0}return!1}function Sh(e){var t=pn(e.target);if(t!==null){var l=h(t);if(l!==null){if(t=l.tag,t===13){if(t=m(l),t!==null){e.blockedOn=t,Oc(e.priority,function(){vh(l)});return}}else if(t===31){if(t=y(l),t!==null){e.blockedOn=t,Oc(e.priority,function(){vh(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 vs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Fo(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);Fs=n,l.target.dispatchEvent(n),Fs=null}else return t=gn(l),t!==null&&yh(t),e.blockedOn=l,!1;t.shift()}return!0}function _h(e,t,l){vs(e)&&l.delete(t)}function tg(){Po=!1,Bl!==null&&vs(Bl)&&(Bl=null),ql!==null&&vs(ql)&&(ql=null),Yl!==null&&vs(Yl)&&(Yl=null),Za.forEach(_h),Ka.forEach(_h)}function xs(e,t){e.blockedOn===t&&(e.blockedOn=null,Po||(Po=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,tg)))}var bs=null;function Ch(e){bs!==e&&(bs=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){bs===e&&(bs=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],a=e[t+2];if(typeof n!="function"){if(Io(n||l)===null)continue;break}var s=gn(l);s!==null&&(e.splice(t,3),t-=3,Wi(s,{pending:!0,data:a,method:l.method,action:n},n,a))}}))}function Fn(e){function t(b){return xs(b,e)}Bl!==null&&xs(Bl,e),ql!==null&&xs(ql,e),Yl!==null&&xs(Yl,e),Za.forEach(t),Ka.forEach(t);for(var l=0;l<Vl.length;l++){var n=Vl[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Vl.length&&(l=Vl[0],l.blockedOn===null);)Sh(l),l.blockedOn===null&&Vl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var a=l[n],s=l[n+1],d=a[ut]||null;if(typeof s=="function")d||Ch(l);else if(d){var p=null;if(s&&s.hasAttribute("formAction")){if(a=s,d=s[ut]||null)p=d.formAction;else if(Io(a)!==null)continue}else p=d.action;typeof p=="function"?l[n+1]=p:(l.splice(n,3),n-=3),Ch(l)}}}function jh(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(d){return a=d})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,a=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),a!==null&&(a(),a=null)}}}function ec(e){this._internalRoot=e}Ss.prototype.render=ec.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,n=Tt();ph(l,n,e,t,null,null)},Ss.prototype.unmount=ec.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),ts(),t[mn]=null}};function Ss(e){this._internalRoot=e}Ss.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rc();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Vl.length&&t!==0&&t<Vl[l].priority;l++);Vl.splice(l,0,e),l===0&&Sh(e)}};var Eh=c.version;if(Eh!=="19.2.3")throw Error(o(527,Eh,"19.2.3"));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var lg={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_s.isDisabled&&_s.supportsFiber)try{aa=_s.inject(lg),St=_s}catch{}}return Fa.createRoot=function(e,t){if(!f(e))throw Error(o(299));var l=!1,n="",a=zf,s=Rf,d=Of;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=hh(e,1,!1,null,null,l,n,null,a,s,d,jh),e[mn]=t.current,Lo(e),new ec(t)},Fa.hydrateRoot=function(e,t,l){if(!f(e))throw Error(o(299));var n=!1,a="",s=zf,d=Rf,p=Of,b=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(a=l.identifierPrefix),l.onUncaughtError!==void 0&&(s=l.onUncaughtError),l.onCaughtError!==void 0&&(d=l.onCaughtError),l.onRecoverableError!==void 0&&(p=l.onRecoverableError),l.formState!==void 0&&(b=l.formState)),t=hh(e,1,!0,t,l??null,n,a,b,s,d,p,jh),t.context=mh(null),l=t.current,n=Tt(),n=Xs(n),a=kl(n),a.callback=null,Nl(l,a,n),l=n,t.current.lanes=l,sa(t,l),Kt(t),e[mn]=t.current,Lo(e),new Ss(t)},Fa.version="19.2.3",Fa}var Lh;function hg(){if(Lh)return nc.exports;Lh=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(c){console.error(c)}}return r(),nc.exports=dg(),nc.exports}var mg=hg();const Dh=r=>{let c;const i=new Set,o=(g,S)=>{const x=typeof g=="function"?g(c):g;if(!Object.is(x,c)){const z=c;c=S??(typeof x!="object"||x===null)?x:Object.assign({},c,x),i.forEach(Z=>Z(c,z))}},f=()=>c,y={setState:o,getState:f,getInitialState:()=>v,subscribe:g=>(i.add(g),()=>i.delete(g))},v=c=r(o,f,y);return y},pg=(r=>r?Dh(r):Dh),gg=r=>r;function yg(r,c=gg){const i=Cs.useSyncExternalStore(r.subscribe,Cs.useCallback(()=>c(r.getState()),[r,c]),Cs.useCallback(()=>c(r.getInitialState()),[r,c]));return Cs.useDebugValue(i),i}const Uh=r=>{const c=pg(r),i=o=>yg(c,o);return Object.assign(i,c),i},Pa=(r=>r?Uh(r):Uh),im=Pa((r,c)=>({logs:[],isEnabled:localStorage.getItem("refchecker_debug")==="true",isVisible:!1,filter:"all",addLog:(i,o,f,h=null)=>{if(!c().isEnabled)return;const m={id:Date.now()+Math.random(),timestamp:new Date().toISOString(),level:i,component:o,message:f,data:h?JSON.stringify(h,null,2):null};r(y=>({logs:[...y.logs.slice(-499),m]}))},toggleEnabled:()=>{r(i=>{const o=!i.isEnabled;return localStorage.setItem("refchecker_debug",o.toString()),{isEnabled:o}})},toggleVisible:()=>{r(i=>({isVisible:!i.isVisible}))},setFilter:i=>{r({filter:i})},clearLogs:()=>{r({logs:[]})},getFilteredLogs:()=>{const{logs:i,filter:o}=c();return o==="all"?i:i.filter(f=>f.level.toLowerCase()===o)}})),om={DEBUG:0,INFO:1,WARN:2,ERROR:3},vg=om.DEBUG;function js(){return new Date().toISOString()}function Es(r){return om[r]>=vg}function ws(r,c,i,o){try{im.getState().addLog(r,c,i,o)}catch{}}const D={debug(r,c,i=null){if(!Es("DEBUG"))return;const o=js();ws("DEBUG",r,c,i),i?console.debug(`[${o}] [DEBUG] [${r}] ${c}`,i):console.debug(`[${o}] [DEBUG] [${r}] ${c}`)},info(r,c,i=null){if(!Es("INFO"))return;const o=js();ws("INFO",r,c,i),i?console.info(`[${o}] [INFO] [${r}] ${c}`,i):console.info(`[${o}] [INFO] [${r}] ${c}`)},warn(r,c,i=null){if(!Es("WARN"))return;const o=js();ws("WARN",r,c,i),i?console.warn(`[${o}] [WARN] [${r}] ${c}`,i):console.warn(`[${o}] [WARN] [${r}] ${c}`)},error(r,c,i=null){if(!Es("ERROR"))return;const o=js();ws("ERROR",r,c,i),i?console.error(`[${o}] [ERROR] [${r}] ${c}`,i):console.error(`[${o}] [ERROR] [${r}] ${c}`)}};function cm(r,c){return function(){return r.apply(c,arguments)}}const{toString:xg}=Object.prototype,{getPrototypeOf:Sc}=Object,{iterator:Ds,toStringTag:um}=Symbol,Us=(r=>c=>{const i=xg.call(c);return r[i]||(r[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Gt=r=>(r=r.toLowerCase(),c=>Us(c)===r),Hs=r=>c=>typeof c===r,{isArray:ea}=Array,Pn=Hs("undefined");function er(r){return r!==null&&!Pn(r)&&r.constructor!==null&&!Pn(r.constructor)&&yt(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const fm=Gt("ArrayBuffer");function bg(r){let c;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?c=ArrayBuffer.isView(r):c=r&&r.buffer&&fm(r.buffer),c}const Sg=Hs("string"),yt=Hs("function"),dm=Hs("number"),tr=r=>r!==null&&typeof r=="object",_g=r=>r===!0||r===!1,As=r=>{if(Us(r)!=="object")return!1;const c=Sc(r);return(c===null||c===Object.prototype||Object.getPrototypeOf(c)===null)&&!(um in r)&&!(Ds in r)},Cg=r=>{if(!tr(r)||er(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},jg=Gt("Date"),Eg=Gt("File"),wg=Gt("Blob"),kg=Gt("FileList"),Ng=r=>tr(r)&&yt(r.pipe),Tg=r=>{let c;return r&&(typeof FormData=="function"&&r instanceof FormData||yt(r.append)&&((c=Us(r))==="formdata"||c==="object"&&yt(r.toString)&&r.toString()==="[object FormData]"))},Ag=Gt("URLSearchParams"),[Mg,zg,Rg,Og]=["ReadableStream","Request","Response","Headers"].map(Gt),Lg=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lr(r,c,{allOwnKeys:i=!1}={}){if(r===null||typeof r>"u")return;let o,f;if(typeof r!="object"&&(r=[r]),ea(r))for(o=0,f=r.length;o<f;o++)c.call(null,r[o],o,r);else{if(er(r))return;const h=i?Object.getOwnPropertyNames(r):Object.keys(r),m=h.length;let y;for(o=0;o<m;o++)y=h[o],c.call(null,r[y],y,r)}}function hm(r,c){if(er(r))return null;c=c.toLowerCase();const i=Object.keys(r);let o=i.length,f;for(;o-- >0;)if(f=i[o],c===f.toLowerCase())return f;return null}const fn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,mm=r=>!Pn(r)&&r!==fn;function pc(){const{caseless:r,skipUndefined:c}=mm(this)&&this||{},i={},o=(f,h)=>{const m=r&&hm(i,h)||h;As(i[m])&&As(f)?i[m]=pc(i[m],f):As(f)?i[m]=pc({},f):ea(f)?i[m]=f.slice():(!c||!Pn(f))&&(i[m]=f)};for(let f=0,h=arguments.length;f<h;f++)arguments[f]&&lr(arguments[f],o);return i}const Dg=(r,c,i,{allOwnKeys:o}={})=>(lr(c,(f,h)=>{i&&yt(f)?r[h]=cm(f,i):r[h]=f},{allOwnKeys:o}),r),Ug=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Hg=(r,c,i,o)=>{r.prototype=Object.create(c.prototype,o),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:c.prototype}),i&&Object.assign(r.prototype,i)},Bg=(r,c,i,o)=>{let f,h,m;const y={};if(c=c||{},r==null)return c;do{for(f=Object.getOwnPropertyNames(r),h=f.length;h-- >0;)m=f[h],(!o||o(m,r,c))&&!y[m]&&(c[m]=r[m],y[m]=!0);r=i!==!1&&Sc(r)}while(r&&(!i||i(r,c))&&r!==Object.prototype);return c},qg=(r,c,i)=>{r=String(r),(i===void 0||i>r.length)&&(i=r.length),i-=c.length;const o=r.indexOf(c,i);return o!==-1&&o===i},Yg=r=>{if(!r)return null;if(ea(r))return r;let c=r.length;if(!dm(c))return null;const i=new Array(c);for(;c-- >0;)i[c]=r[c];return i},Vg=(r=>c=>r&&c instanceof r)(typeof Uint8Array<"u"&&Sc(Uint8Array)),Xg=(r,c)=>{const o=(r&&r[Ds]).call(r);let f;for(;(f=o.next())&&!f.done;){const h=f.value;c.call(r,h[0],h[1])}},Gg=(r,c)=>{let i;const o=[];for(;(i=r.exec(c))!==null;)o.push(i);return o},$g=Gt("HTMLFormElement"),Qg=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,f){return o.toUpperCase()+f}),Hh=(({hasOwnProperty:r})=>(c,i)=>r.call(c,i))(Object.prototype),Zg=Gt("RegExp"),pm=(r,c)=>{const i=Object.getOwnPropertyDescriptors(r),o={};lr(i,(f,h)=>{let m;(m=c(f,h,r))!==!1&&(o[h]=m||f)}),Object.defineProperties(r,o)},Kg=r=>{pm(r,(c,i)=>{if(yt(r)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=r[i];if(yt(o)){if(c.enumerable=!1,"writable"in c){c.writable=!1;return}c.set||(c.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},Jg=(r,c)=>{const i={},o=f=>{f.forEach(h=>{i[h]=!0})};return ea(r)?o(r):o(String(r).split(c)),i},Wg=()=>{},Fg=(r,c)=>r!=null&&Number.isFinite(r=+r)?r:c;function Ig(r){return!!(r&&yt(r.append)&&r[um]==="FormData"&&r[Ds])}const Pg=r=>{const c=new Array(10),i=(o,f)=>{if(tr(o)){if(c.indexOf(o)>=0)return;if(er(o))return o;if(!("toJSON"in o)){c[f]=o;const h=ea(o)?[]:{};return lr(o,(m,y)=>{const v=i(m,f+1);!Pn(v)&&(h[y]=v)}),c[f]=void 0,h}}return o};return i(r,0)},ey=Gt("AsyncFunction"),ty=r=>r&&(tr(r)||yt(r))&&yt(r.then)&&yt(r.catch),gm=((r,c)=>r?setImmediate:c?((i,o)=>(fn.addEventListener("message",({source:f,data:h})=>{f===fn&&h===i&&o.length&&o.shift()()},!1),f=>{o.push(f),fn.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",yt(fn.postMessage)),ly=typeof queueMicrotask<"u"?queueMicrotask.bind(fn):typeof process<"u"&&process.nextTick||gm,ny=r=>r!=null&&yt(r[Ds]),L={isArray:ea,isArrayBuffer:fm,isBuffer:er,isFormData:Tg,isArrayBufferView:bg,isString:Sg,isNumber:dm,isBoolean:_g,isObject:tr,isPlainObject:As,isEmptyObject:Cg,isReadableStream:Mg,isRequest:zg,isResponse:Rg,isHeaders:Og,isUndefined:Pn,isDate:jg,isFile:Eg,isBlob:wg,isRegExp:Zg,isFunction:yt,isStream:Ng,isURLSearchParams:Ag,isTypedArray:Vg,isFileList:kg,forEach:lr,merge:pc,extend:Dg,trim:Lg,stripBOM:Ug,inherits:Hg,toFlatObject:Bg,kindOf:Us,kindOfTest:Gt,endsWith:qg,toArray:Yg,forEachEntry:Xg,matchAll:Gg,isHTMLForm:$g,hasOwnProperty:Hh,hasOwnProp:Hh,reduceDescriptors:pm,freezeMethods:Kg,toObjectSet:Jg,toCamelCase:Qg,noop:Wg,toFiniteNumber:Fg,findKey:hm,global:fn,isContextDefined:mm,isSpecCompliantForm:Ig,toJSONObject:Pg,isAsyncFn:ey,isThenable:ty,setImmediate:gm,asap:ly,isIterable:ny};function de(r,c,i,o,f){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",c&&(this.code=c),i&&(this.config=i),o&&(this.request=o),f&&(this.response=f,this.status=f.status?f.status:null)}L.inherits(de,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.status}}});const ym=de.prototype,vm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{vm[r]={value:r}});Object.defineProperties(de,vm);Object.defineProperty(ym,"isAxiosError",{value:!0});de.from=(r,c,i,o,f,h)=>{const m=Object.create(ym);L.toFlatObject(r,m,function(S){return S!==Error.prototype},g=>g!=="isAxiosError");const y=r&&r.message?r.message:"Error",v=c==null&&r?r.code:c;return de.call(m,y,v,i,o,f),r&&m.cause==null&&Object.defineProperty(m,"cause",{value:r,configurable:!0}),m.name=r&&r.name||"Error",h&&Object.assign(m,h),m};const ay=null;function gc(r){return L.isPlainObject(r)||L.isArray(r)}function xm(r){return L.endsWith(r,"[]")?r.slice(0,-2):r}function Bh(r,c,i){return r?r.concat(c).map(function(f,h){return f=xm(f),!i&&h?"["+f+"]":f}).join(i?".":""):c}function ry(r){return L.isArray(r)&&!r.some(gc)}const sy=L.toFlatObject(L,{},null,function(c){return/^is[A-Z]/.test(c)});function Bs(r,c,i){if(!L.isObject(r))throw new TypeError("target must be an object");c=c||new FormData,i=L.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,N){return!L.isUndefined(N[T])});const o=i.metaTokens,f=i.visitor||S,h=i.dots,m=i.indexes,v=(i.Blob||typeof Blob<"u"&&Blob)&&L.isSpecCompliantForm(c);if(!L.isFunction(f))throw new TypeError("visitor must be a function");function g(C){if(C===null)return"";if(L.isDate(C))return C.toISOString();if(L.isBoolean(C))return C.toString();if(!v&&L.isBlob(C))throw new de("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(C)||L.isTypedArray(C)?v&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function S(C,T,N){let H=C;if(C&&!N&&typeof C=="object"){if(L.endsWith(T,"{}"))T=o?T:T.slice(0,-2),C=JSON.stringify(C);else if(L.isArray(C)&&ry(C)||(L.isFileList(C)||L.endsWith(T,"[]"))&&(H=L.toArray(C)))return T=xm(T),H.forEach(function(V,J){!(L.isUndefined(V)||V===null)&&c.append(m===!0?Bh([T],J,h):m===null?T:T+"[]",g(V))}),!1}return gc(C)?!0:(c.append(Bh(N,T,h),g(C)),!1)}const x=[],z=Object.assign(sy,{defaultVisitor:S,convertValue:g,isVisitable:gc});function Z(C,T){if(!L.isUndefined(C)){if(x.indexOf(C)!==-1)throw Error("Circular reference detected in "+T.join("."));x.push(C),L.forEach(C,function(H,F){(!(L.isUndefined(H)||H===null)&&f.call(c,H,L.isString(F)?F.trim():F,T,z))===!0&&Z(H,T?T.concat(F):[F])}),x.pop()}}if(!L.isObject(r))throw new TypeError("data must be an object");return Z(r),c}function qh(r){const c={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(o){return c[o]})}function _c(r,c){this._pairs=[],r&&Bs(r,this,c)}const bm=_c.prototype;bm.append=function(c,i){this._pairs.push([c,i])};bm.toString=function(c){const i=c?function(o){return c.call(this,o,qh)}:qh;return this._pairs.map(function(f){return i(f[0])+"="+i(f[1])},"").join("&")};function iy(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Sm(r,c,i){if(!c)return r;const o=i&&i.encode||iy;L.isFunction(i)&&(i={serialize:i});const f=i&&i.serialize;let h;if(f?h=f(c,i):h=L.isURLSearchParams(c)?c.toString():new _c(c,i).toString(o),h){const m=r.indexOf("#");m!==-1&&(r=r.slice(0,m)),r+=(r.indexOf("?")===-1?"?":"&")+h}return r}class Yh{constructor(){this.handlers=[]}use(c,i,o){return this.handlers.push({fulfilled:c,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(c){this.handlers[c]&&(this.handlers[c]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(c){L.forEach(this.handlers,function(o){o!==null&&c(o)})}}const _m={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oy=typeof URLSearchParams<"u"?URLSearchParams:_c,cy=typeof FormData<"u"?FormData:null,uy=typeof Blob<"u"?Blob:null,fy={isBrowser:!0,classes:{URLSearchParams:oy,FormData:cy,Blob:uy},protocols:["http","https","file","blob","url","data"]},Cc=typeof window<"u"&&typeof document<"u",yc=typeof navigator=="object"&&navigator||void 0,dy=Cc&&(!yc||["ReactNative","NativeScript","NS"].indexOf(yc.product)<0),hy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",my=Cc&&window.location.href||"http://localhost",py=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Cc,hasStandardBrowserEnv:dy,hasStandardBrowserWebWorkerEnv:hy,navigator:yc,origin:my},Symbol.toStringTag,{value:"Module"})),ot={...py,...fy};function gy(r,c){return Bs(r,new ot.classes.URLSearchParams,{visitor:function(i,o,f,h){return ot.isNode&&L.isBuffer(i)?(this.append(o,i.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)},...c})}function yy(r){return L.matchAll(/\w+|\[(\w*)]/g,r).map(c=>c[0]==="[]"?"":c[1]||c[0])}function vy(r){const c={},i=Object.keys(r);let o;const f=i.length;let h;for(o=0;o<f;o++)h=i[o],c[h]=r[h];return c}function Cm(r){function c(i,o,f,h){let m=i[h++];if(m==="__proto__")return!0;const y=Number.isFinite(+m),v=h>=i.length;return m=!m&&L.isArray(f)?f.length:m,v?(L.hasOwnProp(f,m)?f[m]=[f[m],o]:f[m]=o,!y):((!f[m]||!L.isObject(f[m]))&&(f[m]=[]),c(i,o,f[m],h)&&L.isArray(f[m])&&(f[m]=vy(f[m])),!y)}if(L.isFormData(r)&&L.isFunction(r.entries)){const i={};return L.forEachEntry(r,(o,f)=>{c(yy(o),f,i,0)}),i}return null}function xy(r,c,i){if(L.isString(r))try{return(c||JSON.parse)(r),L.trim(r)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(r)}const nr={transitional:_m,adapter:["xhr","http","fetch"],transformRequest:[function(c,i){const o=i.getContentType()||"",f=o.indexOf("application/json")>-1,h=L.isObject(c);if(h&&L.isHTMLForm(c)&&(c=new FormData(c)),L.isFormData(c))return f?JSON.stringify(Cm(c)):c;if(L.isArrayBuffer(c)||L.isBuffer(c)||L.isStream(c)||L.isFile(c)||L.isBlob(c)||L.isReadableStream(c))return c;if(L.isArrayBufferView(c))return c.buffer;if(L.isURLSearchParams(c))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),c.toString();let y;if(h){if(o.indexOf("application/x-www-form-urlencoded")>-1)return gy(c,this.formSerializer).toString();if((y=L.isFileList(c))||o.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return Bs(y?{"files[]":c}:c,v&&new v,this.formSerializer)}}return h||f?(i.setContentType("application/json",!1),xy(c)):c}],transformResponse:[function(c){const i=this.transitional||nr.transitional,o=i&&i.forcedJSONParsing,f=this.responseType==="json";if(L.isResponse(c)||L.isReadableStream(c))return c;if(c&&L.isString(c)&&(o&&!this.responseType||f)){const m=!(i&&i.silentJSONParsing)&&f;try{return JSON.parse(c,this.parseReviver)}catch(y){if(m)throw y.name==="SyntaxError"?de.from(y,de.ERR_BAD_RESPONSE,this,null,this.response):y}}return c}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ot.classes.FormData,Blob:ot.classes.Blob},validateStatus:function(c){return c>=200&&c<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],r=>{nr.headers[r]={}});const by=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Sy=r=>{const c={};let i,o,f;return r&&r.split(`
|
|
10
|
+
`).forEach(function(m){f=m.indexOf(":"),i=m.substring(0,f).trim().toLowerCase(),o=m.substring(f+1).trim(),!(!i||c[i]&&by[i])&&(i==="set-cookie"?c[i]?c[i].push(o):c[i]=[o]:c[i]=c[i]?c[i]+", "+o:o)}),c},Vh=Symbol("internals");function Ia(r){return r&&String(r).trim().toLowerCase()}function Ms(r){return r===!1||r==null?r:L.isArray(r)?r.map(Ms):String(r)}function _y(r){const c=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=i.exec(r);)c[o[1]]=o[2];return c}const Cy=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function ic(r,c,i,o,f){if(L.isFunction(o))return o.call(this,c,i);if(f&&(c=i),!!L.isString(c)){if(L.isString(o))return c.indexOf(o)!==-1;if(L.isRegExp(o))return o.test(c)}}function jy(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(c,i,o)=>i.toUpperCase()+o)}function Ey(r,c){const i=L.toCamelCase(" "+c);["get","set","has"].forEach(o=>{Object.defineProperty(r,o+i,{value:function(f,h,m){return this[o].call(this,c,f,h,m)},configurable:!0})})}let vt=class{constructor(c){c&&this.set(c)}set(c,i,o){const f=this;function h(y,v,g){const S=Ia(v);if(!S)throw new Error("header name must be a non-empty string");const x=L.findKey(f,S);(!x||f[x]===void 0||g===!0||g===void 0&&f[x]!==!1)&&(f[x||v]=Ms(y))}const m=(y,v)=>L.forEach(y,(g,S)=>h(g,S,v));if(L.isPlainObject(c)||c instanceof this.constructor)m(c,i);else if(L.isString(c)&&(c=c.trim())&&!Cy(c))m(Sy(c),i);else if(L.isObject(c)&&L.isIterable(c)){let y={},v,g;for(const S of c){if(!L.isArray(S))throw TypeError("Object iterator must return a key-value pair");y[g=S[0]]=(v=y[g])?L.isArray(v)?[...v,S[1]]:[v,S[1]]:S[1]}m(y,i)}else c!=null&&h(i,c,o);return this}get(c,i){if(c=Ia(c),c){const o=L.findKey(this,c);if(o){const f=this[o];if(!i)return f;if(i===!0)return _y(f);if(L.isFunction(i))return i.call(this,f,o);if(L.isRegExp(i))return i.exec(f);throw new TypeError("parser must be boolean|regexp|function")}}}has(c,i){if(c=Ia(c),c){const o=L.findKey(this,c);return!!(o&&this[o]!==void 0&&(!i||ic(this,this[o],o,i)))}return!1}delete(c,i){const o=this;let f=!1;function h(m){if(m=Ia(m),m){const y=L.findKey(o,m);y&&(!i||ic(o,o[y],y,i))&&(delete o[y],f=!0)}}return L.isArray(c)?c.forEach(h):h(c),f}clear(c){const i=Object.keys(this);let o=i.length,f=!1;for(;o--;){const h=i[o];(!c||ic(this,this[h],h,c,!0))&&(delete this[h],f=!0)}return f}normalize(c){const i=this,o={};return L.forEach(this,(f,h)=>{const m=L.findKey(o,h);if(m){i[m]=Ms(f),delete i[h];return}const y=c?jy(h):String(h).trim();y!==h&&delete i[h],i[y]=Ms(f),o[y]=!0}),this}concat(...c){return this.constructor.concat(this,...c)}toJSON(c){const i=Object.create(null);return L.forEach(this,(o,f)=>{o!=null&&o!==!1&&(i[f]=c&&L.isArray(o)?o.join(", "):o)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([c,i])=>c+": "+i).join(`
|
|
11
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(c){return c instanceof this?c:new this(c)}static concat(c,...i){const o=new this(c);return i.forEach(f=>o.set(f)),o}static accessor(c){const o=(this[Vh]=this[Vh]={accessors:{}}).accessors,f=this.prototype;function h(m){const y=Ia(m);o[y]||(Ey(f,m),o[y]=!0)}return L.isArray(c)?c.forEach(h):h(c),this}};vt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);L.reduceDescriptors(vt.prototype,({value:r},c)=>{let i=c[0].toUpperCase()+c.slice(1);return{get:()=>r,set(o){this[i]=o}}});L.freezeMethods(vt);function oc(r,c){const i=this||nr,o=c||i,f=vt.from(o.headers);let h=o.data;return L.forEach(r,function(y){h=y.call(i,h,f.normalize(),c?c.status:void 0)}),f.normalize(),h}function jm(r){return!!(r&&r.__CANCEL__)}function ta(r,c,i){de.call(this,r??"canceled",de.ERR_CANCELED,c,i),this.name="CanceledError"}L.inherits(ta,de,{__CANCEL__:!0});function Em(r,c,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?r(i):c(new de("Request failed with status code "+i.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function wy(r){const c=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return c&&c[1]||""}function ky(r,c){r=r||10;const i=new Array(r),o=new Array(r);let f=0,h=0,m;return c=c!==void 0?c:1e3,function(v){const g=Date.now(),S=o[h];m||(m=g),i[f]=v,o[f]=g;let x=h,z=0;for(;x!==f;)z+=i[x++],x=x%r;if(f=(f+1)%r,f===h&&(h=(h+1)%r),g-m<c)return;const Z=S&&g-S;return Z?Math.round(z*1e3/Z):void 0}}function Ny(r,c){let i=0,o=1e3/c,f,h;const m=(g,S=Date.now())=>{i=S,f=null,h&&(clearTimeout(h),h=null),r(...g)};return[(...g)=>{const S=Date.now(),x=S-i;x>=o?m(g,S):(f=g,h||(h=setTimeout(()=>{h=null,m(f)},o-x)))},()=>f&&m(f)]}const Os=(r,c,i=3)=>{let o=0;const f=ky(50,250);return Ny(h=>{const m=h.loaded,y=h.lengthComputable?h.total:void 0,v=m-o,g=f(v),S=m<=y;o=m;const x={loaded:m,total:y,progress:y?m/y:void 0,bytes:v,rate:g||void 0,estimated:g&&y&&S?(y-m)/g:void 0,event:h,lengthComputable:y!=null,[c?"download":"upload"]:!0};r(x)},i)},Xh=(r,c)=>{const i=r!=null;return[o=>c[0]({lengthComputable:i,total:r,loaded:o}),c[1]]},Gh=r=>(...c)=>L.asap(()=>r(...c)),Ty=ot.hasStandardBrowserEnv?((r,c)=>i=>(i=new URL(i,ot.origin),r.protocol===i.protocol&&r.host===i.host&&(c||r.port===i.port)))(new URL(ot.origin),ot.navigator&&/(msie|trident)/i.test(ot.navigator.userAgent)):()=>!0,Ay=ot.hasStandardBrowserEnv?{write(r,c,i,o,f,h,m){if(typeof document>"u")return;const y=[`${r}=${encodeURIComponent(c)}`];L.isNumber(i)&&y.push(`expires=${new Date(i).toUTCString()}`),L.isString(o)&&y.push(`path=${o}`),L.isString(f)&&y.push(`domain=${f}`),h===!0&&y.push("secure"),L.isString(m)&&y.push(`SameSite=${m}`),document.cookie=y.join("; ")},read(r){if(typeof document>"u")return null;const c=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)"));return c?decodeURIComponent(c[1]):null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function My(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function zy(r,c){return c?r.replace(/\/?\/$/,"")+"/"+c.replace(/^\/+/,""):r}function wm(r,c,i){let o=!My(c);return r&&(o||i==!1)?zy(r,c):c}const $h=r=>r instanceof vt?{...r}:r;function hn(r,c){c=c||{};const i={};function o(g,S,x,z){return L.isPlainObject(g)&&L.isPlainObject(S)?L.merge.call({caseless:z},g,S):L.isPlainObject(S)?L.merge({},S):L.isArray(S)?S.slice():S}function f(g,S,x,z){if(L.isUndefined(S)){if(!L.isUndefined(g))return o(void 0,g,x,z)}else return o(g,S,x,z)}function h(g,S){if(!L.isUndefined(S))return o(void 0,S)}function m(g,S){if(L.isUndefined(S)){if(!L.isUndefined(g))return o(void 0,g)}else return o(void 0,S)}function y(g,S,x){if(x in c)return o(g,S);if(x in r)return o(void 0,g)}const v={url:h,method:h,data:h,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:y,headers:(g,S,x)=>f($h(g),$h(S),x,!0)};return L.forEach(Object.keys({...r,...c}),function(S){const x=v[S]||f,z=x(r[S],c[S],S);L.isUndefined(z)&&x!==y||(i[S]=z)}),i}const km=r=>{const c=hn({},r);let{data:i,withXSRFToken:o,xsrfHeaderName:f,xsrfCookieName:h,headers:m,auth:y}=c;if(c.headers=m=vt.from(m),c.url=Sm(wm(c.baseURL,c.url,c.allowAbsoluteUrls),r.params,r.paramsSerializer),y&&m.set("Authorization","Basic "+btoa((y.username||"")+":"+(y.password?unescape(encodeURIComponent(y.password)):""))),L.isFormData(i)){if(ot.hasStandardBrowserEnv||ot.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if(L.isFunction(i.getHeaders)){const v=i.getHeaders(),g=["content-type","content-length"];Object.entries(v).forEach(([S,x])=>{g.includes(S.toLowerCase())&&m.set(S,x)})}}if(ot.hasStandardBrowserEnv&&(o&&L.isFunction(o)&&(o=o(c)),o||o!==!1&&Ty(c.url))){const v=f&&h&&Ay.read(h);v&&m.set(f,v)}return c},Ry=typeof XMLHttpRequest<"u",Oy=Ry&&function(r){return new Promise(function(i,o){const f=km(r);let h=f.data;const m=vt.from(f.headers).normalize();let{responseType:y,onUploadProgress:v,onDownloadProgress:g}=f,S,x,z,Z,C;function T(){Z&&Z(),C&&C(),f.cancelToken&&f.cancelToken.unsubscribe(S),f.signal&&f.signal.removeEventListener("abort",S)}let N=new XMLHttpRequest;N.open(f.method.toUpperCase(),f.url,!0),N.timeout=f.timeout;function H(){if(!N)return;const V=vt.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),B={data:!y||y==="text"||y==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:V,config:r,request:N};Em(function(X){i(X),T()},function(X){o(X),T()},B),N=null}"onloadend"in N?N.onloadend=H:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout(H)},N.onabort=function(){N&&(o(new de("Request aborted",de.ECONNABORTED,r,N)),N=null)},N.onerror=function(J){const B=J&&J.message?J.message:"Network Error",k=new de(B,de.ERR_NETWORK,r,N);k.event=J||null,o(k),N=null},N.ontimeout=function(){let J=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded";const B=f.transitional||_m;f.timeoutErrorMessage&&(J=f.timeoutErrorMessage),o(new de(J,B.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,r,N)),N=null},h===void 0&&m.setContentType(null),"setRequestHeader"in N&&L.forEach(m.toJSON(),function(J,B){N.setRequestHeader(B,J)}),L.isUndefined(f.withCredentials)||(N.withCredentials=!!f.withCredentials),y&&y!=="json"&&(N.responseType=f.responseType),g&&([z,C]=Os(g,!0),N.addEventListener("progress",z)),v&&N.upload&&([x,Z]=Os(v),N.upload.addEventListener("progress",x),N.upload.addEventListener("loadend",Z)),(f.cancelToken||f.signal)&&(S=V=>{N&&(o(!V||V.type?new ta(null,r,N):V),N.abort(),N=null)},f.cancelToken&&f.cancelToken.subscribe(S),f.signal&&(f.signal.aborted?S():f.signal.addEventListener("abort",S)));const F=wy(f.url);if(F&&ot.protocols.indexOf(F)===-1){o(new de("Unsupported protocol "+F+":",de.ERR_BAD_REQUEST,r));return}N.send(h||null)})},Ly=(r,c)=>{const{length:i}=r=r?r.filter(Boolean):[];if(c||i){let o=new AbortController,f;const h=function(g){if(!f){f=!0,y();const S=g instanceof Error?g:this.reason;o.abort(S instanceof de?S:new ta(S instanceof Error?S.message:S))}};let m=c&&setTimeout(()=>{m=null,h(new de(`timeout ${c} of ms exceeded`,de.ETIMEDOUT))},c);const y=()=>{r&&(m&&clearTimeout(m),m=null,r.forEach(g=>{g.unsubscribe?g.unsubscribe(h):g.removeEventListener("abort",h)}),r=null)};r.forEach(g=>g.addEventListener("abort",h));const{signal:v}=o;return v.unsubscribe=()=>L.asap(y),v}},Dy=function*(r,c){let i=r.byteLength;if(i<c){yield r;return}let o=0,f;for(;o<i;)f=o+c,yield r.slice(o,f),o=f},Uy=async function*(r,c){for await(const i of Hy(r))yield*Dy(i,c)},Hy=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const c=r.getReader();try{for(;;){const{done:i,value:o}=await c.read();if(i)break;yield o}}finally{await c.cancel()}},Qh=(r,c,i,o)=>{const f=Uy(r,c);let h=0,m,y=v=>{m||(m=!0,o&&o(v))};return new ReadableStream({async pull(v){try{const{done:g,value:S}=await f.next();if(g){y(),v.close();return}let x=S.byteLength;if(i){let z=h+=x;i(z)}v.enqueue(new Uint8Array(S))}catch(g){throw y(g),g}},cancel(v){return y(v),f.return()}},{highWaterMark:2})},Zh=64*1024,{isFunction:ks}=L,By=(({Request:r,Response:c})=>({Request:r,Response:c}))(L.global),{ReadableStream:Kh,TextEncoder:Jh}=L.global,Wh=(r,...c)=>{try{return!!r(...c)}catch{return!1}},qy=r=>{r=L.merge.call({skipUndefined:!0},By,r);const{fetch:c,Request:i,Response:o}=r,f=c?ks(c):typeof fetch=="function",h=ks(i),m=ks(o);if(!f)return!1;const y=f&&ks(Kh),v=f&&(typeof Jh=="function"?(C=>T=>C.encode(T))(new Jh):async C=>new Uint8Array(await new i(C).arrayBuffer())),g=h&&y&&Wh(()=>{let C=!1;const T=new i(ot.origin,{body:new Kh,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!T}),S=m&&y&&Wh(()=>L.isReadableStream(new o("").body)),x={stream:S&&(C=>C.body)};f&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!x[C]&&(x[C]=(T,N)=>{let H=T&&T[C];if(H)return H.call(T);throw new de(`Response type '${C}' is not supported`,de.ERR_NOT_SUPPORT,N)})});const z=async C=>{if(C==null)return 0;if(L.isBlob(C))return C.size;if(L.isSpecCompliantForm(C))return(await new i(ot.origin,{method:"POST",body:C}).arrayBuffer()).byteLength;if(L.isArrayBufferView(C)||L.isArrayBuffer(C))return C.byteLength;if(L.isURLSearchParams(C)&&(C=C+""),L.isString(C))return(await v(C)).byteLength},Z=async(C,T)=>{const N=L.toFiniteNumber(C.getContentLength());return N??z(T)};return async C=>{let{url:T,method:N,data:H,signal:F,cancelToken:V,timeout:J,onDownloadProgress:B,onUploadProgress:k,responseType:X,headers:Q,withCredentials:ne="same-origin",fetchOptions:re}=km(C),ie=c||fetch;X=X?(X+"").toLowerCase():"text";let oe=Ly([F,V&&V.toAbortSignal()],J),Ne=null;const we=oe&&oe.unsubscribe&&(()=>{oe.unsubscribe()});let pe;try{if(k&&g&&N!=="get"&&N!=="head"&&(pe=await Z(Q,H))!==0){let _=new i(T,{method:"POST",body:H,duplex:"half"}),q;if(L.isFormData(H)&&(q=_.headers.get("content-type"))&&Q.setContentType(q),_.body){const[W,P]=Xh(pe,Os(Gh(k)));H=Qh(_.body,Zh,W,P)}}L.isString(ne)||(ne=ne?"include":"omit");const A=h&&"credentials"in i.prototype,E={...re,signal:oe,method:N.toUpperCase(),headers:Q.normalize().toJSON(),body:H,duplex:"half",credentials:A?ne:void 0};Ne=h&&new i(T,E);let I=await(h?ie(Ne,re):ie(T,E));const ge=S&&(X==="stream"||X==="response");if(S&&(B||ge&&we)){const _={};["status","statusText","headers"].forEach(le=>{_[le]=I[le]});const q=L.toFiniteNumber(I.headers.get("content-length")),[W,P]=B&&Xh(q,Os(Gh(B),!0))||[];I=new o(Qh(I.body,Zh,W,()=>{P&&P(),we&&we()}),_)}X=X||"text";let ye=await x[L.findKey(x,X)||"text"](I,C);return!ge&&we&&we(),await new Promise((_,q)=>{Em(_,q,{data:ye,headers:vt.from(I.headers),status:I.status,statusText:I.statusText,config:C,request:Ne})})}catch(A){throw we&&we(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new de("Network Error",de.ERR_NETWORK,C,Ne),{cause:A.cause||A}):de.from(A,A&&A.code,C,Ne)}}},Yy=new Map,Nm=r=>{let c=r&&r.env||{};const{fetch:i,Request:o,Response:f}=c,h=[o,f,i];let m=h.length,y=m,v,g,S=Yy;for(;y--;)v=h[y],g=S.get(v),g===void 0&&S.set(v,g=y?new Map:qy(c)),S=g;return g};Nm();const jc={http:ay,xhr:Oy,fetch:{get:Nm}};L.forEach(jc,(r,c)=>{if(r){try{Object.defineProperty(r,"name",{value:c})}catch{}Object.defineProperty(r,"adapterName",{value:c})}});const Fh=r=>`- ${r}`,Vy=r=>L.isFunction(r)||r===null||r===!1;function Xy(r,c){r=L.isArray(r)?r:[r];const{length:i}=r;let o,f;const h={};for(let m=0;m<i;m++){o=r[m];let y;if(f=o,!Vy(o)&&(f=jc[(y=String(o)).toLowerCase()],f===void 0))throw new de(`Unknown adapter '${y}'`);if(f&&(L.isFunction(f)||(f=f.get(c))))break;h[y||"#"+m]=f}if(!f){const m=Object.entries(h).map(([v,g])=>`adapter ${v} `+(g===!1?"is not supported by the environment":"is not available in the build"));let y=i?m.length>1?`since :
|
|
12
|
+
`+m.map(Fh).join(`
|
|
13
|
+
`):" "+Fh(m[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+y,"ERR_NOT_SUPPORT")}return f}const Tm={getAdapter:Xy,adapters:jc};function cc(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new ta(null,r)}function Ih(r){return cc(r),r.headers=vt.from(r.headers),r.data=oc.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Tm.getAdapter(r.adapter||nr.adapter,r)(r).then(function(o){return cc(r),o.data=oc.call(r,r.transformResponse,o),o.headers=vt.from(o.headers),o},function(o){return jm(o)||(cc(r),o&&o.response&&(o.response.data=oc.call(r,r.transformResponse,o.response),o.response.headers=vt.from(o.response.headers))),Promise.reject(o)})}const Am="1.13.2",qs={};["object","boolean","number","function","string","symbol"].forEach((r,c)=>{qs[r]=function(o){return typeof o===r||"a"+(c<1?"n ":" ")+r}});const Ph={};qs.transitional=function(c,i,o){function f(h,m){return"[Axios v"+Am+"] Transitional option '"+h+"'"+m+(o?". "+o:"")}return(h,m,y)=>{if(c===!1)throw new de(f(m," has been removed"+(i?" in "+i:"")),de.ERR_DEPRECATED);return i&&!Ph[m]&&(Ph[m]=!0,console.warn(f(m," has been deprecated since v"+i+" and will be removed in the near future"))),c?c(h,m,y):!0}};qs.spelling=function(c){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${c}`),!0)};function Gy(r,c,i){if(typeof r!="object")throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const o=Object.keys(r);let f=o.length;for(;f-- >0;){const h=o[f],m=c[h];if(m){const y=r[h],v=y===void 0||m(y,h,r);if(v!==!0)throw new de("option "+h+" must be "+v,de.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new de("Unknown option "+h,de.ERR_BAD_OPTION)}}const zs={assertOptions:Gy,validators:qs},Jt=zs.validators;let dn=class{constructor(c){this.defaults=c||{},this.interceptors={request:new Yh,response:new Yh}}async request(c,i){try{return await this._request(c,i)}catch(o){if(o instanceof Error){let f={};Error.captureStackTrace?Error.captureStackTrace(f):f=new Error;const h=f.stack?f.stack.replace(/^.+\n/,""):"";try{o.stack?h&&!String(o.stack).endsWith(h.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
14
|
+
`+h):o.stack=h}catch{}}throw o}}_request(c,i){typeof c=="string"?(i=i||{},i.url=c):i=c||{},i=hn(this.defaults,i);const{transitional:o,paramsSerializer:f,headers:h}=i;o!==void 0&&zs.assertOptions(o,{silentJSONParsing:Jt.transitional(Jt.boolean),forcedJSONParsing:Jt.transitional(Jt.boolean),clarifyTimeoutError:Jt.transitional(Jt.boolean)},!1),f!=null&&(L.isFunction(f)?i.paramsSerializer={serialize:f}:zs.assertOptions(f,{encode:Jt.function,serialize:Jt.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),zs.assertOptions(i,{baseUrl:Jt.spelling("baseURL"),withXsrfToken:Jt.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let m=h&&L.merge(h.common,h[i.method]);h&&L.forEach(["delete","get","head","post","put","patch","common"],C=>{delete h[C]}),i.headers=vt.concat(m,h);const y=[];let v=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(i)===!1||(v=v&&T.synchronous,y.unshift(T.fulfilled,T.rejected))});const g=[];this.interceptors.response.forEach(function(T){g.push(T.fulfilled,T.rejected)});let S,x=0,z;if(!v){const C=[Ih.bind(this),void 0];for(C.unshift(...y),C.push(...g),z=C.length,S=Promise.resolve(i);x<z;)S=S.then(C[x++],C[x++]);return S}z=y.length;let Z=i;for(;x<z;){const C=y[x++],T=y[x++];try{Z=C(Z)}catch(N){T.call(this,N);break}}try{S=Ih.call(this,Z)}catch(C){return Promise.reject(C)}for(x=0,z=g.length;x<z;)S=S.then(g[x++],g[x++]);return S}getUri(c){c=hn(this.defaults,c);const i=wm(c.baseURL,c.url,c.allowAbsoluteUrls);return Sm(i,c.params,c.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(c){dn.prototype[c]=function(i,o){return this.request(hn(o||{},{method:c,url:i,data:(o||{}).data}))}});L.forEach(["post","put","patch"],function(c){function i(o){return function(h,m,y){return this.request(hn(y||{},{method:c,headers:o?{"Content-Type":"multipart/form-data"}:{},url:h,data:m}))}}dn.prototype[c]=i(),dn.prototype[c+"Form"]=i(!0)});let $y=class Mm{constructor(c){if(typeof c!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(h){i=h});const o=this;this.promise.then(f=>{if(!o._listeners)return;let h=o._listeners.length;for(;h-- >0;)o._listeners[h](f);o._listeners=null}),this.promise.then=f=>{let h;const m=new Promise(y=>{o.subscribe(y),h=y}).then(f);return m.cancel=function(){o.unsubscribe(h)},m},c(function(h,m,y){o.reason||(o.reason=new ta(h,m,y),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(c){if(this.reason){c(this.reason);return}this._listeners?this._listeners.push(c):this._listeners=[c]}unsubscribe(c){if(!this._listeners)return;const i=this._listeners.indexOf(c);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const c=new AbortController,i=o=>{c.abort(o)};return this.subscribe(i),c.signal.unsubscribe=()=>this.unsubscribe(i),c.signal}static source(){let c;return{token:new Mm(function(f){c=f}),cancel:c}}};function Qy(r){return function(i){return r.apply(null,i)}}function Zy(r){return L.isObject(r)&&r.isAxiosError===!0}const vc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vc).forEach(([r,c])=>{vc[c]=r});function zm(r){const c=new dn(r),i=cm(dn.prototype.request,c);return L.extend(i,dn.prototype,c,{allOwnKeys:!0}),L.extend(i,c,null,{allOwnKeys:!0}),i.create=function(f){return zm(hn(r,f))},i}const Ge=zm(nr);Ge.Axios=dn;Ge.CanceledError=ta;Ge.CancelToken=$y;Ge.isCancel=jm;Ge.VERSION=Am;Ge.toFormData=Bs;Ge.AxiosError=de;Ge.Cancel=Ge.CanceledError;Ge.all=function(c){return Promise.all(c)};Ge.spread=Qy;Ge.isAxiosError=Zy;Ge.mergeConfig=hn;Ge.AxiosHeaders=vt;Ge.formToJSON=r=>Cm(L.isHTMLForm(r)?new FormData(r):r);Ge.getAdapter=Tm.getAdapter;Ge.HttpStatusCode=vc;Ge.default=Ge;const{Axios:Gv,AxiosError:$v,CanceledError:Qv,isCancel:Zv,CancelToken:Kv,VERSION:Jv,all:Wv,Cancel:Fv,isAxiosError:Iv,spread:Pv,toFormData:e1,AxiosHeaders:t1,HttpStatusCode:l1,formToJSON:n1,getAdapter:a1,mergeConfig:r1}=Ge,Je=Ge.create({baseURL:"/api",timeout:3e4});Je.interceptors.request.use(r=>(D.debug("API",`${r.method?.toUpperCase()} ${r.url}`,r.data),r),r=>(D.error("API","Request error",r),Promise.reject(r)));Je.interceptors.response.use(r=>(D.debug("API",`Response ${r.status} from ${r.config.url}`),r),r=>(D.error("API",`Error from ${r.config?.url}`,r.response?.data||r.message),Promise.reject(r)));const Ky=()=>Je.get("/llm-configs"),Jy=r=>Je.post("/llm-configs",r),Wy=(r,c)=>Je.put(`/llm-configs/${r}`,c),Fy=r=>Je.delete(`/llm-configs/${r}`),em=r=>Je.post(`/llm-configs/${r}/set-default`),Iy=r=>Je.post("/llm-configs/validate",r),Py=()=>Je.get("/settings/semantic-scholar"),ev=r=>Je.put("/settings/semantic-scholar",{api_key:r}),tv=()=>Je.delete("/settings/semantic-scholar"),lv=r=>Je.post("/settings/semantic-scholar/validate",{api_key:r}),nv=r=>Je.post("/check",r,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),Rm=r=>Je.post(`/cancel/${r}`),tm=(r=50)=>Je.get("/history",{params:{limit:r}}),In=r=>Je.get(`/history/${r}`),av=r=>Je.delete(`/history/${r}`),rv=(r,c)=>Je.patch(`/history/${r}`,{custom_label:c}),sv=()=>Je.delete("/admin/cache"),iv=()=>Je.delete("/admin/database"),ov=(r,c)=>{const i=window.location.protocol==="https:"?"wss:":"ws:",o=window.location.host,f=`${i}//${o}/api/ws/${r}`;D.info("WebSocket",`Connecting to ${f}`);const h=new WebSocket(f);return h.onopen=()=>{D.info("WebSocket","Connected"),c.onOpen?.()},h.onmessage=m=>{try{const y=JSON.parse(m.data);D.debug("WebSocket",`Message received: ${y.type}`,y),c.onMessage?.(y)}catch(y){D.error("WebSocket","Failed to parse message",y)}},h.onerror=m=>{D.error("WebSocket","Error",m),c.onError?.(m)},h.onclose=m=>{D.info("WebSocket",`Disconnected (code: ${m.code})`),c.onClose?.(m)},h},Xe=Pa((r,c)=>({status:"idle",sessionId:null,currentCheckId:null,sessionToCheckMap:{},activeSessions:[],paperTitle:null,paperSource:null,sourceType:null,statusMessage:"",progress:0,references:[],stats:{total_refs:0,processed_refs:0,verified_count:0,errors_count:0,warnings_count:0,suggestions_count:0,unverified_count:0,refs_with_issues:0,refs_with_errors:0,refs_with_warnings_only:0,refs_verified:0,progress_percent:0},error:null,completedCheckId:null,statusFilter:[],startCheck:(i,o=null,f=null,h=null,m=null)=>{D.info("CheckStore",`Starting check with session ${i}, checkId ${o}, sourceType ${h}, paperTitle ${m}`);const y=c().sessionToCheckMap,v=o?{...y,[i]:o}:y,g=c().activeSessions.includes(i)?c().activeSessions:[...c().activeSessions,i];r({status:"checking",sessionId:i,currentCheckId:o,sessionToCheckMap:v,activeSessions:g,paperTitle:m,paperSource:f,sourceType:h,statusMessage:"Starting check...",progress:0,references:[],stats:{total_refs:0,processed_refs:0,verified_count:0,errors_count:0,warnings_count:0,suggestions_count:0,unverified_count:0,refs_with_issues:0,refs_with_errors:0,refs_with_warnings_only:0,refs_verified:0,progress_percent:0},error:null,completedCheckId:null,statusFilter:[]})},registerSession:(i,o)=>{if(!i)return;const{sessionToCheckMap:f,activeSessions:h}=c(),m=h.includes(i);D.info("CheckStore",`Registering session ${i} for check ${o}, alreadyActive=${m}`),r({sessionToCheckMap:{...f,[i]:o},activeSessions:m?h:[...h,i]})},unregisterSession:i=>{if(!i)return;const{sessionToCheckMap:o,activeSessions:f}=c(),h={...o};delete h[i],r({sessionToCheckMap:h,activeSessions:f.filter(m=>m!==i)})},adoptSession:i=>{const{session_id:o,id:f,paper_title:h,paper_source:m,results:y=[],total_refs:v=0,errors_count:g=0,warnings_count:S=0,suggestions_count:x=0,unverified_count:z=0,refs_with_issues:Z=0,refs_with_errors:C,refs_with_warnings_only:T,refs_verified:N}=i||{},H=Array.isArray(y)?y.length:0,F=Math.max(v-g-S-x-z,0),V=v>0?Math.min(H/v*100,100):0;let J=C??0,B=T??0,k=N??0;Array.isArray(y)&&y.length>0&&J===0&&B===0&&k===0&&y.forEach(X=>{const Q=X.errors?.some(ie=>ie.error_type!=="unverified"),ne=X.warnings?.length>0,re=(X.status||"").toLowerCase();re==="error"||Q?J++:re==="warning"||ne?B++:(re==="verified"||re==="suggestion")&&k++}),D.info("CheckStore",`Adopting in-progress session ${o} for check ${f}`),r({status:"checking",sessionId:o,currentCheckId:f,paperTitle:h,paperSource:m,statusMessage:"Reconnected to in-progress check",progress:V,references:Array.isArray(y)?y.map((X,Q)=>({...X,index:Q,status:X.status||"pending"})):[],stats:{total_refs:v,processed_refs:H,verified_count:F,errors_count:g,warnings_count:S,suggestions_count:x,unverified_count:z,refs_with_issues:Z,refs_with_errors:J,refs_with_warnings_only:B,refs_verified:k,progress_percent:V},error:null,completedCheckId:null,statusFilter:[]})},setCurrentCheckId:i=>{r({currentCheckId:i})},setStatusFilter:i=>{const o=c().statusFilter;o.includes(i)&&o.length===1?r({statusFilter:[]}):r({statusFilter:[i]})},clearStatusFilter:()=>{r({statusFilter:[]})},setStatusMessage:i=>{D.debug("CheckStore",`Status: ${i}`),r({statusMessage:i})},setProgress:i=>{r({progress:i})},setPaperTitle:i=>{D.info("CheckStore",`Paper title: ${i}`),r({paperTitle:i})},setPaperSource:i=>{D.info("CheckStore",`Paper source: ${i}`),r({paperSource:i})},setReferences:i=>{D.info("CheckStore",`References extracted: ${i.length}`);const o=i.map((f,h)=>({...f,index:h,status:"pending",errors:[],warnings:[],authoritative_urls:[]}));r({references:o})},updateReference:(i,o)=>{D.debug("CheckStore",`Reference ${i} updated`,o);const f=o?.status?o.status.toLowerCase():null,{index:h,...m}=o;r(y=>({references:y.references.map((v,g)=>g===i?{...v,...m,index:g,...f?{status:f}:{}}:v)}))},updateStats:i=>{D.debug("CheckStore","Stats updated",i),r({stats:i,progress:i.progress_percent||0})},completeCheck:i=>{D.info("CheckStore",`Check completed, id: ${i}`),r({status:"completed",statusMessage:"Check completed",completedCheckId:i})},cancelCheck:()=>{D.info("CheckStore","Check cancelled"),r({status:"cancelled",statusMessage:"Check cancelled"})},setError:i=>{D.error("CheckStore","Check error",i);let o=i;typeof i=="string"&&(o=i.replace(/\s*\(https?:\/\/[^\s)]+\)/g,""),o=o.replace(/^Check failed:\s*/i,"")),r({status:"error",statusMessage:`Error: ${o}`,error:o})},reset:()=>{D.info("CheckStore","Reset state");const i=c().sessionToCheckMap;r({status:"idle",sessionId:null,currentCheckId:null,sessionToCheckMap:i,paperTitle:null,paperSource:null,statusMessage:"",progress:0,references:[],stats:{total_refs:0,processed_refs:0,verified_count:0,errors_count:0,warnings_count:0,suggestions_count:0,unverified_count:0,refs_with_issues:0,refs_with_errors:0,refs_with_warnings_only:0,refs_verified:0,progress_percent:0},error:null,completedCheckId:null,statusFilter:[]})},handleWebSocketMessage:i=>{const{type:o,session_id:f,check_id:h,...m}=i,y=c(),v=st.getState(),g=h||y.sessionToCheckMap[f]||y.currentCheckId;if(f&&y.sessionId&&f!==y.sessionId){if(!g){D.warn("CheckStore",`Cannot route message - no check_id for session ${f}`);return}switch(o){case"started":case"extracting":v.updateHistoryProgress(g,{status:"in_progress"}),m.paper_title&&v.updateHistoryItemTitle(g,m.paper_title);break;case"references_extracted":const x=m.references?m.references.map((z,Z)=>({...z,index:Z,status:"pending",errors:[],warnings:[],authoritative_urls:[]})):[];v.updateHistoryProgress(g,{status:"in_progress",total_refs:m.total_refs||m.count||0,processed_refs:0,results:x,extraction_method:m.extraction_method});break;case"checking_reference":typeof m.index=="number"&&v.updateHistoryReference(g,m.index-1,{status:"checking"});break;case"reference_result":v.updateHistoryReference(g,m.index-1,{...m,status:m.status||"checked"});break;case"summary_update":v.updateHistoryProgress(g,{status:"in_progress",total_refs:m.total_refs,processed_refs:m.processed_refs,errors_count:m.errors_count,warnings_count:m.warnings_count,suggestions_count:m.suggestions_count,unverified_count:m.unverified_count,verified_count:m.verified_count,refs_with_errors:m.refs_with_errors,refs_with_warnings_only:m.refs_with_warnings_only,refs_verified:m.refs_verified});break;case"completed":D.info("CheckStore",`Check ${g} completed (concurrent session ${f?.slice(0,8)})`),v.updateHistoryProgress(g,{status:"completed",total_refs:m.total_refs,processed_refs:m.total_refs,errors_count:m.errors_count,warnings_count:m.warnings_count,suggestions_count:m.suggestions_count,unverified_count:m.unverified_count,verified_count:m.verified_count,refs_with_errors:m.refs_with_errors,refs_with_warnings_only:m.refs_with_warnings_only,refs_verified:m.refs_verified,extraction_method:m.extraction_method});break;case"error":D.error("CheckStore",`Check ${g} failed (concurrent session ${f?.slice(0,8)})`,m),v.updateHistoryProgress(g,{status:"error"});break;case"cancelled":D.info("CheckStore",`Check ${g} cancelled (concurrent session ${f?.slice(0,8)})`),v.updateHistoryProgress(g,{status:"cancelled"});break}return}switch(D.debug("CheckStore",`Processing message type: ${o}`),o){case"started":y.setStatusMessage(`Check started: ${m.message||"Initializing..."}`),m.source&&y.setPaperSource(m.source),st.getState().updateHistoryProgress(y.currentCheckId,{status:"in_progress",paper_source:m.source||y.paperSource||""});break;case"extracting":y.setStatusMessage(m.message||"Extracting references..."),m.paper_title&&m.paper_title!=="Unknown Paper"&&(!y.paperTitle||y.paperTitle==="Unknown Paper")&&(y.setPaperTitle(m.paper_title),st.getState().updateHistoryItemTitle(y.currentCheckId,m.paper_title)),st.getState().updateHistoryProgress(y.currentCheckId,{status:"in_progress"});break;case"title_updated":m.paper_title&&(y.setPaperTitle(m.paper_title),st.getState().updateHistoryItemTitle(y.currentCheckId,m.paper_title));break;case"references_extracted":y.setStatusMessage(`Found ${m.total_refs||m.count||0} references, starting verification...`),m.references&&y.setReferences(m.references),typeof m.total_refs=="number"&&st.getState().updateHistoryProgress(y.currentCheckId,{status:"in_progress",total_refs:m.total_refs,processed_refs:0,extraction_method:m.extraction_method}),m.extraction_method&&y.updateStats({...c().stats,extraction_method:m.extraction_method});break;case"checking_reference":typeof m.index=="number"&&y.updateReference(m.index-1,{status:"checking"});break;case"reference_result":y.updateReference(m.index-1,{...m,status:m.status||"checked"});break;case"summary_update":y.updateStats(m),y.setStatusMessage(`Processed ${m.processed_refs} of ${m.total_refs} references...`),st.getState().updateHistoryProgress(y.currentCheckId,{status:"in_progress",total_refs:m.total_refs,processed_refs:m.processed_refs,errors_count:m.errors_count,warnings_count:m.warnings_count,suggestions_count:m.suggestions_count,unverified_count:m.unverified_count,verified_count:m.verified_count,refs_with_errors:m.refs_with_errors,refs_with_warnings_only:m.refs_with_warnings_only,refs_verified:m.refs_verified});break;case"progress":y.setProgress(m.percent||m.current/m.total*100),m.message&&y.setStatusMessage(m.message);break;case"completed":y.completeCheck(m.check_id),st.getState().updateHistoryProgress(y.currentCheckId,{status:"completed",total_refs:m.total_refs,processed_refs:m.total_refs,errors_count:m.errors_count,warnings_count:m.warnings_count,suggestions_count:m.suggestions_count,unverified_count:m.unverified_count,verified_count:m.verified_count,refs_with_errors:m.refs_with_errors,refs_with_warnings_only:m.refs_with_warnings_only,refs_verified:m.refs_verified,extraction_method:m.extraction_method});break;case"cancelled":y.cancelCheck();break;case"error":D.error("CheckStore","Server error",{data:m,checkIdForMessage:g,currentCheckId:y.currentCheckId,sessionId:y.sessionId,messageSessionId:f}),y.setError(m.message||m.details||"Unknown error"),g?(D.info("CheckStore",`Updating history item ${g} to error status`),st.getState().updateHistoryProgress(g,{status:"error"})):D.warn("CheckStore","No checkIdForMessage available to update history");break;default:D.warn("CheckStore",`Unknown message type: ${o}`,m)}}})),st=Pa((r,c)=>({history:[],selectedCheckId:null,selectedCheck:null,isLoading:!1,isLoadingDetail:!1,error:null,placeholderAdded:!1,scrollTrigger:0,fetchHistory:async(i=50)=>{D.info("HistoryStore","fetchHistory called"),r({isLoading:!0,error:null});try{const f=(await tm(i)).data;let h=Array.isArray(f)?[...f]:[];const m=Xe.getState(),y=m.status==="checking"&&!!m.currentCheckId,v=y&&h.some(k=>k.id===m.currentCheckId),g=h.find(k=>k.id===m.currentCheckId);if(g&&y&&g.status!=="in_progress"){D.info("HistoryStore","Detected completed/non-in-progress state for current check, hydrating detail",{id:g.id,status:g.status});try{const k=(await In(g.id)).data,X=Math.max((k.total_refs||0)-(k.errors_count||0)-(k.warnings_count||0)-(k.suggestions_count||0)-(k.unverified_count||0),0);Xe.setState({status:k.status||"completed",statusMessage:k.status==="completed"?"Check completed":`Status: ${k.status||""}`,currentCheckId:k.id,paperTitle:k.paper_title,paperSource:k.paper_source,references:Array.isArray(k.results)?k.results.map((Q,ne)=>({...Q,index:ne,status:Q.status||"checked",errors:Q.errors||[],warnings:Q.warnings||[],authoritative_urls:Q.authoritative_urls||[]})):[],stats:{total_refs:k.total_refs||0,processed_refs:k.total_refs||0,verified_count:X,errors_count:k.errors_count||0,warnings_count:k.warnings_count||0,suggestions_count:k.suggestions_count||0,unverified_count:k.unverified_count||0,refs_with_issues:k.refs_with_issues||0,refs_verified:k.refs_verified||X,progress_percent:100},completedCheckId:k.status==="completed"?k.id:null})}catch(k){D.error("HistoryStore","Failed to hydrate current check detail",k)}}const S=h.filter(k=>k.status==="in_progress").slice(0,5);for(const k of S)try{const X=(await In(k.id)).data,Q=Array.isArray(X.results)?X.results:[],ne=Q.filter(re=>re&&re.status&&re.status!=="pending"&&re.status!=="checking").length;h=h.map(re=>re.id===k.id?{...re,status:X.status||"in_progress",total_refs:X.total_refs||0,processed_refs:ne,errors_count:X.errors_count||0,warnings_count:X.warnings_count||0,suggestions_count:X.suggestions_count||0,unverified_count:X.unverified_count||0,refs_with_errors:X.refs_with_errors||0,refs_with_warnings_only:X.refs_with_warnings_only||0,results:Q,session_id:k.session_id}:re),k.session_id&&X.status==="in_progress"&&Xe.getState().registerSession(k.session_id,k.id),D.info("HistoryStore","Loaded progress for in_progress item",{id:k.id,status:X.status,total_refs:X.total_refs,processed_refs:ne,session_id:k.session_id})}catch(X){D.warn("HistoryStore","Failed to load in_progress item detail",{id:k.id,error:X?.message})}const x=!v&&y?[{id:m.currentCheckId,paper_title:m.paperTitle||m.paperSource||"In-progress check",paper_source:m.paperSource||"",custom_label:null,timestamp:new Date().toISOString(),total_refs:m.stats?.total_refs||0,errors_count:m.stats?.errors_count||0,warnings_count:m.stats?.warnings_count||0,suggestions_count:m.stats?.suggestions_count||0,unverified_count:m.stats?.unverified_count||0,llm_provider:null,llm_model:null,status:"in_progress",source_type:"url",placeholder:!1},...h]:h;!v&&y&&D.info("HistoryStore","Injected active check into history",{id:m.currentCheckId}),D.info("HistoryStore",`Fetched ${x.length} items (including injected) from API`);const z={completed:3,error:2,cancelled:2,in_progress:1,idle:0},Z=c().history,C=x.map(k=>{const X=Z.find(re=>re.id===k.id);if(!X)return k;const Q=z[X.status]??0,ne=z[k.status]??0;return Q>ne?(D.info("HistoryStore",`Preserving in-memory status for ${k.id}`,{inMemory:X.status,fetched:k.status}),{...k,...X}):k}),T=new Set(x.map(k=>k.id)),N=Z.filter(k=>k.id!==-1&&!T.has(k.id)&&k.status==="in_progress");N.length>0&&(D.info("HistoryStore",`Preserving ${N.length} locally-added items not yet in API`),C.unshift(...N)),r({history:C,isLoading:!1}),D.info("HistoryStore",`Set ${C.length} history items (merged)`);const{selectedCheckId:H,selectedCheck:F}=c(),V=x.find(k=>k.id===H),J=V&&F&&V.status!==F.status;if(H!==null&&H!==-1&&(J||!F)){D.info("HistoryStore",`Refreshing selected check ${H} after history fetch`);try{const X=(await In(H)).data,Q=Xe.getState(),ne=Q.status==="checking",re=Q.sessionId===X.session_id;X.status==="in_progress"&&X.session_id&&!ne&&!re&&Xe.getState().adoptSession(X),r({selectedCheck:X})}catch(k){D.error("HistoryStore",`Failed to refresh selected check ${H}`,k)}}}catch(o){D.error("HistoryStore","Failed to fetch history",o),r({error:o.message,isLoading:!1})}},initializeWithPlaceholder:async(i=50)=>{if(c().placeholderAdded){D.info("HistoryStore","Placeholder already added, skipping initialization");return}r({placeholderAdded:!0,isLoading:!0,error:null}),D.info("HistoryStore","Starting initializeWithPlaceholder API call");const f=5,h=1e3;let m=null;for(let v=1;v<=f;v++)try{D.info("HistoryStore",`Attempting to fetch history (attempt ${v}/${f})`);const g=new Promise((T,N)=>setTimeout(()=>N(new Error("Connection timeout")),1e4)),x=(await Promise.race([tm(i),g])).data;let z=Array.isArray(x)?[...x]:[];const Z=z.filter(T=>T.status==="in_progress").slice(0,5);for(const T of Z)try{const N=(await In(T.id)).data,H=Array.isArray(N.results)?N.results:[],F=H.filter(V=>V&&V.status&&V.status!=="pending"&&V.status!=="checking").length;z=z.map(V=>V.id===T.id?{...V,status:N.status||"in_progress",total_refs:N.total_refs||0,processed_refs:F,errors_count:N.errors_count||0,warnings_count:N.warnings_count||0,suggestions_count:N.suggestions_count||0,unverified_count:N.unverified_count||0,refs_with_errors:N.refs_with_errors||0,refs_with_warnings_only:N.refs_with_warnings_only||0,results:H,session_id:T.session_id}:V),T.session_id&&N.status==="in_progress"&&Xe.getState().registerSession(T.session_id,T.id),D.info("HistoryStore","Startup: loaded progress for in_progress item",{id:T.id,status:N.status,total_refs:N.total_refs,processed_refs:F,session_id:T.session_id})}catch(N){D.warn("HistoryStore","Startup: failed to load in_progress item detail",{id:T.id,error:N?.message})}D.info("HistoryStore",`Fetched ${z.length} items, adding placeholder`),r({history:[{id:-1,paper_title:"New refcheck",paper_source:"",custom_label:null,timestamp:null,total_refs:0,errors_count:0,warnings_count:0,suggestions_count:0,unverified_count:0,llm_provider:null,llm_model:null,status:"idle",source_type:"url",placeholder:!0},...z],isLoading:!1,error:null,selectedCheckId:-1,selectedCheck:null}),D.info("HistoryStore",`Initialized with placeholder and ${z.length} history items`);return}catch(g){if(m=g,D.warn("HistoryStore",`Attempt ${v}/${f} failed: ${g.message}`),v<f){const S=h*Math.pow(2,v-1);D.info("HistoryStore",`Retrying in ${S}ms...`),await new Promise(x=>setTimeout(x,S))}}D.error("HistoryStore",`Failed to fetch history after ${f} attempts`,m),r({history:[{id:-1,paper_title:"New refcheck",paper_source:"",custom_label:null,timestamp:null,total_refs:0,errors_count:0,warnings_count:0,suggestions_count:0,unverified_count:0,llm_provider:null,llm_model:null,status:"idle",source_type:"url",placeholder:!0}],error:`Failed to connect to server after ${f} attempts. History will load when server is available.`,isLoading:!1,selectedCheckId:-1,selectedCheck:null}),setTimeout(()=>{D.info("HistoryStore","Background retry: attempting to fetch history"),c().fetchHistory()},5e3)},selectCheck:async i=>{if(i===-1){r({selectedCheckId:-1,selectedCheck:null,isLoadingDetail:!1,error:null});return}const o=c().history.find(f=>f.id===i);if(o?.status==="in_progress"&&o?.total_refs>0,o?.status==="in_progress"&&o?.results?.length>0){r({selectedCheckId:i,selectedCheck:o,isLoadingDetail:!1,error:null});return}r({selectedCheckId:i,isLoadingDetail:!0,error:null});try{D.info("HistoryStore",`Loading check details for ${i}`);const h=(await In(i)).data,m=Xe.getState(),y=m.status==="checking",v=m.sessionId===h.session_id;h.status==="in_progress"&&h.session_id&&!y&&!v&&Xe.getState().adoptSession(h);const g={completed:3,error:2,cancelled:2,in_progress:1,idle:0};r(S=>{const x=S.history.find(B=>B.id===i),z=g[x?.status]??0,Z=g[h.status]??0,C=x?.processed_refs||0,T=h.processed_refs||0,N=x&&(z>Z||z===Z&&x.status==="in_progress"&&C>T),H=x?.results||[],F=h.results||[],V=H.length>0&&(F.length===0||H.length>=F.length);return{selectedCheck:N&&x.status==="in_progress"?{...h,status:x.status,total_refs:x.total_refs||h.total_refs,processed_refs:x.processed_refs||h.processed_refs,errors_count:x.errors_count??h.errors_count,warnings_count:x.warnings_count??h.warnings_count,suggestions_count:x.suggestions_count??h.suggestions_count,unverified_count:x.unverified_count??h.unverified_count,results:V?H:F}:{...h,results:V?H:F},isLoadingDetail:!1,selectedCheckId:i,history:S.history.map(B=>B.id===i?N?B:{...B,status:h.status,total_refs:h.total_refs,processed_refs:h.processed_refs,errors_count:h.errors_count,warnings_count:h.warnings_count,suggestions_count:h.suggestions_count,unverified_count:h.unverified_count,refs_with_errors:h.refs_with_errors,refs_with_warnings_only:h.refs_with_warnings_only,paper_title:h.paper_title||B.paper_title}:B)}}),D.info("HistoryStore","Check details loaded and history synced",{title:h.paper_title,refs:h.total_refs,status:h.status})}catch(f){D.error("HistoryStore","Failed to load check details",f),r({error:f.message,isLoadingDetail:!1})}},clearSelection:()=>{r({selectedCheckId:null,selectedCheck:null})},updateLabel:async(i,o)=>{if(i!==-1)try{D.info("HistoryStore",`Updating label for ${i}`,{label:o}),await rv(i,o),r(f=>({history:f.history.map(h=>h.id===i?{...h,custom_label:o}:h),selectedCheck:f.selectedCheck?.id===i?{...f.selectedCheck,custom_label:o}:f.selectedCheck})),D.info("HistoryStore","Label updated")}catch(f){throw D.error("HistoryStore","Failed to update label",f),f}},updateHistoryProgress:(i,o={})=>{if(!i){D.warn("HistoryStore","updateHistoryProgress called with no id");return}r(f=>({history:f.history.map(h=>h.id===i?{...h,...o}:h),selectedCheck:f.selectedCheck?.id===i?{...f.selectedCheck,...o}:f.selectedCheck}))},updateHistoryReference:(i,o,f)=>{if(!i||o<0){D.warn("HistoryStore","updateHistoryReference called with invalid args",{checkId:i,refIndex:o});return}r(h=>{const m=h.history.map(v=>{if(v.id!==i||!v.results||o>=v.results.length)return v;const g=[...v.results];return g[o]={...g[o],...f},{...v,results:g}});let y=h.selectedCheck;if(h.selectedCheck?.id===i&&h.selectedCheck?.results){const v=[...h.selectedCheck.results];o<v.length&&(v[o]={...v[o],...f},y={...h.selectedCheck,results:v})}return{history:m,selectedCheck:y}})},deleteCheck:async i=>{if(i===-1){r(o=>({history:o.history.filter(f=>f.id!==-1),selectedCheckId:o.selectedCheckId===-1?null:o.selectedCheckId,selectedCheck:o.selectedCheckId===-1?null:o.selectedCheck}));return}try{D.info("HistoryStore",`Deleting check ${i}`),await av(i),r(f=>{const h=f.history.filter(g=>g.id!==i),m=f.selectedCheckId===i;let y=m?null:f.selectedCheckId,v=m?null:f.selectedCheck;if(m&&h.length>0&&!h.some(S=>S.id===-1)){const S=h[0];y=S.id,v=S}return{history:h,selectedCheckId:y,selectedCheck:v}});const o=c();if(o.selectedCheckId&&o.selectedCheckId!==i)try{const f=await In(o.selectedCheckId);r({selectedCheck:f.data})}catch(f){D.error("HistoryStore","Failed to fetch auto-selected check details",f)}D.info("HistoryStore","Check deleted")}catch(o){throw D.error("HistoryStore","Failed to delete check",o),o}},addToHistory:i=>{D.info("HistoryStore","Adding check to history",{id:i.id}),r(o=>({history:[i,...o.history.filter(f=>f.id!==-1)]}))},ensureNewRefcheckItem:()=>{r(i=>i.history.some(h=>h.id===-1)?{...i,placeholderAdded:!0,scrollTrigger:i.scrollTrigger+1}:{history:[{id:-1,paper_title:"New refcheck",paper_source:"",custom_label:null,timestamp:null,total_refs:0,errors_count:0,warnings_count:0,suggestions_count:0,unverified_count:0,llm_provider:null,llm_model:null,status:"idle",source_type:"url",placeholder:!0},...i.history],placeholderAdded:!0,scrollTrigger:i.scrollTrigger+1})},updateHistoryItemTitle:(i,o)=>{D.info("HistoryStore",`Updating title for ${i}`,{paper_title:o}),r(f=>({history:f.history.map(h=>h.id===i?{...h,paper_title:o}:h),selectedCheck:f.selectedCheck?.id===i?{...f.selectedCheck,paper_title:o}:f.selectedCheck}))}}));function cv(r){const c=new Date(r),o=new Date-c,f=Math.floor(o/(1e3*60*60*24));return f===0?`Today at ${c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:f===1?`Yesterday at ${c.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:f<7?c.toLocaleDateString([],{weekday:"long",hour:"2-digit",minute:"2-digit"}):c.toLocaleDateString([],{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ar(r,c=!1){return!r||r.length===0?"Unknown authors":r.length===1?r[0]:r.length===2?`${r[0]} and ${r[1]}`:c?`${r[0]} et al.`:r.length>10?`${r.slice(0,10).join(", ")}, et al.`:r.join(", ")}function Rs(r){if(r===0)return"0 Bytes";const c=1024,i=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(r)/Math.log(c));return parseFloat((r/Math.pow(c,o)).toFixed(2))+" "+i[o]}function xc(r){if(!r)return null;const c=r.split(`
|
|
15
|
+
`);if(c.length>=3){const h=c[0].replace(/:$/,"").trim(),m=c[1].match(/cited:\s*(.*)/),y=c[2].match(/actual:\s*(.*)/);if(m||y)return{prefix:h,cited:m?m[1].trim():null,actual:y?y[1].trim():null}}const i=r.match(/^(.+?):?\s*cited:\s*([^a]+?)(?:\s+actual:\s*(.+))?$/i);if(i)return{prefix:i[1].trim(),cited:i[2]?.trim()||null,actual:i[3]?.trim()||null};const o=r.toLowerCase().indexOf("cited:"),f=r.toLowerCase().indexOf("actual:");if(o!==-1&&f!==-1&&f>o){const h=r.substring(0,o).replace(/:$/,"").trim(),m=r.substring(o+6,f).trim(),y=r.substring(f+7).trim();return{prefix:h,cited:m,actual:y}}return null}function Ec(r){const c={title:r.title,authors:r.authors,year:r.year,venue:r.venue,url:r.authoritative_urls?.[0]?.url||r.cited_url},i=[...r.errors||[],...r.warnings||[]];for(const o of i){const f=(o.error_type||"").toLowerCase(),m=xc(o.error_details)?.actual||o.actual_value;if(m)switch(f){case"title":c.title=m;break;case"author":case"authors":typeof m=="string"?c.authors=m.split(/,\s*(?:and\s+)?|;\s*|\s+and\s+/).map(y=>y.trim()).filter(y=>y.length>0):Array.isArray(m)&&(c.authors=m);break;case"year":c.year=m;break;case"venue":c.venue=m;break}}if(r.suggestions?.length>0)for(const o of r.suggestions){const f=o.suggestion_details||o;if(typeof f=="string"){const h=f.match(/https?:\/\/arxiv\.org\/abs\/[\w.]+/);h&&(c.arxivUrl=h[0])}}return c}function uv({paperTitle:r,paperSource:c,stats:i,references:o}){const f=[];return f.push("# RefChecker Report"),f.push(""),f.push(`**Paper:** ${r||"Unknown"}`),c&&f.push(`**Source:** ${c}`),f.push(`**Date:** ${new Date().toLocaleString()}`),f.push(""),f.push("## Summary"),f.push(""),f.push("| Metric | Count |"),f.push("|--------|-------|"),f.push(`| Total References | ${i.total_refs||0} |`),f.push(`| Verified | ${i.refs_verified??i.verified_count??0} |`),f.push(`| With Errors | ${i.refs_with_errors??0} |`),f.push(`| With Warnings | ${i.refs_with_warnings_only??0} |`),f.push(`| Unverified | ${i.unverified_count??0} |`),f.push(""),f.push("| Issue Type | Count |"),f.push("|------------|-------|"),f.push(`| Errors | ${i.errors_count||0} |`),f.push(`| Warnings | ${i.warnings_count||0} |`),f.push(`| Suggestions | ${i.suggestions_count||0} |`),f.push(""),f.push("## References"),f.push(""),!o||o.length===0?f.push("No references found."):o.forEach((h,m)=>{const y=(h.status||"unknown").toLowerCase(),v={verified:"✅",warning:"⚠️",error:"❌",suggestion:"💡",unverified:"❓"}[y]||"❓";if(f.push(`### ${m+1}. ${h.title||h.cited_url||"Unknown Title"} ${v}`),f.push(""),h.authors?.length>0&&f.push(`**Authors:** ${ar(h.authors)}`),h.venue&&f.push(`**Venue:** ${h.venue}`),h.year&&f.push(`**Year:** ${h.year}`),h.cited_url&&f.push(`**Cited URL:** ${h.cited_url}`),h.authoritative_urls?.length>0&&(f.push(""),f.push("**Verified URLs:**"),h.authoritative_urls.forEach(g=>{const S={semantic_scholar:"Semantic Scholar",arxiv:"ArXiv",doi:"DOI",openalex:"OpenAlex",openreview:"OpenReview"}[g.type]||g.type;f.push(`- ${S}: ${g.url}`)})),h.errors?.length>0){const g=h.errors.filter(x=>x.error_type!=="unverified"),S=h.errors.find(x=>x.error_type==="unverified");g.length>0&&(f.push(""),f.push("**Errors:**"),g.forEach(x=>{const z=xc(x.error_details);z?(f.push(`- ❌ ${z.prefix}`),z.cited&&f.push(` - Cited: ${z.cited}`),z.actual&&f.push(` - Actual: ${z.actual}`)):(f.push(`- ❌ ${x.error_details||x.error_type}`),x.cited_value&&f.push(` - Cited: ${x.cited_value}`),x.actual_value&&f.push(` - Actual: ${x.actual_value}`))})),S&&y==="unverified"&&(f.push(""),f.push(`**Could not verify:** ${S.error_details||"Paper not found by any checker"}`))}h.warnings?.length>0&&(f.push(""),f.push("**Warnings:**"),h.warnings.forEach(g=>{const S=xc(g.error_details);S?(f.push(`- ⚠️ ${S.prefix}`),S.cited&&f.push(` - Cited: ${S.cited}`),S.actual&&f.push(` - Actual: ${S.actual}`)):(f.push(`- ⚠️ ${g.error_details||g.error_type}`),g.cited_value&&f.push(` - Cited: ${g.cited_value}`),g.actual_value&&f.push(` - Actual: ${g.actual_value}`))})),h.suggestions?.length>0&&(f.push(""),f.push("**Suggestions:**"),h.suggestions.forEach(g=>{const S=typeof g=="string"?g:g.suggestion_details;f.push(`- 💡 ${S}`)})),f.push(""),f.push("---"),f.push("")}),f.join(`
|
|
16
|
+
`)}function uc(r,c,i="text/markdown"){const o=new Blob([r],{type:i}),f=URL.createObjectURL(o),h=document.createElement("a");h.href=f,h.download=c,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(f)}async function fv(r){try{return await navigator.clipboard.writeText(r),!0}catch(c){return console.error("Failed to copy to clipboard:",c),!1}}function dv({paperTitle:r,paperSource:c,stats:i,references:o}){const f=[];return f.push("REFCHECKER REPORT"),f.push("=".repeat(50)),f.push(""),f.push(`Paper: ${r||"Unknown"}`),c&&f.push(`Source: ${c}`),f.push(`Date: ${new Date().toLocaleString()}`),f.push(""),f.push("SUMMARY"),f.push("-".repeat(30)),f.push(`Total References: ${i.total_refs||0}`),f.push(`Verified: ${i.refs_verified??i.verified_count??0}`),f.push(`Errors: ${i.errors_count||0}`),f.push(`Warnings: ${i.warnings_count||0}`),f.push(`Unverified: ${i.unverified_count??0}`),f.push(""),f.push("REFERENCES"),f.push("-".repeat(30)),!o||o.length===0?f.push("No references found."):o.forEach((h,m)=>{const y=(h.status||"unknown").toUpperCase();f.push(""),f.push(`[${m+1}] ${h.title||h.cited_url||"Unknown Title"} [${y}]`),h.authors?.length>0&&f.push(` Authors: ${ar(h.authors)}`),h.year&&f.push(` Year: ${h.year}`),h.venue&&f.push(` Venue: ${h.venue}`),h.errors?.length>0&&h.errors.filter(v=>v.error_type!=="unverified").forEach(v=>{f.push(` ERROR: ${v.error_details||v.error_type}`)}),h.warnings?.length>0&&h.warnings.forEach(v=>{f.push(` WARNING: ${v.error_details||v.error_type}`)})}),f.join(`
|
|
17
|
+
`)}function hv(r,c){let i="";if(r.authors?.length>0){const f=r.authors[0].split(/[,\s]+/);i=f[f.length>1?f.length-1:0]||"",i=i.replace(/[^a-zA-Z]/g,"").toLowerCase()}if(r.year&&(i+=r.year),r.title){const o=r.title.split(/\s+/)[0].replace(/[^a-zA-Z]/g,"").toLowerCase();i+=o}return i||`ref${c+1}`}function Ns(r){return r?r.replace(/\\/g,"\\textbackslash{}").replace(/[&%$#_{}]/g,c=>"\\"+c).replace(/~/g,"\\textasciitilde{}").replace(/\^/g,"\\textasciicircum{}"):""}function Om(r,c=0){const i=Ec(r),o=hv({...r,...i,authors:i.authors},c),f=[],h=(i.venue||"").toLowerCase();let m="article";if(h.includes("conference")||h.includes("proceedings")||h.includes("workshop")?m="inproceedings":(h.includes("arxiv")||i.arxivUrl||r.cited_url?.includes("arxiv"))&&(m="misc"),f.push(`@${m}{${o},`),i.title&&f.push(` title = {${Ns(i.title)}},`),i.authors?.length>0){const y=i.authors.map(v=>Ns(v)).join(" and ");f.push(` author = {${y}},`)}if(i.year&&f.push(` year = {${i.year}},`),i.venue&&(m==="inproceedings"?f.push(` booktitle = {${Ns(i.venue)}},`):m==="article"&&f.push(` journal = {${Ns(i.venue)}},`)),i.arxivUrl){f.push(` url = {${i.arxivUrl}},`);const y=i.arxivUrl.match(/arxiv\.org\/abs\/(.+)/);y&&(f.push(` eprint = {${y[1]}},`),f.push(" archiveprefix = {arXiv},"))}else{const y=r.authoritative_urls?.find(g=>g.type==="doi"),v=r.authoritative_urls?.find(g=>g.type==="arxiv");if(y){const g=y.url.match(/doi\.org\/(.+)/);g?f.push(` doi = {${g[1]}},`):f.push(` url = {${y.url}},`)}else if(v){f.push(` url = {${v.url}},`);const g=v.url.match(/arxiv\.org\/abs\/(.+)/);g&&(f.push(` eprint = {${g[1]}},`),f.push(" archiveprefix = {arXiv},"))}else r.cited_url&&f.push(` url = {${r.cited_url}},`)}return f.push("}"),f.join(`
|
|
18
|
+
`)}function mv({references:r}){return!r||r.length===0?"% No references found":r.map((i,o)=>Om(i,o)).join(`
|
|
19
|
+
|
|
20
|
+
`)}function pv(r){const c=Ec(r),i=[];c.authors?.length>0&&i.push(ar(c.authors)),c.year&&i.push(c.year),c.title&&i.push(c.title),c.venue&&i.push(c.venue);let o=i.join(". ");o&&!o.endsWith(".")&&(o+=".");const f=c.arxivUrl||c.url;return f&&(o+=` ${f}`),o}function lm(r){const c=Ec(r),i=[];c.title&&i.push(`**${c.title}**`),c.authors?.length>0&&i.push(`**Authors:** ${ar(c.authors)}`),c.venue&&i.push(`**Venue:** *${c.venue}*`),c.year&&i.push(`**Year:** ${c.year}`);const o=c.arxivUrl||c.url;return o&&i.push(`**URL:** ${o}`),i.join(`
|
|
21
|
+
`)}function nm(r){if(!r||r.startsWith("http://")||r.startsWith("https://"))return r;const c=r.match(/^(?:arXiv:)?(\d{4}\.\d{4,5}(?:v\d+)?)$/i);return c?`https://arxiv.org/abs/${c[1]}`:r}function gv({item:r,isSelected:c}){const{selectCheck:i,updateLabel:o,deleteCheck:f,updateHistoryProgress:h}=st(),m=Xe(E=>E.sessionId),y=Xe(E=>E.cancelCheck),[v,g]=K.useState(!1),[S,x]=K.useState(""),[z,Z]=K.useState(!1),[C,T]=K.useState(!1),N=r.custom_label||r.paper_title||"Untitled Check",H=r.id===-1,F=r.status==="in_progress",V=r.total_refs||0,J=r.processed_refs||0,B=V>0?Math.min(J/V*100,100):0,k=()=>{!v&&!c&&(D.info("HistoryItem",`Selecting check ${r.id}`),i(r.id))},X=E=>{E.stopPropagation(),x(N),g(!0)},Q=async()=>{if(S.trim()&&S.trim()!==N)try{await o(r.id,S.trim()),D.info("HistoryItem",`Label updated for ${r.id}`)}catch(E){D.error("HistoryItem","Failed to update label",E)}g(!1)},ne=()=>{g(!1)},re=E=>{E.key==="Enter"?Q():E.key==="Escape"&&ne()},ie=async E=>{E.stopPropagation(),Z(!0)},oe=async E=>{E.stopPropagation();try{await f(r.id),D.info("HistoryItem",`Deleted check ${r.id}`)}catch(I){D.error("HistoryItem","Failed to delete",I)}Z(!1)},Ne=E=>{E.stopPropagation(),Z(!1)},we=async E=>{if(E.stopPropagation(),!(!r.session_id||C)){T(!0);try{D.info("HistoryItem",`Cancelling check ${r.session_id}`),await Rm(r.session_id),h(r.id,{status:"cancelled"}),r.session_id===m&&y(),D.info("HistoryItem",`Check ${r.id} cancelled`)}catch(I){D.error("HistoryItem","Failed to cancel check",I),h(r.id,{status:"cancelled"}),r.session_id===m&&y()}finally{T(!1)}}},A=r.status==="in_progress"?{color:"var(--color-accent)",label:"In progress",isAnimated:!0}:r.status==="cancelled"?{color:"var(--color-warning)",label:"Cancelled",isAnimated:!1}:r.status==="error"?{color:"var(--color-error)",label:"Error",isAnimated:!1}:r.errors_count>0?{color:"var(--color-error)",label:`${r.errors_count} errors`,isAnimated:!1}:r.warnings_count>0?{color:"var(--color-warning)",label:`${r.warnings_count} warnings`,isAnimated:!1}:r.unverified_count>0?{color:"var(--color-text-muted)",label:`${r.unverified_count} unverified`,isAnimated:!1}:{color:"var(--color-success)",label:"All verified",isAnimated:!1};return u.jsxs("div",{"data-history-item":!0,onClick:k,className:`px-3 py-2 mx-2 my-0.5 cursor-pointer transition-colors rounded-md relative ${c?"":"history-item-hoverable"}`,style:{backgroundColor:c?"var(--color-bg-tertiary)":void 0,minHeight:"72px"},children:[u.jsxs("div",{className:"w-full",children:[v?u.jsx("input",{type:"text",value:S,onChange:E=>x(E.target.value),onBlur:Q,onKeyDown:re,onClick:E=>E.stopPropagation(),autoFocus:!0,className:"w-full px-2 py-1 text-sm rounded border focus:outline-none focus:ring-1",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-accent)",color:"var(--color-text-primary)"}}):u.jsx("div",{className:"font-medium text-sm leading-tight overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--color-text-primary)"},title:N,children:N}),!H&&r.paper_source&&r.source_type!=="text"&&r.source_type!=="file"&&u.jsx("div",{className:"text-xs mt-0.5 overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--color-text-muted)"},title:nm(r.paper_source),children:nm(r.paper_source)}),r.timestamp&&!H&&u.jsx("div",{className:"text-xs mt-1",style:{color:"var(--color-text-muted)"},children:cv(r.timestamp)}),u.jsxs("div",{className:"flex items-center gap-1.5 mt-1 text-xs",style:{color:"var(--color-text-muted)"},children:[r.status==="error"&&u.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",style:{color:"var(--color-error)"},children:u.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),r.status==="cancelled"&&u.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",style:{color:"var(--color-warning)"},children:u.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1zm4 0a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})}),u.jsx("span",{style:{color:r.status==="error"?"var(--color-error)":r.status==="cancelled"?"var(--color-warning)":void 0},children:H?"Start a new check":r.status==="error"?"Check failed":r.status==="cancelled"?"Cancelled":F?V>0?`${J}/${V}`:"Extracting...":`${V} refs`}),!H&&u.jsxs(u.Fragment,{children:[(r.refs_with_errors||0)>0&&u.jsxs("span",{className:"flex items-center",style:{color:"var(--color-error)"},title:`${r.refs_with_errors} ref${r.refs_with_errors===1?"":"s"} with errors`,children:[u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),u.jsx("span",{className:"ml-0.5",children:r.refs_with_errors})]}),(r.refs_with_warnings_only||0)>0&&u.jsxs("span",{className:"flex items-center",style:{color:"var(--color-warning)"},title:`${r.refs_with_warnings_only} ref${r.refs_with_warnings_only===1?"":"s"} with warnings`,children:[u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),u.jsx("span",{className:"ml-0.5",children:r.refs_with_warnings_only})]}),(r.suggestions_count||0)>0&&u.jsxs("span",{className:"flex items-center",style:{color:"var(--color-suggestion)"},title:`${r.suggestions_count} suggestion${r.suggestions_count===1?"":"s"}`,children:[u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{d:"M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z"})}),u.jsx("span",{className:"ml-0.5",children:r.suggestions_count})]}),(r.unverified_count||0)>0&&u.jsxs("span",{className:"flex items-center",style:{color:"var(--color-text-muted)"},title:`${r.unverified_count} unverified ref${r.unverified_count===1?"":"s"}`,children:[u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:u.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),u.jsx("span",{className:"ml-0.5",children:r.unverified_count})]}),!F&&(r.refs_with_errors||0)===0&&(r.refs_with_warnings_only||0)===0&&(r.suggestions_count||0)===0&&(r.unverified_count||0)===0&&r.status==="completed"&&u.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",style:{color:"var(--color-success)"},title:"All references verified",children:u.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})]}),!H&&A.isAnimated&&u.jsxs("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",style:{color:A.color},children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),F&&r.session_id&&u.jsx("button",{onClick:we,disabled:C,className:"ml-auto text-xs px-2 py-0.5 rounded transition-colors",style:{backgroundColor:"var(--color-error-bg)",color:"var(--color-error)",opacity:C?.5:1,cursor:C?"wait":"pointer"},onMouseEnter:E=>{C||(E.currentTarget.style.backgroundColor="var(--color-error)",E.currentTarget.style.color="white")},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="var(--color-error-bg)",E.currentTarget.style.color="var(--color-error)"},title:"Cancel this check",children:C?"Cancelling...":"Cancel"})]}),F&&V>0&&u.jsxs("div",{className:"mt-2",children:[u.jsx("div",{className:"h-1 rounded-full overflow-hidden",style:{backgroundColor:"var(--color-bg-tertiary)"},children:u.jsx("div",{className:"h-full rounded-full transition-all duration-300 progress-bar",style:{width:`${Math.round(B)}%`}})}),u.jsxs("p",{className:"text-xs mt-0.5",style:{color:"var(--color-text-muted)"},children:[Math.round(B),"% complete"]})]})]}),z?u.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-1 px-2 py-1 rounded-lg",style:{backgroundColor:"var(--color-error-bg)"},children:[u.jsx("button",{onClick:oe,className:"p-1 rounded transition-colors",style:{color:"var(--color-error)"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor="var(--color-error)",E.currentTarget.style.color="white"},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent",E.currentTarget.style.color="var(--color-error)"},title:"Confirm delete",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),u.jsx("button",{onClick:Ne,className:"p-1 rounded transition-colors",style:{color:"var(--color-text-secondary)"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor="var(--color-bg-tertiary)"},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent"},title:"Cancel",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):!v&&!H&&u.jsxs("div",{className:"history-item-actions absolute top-2 right-2 flex items-center",children:[u.jsx("div",{className:"w-8 h-6",style:{background:"linear-gradient(to right, transparent, var(--color-bg-tertiary))"}}),u.jsxs("div",{className:"flex items-center gap-1 pl-1 pr-1 h-6",style:{backgroundColor:"var(--color-bg-tertiary)"},children:[u.jsx("button",{onClick:X,className:"p-1 rounded transition-colors cursor-pointer",style:{color:"var(--color-text-secondary)"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor="var(--color-accent)",E.currentTarget.style.color="white"},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent",E.currentTarget.style.color="var(--color-text-secondary)"},title:"Edit label",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),u.jsx("button",{onClick:ie,className:"p-1 rounded transition-colors cursor-pointer",style:{color:"var(--color-error)"},onMouseEnter:E=>{E.currentTarget.style.backgroundColor="var(--color-error-bg)"},onMouseLeave:E=>{E.currentTarget.style.backgroundColor="transparent"},title:"Delete",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]})}function yv(){const{history:r,selectedCheckId:c,isLoading:i,error:o,scrollTrigger:f}=st(),[h,m]=K.useState(!1),y=K.useRef(null);return K.useEffect(()=>{y.current&&(y.current.scrollTop=0)},[f]),K.useEffect(()=>{if(i&&r.length===0){const v=setTimeout(()=>{m(!0)},5e3);return()=>clearTimeout(v)}else m(!1)},[i,r.length]),i&&r.length===0?u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-4",style:{color:"var(--color-text-muted)"},children:[u.jsxs("div",{className:"flex items-center",children:[u.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2",fill:"none",viewBox:"0 0 24 24",children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading..."]}),h&&u.jsxs("p",{className:"text-xs mt-2 text-center",children:["Taking longer than expected...",u.jsx("br",{}),"Check if the backend is running on port 8000"]})]}):o&&r.length===0?u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-4 text-center",style:{color:"var(--color-text-muted)"},children:[u.jsx("svg",{className:"w-12 h-12 mb-3 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),u.jsx("p",{className:"text-sm text-red-400",children:"Failed to connect to backend"}),u.jsx("p",{className:"text-xs mt-1",children:"Make sure the server is running"})]}):r.length===0?u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-4 text-center",style:{color:"var(--color-text-muted)"},children:[u.jsx("svg",{className:"w-12 h-12 mb-3 opacity-50",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),u.jsx("p",{className:"text-sm",children:"No checks yet"}),u.jsx("p",{className:"text-xs mt-1",children:"Start a check to see history"})]}):u.jsx("div",{ref:y,className:"flex-1 overflow-y-auto",children:r.map(v=>u.jsx(gv,{item:v,isSelected:v.id===c},v.id))})}const Ys=Pa((r,c)=>({configs:[],selectedConfigId:null,isLoading:!1,error:null,fetchConfigs:async()=>{r({isLoading:!0,error:null});const i=5,o=1e3;let f=null;for(let h=1;h<=i;h++)try{D.info("ConfigStore",`Fetching LLM configs (attempt ${h}/${i})`);const y=(await Ky()).data,v=y.find(g=>g.is_default);r({configs:y,selectedConfigId:v?.id||y[0]?.id||null,isLoading:!1,error:null}),D.info("ConfigStore",`Loaded ${y.length} configs`);return}catch(m){if(f=m,D.warn("ConfigStore",`Attempt ${h}/${i} failed: ${m.message}`),h<i){const y=o*Math.pow(2,h-1);D.info("ConfigStore",`Retrying in ${y}ms...`),await new Promise(v=>setTimeout(v,y))}}D.error("ConfigStore",`Failed to fetch configs after ${i} attempts`,f),r({error:f?.message||"Failed to connect to server",isLoading:!1}),setTimeout(()=>{D.info("ConfigStore","Background retry: attempting to fetch configs"),c().fetchConfigs()},5e3)},addConfig:async i=>{r({isLoading:!0,error:null});try{D.info("ConfigStore","Creating LLM config",{name:i.name,provider:i.provider});const f=(await Jy(i)).data;return r(h=>({configs:[...h.configs,f],selectedConfigId:f.id,isLoading:!1})),await em(f.id),D.info("ConfigStore","Config created",f),f}catch(o){throw D.error("ConfigStore","Failed to create config",o),r({error:o.message,isLoading:!1}),o}},updateConfig:async(i,o)=>{r({isLoading:!0,error:null});try{D.info("ConfigStore",`Updating config ${i}`,o);const h=(await Wy(i,o)).data;return r(m=>({configs:m.configs.map(y=>y.id===i?h:y),isLoading:!1})),D.info("ConfigStore","Config updated"),h}catch(f){throw D.error("ConfigStore","Failed to update config",f),r({error:f.message,isLoading:!1}),f}},deleteConfig:async i=>{r({isLoading:!0,error:null});try{D.info("ConfigStore",`Deleting config ${i}`),await Fy(i),r(o=>{const f=o.configs.filter(m=>m.id!==i),h=o.selectedConfigId===i?f[0]?.id||null:o.selectedConfigId;return{configs:f,selectedConfigId:h,isLoading:!1}}),D.info("ConfigStore","Config deleted")}catch(o){throw D.error("ConfigStore","Failed to delete config",o),r({error:o.message,isLoading:!1}),o}},selectConfig:async i=>{D.info("ConfigStore",`Selecting config ${i}`);try{await em(i),r({selectedConfigId:i})}catch(o){D.error("ConfigStore","Failed to set default config",o)}},getSelectedConfig:()=>{const{configs:i,selectedConfigId:o}=c();return i.find(f=>f.id===o)||null}})),fc="",Lm=Pa((r,c)=>({settings:{},version:null,isLoading:!1,error:null,isSettingsOpen:!1,openSettings:()=>{r({isSettingsOpen:!0}),c().fetchSettings(),c().fetchVersion()},closeSettings:()=>{r({isSettingsOpen:!1})},toggleSettings:()=>{const{isSettingsOpen:i}=c();i?c().closeSettings():c().openSettings()},fetchSettings:async()=>{r({isLoading:!0,error:null});try{const i=await fetch(`${fc}/api/settings`);if(!i.ok)throw new Error(`Failed to fetch settings: ${i.status}`);const o=await i.json();D.info("SettingsStore","Fetched settings",o),r({settings:o,isLoading:!1})}catch(i){D.error("SettingsStore","Error fetching settings",i),r({error:i.message,isLoading:!1})}},fetchVersion:async(i=1)=>{try{const h=await fetch(`${fc}/api/version`);if(!h.ok)throw new Error(`Failed to fetch version: ${h.status}`);const m=await h.json();r({version:m.version}),D.info("SettingsStore",`Fetched version ${m.version}`)}catch(h){D.error("SettingsStore",`Error fetching version (attempt ${i})`,h),i<3&&setTimeout(()=>c().fetchVersion(i+1),800)}},updateSetting:async(i,o)=>{const{settings:f}=c(),h={...f};r({settings:{...f,[i]:{...f[i],value:String(o)}}});try{const m=await fetch(`${fc}/api/settings/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:String(o)})});if(!m.ok)throw new Error(`Failed to update setting: ${m.status}`);const y=await m.json();D.info("SettingsStore",`Updated setting ${i}`,y),r({settings:{...c().settings,[i]:{...c().settings[i],value:y.value}}})}catch(m){D.error("SettingsStore",`Error updating setting ${i}`,m),r({settings:h,error:m.message})}},getSetting:i=>{const{settings:o}=c(),f=o[i];if(!f)return null;const h=f.value;switch(f.type){case"number":return parseInt(h,10);case"boolean":return h==="true";default:return h}}})),dc=220,hc=500,vv=280,am="refchecker-sidebar-width";function xv(){const{fetchConfigs:r}=Ys(),{initializeWithPlaceholder:c,ensureNewRefcheckItem:i,selectCheck:o}=st(),{status:f,reset:h}=Xe(),{toggleSettings:m}=Lm(),[y,v]=K.useState(()=>{const T=localStorage.getItem(am);return T?Math.min(hc,Math.max(dc,parseInt(T,10))):vv}),[g,S]=K.useState(!1),x=K.useRef(null);K.useEffect(()=>{D.info("Sidebar","Initializing sidebar data"),r(),c()},[r,c]),K.useEffect(()=>{localStorage.setItem(am,y.toString())},[y]);const z=K.useCallback(T=>{T.preventDefault(),S(!0)},[]),Z=K.useCallback(()=>{S(!1)},[]),C=K.useCallback(T=>{if(g&&x.current){const N=T.clientX-x.current.getBoundingClientRect().left;N>=dc&&N<=hc&&v(N)}},[g]);return K.useEffect(()=>(g&&(window.addEventListener("mousemove",C),window.addEventListener("mouseup",Z),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",Z),document.body.style.cursor="",document.body.style.userSelect=""}),[g,C,Z]),u.jsxs("aside",{ref:x,className:"flex flex-col h-full relative",style:{width:`${y}px`,minWidth:`${dc}px`,maxWidth:`${hc}px`,backgroundColor:"var(--color-bg-secondary)"},children:[u.jsx("div",{className:"flex-shrink-0 px-3 py-3",children:u.jsxs("button",{onClick:()=>{i(),f!=="checking"&&h(),o(-1)},className:"w-full px-3 py-2 flex items-center gap-2 cursor-pointer transition-colors rounded-md hover:bg-[var(--color-bg-tertiary)]",title:"Create new refcheck",children:[u.jsx("span",{className:"w-6 h-6 rounded-full font-medium flex items-center justify-center flex-shrink-0",style:{backgroundColor:"var(--color-accent)",color:"#ffffff"},children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})})}),u.jsx("span",{className:"text-sm font-medium",style:{color:"var(--color-text-primary)"},children:"New Refcheck"})]})}),u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-h-0",children:[u.jsx("div",{className:"px-4 py-3",children:u.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--color-text-muted)"},children:"History"})}),u.jsx(yv,{})]}),u.jsx("div",{className:"flex-shrink-0 px-3 py-2",children:u.jsxs("button",{onClick:m,className:"flex items-center gap-2 w-full px-3 py-2 rounded-md text-sm transition-colors cursor-pointer hover:bg-[var(--color-bg-tertiary)]",style:{color:"var(--color-text-secondary)"},title:"Settings",children:[u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),u.jsx("span",{children:"Settings"})]})}),u.jsx("div",{onMouseDown:z,className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-blue-500 transition-colors",style:{backgroundColor:g?"var(--color-accent)":"transparent"}})]})}function Ls({children:r,variant:c="primary",size:i="md",disabled:o=!1,loading:f=!1,className:h="",...m}){const y="inline-flex items-center justify-center font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",v={primary:{backgroundColor:"var(--color-accent)",color:"#ffffff",hoverBg:"var(--color-accent-hover)"},secondary:{backgroundColor:"var(--color-bg-tertiary)",color:"var(--color-text-primary)",hoverBg:"var(--color-border)"},danger:{backgroundColor:"var(--color-error)",color:"#ffffff",hoverBg:"#dc2626"},ghost:{backgroundColor:"transparent",color:"var(--color-text-secondary)",hoverBg:"var(--color-bg-tertiary)"}},g={sm:"px-2.5 py-1.5 text-sm",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},S=v[c]||v.primary;return u.jsxs("button",{className:`${y} ${g[i]} ${h}`,style:{backgroundColor:o?"var(--color-bg-tertiary)":S.backgroundColor,color:o?"var(--color-text-muted)":S.color,cursor:o?"not-allowed":"pointer",opacity:o?.6:1},disabled:o||f,onMouseEnter:x=>{o||(x.currentTarget.style.backgroundColor=S.hoverBg)},onMouseLeave:x=>{o||(x.currentTarget.style.backgroundColor=S.backgroundColor)},...m,children:[f&&u.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",fill:"none",viewBox:"0 0 24 24",children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r]})}function bv({file:r,isDragging:c,error:i,onDragEnter:o,onDragLeave:f,onDragOver:h,onDrop:m,onFileSelect:y,onClear:v,disabled:g}){const S=K.useRef(null),x=()=>{!g&&S.current&&S.current.click()};return u.jsxs("div",{children:[u.jsxs("div",{onClick:x,onDragEnter:o,onDragLeave:f,onDragOver:h,onDrop:m,className:`
|
|
22
|
+
relative rounded-lg border-2 border-dashed p-8 text-center transition-all cursor-pointer
|
|
23
|
+
${c?"active":""}
|
|
24
|
+
`,style:{borderColor:c?"var(--color-accent)":i?"var(--color-error)":"var(--color-border)",backgroundColor:c?"var(--color-info-bg)":"var(--color-bg-primary)",opacity:g?.6:1,cursor:g?"not-allowed":"pointer"},children:[u.jsx("input",{ref:S,type:"file",onChange:y,accept:".pdf,.txt,.tex,.latex,.bib",className:"hidden",disabled:g}),r?u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--color-success)"},children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),u.jsx("span",{className:"font-medium",style:{color:"var(--color-text-primary)"},children:r.name})]}),u.jsx("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:Rs(r.size)}),!g&&u.jsx("button",{onClick:z=>{z.stopPropagation(),v()},className:"text-sm underline transition-colors",style:{color:"var(--color-accent)"},children:"Choose different file"})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--color-text-muted)"},children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),u.jsxs("p",{style:{color:"var(--color-text-primary)"},children:[u.jsx("span",{className:"font-medium",style:{color:"var(--color-accent)"},children:"Click to upload"})," ","or drag and drop"]}),u.jsx("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"PDF, TXT, TEX, LaTeX, or BibTeX (max 200MB)"})]})]}),i&&u.jsx("p",{className:"mt-2 text-sm",style:{color:"var(--color-error)"},children:i})]})}const mc=200*1024*1024,Sv=["application/pdf","text/plain","text/x-tex","application/x-tex","application/x-latex"],rm=[".pdf",".txt",".tex",".latex",".bib"];function _v(){const[r,c]=K.useState(null),[i,o]=K.useState(!1),[f,h]=K.useState(null),m=K.useRef(0),y=K.useCallback(T=>{if(T.size>mc){const V=`File too large. Maximum size is ${Rs(mc)}, got ${Rs(T.size)}`;return D.warn("useFileUpload",V),V}const N=T.name.toLowerCase(),H=rm.some(V=>N.endsWith(V)),F=Sv.includes(T.type)||T.type==="";if(!H&&!F){const V="Invalid file type. Allowed: PDF, TXT, TEX, LaTeX, BibTeX";return D.warn("useFileUpload",V),V}return null},[]),v=K.useCallback(T=>{h(null);const N=y(T);return N?(h(N),!1):(D.info("useFileUpload",`File selected: ${T.name} (${Rs(T.size)})`),c(T),!0)},[y]),g=K.useCallback(T=>{T.preventDefault(),T.stopPropagation(),m.current++,T.dataTransfer.items&&T.dataTransfer.items.length>0&&o(!0)},[]),S=K.useCallback(T=>{T.preventDefault(),T.stopPropagation(),m.current--,m.current===0&&o(!1)},[]),x=K.useCallback(T=>{T.preventDefault(),T.stopPropagation()},[]),z=K.useCallback(T=>{T.preventDefault(),T.stopPropagation(),o(!1),m.current=0;const N=T.dataTransfer.files;N&&N.length>0&&v(N[0])},[v]),Z=K.useCallback(T=>{const N=T.target.files;N&&N.length>0&&v(N[0])},[v]),C=K.useCallback(()=>{D.debug("useFileUpload","File cleared"),c(null),h(null)},[]);return{file:r,isDragging:i,error:f,handleDragEnter:g,handleDragLeave:S,handleDragOver:x,handleDrop:z,handleInputChange:Z,clearFile:C,maxFileSize:mc,allowedExtensions:rm}}function Cv(r){if(!r)return r;const c=r.trim(),i=/^(https?:\/\/[^\s]+?)(https?:\/\/)/i,o=c.match(i);return o?o[1]:c}function jv(){const[r,c]=K.useState("url"),[i,o]=K.useState(""),[f,h]=K.useState(""),[m,y]=K.useState(!1),{status:v,startCheck:g,reset:S,cancelCheck:x,setError:z}=Xe(),{getSelectedConfig:Z}=Ys(),{fetchHistory:C,clearSelection:T,selectCheck:N}=st(),H=_v(),F=async()=>{if(T(),r==="url"&&!i.trim()){D.warn("InputSection","No URL/ArXiv ID provided");return}if(r==="file"&&!H.file){D.warn("InputSection","No file selected");return}if(r==="text"&&!f.trim()){D.warn("InputSection","No text provided");return}y(!0);try{const Q=Z(),ne=r==="url"?Cv(i):null,re=new FormData;re.append("source_type",r==="url"?"url":r==="file"?"file":"text"),r==="url"?re.append("source_value",ne):r==="file"?re.append("file",H.file):re.append("source_text",f),Q?(re.append("llm_config_id",Q.id.toString()),re.append("llm_provider",Q.provider),Q.model&&re.append("llm_model",Q.model),re.append("use_llm","true")):re.append("use_llm","false"),D.info("Check","Initiating check request",{mode:r,llm:Q?.provider,model:Q?.model,source:r==="url"?ne:r==="file"?H.file?.name:"pasted text"});const ie=r==="url"?ne:r==="file"?H.file?.name:"Pasted text",oe=r==="url"?"url":r==="file"?"file":"text",Ne=r==="file"?H.file?.name:null;D.info("API","Sending POST /api/check");const we=await nv(re),{session_id:pe,check_id:A,message:E}=we.data;D.info("API","Check started successfully",{session_id:pe,check_id:A,message:E}),g(pe,A,ie,oe,Ne);const{addToHistory:I}=st.getState();I({id:A,paper_title:Ne||ie,paper_source:ie,source_type:oe,custom_label:null,timestamp:new Date().toISOString(),total_refs:0,errors_count:0,warnings_count:0,unverified_count:0,llm_provider:Q?.provider||null,llm_model:Q?.model||null,status:"in_progress",session_id:pe}),N(A)}catch(Q){D.error("InputSection","Failed to start check",Q),z(Q.response?.data?.detail||Q.message||"Failed to start check")}finally{y(!1)}},V=()=>{S(),C()},{selectedCheckId:J}=st.getState(),B=J===-1,k=v==="checking"&&!B,X=(v==="completed"||v==="cancelled"||v==="error")&&!B;return u.jsxs("div",{className:"rounded-lg border p-6",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:[u.jsx("h2",{className:"text-lg font-semibold mb-4",style:{color:"var(--color-text-primary)"},children:"Check Paper References"}),u.jsx("div",{className:"flex gap-2 mb-4",children:[{id:"url",label:"URL / ArXiv ID"},{id:"file",label:"Upload File"},{id:"text",label:"Paste Text"}].map(Q=>u.jsx("button",{onClick:()=>c(Q.id),disabled:k,className:"px-4 py-2 text-sm font-medium rounded-lg transition-colors",style:{backgroundColor:r===Q.id?"var(--color-accent)":"var(--color-bg-tertiary)",color:r===Q.id?"#ffffff":"var(--color-text-secondary)",cursor:k?"not-allowed":"pointer"},onMouseEnter:ne=>{!k&&r!==Q.id&&(ne.currentTarget.style.backgroundColor="var(--color-bg-hover)",ne.currentTarget.style.color="var(--color-text-primary)")},onMouseLeave:ne=>{r!==Q.id&&(ne.currentTarget.style.backgroundColor="var(--color-bg-tertiary)",ne.currentTarget.style.color="var(--color-text-secondary)")},children:Q.label},Q.id))}),u.jsxs("div",{className:"mb-4",children:[r==="url"&&u.jsx("input",{type:"text",value:i,onChange:Q=>o(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&i.trim()&&!k&&!m&&(Q.preventDefault(),F())},placeholder:"Enter ArXiv ID (e.g., 2401.12345) or URL",disabled:k,className:"w-full px-4 py-3 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"}}),r==="file"&&u.jsx(bv,{file:H.file,isDragging:H.isDragging,error:H.error,onDragEnter:H.handleDragEnter,onDragLeave:H.handleDragLeave,onDragOver:H.handleDragOver,onDrop:H.handleDrop,onFileSelect:H.handleInputChange,onClear:H.clearFile,disabled:k}),r==="text"&&u.jsx("textarea",{value:f,onChange:Q=>h(Q.target.value),placeholder:"Paste bibliography text here...",disabled:k,rows:6,className:"w-full px-4 py-3 rounded-lg border focus:outline-none focus:ring-2 resize-y",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"}})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[!k&&!X&&u.jsx(Ls,{onClick:F,loading:m,disabled:r==="url"&&!i.trim()||r==="file"&&!H.file||r==="text"&&!f.trim(),children:"Check References"}),X&&u.jsx(Ls,{onClick:V,children:"New Check"}),!X&&u.jsx("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:(()=>{const Q=Z();return Q?`Using ${Q.name} (${Q.provider})`:"No LLM configured - using regex extraction"})()})]})]})}const yl="";function Ev(r){if(!r)return null;const c=/(\d{4}\.\d{4,5})(v\d+)?/;if(c.test(r)){const i=r.match(c);return i?i[1]:null}if(r.includes("arxiv.org")){const i=r.match(c);return i?i[1]:null}return null}function wv(r,c){if(!r)return{type:"unknown"};const i=Ev(r);return i?{type:"arxiv",arxivId:i,thumbnailUrl:`https://arxiv.org/abs/${i}`,pdfUrl:`https://arxiv.org/pdf/${i}.pdf`}:c==="file"?r.toLowerCase().endsWith(".pdf")?{type:"pdf",filename:r}:{type:"file",filename:r}:c==="text"?{type:"text"}:r.startsWith("http://")||r.startsWith("https://")?r.toLowerCase().includes(".pdf")?{type:"pdf",url:r}:{type:"url",url:r}:{type:"unknown"}}function kv(r,c,i,o){if(!r||i==="text")return null;if(i==="file"&&c&&o)return{type:"file",value:`/api/file/${o}`,display:c,checkId:o};if(c&&r.startsWith(c)){const h=r.substring(c.length).trim();(h.startsWith("http://")||h.startsWith("https://"))&&(r=h)}if(r.startsWith("http://")||r.startsWith("https://"))return{type:"url",value:r,display:r};const f=r.match(/^(?:arXiv:)?(\d{4}\.\d{4,5}(?:v\d+)?)$/i);if(f){const h=`https://arxiv.org/abs/${f[1]}`;return{type:"url",value:h,display:h}}return{type:"text",value:r,display:r}}function Nv(){const{status:r,statusMessage:c,progress:i,paperTitle:o,paperSource:f,sourceType:h,currentCheckId:m,sessionId:y,stats:v,cancelCheck:g,setError:S}=Xe(),{selectedCheck:x,selectedCheckId:z,isLoadingDetail:Z,updateHistoryProgress:C,history:T}=st(),N=T.find(he=>he.id===z),H=z!==null&&z!==-1,F=z===m?y:x?.session_id,V=z===m;let J="idle",B=null,k=null,X="",Q=0,ne=0,re=0,ie=null,oe=null,Ne=null;V&&r!=="idle"?(J=r,B=o&&o!=="Unknown Paper"?o:N?.paper_title||x?.paper_title||o,k=f||N?.paper_source||x?.paper_source,X=c,Q=i,ne=v?.total_refs||0,re=v?.processed_refs||0,ie=x?.llm_provider,oe=x?.llm_model,Ne=x?.extraction_method||v?.extraction_method):H&&x&&(J=x.status||"idle",B=x.custom_label||x.paper_title,k=x.paper_source,ne=x.total_refs||0,re=x.processed_refs||0,Q=ne>0?re/ne*100:0,ie=x.llm_provider,oe=x.llm_model,Ne=x.extraction_method,J==="in_progress"?re>0?X=`Processed ${re} of ${ne} references...`:ne>0?X=`Found ${ne} references, starting verification...`:X="Extracting references...":J==="completed"?X=`Completed • ${ne} references checked`:J==="cancelled"?X="Check cancelled":J==="error"&&(X="Check failed"));const we=x?.source_type||(V?h:null),pe=oe?`${ie?`${ie} / `:""}${oe}`:null,A=kv(k,B,we,z),E=wv(k,we),I=J==="in_progress"||J==="checking",ge=J==="completed",ye=J==="cancelled",_=J==="error",[q,W]=K.useState(null),[P,le]=K.useState(!1),[ue,Ce]=K.useState(!1),[et,Le]=K.useState(!1),[Wt,vl]=K.useState(null);K.useEffect(()=>{if(!z||z===-1){W(null),vl(null),le(!1);return}W(null),vl(null),le(!1),Ce(!0);const he=`${yl}/api/thumbnail/${z}`;W(he),vl(`${yl}/api/preview/${z}`),Ce(!1)},[z]);const la=()=>{if(!z||z===-1)return null;const he={width:"80px",height:"100px",flexShrink:0,borderRadius:"4px",overflow:"hidden",backgroundColor:"var(--color-bg-tertiary)",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--color-border)"},It={width:"24px",height:"24px",color:"var(--color-text-muted)"};let qt=null;if(E?.type==="arxiv"&&E?.pdfUrl?qt=E.pdfUrl:E?.type==="url"&&E?.url||E?.type==="pdf"&&E?.url?qt=E.url:E?.type==="text"&&z?qt=`${yl}/api/text/${z}`:E?.type==="file"&&z&&(qt=`${yl}/api/file/${z}`),q&&!P){const Fe=u.jsx("img",{src:q,alt:"Paper thumbnail",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top"},onError:()=>le(!0),onLoad:()=>Ce(!1)});return u.jsx("button",{type:"button",title:"Click to enlarge",onClick:xt=>{xt.stopPropagation(),Le(!0)},style:{...he,cursor:"pointer",transition:"border-color 0.2s, box-shadow 0.2s",padding:0,background:"none"},className:"hover:border-blue-400 hover:shadow-md",children:ue?u.jsxs("svg",{className:"w-6 h-6 animate-spin",fill:"none",viewBox:"0 0 24 24",style:{color:"var(--color-text-muted)"},children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):Fe})}if(E?.type==="arxiv")return u.jsx("a",{href:qt||E.thumbnailUrl,target:"_blank",rel:"noopener noreferrer",title:`View on ArXiv: ${E.arxivId}`,onClick:Fe=>Fe.stopPropagation(),style:{...he,textDecoration:"none",cursor:"pointer"},className:"hover:border-blue-400",children:u.jsxs("div",{style:{textAlign:"center"},children:[u.jsxs("svg",{style:It,viewBox:"0 0 24 24",fill:"currentColor",children:[u.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"}),u.jsx("polyline",{points:"14 2 14 8 20 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13",stroke:"white",strokeWidth:"1.5"}),u.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17",stroke:"white",strokeWidth:"1.5"})]}),u.jsx("div",{style:{fontSize:"8px",marginTop:"2px",color:"var(--color-text-muted)"},children:"arXiv"})]})});if(E?.type==="pdf"){const Fe=u.jsxs("div",{style:{textAlign:"center"},children:[u.jsxs("svg",{style:It,viewBox:"0 0 24 24",fill:"currentColor",children:[u.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"}),u.jsx("polyline",{points:"14 2 14 8 20 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),u.jsx("div",{style:{fontSize:"8px",marginTop:"2px",color:"var(--color-text-muted)"},children:"PDF"})]});return qt?u.jsx("a",{href:qt,target:"_blank",rel:"noopener noreferrer",title:"View PDF",onClick:xt=>xt.stopPropagation(),style:{...he,textDecoration:"none",cursor:"pointer"},className:"hover:border-blue-400",children:Fe}):u.jsx("div",{style:he,children:Fe})}if(E?.type==="text"){const Fe=z?`${yl}/api/text/${z}`:null,xt=u.jsxs("div",{style:{textAlign:"center"},children:[u.jsxs("svg",{style:It,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[u.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"}),u.jsx("path",{d:"M14 2v6h6"}),u.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),u.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),u.jsx("div",{style:{fontSize:"8px",marginTop:"2px",color:"var(--color-text-muted)"},children:"Text"})]});return Fe?u.jsx("a",{href:Fe,target:"_blank",rel:"noopener noreferrer",title:"View pasted text",onClick:Gl=>Gl.stopPropagation(),style:{...he,textDecoration:"none",cursor:"pointer"},className:"hover:border-blue-400",children:xt}):u.jsx("div",{style:he,children:xt})}if(E?.type==="file"){const Fe=z?`${yl}/api/file/${z}`:null,xt=u.jsxs("div",{style:{textAlign:"center"},children:[u.jsxs("svg",{style:It,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[u.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"}),u.jsx("path",{d:"M14 2v6h6"})]}),u.jsx("div",{style:{fontSize:"8px",marginTop:"2px",color:"var(--color-text-muted)"},children:"File"})]});return Fe?u.jsx("a",{href:Fe,target:"_blank",rel:"noopener noreferrer",title:"View uploaded file",onClick:Gl=>Gl.stopPropagation(),style:{...he,textDecoration:"none",cursor:"pointer"},className:"hover:border-blue-400",children:xt}):u.jsx("div",{style:he,children:xt})}return E?.type==="url"?u.jsx("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",title:"Open URL",onClick:Fe=>Fe.stopPropagation(),style:{...he,textDecoration:"none",cursor:"pointer"},className:"hover:border-blue-400",children:u.jsxs("div",{style:{textAlign:"center"},children:[u.jsxs("svg",{style:It,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),u.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),u.jsx("div",{style:{fontSize:"8px",marginTop:"2px",color:"var(--color-text-muted)"},children:"URL"})]})}):null};if(H&&Z)return u.jsx("div",{className:"rounded-lg border p-4",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 animate-pulse",style:{backgroundColor:"var(--color-bg-tertiary)"},children:u.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",style:{color:"var(--color-text-muted)"},children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}),u.jsx("div",{className:"flex-1 min-w-0",children:u.jsx("h3",{className:"font-medium",style:{color:"var(--color-text-primary)"},children:"Loading check details..."})})]})});if(!H||J==="idle")return null;const rr=()=>I?u.jsxs("svg",{className:"w-6 h-6 animate-spin",fill:"none",viewBox:"0 0 24 24",style:{color:"var(--color-accent)"},children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):ge?u.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--color-success)"},children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):ye?u.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",style:{color:"var(--color-warning)"},children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}):_?u.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",style:{color:"var(--color-error)"},children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}):null,Ft=()=>I?"var(--color-info-bg)":ge?"var(--color-success-bg)":ye?"var(--color-warning-bg)":_?"var(--color-error-bg)":"var(--color-bg-tertiary)",na=I&&F;return u.jsxs("div",{className:"rounded-lg border p-4",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",style:{backgroundColor:Ft()},children:rr()}),la(),u.jsxs("div",{className:"flex-1 min-w-0",children:[B&&u.jsx("h3",{className:"font-medium",style:{color:"var(--color-text-primary)",wordBreak:"break-word",overflowWrap:"anywhere"},children:B}),A&&E?.type!=="text"&&u.jsx("p",{className:"text-sm",style:{color:"var(--color-text-muted)",wordBreak:"break-all",overflowWrap:"anywhere"},title:A.value,children:A.type==="url"||A.type==="file"?u.jsx("a",{href:A.value,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--color-link)"},onClick:he=>he.stopPropagation(),children:A.display}):A.display}),(()=>{if(Ne&&["bbl","bib"].includes(Ne)){const he=we==="text"?`Pasted .${Ne} file`:`ArXiv .${Ne} file`;return u.jsxs("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:["Source:"," ",z?u.jsx("a",{href:`${yl}/api/bibliography/${z}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--color-link)"},onClick:It=>It.stopPropagation(),children:he}):he]})}return Ne==="pdf"?u.jsx("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Source: PDF extraction"}):we==="text"&&z?u.jsxs("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:["Source:"," ",u.jsx("a",{href:`${yl}/api/text/${z}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--color-link)"},onClick:he=>he.stopPropagation(),children:"Pasted text"})]}):we==="file"&&z?u.jsxs("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:["Source:"," ",u.jsx("a",{href:`${yl}/api/file/${z}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--color-link)"},onClick:he=>he.stopPropagation(),children:"Uploaded file"})]}):null})(),pe&&u.jsxs("p",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:["Model: ",pe]}),u.jsx("p",{className:"text-sm",style:{color:_?"var(--color-error)":"var(--color-text-muted)",wordBreak:"break-word",overflowWrap:"anywhere"},children:X})]}),na&&u.jsx("button",{onClick:async()=>{if(F)try{D.info("StatusSection",`Cancelling check ${F}`),await Rm(F),z&&C(z,{status:"cancelled"}),F===y&&g()}catch(he){D.error("StatusSection","Failed to cancel",he),z&&C(z,{status:"cancelled"}),F===y&&g(),S(he.response?.data?.detail||he.message||"Failed to cancel")}},className:"px-3 py-2 text-sm font-medium rounded transition-colors cursor-pointer hover:opacity-80",style:{backgroundColor:"var(--color-error-bg)",color:"var(--color-error)"},onMouseEnter:he=>{he.currentTarget.style.backgroundColor="var(--color-error)",he.currentTarget.style.color="white"},onMouseLeave:he=>{he.currentTarget.style.backgroundColor="var(--color-error-bg)",he.currentTarget.style.color="var(--color-error)"},children:"Cancel"})]}),I&&u.jsxs("div",{className:"mt-4",children:[u.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{backgroundColor:"var(--color-bg-tertiary)"},children:u.jsx("div",{className:"h-full rounded-full transition-all duration-300 progress-bar",style:{width:`${Math.round(Q)}%`}})}),u.jsx("p",{className:"text-xs mt-1",style:{color:"var(--color-text-muted)"},children:ne>0?`${Math.round(Q)}% complete`:"Starting..."})]}),et&&(Wt||q)&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"rgba(0, 0, 0, 0.9)"},onClick:()=>Le(!1),children:u.jsxs("div",{className:"relative w-full h-full flex items-center justify-center p-8",children:[u.jsx("button",{type:"button",onClick:()=>Le(!1),className:"absolute top-4 right-4 w-10 h-10 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 text-white transition-colors z-10",title:"Close (Esc)",children:u.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),u.jsx("img",{src:Wt||q,alt:"Paper preview",style:{maxWidth:"95vw",maxHeight:"95vh",objectFit:"contain"},className:"rounded-lg shadow-2xl",onClick:he=>he.stopPropagation(),onError:he=>{Wt&&q&&he.target.src!==q&&(he.target.src=q)}})]})})]})}function Tv({stats:r,isComplete:c,references:i,paperTitle:o,paperSource:f}){const{statusFilter:h,setStatusFilter:m}=Xe(),[y,v]=K.useState(!1),g=K.useRef(null);K.useEffect(()=>{const ie=oe=>{g.current&&!g.current.contains(oe.target)&&v(!1)};return document.addEventListener("mousedown",ie),()=>document.removeEventListener("mousedown",ie)},[]);const S={verified:{id:"verified",label:"Verified",color:"var(--color-success)",bgColor:"var(--color-success-bg)"},error:{id:"error",label:"Errors",color:"var(--color-error)",bgColor:"var(--color-error-bg)"},warning:{id:"warning",label:"Warnings",color:"var(--color-warning)",bgColor:"var(--color-warning-bg)"},suggestion:{id:"suggestion",label:"Suggestions",color:"var(--color-suggestion)",bgColor:"var(--color-suggestion-bg)"},unverified:{id:"unverified",label:"Unverified",color:"var(--color-text-muted)",bgColor:"var(--color-bg-tertiary)"}},x=[{...S.error,value:r.errors_count||0},{...S.warning,value:r.warnings_count||0},{...S.suggestion,value:r.suggestions_count||0},{...S.unverified,value:r.unverified_count||0}],z=ie=>{m(ie)},Z=h.length>0,C=Z?h[0]:null,T=C?S[C]:null,N=r.refs_with_errors??0,H=r.refs_with_warnings_only??0,F=r.refs_verified??r.verified_count??0,V=r.unverified_count??0,J=r.processed_refs??0,B=h.includes("verified"),k=h.includes("error"),X=h.includes("warning"),Q=h.includes("unverified"),ne=`refchecker-${(o||"report").replace(/[^a-z0-9]/gi,"_").substring(0,50)}`,re=ie=>{v(!1);const oe={paperTitle:o,paperSource:f,stats:r,references:i};switch(ie){case"markdown":uc(uv(oe),`${ne}.md`,"text/markdown");break;case"text":uc(dv(oe),`${ne}.txt`,"text/plain");break;case"bibtex":uc(mv(oe),`${ne}.bib`,"application/x-bibtex");break}};return u.jsxs("div",{className:"rounded-lg border p-3",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:[u.jsxs("div",{className:"flex items-center justify-between mb-3 relative",style:{height:"24px"},children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("h3",{className:"font-semibold text-sm",style:{color:"var(--color-text-primary)"},children:"Summary"}),!c&&r.processed_refs>0&&r.processed_refs<r.total_refs&&u.jsxs("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:[r.processed_refs,"/",r.total_refs," checked"]})]}),u.jsxs("div",{className:"absolute right-0 top-0 flex items-center gap-2",children:[Z&&T&&u.jsxs("button",{onClick:()=>z(C),className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium transition-opacity hover:opacity-80",style:{backgroundColor:T.bgColor,color:T.color},children:[u.jsxs("span",{children:["Showing ",T.label.toLowerCase()]}),u.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.jsx("path",{d:"M18 6L6 18M6 6l12 12",strokeLinecap:"round",strokeLinejoin:"round"})})]}),u.jsxs("div",{className:"relative",ref:g,children:[u.jsxs("button",{onClick:()=>c&&v(!y),disabled:!c,className:`flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-medium transition-all ${c?"cursor-pointer hover:opacity-80":"cursor-not-allowed opacity-40"}`,style:{backgroundColor:c?"var(--color-accent)":"var(--color-bg-tertiary)",color:c?"white":"var(--color-text-muted)"},title:c?"Export results":"Export available when check completes",children:[u.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[u.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("polyline",{points:"7,10 12,15 17,10",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3",strokeLinecap:"round",strokeLinejoin:"round"})]}),u.jsx("span",{children:"Export"}),u.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.jsx("path",{d:"M6 9l6 6 6-6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),y&&u.jsxs("div",{className:"absolute right-0 top-full mt-1 py-1 rounded-lg border shadow-lg z-50",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border)",minWidth:"140px"},children:[u.jsx("button",{onClick:()=>re("markdown"),className:"w-full px-3 py-1.5 text-xs text-left transition-colors cursor-pointer hover:bg-[var(--color-bg-tertiary)]",style:{color:"var(--color-text-primary)"},children:"📝 Markdown (.md)"}),u.jsx("button",{onClick:()=>re("text"),className:"w-full px-3 py-1.5 text-xs text-left transition-colors cursor-pointer hover:bg-[var(--color-bg-tertiary)]",style:{color:"var(--color-text-primary)"},children:"📄 Plain Text (.txt)"}),u.jsx("button",{onClick:()=>re("bibtex"),className:"w-full px-3 py-1.5 text-xs text-left transition-colors cursor-pointer hover:bg-[var(--color-bg-tertiary)]",style:{color:"var(--color-text-primary)"},children:"📚 BibTeX (.bib)"})]})]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsxs("button",{onClick:()=>z("verified"),className:`flex items-center gap-1 px-2 py-1 rounded transition-all cursor-pointer hover:opacity-80 ${B?"ring-1":""}`,style:{backgroundColor:B?"var(--color-success-bg)":"transparent",ringColor:"var(--color-success)"},title:`${F} reference${F===1?"":"s"} fully verified`,children:[u.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-success)"}),u.jsx("path",{d:"M8.5 12.5l2.5 2.5 4.5-5",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),u.jsx("span",{className:"text-sm font-bold",style:{color:"var(--color-success)"},children:F})]}),u.jsxs("button",{onClick:()=>z("error"),disabled:N===0,className:`flex items-center gap-1 px-2 py-1 rounded transition-all ${N>0?"cursor-pointer hover:opacity-80":"cursor-default opacity-50"} ${k?"ring-1":""}`,style:{backgroundColor:k?"var(--color-error-bg)":"transparent",ringColor:"var(--color-error)"},title:N>0?`${N} reference${N===1?"":"s"} with errors`:"No references with errors",children:[u.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-error)"}),u.jsx("path",{d:"M12 7v6",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"}),u.jsx("circle",{cx:"12",cy:"15.5",r:"1.2",fill:"#fff"})]}),u.jsx("span",{className:"text-sm font-bold",style:{color:N>0?"var(--color-error)":"var(--color-text-muted)"},children:N})]}),u.jsxs("button",{onClick:()=>z("warning"),disabled:H===0,className:`flex items-center gap-1 px-2 py-1 rounded transition-all ${H>0?"cursor-pointer hover:opacity-80":"cursor-default opacity-50"} ${X?"ring-1":""}`,style:{backgroundColor:X?"var(--color-warning-bg)":"transparent",ringColor:"var(--color-warning)"},title:H>0?`${H} reference${H===1?"":"s"} with warnings only`:"No references with warnings only",children:[u.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",children:[u.jsx("path",{d:"M12 2L2 20h20L12 2z",fill:"var(--color-warning)"}),u.jsx("path",{d:"M12 9v4",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"}),u.jsx("circle",{cx:"12",cy:"15.5",r:"1",fill:"#fff"})]}),u.jsx("span",{className:"text-sm font-bold",style:{color:H>0?"var(--color-warning)":"var(--color-text-muted)"},children:H})]}),V>0&&u.jsxs("button",{onClick:()=>z("unverified"),className:`flex items-center gap-1 px-2 py-1 rounded transition-all cursor-pointer hover:opacity-80 ${Q?"ring-1":""}`,style:{backgroundColor:Q?"var(--color-bg-tertiary)":"transparent",ringColor:"var(--color-text-muted)"},title:`${V} reference${V===1?"":"s"} could not be verified`,children:[u.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-text-muted)"}),u.jsx("text",{x:"12",y:"16",textAnchor:"middle",fill:"#fff",fontSize:"12",fontWeight:"bold",children:"?"})]}),u.jsx("span",{className:"text-sm font-bold",style:{color:"var(--color-text-muted)"},children:V})]}),u.jsxs("span",{className:"text-xs px-1",style:{color:"var(--color-text-muted)"},children:["of ",J]}),u.jsx("div",{className:"w-px h-4 mx-1",style:{backgroundColor:"var(--color-border)"}}),x.filter(ie=>ie.value>0).map(ie=>{const oe=h.includes(ie.id);return u.jsxs("button",{onClick:()=>z(ie.id),className:"flex items-center gap-1 px-2 py-0.5 rounded-full text-xs transition-all cursor-pointer hover:opacity-80 border",style:{backgroundColor:oe?ie.bgColor:"transparent",borderColor:oe?ie.color:"var(--color-border)",color:ie.color},title:`${ie.value} ${ie.label.toLowerCase()} (total issues)`,children:[u.jsx("span",{className:"font-bold",children:ie.value}),u.jsx("span",{children:ie.label})]},ie.id)})]})]})}const Av=/https?:\/\/[^\s]+/g,sm=r=>{if(!r)return null;const c=r.split(`
|
|
25
|
+
`);if(c.length>=3){const m=c[0].replace(/:$/,"").trim(),v=c[1].match(/cited:\s*(.*)/),g=v?v[1].trim():null,x=c[2].match(/actual:\s*(.*)/),z=x?x[1].trim():null;return{prefix:m,cited:g,actual:z,isMultiline:!0}}const i=r.match(/cited:\s*'([^']*)'/),o=r.match(/actual:\s*'([^']*)'/);let f=r;const h=r.indexOf("cited:");return h>0?f=r.substring(0,h).trim():h===0&&(f=null),{prefix:f,cited:i?i[1]:null,actual:o?o[1]:null,isMultiline:!1}},un=r=>{if(!r)return null;const c=[];let i=0,o;for(;(o=Av.exec(r))!==null;){o.index>i&&c.push(r.slice(i,o.index));const f=o[0];c.push({type:"link",url:f}),i=o.index+f.length}return i<r.length&&c.push(r.slice(i)),c.map((f,h)=>typeof f=="string"?u.jsx("span",{children:f},`txt-${h}`):u.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--color-link)"},children:f.url},`url-${h}`))};function Mv({reference:r,index:c,displayIndex:i,totalRefs:o}){const f=typeof c=="number"?c:typeof i=="number"?i:0,h=(r.status||"").toLowerCase(),[m,y]=K.useState(!1),v=K.useRef(null);K.useEffect(()=>{const C=T=>{v.current&&!v.current.contains(T.target)&&y(!1)};return m&&document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[m]);const g=async C=>{let T;switch(C){case"markdown":T=lm(r);break;case"plaintext":T=pv(r);break;case"bibtex":T=Om(r);break;default:T=lm(r)}await fv(T),y(!1)},S=()=>{switch(h){case"verified":return"var(--color-success)";case"warning":return"var(--color-warning)";case"error":return"var(--color-error)";case"suggestion":return"var(--color-suggestion)";case"unverified":return"var(--color-text-muted)";case"unchecked":return"var(--color-text-muted)";case"checking":return"var(--color-accent)";case"pending":return"var(--color-text-muted)";default:return"var(--color-text-muted)"}},x=()=>{const C="w-7 h-7";return h==="checking"?u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Checking...",children:u.jsxs("svg",{className:`${C} animate-spin`,viewBox:"0 0 24 24",fill:"none",style:{color:S()},children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):h==="pending"?u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Waiting in queue",children:u.jsxs("svg",{className:C,viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-bg-tertiary)",stroke:S(),strokeWidth:"2"}),u.jsx("path",{d:"M12 7v5l3 2",stroke:S(),strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}):h==="error"?u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Error",children:u.jsxs("svg",{className:C,viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-error)"}),u.jsx("path",{d:"M12 7v6",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"}),u.jsx("circle",{cx:"12",cy:"15.5",r:"1.2",fill:"#fff"})]})}):h==="verified"?u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Verified",children:u.jsxs("svg",{className:C,viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-success)"}),u.jsx("path",{d:"M8.5 12.5l2.5 2.5 4.5-5",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}):h==="warning"?u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Warning",children:u.jsxs("svg",{className:C,viewBox:"0 0 24 24",fill:"none",children:[u.jsx("path",{d:"M12 2L2 20h20L12 2z",fill:"var(--color-warning)"}),u.jsx("path",{d:"M12 9v4",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"}),u.jsx("circle",{cx:"12",cy:"15.5",r:"1",fill:"#fff"})]})}):h==="suggestion"?u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Suggestion",children:u.jsxs("svg",{className:C,viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-suggestion)"}),u.jsx("path",{d:"M12 7v4m0 0l-2-2m2 2l2-2",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("circle",{cx:"12",cy:"15.5",r:"1.2",fill:"#fff"})]})}):h==="unchecked"?u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Not checked (check cancelled or timed out)",children:u.jsxs("svg",{className:C,viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-text-muted)"}),u.jsx("path",{d:"M8 12h8",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"})]})}):u.jsx("span",{className:"flex-shrink-0 inline-block",title:"Unverified",children:u.jsxs("svg",{className:C,viewBox:"0 0 24 24",fill:"none",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"var(--color-text-muted)"}),u.jsx("path",{d:"M10.75 9.5c.1-1.1.95-2 2.2-2 1.21 0 2.2.89 2.2 1.99 0 .86-.56 1.6-1.4 1.83-.55.15-.95.63-.95 1.2v.23",stroke:"#fff",strokeWidth:"1.6",strokeLinecap:"round"}),u.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"#fff"})]})})},z=C=>{switch(C){case"semantic_scholar":return"Verified URL";case"arxiv":return"ArXiv URL";case"doi":return"DOI URL";case"openalex":return"OpenAlex URL";case"openreview":return"OpenReview URL";default:return"URL"}},Z=C=>{switch(C){case"author":return"Author";case"year":return"Year";case"venue":return"Venue";case"title":return"Title";default:return C?.charAt(0).toUpperCase()+C?.slice(1)||"Unknown"}};return u.jsx("div",{className:"py-4 border-b font-mono text-sm",style:{borderColor:"var(--color-border)"},children:u.jsxs("div",{className:"flex items-start gap-3 pl-4 pr-8",children:[u.jsx("div",{className:"flex-shrink-0 w-8 flex justify-center pt-0.5",children:x()}),u.jsxs("span",{className:"flex-shrink-0 w-8 text-right",style:{color:"var(--color-text-secondary)"},children:[(f??0)+1,"."]}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsx("div",{className:"font-bold flex-1",style:{color:"var(--color-text-primary)"},children:r.title||r.cited_url||"Unknown Title"}),u.jsxs("div",{className:"relative flex-shrink-0",ref:v,children:[u.jsx("button",{onClick:()=>y(!m),className:"p-1 rounded opacity-40 hover:opacity-100 transition-opacity cursor-pointer",style:{color:"var(--color-text-secondary)"},title:"Copy corrected reference",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),m&&u.jsxs("div",{className:"absolute right-0 top-full mt-1 py-1 rounded-md shadow-lg z-50 min-w-[140px]",style:{backgroundColor:"var(--color-bg-secondary)",border:"1px solid var(--color-border)"},children:[u.jsxs("button",{onClick:()=>g("markdown"),className:"w-full px-3 py-1.5 text-left text-xs hover:bg-black/10 dark:hover:bg-white/10 cursor-pointer flex items-center gap-2",style:{color:"var(--color-text-primary)"},children:[u.jsx("span",{children:"📝"})," Markdown"]}),u.jsxs("button",{onClick:()=>g("plaintext"),className:"w-full px-3 py-1.5 text-left text-xs hover:bg-black/10 dark:hover:bg-white/10 cursor-pointer flex items-center gap-2",style:{color:"var(--color-text-primary)"},children:[u.jsx("span",{children:"📄"})," Plain Text"]}),u.jsxs("button",{onClick:()=>g("bibtex"),className:"w-full px-3 py-1.5 text-left text-xs hover:bg-black/10 dark:hover:bg-white/10 cursor-pointer flex items-center gap-2",style:{color:"var(--color-text-primary)"},children:[u.jsx("span",{children:"📚"})," BibTeX"]})]})]})]}),r.authors?.length>0&&u.jsx("div",{style:{color:"var(--color-text-secondary)"},children:ar(r.authors)}),r.venue&&u.jsx("div",{style:{color:"var(--color-text-secondary)"},children:r.venue}),r.year&&u.jsx("div",{style:{color:"var(--color-text-secondary)"},children:r.year}),r.cited_url&&u.jsx("div",{children:u.jsx("a",{href:r.cited_url,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--color-link)"},children:r.cited_url})}),(r.authoritative_urls?.length>0||r.errors?.length>0||r.warnings?.length>0||r.status==="unverified")&&u.jsxs("div",{className:"my-3 flex items-center gap-3",children:[u.jsx("span",{className:"text-xs uppercase tracking-wide font-medium",style:{color:"var(--color-text-muted)"},children:"Verification"}),u.jsx("div",{className:"flex-1 border-t",style:{borderColor:"var(--color-border)"}})]}),(()=>{const C=r.authoritative_urls||[],T=new Set;return C.filter(H=>H.type==="arxiv"?T.has("arxiv")||C.some(V=>V.type==="arxiv"&&V.url?.includes("/abs/"))&&H.url?.includes("/pdf/")?!1:(T.add("arxiv"),!0):!0).map((H,F)=>u.jsxs("div",{className:"flex",children:[u.jsxs("span",{className:"flex-shrink-0",style:{color:"var(--color-text-secondary)",width:"120px"},children:[z(H.type),":"]}),u.jsx("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",style:{color:"var(--color-link)"},children:H.url})]},F))})(),r.status==="unverified"&&u.jsxs("div",{className:"flex items-start gap-2",style:{color:"var(--color-text-muted)",wordBreak:"break-word"},children:[u.jsx("span",{className:"pt-0.5 inline-block flex-shrink-0",children:u.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("text",{x:"12",y:"16",textAnchor:"middle",fill:"#fff",fontSize:"14",fontWeight:"bold",children:"?"})]})}),u.jsxs("div",{children:[u.jsxs("div",{children:["Could not verify: ",r.title||"Unknown"]}),r.errors?.find(C=>C.error_type==="unverified")&&u.jsxs("div",{children:["Subreason: ",un(r.errors.find(C=>C.error_type==="unverified")?.error_details||"Paper not found by any checker")]})]})]}),r.warnings?.map((C,T)=>{const N=sm(C.error_details),H=N?.cited||N?.actual,V=(k=>{if(!k)return null;const X=k.match(/\(v\d+\s+vs\s+v\d+\s+update\)/i);return X?X[0]:null})(C.error_type),J=H&&typeof N?.prefix=="string"?N.prefix.replace(/:$/,""):C.error_details||`${Z(C.error_type)} mismatch`,B=V&&J&&!J.includes(V)?`${J} ${V}`:J||"";return u.jsxs("div",{style:{color:"var(--color-warning)",wordBreak:"break-word"},children:[u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("span",{children:"⚠️"}),u.jsxs("span",{children:[u.jsx("span",{className:"font-bold",children:"Warning:"})," ",B]})]}),(N?.cited||C.cited_value)&&u.jsxs("div",{className:"flex ml-6",children:[u.jsx("span",{className:"flex-shrink-0",style:{width:"70px"},children:u.jsx("span",{className:"font-bold",children:"cited:"})}),u.jsx("span",{children:un(N?.cited||C.cited_value)})]}),(N?.actual||C.actual_value)&&u.jsxs("div",{className:"flex ml-6",children:[u.jsx("span",{className:"flex-shrink-0",style:{width:"70px"},children:u.jsx("span",{className:"font-bold",children:"actual:"})}),u.jsx("span",{children:un(N?.actual||C.actual_value)})]})]},`warning-${T}`)}),r.errors?.filter(C=>C.error_type!=="unverified").map((C,T)=>{const N=sm(C.error_details),H=N?.cited||N?.actual,V=(k=>{if(!k)return null;const X=k.match(/\(v\d+\s+vs\s+v\d+\s+update\)/i);return X?X[0]:null})(C.error_type),J=H&&typeof N?.prefix=="string"?N.prefix:C.error_details||C.error_type,B=V&&J&&!J.includes(V)?`${J} ${V}`:J||"";return u.jsxs("div",{style:{color:"var(--color-error)",wordBreak:"break-word"},children:[u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("span",{className:"pt-0.5 inline-block flex-shrink-0",children:u.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("path",{d:"M12 7v6",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round"}),u.jsx("circle",{cx:"12",cy:"15.5",r:"1.2",fill:"#fff"})]})}),u.jsxs("span",{children:[u.jsx("span",{className:"font-bold",children:"Error:"})," ",H?B:un(B)]})]}),(N?.cited||C.cited_value)&&u.jsxs("div",{className:"flex ml-6",children:[u.jsx("span",{className:"flex-shrink-0",style:{width:"70px"},children:u.jsx("span",{className:"font-bold",children:"cited:"})}),u.jsx("span",{children:un(N?.cited||C.cited_value)})]}),(N?.actual||C.actual_value)&&u.jsxs("div",{className:"flex ml-6",children:[u.jsx("span",{className:"flex-shrink-0",style:{width:"70px"},children:u.jsx("span",{className:"font-bold",children:"actual:"})}),u.jsx("span",{children:un(N?.actual||C.actual_value)})]})]},`error-${T}`)}),r.suggestions?.map((C,T)=>u.jsx("div",{style:{color:"var(--color-suggestion)",wordBreak:"break-word"},children:u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("span",{className:"pt-0.5 inline-block flex-shrink-0",children:u.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("path",{d:"M12 7v4m0 0l-2-2m2 2l2-2",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("circle",{cx:"12",cy:"15.5",r:"1.2",fill:"#fff"})]})}),u.jsxs("span",{children:[u.jsx("span",{className:"font-bold",children:"Suggestion:"})," ",un(C.suggestion_details||C)]})]})},`suggestion-${T}`))]})]})})}const zv=(r,c=!1)=>{const i=(r.status||"").trim().toLowerCase();if(["error","warning","suggestion","unverified","verified"].includes(i))return i;if(i==="pending"||i==="checking"||["in_progress","queued","processing","started"].includes(i))return c?"unchecked":i==="pending"?"pending":"checking";const o=Array.isArray(r.errors)&&r.errors.some(m=>(m?.error_type||"").toLowerCase()!=="unverified"),f=!o&&Array.isArray(r.warnings)&&r.warnings.length>0,h=!o&&!f&&Array.isArray(r.suggestions)&&r.suggestions.length>0;return o?"error":f?"warning":h?"suggestion":"verified"};function Rv({references:r,isLoading:c,isCheckComplete:i=!1}){const{statusFilter:o}=Xe(),{sortedReferences:f,filteredReferences:h,normalizedFilters:m}=K.useMemo(()=>{const y=o.map(x=>x.toLowerCase()),v=(r||[]).slice().sort((x,z)=>{const Z=typeof x?.index=="number"?x.index:Number.MAX_SAFE_INTEGER,C=typeof z?.index=="number"?z.index:Number.MAX_SAFE_INTEGER;return Z-C}),S=v.map(x=>({...x,status:zv(x,i),errors:Array.isArray(x.errors)?x.errors:[],warnings:Array.isArray(x.warnings)?x.warnings:[]})).filter(x=>{const z=(x.status||"").toLowerCase();return y.length===0?!0:y.some(Z=>{switch(Z){case"verified":return z==="verified"||z==="suggestion";case"error":return x.errors?.some(C=>C.error_type!=="unverified");case"warning":return x.warnings?.length>0;case"suggestion":return x.suggestions?.length>0;case"unverified":return z==="unverified"||x.errors?.some(C=>C.error_type==="unverified");default:return z===Z}})});return{sortedReferences:v,filteredReferences:S,normalizedFilters:y}},[r,o,i]);return c?u.jsxs("div",{className:"rounded-lg border p-8 text-center",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:[u.jsxs("svg",{className:"animate-spin h-8 w-8 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",style:{color:"var(--color-accent)"},children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),u.jsx("p",{style:{color:"var(--color-text-muted)"},children:"Loading references..."})]}):!r||r.length===0?u.jsxs("div",{className:"rounded-lg border p-8 text-center",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:[u.jsx("svg",{className:"w-12 h-12 mx-auto mb-3 opacity-50",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--color-text-muted)"},children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),u.jsx("p",{style:{color:"var(--color-text-muted)"},children:"No references extracted yet"}),u.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-muted)"},children:"References will appear here as they are found"})]}):u.jsxs("div",{className:"rounded-lg border overflow-hidden relative",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:[u.jsxs("div",{className:"px-4 py-3 border-b flex items-center justify-between relative",style:{borderColor:"var(--color-border)",minHeight:"48px"},children:[u.jsxs("h3",{className:"font-semibold",style:{color:"var(--color-text-primary)"},children:["References (",f.length,")"]}),o.length>0&&u.jsxs("span",{className:"absolute right-4 text-sm px-2 py-1 rounded",style:{backgroundColor:"var(--color-bg-tertiary)",color:"var(--color-text-secondary)"},children:["Showing ",h.length," (",o.join(", "),")"]})]}),u.jsx("div",{className:"divide-y",style:{borderColor:"var(--color-border)"},children:h.map((y,v)=>u.jsx(Mv,{reference:y,index:y.index??v,displayIndex:v,totalRefs:f.length},`ref-${y.index??v}-${v}`))})]})}function Ov(){const r=K.useRef(null),c=K.useRef(null),[i,o]=K.useState(!1),[f,h]=K.useState(null),{status:m,references:y,stats:v,currentCheckId:g,clearStatusFilter:S}=Xe(),{selectedCheck:x,selectedCheckId:z,isLoadingDetail:Z,selectCheck:C}=st();K.useEffect(()=>{const pe=r.current;if(!pe)return;const A=()=>{o(pe.scrollTop>300)};return pe.addEventListener("scroll",A,{passive:!0}),()=>pe.removeEventListener("scroll",A)},[]),K.useEffect(()=>{const pe=()=>{if(c.current){const A=c.current.getBoundingClientRect(),E=12,I=44,ge=window.innerWidth;let ye=A.right+E;const _=ge-I-E;ye>_&&(ye=Math.max(A.right-I-E,E)),h(ye)}};return pe(),window.addEventListener("resize",pe),()=>window.removeEventListener("resize",pe)},[]);const T=K.useCallback(()=>{r.current?.scrollTo({top:0,behavior:"smooth"})},[]),N=z===-1,H=z!==null&&z!==-1;K.useEffect(()=>{S()},[z,S]);const F=N||!H&&m==="idle",V=H,J=z===g,B=x&&x.id===z,k=B?x.status:J?m:"idle",X=k==="in_progress"||k==="checking",Q=k==="completed"||k==="cancelled",ne=B?x.custom_label||x.paper_title:null,re=B?x.paper_source:null,oe=J&&y&&y.length>0?y:B&&x.results?x.results.map((pe,A)=>({...pe,index:A})):[],we=(()=>{if(J&&v&&v.total_refs>0)return v;if(B){const pe=x.total_refs||0,A=oe?.filter(le=>le.status&&!["pending","checking"].includes(le.status.toLowerCase())).length||0,E=x.processed_refs||A||0,I=x.errors_count||0,ge=x.warnings_count||0,ye=x.suggestions_count||0,_=x.unverified_count||0,q=x.refs_verified??x.verified_count??Math.max(0,(X?E:pe)-I-ge-_);let W=x.refs_with_errors,P=x.refs_with_warnings_only;return W===void 0&&oe?.length>0&&(W=oe.filter(le=>le.status==="error"||le.errors?.some(ue=>ue.error_type!=="unverified")).length),P===void 0&&oe?.length>0&&(P=oe.filter(le=>(le.status==="warning"||le.warnings?.length>0)&&le.status!=="error"&&!le.errors?.some(ue=>ue.error_type!=="unverified")).length),{total_refs:pe,processed_refs:E,verified_count:q,refs_verified:q,errors_count:I,warnings_count:ge,suggestions_count:ye,unverified_count:_,refs_with_errors:W??0,refs_with_warnings_only:P??0,progress_percent:pe>0?E/pe*100:0}}return v||{total_refs:0,processed_refs:0,verified_count:0,refs_verified:0,errors_count:0,warnings_count:0,suggestions_count:0,unverified_count:0,refs_with_errors:0,refs_with_warnings_only:0,progress_percent:0}})();return u.jsxs("main",{ref:r,className:"flex-1 relative",style:{backgroundColor:"var(--color-bg-primary)",overflowY:"scroll"},children:[u.jsxs("div",{ref:c,className:"max-w-4xl mx-auto p-6 space-y-6",children:[F&&u.jsx(jv,{}),V&&u.jsx(Nv,{}),V&&u.jsx(Tv,{stats:we,isComplete:Q,references:oe,paperTitle:ne,paperSource:re}),V&&u.jsx(Rv,{references:oe,isLoading:Z,isCheckComplete:Q})]}),i&&f&&u.jsx("button",{onClick:T,className:"fixed z-40 p-2 rounded-full shadow-lg transition-all duration-200 hover:scale-110 opacity-50 hover:opacity-100",style:{backgroundColor:"var(--color-bg-tertiary)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border)",left:`${f}px`,bottom:"2rem"},title:"Scroll to top","aria-label":"Scroll to top",children:u.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})}function Lv(){const{logs:r,isEnabled:c,isVisible:i,filter:o,toggleEnabled:f,toggleVisible:h,setFilter:m,clearLogs:y}=im(),[v,g]=K.useState(null),S=K.useRef(null);K.useEffect(()=>{i&&S.current&&S.current.scrollIntoView({behavior:"smooth"})},[r,i]);const x=r.filter(H=>o==="all"?!0:H.level.toLowerCase()===o),z=H=>{switch(H){case"ERROR":return"#ef4444";case"WARN":return"#f59e0b";case"INFO":return"#3b82f6";case"DEBUG":return"#6b7280";default:return"#9ca3af"}},Z=H=>{switch(H){case"ERROR":return"rgba(239, 68, 68, 0.1)";case"WARN":return"rgba(245, 158, 11, 0.1)";case"INFO":return"rgba(59, 130, 246, 0.1)";default:return"transparent"}},C=async()=>{if(confirm("Clear all cached verification results?")){g("cache");try{const H=await sv();alert(H.data.message)}catch(H){alert("Failed to clear cache: "+(H.response?.data?.detail||H.message))}finally{g(null)}}},T=async()=>{if(confirm("Clear all data (cache + history)? This cannot be undone.")){g("database");try{const H=await iv();alert(H.data.message),window.location.reload()}catch(H){alert("Failed to clear database: "+(H.response?.data?.detail||H.message))}finally{g(null)}}},N=u.jsx("button",{onClick:h,className:"fixed bottom-4 right-4 z-50 p-2 rounded-full shadow-lg transition-all",style:{backgroundColor:c?i?"#3b82f6":"#1f2937":"#374151",color:c?"white":"#9ca3af"},title:i?"Hide Debug Panel":"Show Debug Panel",children:u.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})});return i?u.jsxs(u.Fragment,{children:[N,u.jsxs("div",{className:"fixed bottom-16 right-4 z-40 w-[600px] max-w-[90vw] rounded-lg shadow-xl border overflow-hidden",style:{backgroundColor:"#1f2937",borderColor:"#374151",maxHeight:"50vh"},children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b",style:{borderColor:"#374151",backgroundColor:"#111827"},children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"text-white font-medium text-sm",children:"Debug Logs"}),u.jsxs("span",{className:"text-xs px-2 py-0.5 rounded",style:{backgroundColor:"#374151",color:"#9ca3af"},children:[x.length," entries"]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:C,disabled:v!==null,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:"#374151",color:"#9ca3af"},title:"Clear verification cache",children:v==="cache"?"...":"Clear Cache"}),u.jsx("button",{onClick:T,disabled:v!==null,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:"#7f1d1d",color:"#fca5a5"},title:"Clear all data (cache + history)",children:v==="database"?"...":"Clear All"}),u.jsx("div",{className:"w-px h-4 bg-gray-600"}),u.jsxs("select",{value:o,onChange:H=>m(H.target.value),className:"text-xs px-2 py-1 rounded border-0",style:{backgroundColor:"#374151",color:"#e5e7eb"},children:[u.jsx("option",{value:"all",children:"All"}),u.jsx("option",{value:"error",children:"Errors"}),u.jsx("option",{value:"warn",children:"Warnings"}),u.jsx("option",{value:"info",children:"Info"}),u.jsx("option",{value:"debug",children:"Debug"})]}),u.jsx("button",{onClick:f,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:c?"#059669":"#374151",color:c?"white":"#9ca3af"},children:c?"ON":"OFF"}),u.jsx("button",{onClick:y,className:"text-xs px-2 py-1 rounded",style:{backgroundColor:"#374151",color:"#9ca3af"},children:"Clear Logs"}),u.jsx("button",{onClick:h,className:"text-gray-400 hover:text-white",children:u.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),u.jsxs("div",{className:"overflow-y-auto font-mono text-xs",style:{maxHeight:"calc(50vh - 44px)"},children:[c?x.length===0?u.jsx("div",{className:"p-4 text-center text-gray-500",children:"No logs yet. Start a check to see logs."}):x.map(H=>u.jsxs("div",{className:"px-3 py-1.5 border-b hover:bg-gray-800",style:{borderColor:"#374151",backgroundColor:Z(H.level)},children:[u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("span",{className:"text-gray-500 shrink-0",children:H.timestamp.split("T")[1].split(".")[0]}),u.jsx("span",{className:"font-bold shrink-0 w-12",style:{color:z(H.level)},children:H.level}),u.jsxs("span",{className:"text-purple-400 shrink-0",children:["[",H.component,"]"]}),u.jsx("span",{className:"text-gray-200 break-all",children:H.message})]}),H.data&&u.jsx("pre",{className:"mt-1 ml-24 text-gray-400 whitespace-pre-wrap break-all",style:{fontSize:"10px"},children:H.data})]},H.id)):u.jsx("div",{className:"p-4 text-center text-gray-500",children:'Debug logging is disabled. Click "ON" to enable.'}),u.jsx("div",{ref:S})]})]})]}):N}function Dv(){const r=Xe(h=>h.activeSessions),c=Xe(h=>h.handleWebSocketMessage),i=Xe(h=>h.setError),o=Xe(h=>h.unregisterSession),f=K.useRef(new Map);return K.useEffect(()=>{if(!(!r||r.length===0)){for(const h of r){if(f.current.has(h))continue;D.info("LiveWebSocketManager",`Creating WebSocket for session ${h}`);const m=ov(h,{onOpen:()=>{D.info("WebSocket",`Connected to session ${h}`)},onMessage:y=>{const v={...y,session_id:h};D.info("WebSocket",`Message from ${h}: ${y.type}`,y),c(v)},onError:y=>{D.error("WebSocket",`Error on session ${h}`,{error:y?.toString()}),Xe.getState().sessionId===h&&i("Connection error")},onClose:y=>{D.info("WebSocket",`Session ${h} closed with code ${y?.code||"unknown"}`),f.current.delete(h)}});f.current.set(h,m)}for(const[h,m]of f.current.entries())r.includes(h)||(D.info("LiveWebSocketManager",`Closing WebSocket for inactive session ${h}`),m.close(),f.current.delete(h))}},[r,c,i,o]),K.useEffect(()=>()=>{D.info("LiveWebSocketManager","Unmounting, closing all WebSocket connections"),f.current.forEach((h,m)=>{D.info("LiveWebSocketManager",`Closing connection to session ${m}`),h.close()}),f.current.clear()},[]),null}function Uv({theme:r,onThemeChange:c}){const{settings:i,isLoading:o,version:f,isSettingsOpen:h,closeSettings:m,updateSetting:y}=Lm(),v=K.useRef(null),[g,S]=K.useState("General"),[x,z]=K.useState(!1),[Z,C]=K.useState(!1),[T,N]=K.useState(""),[H,F]=K.useState(!0),[V,J]=K.useState(!1),[B,k]=K.useState(!1),[X,Q]=K.useState(null);if(K.useEffect(()=>{h&&g==="API Keys"&&re()},[h,g]),K.useEffect(()=>{const E=I=>{I.key==="Escape"&&h&&m()};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[h,m]),K.useEffect(()=>{const E=I=>{v.current&&!v.current.contains(I.target)&&m()};return h&&setTimeout(()=>{document.addEventListener("mousedown",E)},100),()=>document.removeEventListener("mousedown",E)},[h,m]),!h)return null;const ne=(E,I)=>{D.info("SettingsPanel",`Updating setting ${E} to ${I}`),y(E,I)},re=async()=>{try{F(!0);const E=await Py();z(E.data.has_key),D.info("SettingsPanel",`SS Key status: ${E.data.has_key?"configured":"not configured"}`)}catch(E){D.error("SettingsPanel","Failed to load SS key status",E),Q("Failed to load status")}finally{F(!1)}},ie=async()=>{if(!T.trim()){Q("API key cannot be empty");return}try{k(!0),Q(null);const E=await lv(T.trim());if(!E.data.valid){Q(E.data.message||"Invalid API key"),k(!1);return}D.info("SettingsPanel","SS API key validated successfully"),k(!1),J(!0),await ev(T.trim()),z(!0),C(!1),N(""),D.info("SettingsPanel","SS API key saved")}catch(E){D.error("SettingsPanel","Failed to save SS key",E),Q(E.response?.data?.detail||"Failed to validate API key")}finally{k(!1),J(!1)}},oe=async()=>{try{J(!0),Q(null),await tv(),z(!1),C(!1),N(""),D.info("SettingsPanel","SS API key deleted")}catch(E){D.error("SettingsPanel","Failed to delete SS key",E),Q(E.response?.data?.detail||"Failed to delete API key")}finally{J(!1)}},Ne=()=>{C(!1),N(""),Q(null)},we=[{id:"General",label:"General",icon:u.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})},{id:"API Keys",label:"API Keys",icon:u.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})})}],pe=()=>u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between py-3 border-b",style:{borderColor:"var(--color-border)"},children:[u.jsx("div",{children:u.jsx("div",{className:"font-medium",style:{color:"var(--color-text-primary)"},children:"Theme"})}),u.jsxs("div",{className:"relative",children:[u.jsxs("select",{value:r,onChange:E=>c(E.target.value),className:"appearance-none px-4 py-2 pr-8 rounded-lg border text-sm cursor-pointer",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)",minWidth:"120px"},children:[u.jsx("option",{value:"system",children:"System"}),u.jsx("option",{value:"dark",children:"Dark"}),u.jsx("option",{value:"light",children:"Light"})]}),u.jsx("svg",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--color-text-secondary)"},children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),u.jsxs("div",{className:"flex items-center justify-between py-3 border-b",style:{borderColor:"var(--color-border)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"font-medium",style:{color:"var(--color-text-primary)"},children:i.max_concurrent_checks?.label||"Concurrent Checks"}),u.jsx("div",{className:"text-sm mt-0.5",style:{color:"var(--color-text-secondary)"},children:i.max_concurrent_checks?.description||"Maximum number of references to check simultaneously"})]}),u.jsx("input",{type:"number",value:i.max_concurrent_checks?.value??6,min:i.max_concurrent_checks?.min??1,max:i.max_concurrent_checks?.max??20,onChange:E=>ne("max_concurrent_checks",E.target.value),className:"px-3 py-2 rounded-lg border text-sm text-center",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)",width:"80px"}})]})]}),A=()=>u.jsx("div",{className:"space-y-1",children:u.jsxs("div",{className:"py-3 border-b",style:{borderColor:"var(--color-border)"},children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsxs("div",{children:[u.jsx("div",{className:"font-medium",style:{color:"var(--color-text-primary)"},children:"Semantic Scholar API Key"}),u.jsx("div",{className:"text-sm mt-0.5",style:{color:"var(--color-text-secondary)"},children:"Optional. Increases rate limits for reference verification."})]}),!Z&&u.jsxs("div",{className:"flex items-center gap-2",children:[x?u.jsx("span",{className:"text-xs px-2 py-0.5 rounded",style:{backgroundColor:"var(--color-success-bg)",color:"var(--color-success)"},children:"✓ Configured"}):u.jsx("span",{className:"text-xs",style:{color:"var(--color-text-muted)"},children:"Not configured"}),u.jsx("button",{onClick:()=>C(!0),className:"text-sm px-3 py-1 rounded transition-colors cursor-pointer",style:{color:"var(--color-accent)"},children:x?"Edit":"Add"})]})]}),H?u.jsx("div",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"Loading..."}):Z&&u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx("input",{type:"password",value:T,onChange:E=>N(E.target.value),placeholder:x?"Enter new key...":"Enter API key...",className:"w-full px-3 py-2 text-sm rounded border",style:{backgroundColor:"var(--color-bg-primary)",borderColor:X?"var(--color-error)":"var(--color-border)",color:"var(--color-text-primary)"},disabled:V||B,autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&ie(),E.key==="Escape"&&Ne()}}),X&&u.jsx("div",{className:"text-xs",style:{color:"var(--color-error)"},children:X}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{onClick:ie,disabled:V||B||!T.trim(),className:"px-4 py-1.5 text-sm rounded cursor-pointer",style:{backgroundColor:"var(--color-accent)",color:"white",opacity:V||B||!T.trim()?.5:1},children:B?"Validating...":V?"Saving...":"Save"}),x&&u.jsx("button",{onClick:oe,disabled:V||B,className:"px-4 py-1.5 text-sm rounded cursor-pointer",style:{backgroundColor:"var(--color-error-bg)",color:"var(--color-error)",opacity:V||B?.5:1},children:"Delete"}),u.jsx("button",{onClick:Ne,disabled:V||B,className:"px-4 py-1.5 text-sm rounded border cursor-pointer",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"Cancel"})]})]})]})});return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},children:u.jsxs("div",{ref:v,className:"rounded-2xl shadow-2xl overflow-hidden flex",style:{backgroundColor:"var(--color-bg-secondary)",width:"680px",maxWidth:"90vw",height:"400px",maxHeight:"80vh"},children:[u.jsxs("div",{className:"w-48 flex-shrink-0 border-r py-4",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)"},children:[u.jsxs("div",{className:"px-4 mb-4 flex items-center gap-2",children:[u.jsx("button",{onClick:m,className:"p-1.5 rounded-lg transition-colors cursor-pointer hover:bg-[var(--color-bg-tertiary)]",style:{color:"var(--color-text-secondary)"},children:u.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),u.jsx("span",{className:"font-semibold",style:{color:"var(--color-text-primary)"},children:"Settings"})]}),u.jsx("nav",{className:"space-y-1 px-3",children:we.map(E=>u.jsxs("button",{onClick:()=>S(E.id),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors cursor-pointer",style:{backgroundColor:g===E.id?"var(--color-bg-tertiary)":"transparent",color:g===E.id?"var(--color-text-primary)":"var(--color-text-secondary)"},children:[E.icon,E.label]},E.id))}),u.jsxs("div",{className:"px-4 mt-6 text-xs",style:{color:"var(--color-text-muted)"},children:["Version ",f||"—"]})]}),u.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[u.jsx("div",{className:"px-6 py-4 border-b",style:{borderColor:"var(--color-border)"},children:u.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--color-text-primary)"},children:g})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:o?u.jsx("div",{className:"flex items-center justify-center py-8",children:u.jsxs("svg",{className:"animate-spin h-6 w-6",style:{color:"var(--color-accent)"},fill:"none",viewBox:"0 0 24 24",children:[u.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),u.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):u.jsxs(u.Fragment,{children:[g==="General"&&pe(),g==="API Keys"&&A()]})})]})]})})}function Hv({isOpen:r,onClose:c,title:i,children:o,size:f="md",closeOnBackdropClick:h=!1,closeOnEscape:m=!0}){const y=K.useRef(null),v=K.useRef(null);if(K.useEffect(()=>(r?(v.current=document.activeElement,y.current?.focus(),document.body.style.overflow="hidden"):(document.body.style.overflow="",v.current?.focus()),()=>{document.body.style.overflow=""}),[r]),K.useEffect(()=>{const S=x=>{x.key==="Escape"&&r&&m&&c()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r,c,m]),!r)return null;const g={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0, 0, 0, 0.5)"},onClick:S=>{h&&S.target===S.currentTarget&&c()},children:u.jsxs("div",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",tabIndex:-1,className:`w-full ${g[f]} rounded-lg shadow-xl transform transition-all`,style:{backgroundColor:"var(--color-bg-primary)"},children:[u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b",style:{borderColor:"var(--color-border)"},children:[u.jsx("h2",{id:"modal-title",className:"text-lg font-semibold",style:{color:"var(--color-text-primary)"},children:i}),u.jsx("button",{onClick:c,className:"p-1 rounded-lg transition-colors",style:{color:"var(--color-text-secondary)"},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--color-bg-tertiary)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},"aria-label":"Close modal",children:u.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),u.jsx("div",{className:"px-6 py-4",children:o})]})})}const Ts=[{id:"openai",name:"OpenAI",defaultModel:"gpt-4o",requiresKey:!0},{id:"anthropic",name:"Anthropic",defaultModel:"claude-3-5-sonnet-latest",requiresKey:!0},{id:"google",name:"Google",defaultModel:"gemini-1.5-flash",requiresKey:!0},{id:"azure",name:"Azure OpenAI",defaultModel:"gpt-4o",requiresKey:!0,requiresEndpoint:!0},{id:"vllm",name:"vLLM (Local)",defaultModel:"meta-llama/Llama-3.1-8B-Instruct",requiresKey:!1,requiresEndpoint:!0}];function Bv({isOpen:r,onClose:c,editConfig:i=null}){const{addConfig:o,updateConfig:f}=Ys(),[h,m]=K.useState(!1),[y,v]=K.useState(!1),[g,S]=K.useState(null),[x,z]=K.useState({name:"",provider:"anthropic",model:"",api_key:"",endpoint:""});K.useEffect(()=>{if(r){const F=i?.provider||"anthropic",J=Ts.find(B=>B.id===F)?.defaultModel||"";z({name:i?.name||J,provider:F,model:i?.model||"",api_key:"",endpoint:i?.endpoint||""}),S(null)}},[r,i]);const Z=Ts.find(F=>F.id===x.provider),C=F=>{const{name:V,value:J}=F.target;z(B=>{const k={...B,[V]:J};if(V==="model"&&!i){const X=B.model||Z?.defaultModel||"";(!B.name||B.name===X)&&(k.name=J||Z?.defaultModel||"")}return k}),S(null)},T=F=>{const V=F.target.value,J=Ts.find(B=>B.id===V);z(B=>{const k=B.model||Z?.defaultModel||"",X=J?.defaultModel||"";return{...B,provider:V,model:"",name:!B.name||B.name===k?X:B.name,endpoint:V==="vllm"?"http://localhost:8000":B.endpoint}}),S(null)},N=()=>x.name.trim()?Z?.requiresKey&&!i&&!x.api_key.trim()?(S("API key is required"),!1):Z?.requiresEndpoint&&!x.endpoint.trim()?(S("Endpoint URL is required"),!1):!0:(S("Name is required"),!1),H=async F=>{if(F.preventDefault(),!!N()){m(!0),S(null);try{const V={name:x.name.trim(),provider:x.provider,model:x.model.trim()||Z?.defaultModel||null,endpoint:x.endpoint.trim()||null};if(x.api_key.trim()&&(V.api_key=x.api_key.trim()),Z?.requiresKey&&(x.api_key.trim()||!i)){v(!0);try{const J={provider:V.provider,model:V.model,api_key:V.api_key,endpoint:V.endpoint};D.info("LLMConfigModal","Validating API connection...",{provider:V.provider,model:V.model});const B=await Iy(J);if(!B.data.valid)throw new Error(B.data.error||"API validation failed");D.info("LLMConfigModal","API validation successful")}catch(J){D.error("LLMConfigModal","API validation failed",J);let B="Unknown error";const k=J.response?.data?.detail;k?typeof k=="string"?B=k:Array.isArray(k)?B=k.map(Q=>`${Q.loc?.slice(1).join(".")||"field"}: ${Q.msg}`).join(", "):k.message?B=k.message:B="Validation failed":J.response?.data?.message?B=J.response.data.message:typeof J.message=="string"&&(B=J.message),B=B.replace(/sk-[a-zA-Z0-9-_]+/g,"[REDACTED]"),B=B.replace(/"api_key":\s*"[^"]+"/g,'"api_key":"[REDACTED]"'),S(`API validation failed: ${B}`),v(!1),m(!1);return}v(!1)}i?(await f(i.id,V),D.info("LLMConfigModal","Config updated")):(await o(V),D.info("LLMConfigModal","Config created")),c()}catch(V){D.error("LLMConfigModal","Failed to save config",V),S(V.response?.data?.detail||V.message||"Failed to save configuration")}finally{m(!1),v(!1)}}};return u.jsx(Hv,{isOpen:r,onClose:c,title:i?"Edit LLM Configuration":"Add LLM Configuration",size:"md",children:u.jsxs("form",{onSubmit:H,className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"name",className:"block text-sm font-medium mb-1",style:{color:"var(--color-text-primary)"},children:"Configuration Name"}),u.jsx("input",{type:"text",id:"name",name:"name",value:x.name,onChange:C,placeholder:"e.g., My GPT-4",className:"w-full px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"}})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"provider",className:"block text-sm font-medium mb-1",style:{color:"var(--color-text-primary)"},children:"Provider"}),u.jsx("select",{id:"provider",name:"provider",value:x.provider,onChange:T,className:"w-full px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"},children:Ts.map(F=>u.jsx("option",{value:F.id,children:F.name},F.id))})]}),u.jsxs("div",{children:[u.jsxs("label",{htmlFor:"model",className:"block text-sm font-medium mb-1",style:{color:"var(--color-text-primary)"},children:["Model",u.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--color-text-muted)"},children:"(optional)"})]}),u.jsx("input",{type:"text",id:"model",name:"model",value:x.model,onChange:C,placeholder:Z?.defaultModel||"Default model",className:"w-full px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"}}),u.jsxs("p",{className:"mt-1 text-xs",style:{color:"var(--color-text-muted)"},children:["Default: ",Z?.defaultModel]})]}),Z?.requiresKey&&u.jsxs("div",{children:[u.jsxs("label",{htmlFor:"api_key",className:"block text-sm font-medium mb-1",style:{color:"var(--color-text-primary)"},children:["API Key",i&&u.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--color-text-muted)"},children:"(leave blank to keep existing)"})]}),u.jsx("input",{type:"password",id:"api_key",name:"api_key",value:x.api_key,onChange:C,placeholder:i?"••••••••":"Enter API key",className:"w-full px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"}}),u.jsx("p",{className:"mt-1 text-xs",style:{color:"var(--color-text-muted)"},children:"Stored securely and never shown again"})]}),Z?.requiresEndpoint&&u.jsxs("div",{children:[u.jsx("label",{htmlFor:"endpoint",className:"block text-sm font-medium mb-1",style:{color:"var(--color-text-primary)"},children:"Endpoint URL"}),u.jsx("input",{type:"url",id:"endpoint",name:"endpoint",value:x.endpoint,onChange:C,placeholder:x.provider==="vllm"?"http://localhost:8000":"https://your-resource.openai.azure.com",className:"w-full px-3 py-2 rounded-lg border focus:outline-none focus:ring-2",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"}})]}),g&&u.jsx("div",{className:"p-3 rounded-lg text-sm break-words overflow-hidden",style:{backgroundColor:"var(--color-error-bg)",color:"var(--color-error)",maxHeight:"120px",overflowY:"auto",wordBreak:"break-word"},children:g}),u.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[u.jsx(Ls,{type:"button",variant:"secondary",onClick:c,disabled:h||y,children:"Cancel"}),u.jsx(Ls,{type:"submit",loading:h||y,children:y?"Validating...":i?"Save Changes":"Add Configuration"})]})]})})}function qv({compact:r=!1}){const{configs:c,selectedConfigId:i,selectConfig:o,deleteConfig:f,isLoading:h}=Ys(),[m,y]=K.useState(!1),[v,g]=K.useState(!1),[S,x]=K.useState(null),[z,Z]=K.useState(null),C=K.useRef(null),T=c.find(B=>B.id===i),N=B=>{if(!B)return"No LLM configured";const k=B.model||"default";return`${B.provider}-${k}`};K.useEffect(()=>{const B=k=>{C.current&&!C.current.contains(k.target)&&(y(!1),Z(null))};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const H=B=>{D.info("LLMSelector",`Selected config ${B}`),o(B),y(!1)},F=(B,k)=>{B.stopPropagation(),Z(k)},V=async(B,k)=>{B.stopPropagation();try{await f(k),D.info("LLMSelector",`Deleted config ${k}`)}catch(X){D.error("LLMSelector","Failed to delete config",X)}Z(null)},J=B=>{B.stopPropagation(),Z(null)};return u.jsxs("div",{className:"relative",ref:C,children:[u.jsxs("button",{onClick:()=>{y(!m),Z(null)},className:"w-full flex items-center justify-between px-3 py-2 rounded-lg border transition-colors",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border)",color:"var(--color-text-primary)"},disabled:h,children:[u.jsx("span",{className:"truncate",children:T?u.jsx("span",{className:"font-medium",children:N(T)}):u.jsx("span",{style:{color:"var(--color-text-muted)"},children:h?"Loading...":"No LLM configured"})}),u.jsx("svg",{className:`w-4 h-4 transition-transform ${m?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m&&u.jsxs("div",{className:"absolute z-10 w-full mt-1 rounded-lg border shadow-lg overflow-hidden",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border)"},children:[u.jsx("div",{className:"max-h-48 overflow-y-auto",children:c.length===0?u.jsx("div",{className:"px-3 py-2 text-sm",style:{color:"var(--color-text-muted)"},children:"No configurations"}):c.map(B=>u.jsxs("div",{className:"flex items-center justify-between px-3 py-2 cursor-pointer transition-colors",style:{backgroundColor:B.id===i?"var(--color-bg-tertiary)":"transparent"},onMouseEnter:k=>{B.id!==i&&(k.currentTarget.style.backgroundColor="var(--color-bg-secondary)")},onMouseLeave:k=>{B.id!==i&&(k.currentTarget.style.backgroundColor="transparent")},children:[u.jsxs("div",{className:"flex-1 min-w-0",onClick:()=>H(B.id),children:[u.jsx("div",{className:"font-medium truncate",style:{color:"var(--color-text-primary)"},children:N(B)}),u.jsx("div",{className:"text-xs truncate",style:{color:"var(--color-text-muted)"},children:B.name})]}),u.jsx("div",{className:"flex items-center gap-1",children:z===B.id?u.jsxs("div",{className:"flex items-center gap-1 px-1 py-0.5 rounded-lg",style:{backgroundColor:"var(--color-error-bg)"},children:[u.jsx("button",{onClick:k=>V(k,B.id),className:"p-1 rounded transition-colors",style:{color:"var(--color-error)"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="var(--color-error)",k.currentTarget.style.color="white"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent",k.currentTarget.style.color="var(--color-error)"},title:"Confirm delete",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),u.jsx("button",{onClick:J,className:"p-1 rounded transition-colors",style:{color:"var(--color-text-secondary)"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="var(--color-bg-tertiary)"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},title:"Cancel",children:u.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:k=>{k.stopPropagation(),x(B),g(!0),y(!1)},className:"p-1 rounded transition-colors cursor-pointer",style:{color:"var(--color-text-secondary)"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="var(--color-accent)",k.currentTarget.style.color="white"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent",k.currentTarget.style.color="var(--color-text-secondary)"},title:"Edit configuration",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),u.jsx("button",{onClick:k=>F(k,B.id),className:"p-1 rounded transition-colors cursor-pointer",style:{color:"var(--color-error)"},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="var(--color-error-bg)"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},title:"Delete configuration",children:u.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})})]},B.id))}),u.jsx("div",{className:"border-t",style:{borderColor:"var(--color-border)"},children:u.jsxs("button",{onClick:()=>{y(!1),g(!0)},className:"w-full flex items-center px-3 py-2 text-sm transition-colors",style:{color:"var(--color-accent)"},onMouseEnter:B=>{B.currentTarget.style.backgroundColor="var(--color-bg-secondary)"},onMouseLeave:B=>{B.currentTarget.style.backgroundColor="transparent"},children:[u.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add LLM Configuration"]})})]}),u.jsx(Bv,{isOpen:v,onClose:()=>{g(!1),x(null)},editConfig:S})]})}function Yv(){const[r,c]=K.useState(()=>localStorage.getItem("refchecker-theme")||"system");K.useEffect(()=>{D.debug("App",`Theme changed to: ${r}`);let o=r;r==="system"&&(o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.classList.toggle("dark",o==="dark"),localStorage.setItem("refchecker-theme",r)},[r]),K.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{r==="system"&&document.documentElement.classList.toggle("dark",o.matches)};return o.addEventListener("change",f),()=>o.removeEventListener("change",f)},[r]);const i=o=>{c(o)};return u.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--color-bg-primary)"},children:[u.jsx(xv,{}),u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsx(Dv,{}),u.jsxs("header",{className:"h-14 flex items-center justify-between px-6 border-b",style:{backgroundColor:"var(--color-bg-secondary)",borderColor:"var(--color-border)"},children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("svg",{className:"w-8 h-8 flex-shrink-0",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("rect",{width:"100",height:"100",rx:"15",fill:"#3b82f6"}),u.jsx("path",{d:"M25 30h50M25 50h40M25 70h30",stroke:"white",strokeWidth:"8",strokeLinecap:"round"}),u.jsx("circle",{cx:"75",cy:"70",r:"12",fill:"#10b981"}),u.jsx("path",{d:"M70 70l4 4 8-8",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}),u.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--color-text-primary)"},children:"RefChecker"})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"w-64",children:u.jsx(qv,{compact:!0})}),u.jsx("a",{href:"https://github.com/markrussinovich/refchecker",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-gray-200 transition-colors",title:"View on GitHub",children:u.jsx("svg",{className:"w-6 h-6",fill:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),u.jsx(Ov,{})]}),u.jsx(Lv,{}),u.jsx(Uv,{theme:r,onThemeChange:i})]})}D.info("App","RefChecker Web UI starting...");mg.createRoot(document.getElementById("root")).render(u.jsx(K.StrictMode,{children:u.jsx(Yv,{})}));
|