nlm-memory 0.5.7 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,69 +0,0 @@
1
- function Td(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const a=Object.getOwnPropertyDescriptor(r,l);a&&Object.defineProperty(e,l,a.get?a:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const a of l)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const a={};return l.integrity&&(a.integrity=l.integrity),l.referrerPolicy&&(a.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?a.credentials="include":l.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(l){if(l.ep)return;l.ep=!0;const a=n(l);fetch(l.href,a)}})();function Rd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eu={exports:{}},$l={},tu={exports:{}},A={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Nr=Symbol.for("react.element"),Md=Symbol.for("react.portal"),Od=Symbol.for("react.fragment"),zd=Symbol.for("react.strict_mode"),$d=Symbol.for("react.profiler"),Id=Symbol.for("react.provider"),bd=Symbol.for("react.context"),Dd=Symbol.for("react.forward_ref"),Fd=Symbol.for("react.suspense"),Ud=Symbol.for("react.memo"),Ad=Symbol.for("react.lazy"),Ti=Symbol.iterator;function Bd(e){return e===null||typeof e!="object"?null:(e=Ti&&e[Ti]||e["@@iterator"],typeof e=="function"?e:null)}var nu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ru=Object.assign,lu={};function _n(e,t,n){this.props=e,this.context=t,this.refs=lu,this.updater=n||nu}_n.prototype.isReactComponent={};_n.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};_n.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function su(){}su.prototype=_n.prototype;function Ma(e,t,n){this.props=e,this.context=t,this.refs=lu,this.updater=n||nu}var Oa=Ma.prototype=new su;Oa.constructor=Ma;ru(Oa,_n.prototype);Oa.isPureReactComponent=!0;var Ri=Array.isArray,au=Object.prototype.hasOwnProperty,za={current:null},iu={key:!0,ref:!0,__self:!0,__source:!0};function ou(e,t,n){var r,l={},a=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)au.call(t,r)&&!iu.hasOwnProperty(r)&&(l[r]=t[r]);var o=arguments.length-2;if(o===1)l.children=n;else if(1<o){for(var u=Array(o),d=0;d<o;d++)u[d]=arguments[d+2];l.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)l[r]===void 0&&(l[r]=o[r]);return{$$typeof:Nr,type:e,key:a,ref:i,props:l,_owner:za.current}}function Wd(e,t){return{$$typeof:Nr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function $a(e){return typeof e=="object"&&e!==null&&e.$$typeof===Nr}function Vd(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mi=/\/+/g;function ts(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Vd(""+e.key):t.toString(36)}function Gr(e,t,n,r,l){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Nr:case Md:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+ts(i,0):r,Ri(l)?(n="",e!=null&&(n=e.replace(Mi,"$&/")+"/"),Gr(l,t,n,"",function(d){return d})):l!=null&&($a(l)&&(l=Wd(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(Mi,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",Ri(e))for(var o=0;o<e.length;o++){a=e[o];var u=r+ts(a,o);i+=Gr(a,t,n,u,l)}else if(u=Bd(e),typeof u=="function")for(e=u.call(e),o=0;!(a=e.next()).done;)a=a.value,u=r+ts(a,o++),i+=Gr(a,t,n,u,l);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Rr(e,t,n){if(e==null)return e;var r=[],l=0;return Gr(e,r,"","",function(a){return t.call(n,a,l++)}),r}function Hd(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ne={current:null},Jr={transition:null},Kd={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:Jr,ReactCurrentOwner:za};function uu(){throw Error("act(...) is not supported in production builds of React.")}A.Children={map:Rr,forEach:function(e,t,n){Rr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Rr(e,function(){t++}),t},toArray:function(e){return Rr(e,function(t){return t})||[]},only:function(e){if(!$a(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};A.Component=_n;A.Fragment=Od;A.Profiler=$d;A.PureComponent=Ma;A.StrictMode=zd;A.Suspense=Fd;A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kd;A.act=uu;A.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ru({},e.props),l=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=za.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)au.call(t,u)&&!iu.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var d=0;d<u;d++)o[d]=arguments[d+2];r.children=o}return{$$typeof:Nr,type:e.type,key:l,ref:a,props:r,_owner:i}};A.createContext=function(e){return e={$$typeof:bd,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Id,_context:e},e.Consumer=e};A.createElement=ou;A.createFactory=function(e){var t=ou.bind(null,e);return t.type=e,t};A.createRef=function(){return{current:null}};A.forwardRef=function(e){return{$$typeof:Dd,render:e}};A.isValidElement=$a;A.lazy=function(e){return{$$typeof:Ad,_payload:{_status:-1,_result:e},_init:Hd}};A.memo=function(e,t){return{$$typeof:Ud,type:e,compare:t===void 0?null:t}};A.startTransition=function(e){var t=Jr.transition;Jr.transition={};try{e()}finally{Jr.transition=t}};A.unstable_act=uu;A.useCallback=function(e,t){return Ne.current.useCallback(e,t)};A.useContext=function(e){return Ne.current.useContext(e)};A.useDebugValue=function(){};A.useDeferredValue=function(e){return Ne.current.useDeferredValue(e)};A.useEffect=function(e,t){return Ne.current.useEffect(e,t)};A.useId=function(){return Ne.current.useId()};A.useImperativeHandle=function(e,t,n){return Ne.current.useImperativeHandle(e,t,n)};A.useInsertionEffect=function(e,t){return Ne.current.useInsertionEffect(e,t)};A.useLayoutEffect=function(e,t){return Ne.current.useLayoutEffect(e,t)};A.useMemo=function(e,t){return Ne.current.useMemo(e,t)};A.useReducer=function(e,t,n){return Ne.current.useReducer(e,t,n)};A.useRef=function(e){return Ne.current.useRef(e)};A.useState=function(e){return Ne.current.useState(e)};A.useSyncExternalStore=function(e,t,n){return Ne.current.useSyncExternalStore(e,t,n)};A.useTransition=function(){return Ne.current.useTransition()};A.version="18.3.1";tu.exports=A;var x=tu.exports;const cu=Rd(x),Qd=Td({__proto__:null,default:cu},[x]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Yd=x,Xd=Symbol.for("react.element"),Gd=Symbol.for("react.fragment"),Jd=Object.prototype.hasOwnProperty,Zd=Yd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,qd={key:!0,ref:!0,__self:!0,__source:!0};function du(e,t,n){var r,l={},a=null,i=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Jd.call(t,r)&&!qd.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:Xd,type:e,key:a,ref:i,props:l,_owner:Zd.current}}$l.Fragment=Gd;$l.jsx=du;$l.jsxs=du;eu.exports=$l;var s=eu.exports,fu={exports:{}},Oe={},pu={exports:{}},hu={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(M,z){var b=M.length;M.push(z);e:for(;0<b;){var J=b-1>>>1,E=M[J];if(0<l(E,z))M[J]=z,M[b]=E,b=J;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var z=M[0],b=M.pop();if(b!==z){M[0]=b;e:for(var J=0,E=M.length,U=E>>>1;J<U;){var B=2*(J+1)-1,le=M[B],xe=B+1,Tr=M[xe];if(0>l(le,b))xe<E&&0>l(Tr,le)?(M[J]=Tr,M[xe]=b,J=xe):(M[J]=le,M[B]=b,J=B);else if(xe<E&&0>l(Tr,b))M[J]=Tr,M[xe]=b,J=xe;else break e}}return z}function l(M,z){var b=M.sortIndex-z.sortIndex;return b!==0?b:M.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var u=[],d=[],h=1,f=null,m=3,k=!1,y=!1,N=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(M){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=M)r(d),z.sortIndex=z.expirationTime,t(u,z);else break;z=n(d)}}function g(M){if(N=!1,v(M),!y)if(n(u)!==null)y=!0,I(j);else{var z=n(d);z!==null&&H(g,z.startTime-M)}}function j(M,z){y=!1,N&&(N=!1,p(_),_=-1),k=!0;var b=m;try{for(v(z),f=n(u);f!==null&&(!(f.expirationTime>z)||M&&!D());){var J=f.callback;if(typeof J=="function"){f.callback=null,m=f.priorityLevel;var E=J(f.expirationTime<=z);z=e.unstable_now(),typeof E=="function"?f.callback=E:f===n(u)&&r(u),v(z)}else r(u);f=n(u)}if(f!==null)var U=!0;else{var B=n(d);B!==null&&H(g,B.startTime-z),U=!1}return U}finally{f=null,m=b,k=!1}}var w=!1,C=null,_=-1,$=5,T=-1;function D(){return!(e.unstable_now()-T<$)}function W(){if(C!==null){var M=e.unstable_now();T=M;var z=!0;try{z=C(!0,M)}finally{z?L():(w=!1,C=null)}}else w=!1}var L;if(typeof c=="function")L=function(){c(W)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,F=R.port2;R.port1.onmessage=W,L=function(){F.postMessage(null)}}else L=function(){S(W,0)};function I(M){C=M,w||(w=!0,L())}function H(M,z){_=S(function(){M(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){y||k||(y=!0,I(j))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(M){switch(m){case 1:case 2:case 3:var z=3;break;default:z=m}var b=m;m=z;try{return M()}finally{m=b}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,z){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var b=m;m=M;try{return z()}finally{m=b}},e.unstable_scheduleCallback=function(M,z,b){var J=e.unstable_now();switch(typeof b=="object"&&b!==null?(b=b.delay,b=typeof b=="number"&&0<b?J+b:J):b=J,M){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=b+E,M={id:h++,callback:z,priorityLevel:M,startTime:b,expirationTime:E,sortIndex:-1},b>J?(M.sortIndex=b,t(d,M),n(u)===null&&M===n(d)&&(N?(p(_),_=-1):N=!0,H(g,b-J))):(M.sortIndex=E,t(u,M),y||k||(y=!0,I(j))),M},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(M){var z=m;return function(){var b=m;m=z;try{return M.apply(this,arguments)}finally{m=b}}}})(hu);pu.exports=hu;var ef=pu.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var tf=x,Me=ef;function P(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var mu=new Set,rr={};function Yt(e,t){xn(e,t),xn(e+"Capture",t)}function xn(e,t){for(rr[e]=t,e=0;e<t.length;e++)mu.add(t[e])}var st=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zs=Object.prototype.hasOwnProperty,nf=/^[: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]*$/,Oi={},zi={};function rf(e){return zs.call(zi,e)?!0:zs.call(Oi,e)?!1:nf.test(e)?zi[e]=!0:(Oi[e]=!0,!1)}function lf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sf(e,t,n,r){if(t===null||typeof t>"u"||lf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ke(e,t,n,r,l,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var pe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pe[e]=new ke(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pe[t]=new ke(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){pe[e]=new ke(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pe[e]=new ke(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){pe[e]=new ke(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){pe[e]=new ke(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){pe[e]=new ke(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){pe[e]=new ke(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){pe[e]=new ke(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ia=/[\-:]([a-z])/g;function ba(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ia,ba);pe[t]=new ke(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ia,ba);pe[t]=new ke(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ia,ba);pe[t]=new ke(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){pe[e]=new ke(e,1,!1,e.toLowerCase(),null,!1,!1)});pe.xlinkHref=new ke("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){pe[e]=new ke(e,1,!1,e.toLowerCase(),null,!0,!0)});function Da(e,t,n,r){var l=pe.hasOwnProperty(t)?pe[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(sf(t,n,l,r)&&(n=null),r||l===null?rf(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ut=tf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Mr=Symbol.for("react.element"),qt=Symbol.for("react.portal"),en=Symbol.for("react.fragment"),Fa=Symbol.for("react.strict_mode"),$s=Symbol.for("react.profiler"),vu=Symbol.for("react.provider"),gu=Symbol.for("react.context"),Ua=Symbol.for("react.forward_ref"),Is=Symbol.for("react.suspense"),bs=Symbol.for("react.suspense_list"),Aa=Symbol.for("react.memo"),ft=Symbol.for("react.lazy"),yu=Symbol.for("react.offscreen"),$i=Symbol.iterator;function On(e){return e===null||typeof e!="object"?null:(e=$i&&e[$i]||e["@@iterator"],typeof e=="function"?e:null)}var te=Object.assign,ns;function An(e){if(ns===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ns=t&&t[1]||""}return`
34
- `+ns+e}var rs=!1;function ls(e,t){if(!e||rs)return"";rs=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var l=d.stack.split(`
35
- `),a=r.stack.split(`
36
- `),i=l.length-1,o=a.length-1;1<=i&&0<=o&&l[i]!==a[o];)o--;for(;1<=i&&0<=o;i--,o--)if(l[i]!==a[o]){if(i!==1||o!==1)do if(i--,o--,0>o||l[i]!==a[o]){var u=`
37
- `+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=o);break}}}finally{rs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?An(e):""}function af(e){switch(e.tag){case 5:return An(e.type);case 16:return An("Lazy");case 13:return An("Suspense");case 19:return An("SuspenseList");case 0:case 2:case 15:return e=ls(e.type,!1),e;case 11:return e=ls(e.type.render,!1),e;case 1:return e=ls(e.type,!0),e;default:return""}}function Ds(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case en:return"Fragment";case qt:return"Portal";case $s:return"Profiler";case Fa:return"StrictMode";case Is:return"Suspense";case bs:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gu:return(e.displayName||"Context")+".Consumer";case vu:return(e._context.displayName||"Context")+".Provider";case Ua:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Aa:return t=e.displayName||null,t!==null?t:Ds(e.type)||"Memo";case ft:t=e._payload,e=e._init;try{return Ds(e(t))}catch{}}return null}function of(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ds(t);case 8:return t===Fa?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Lt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uf(e){var t=xu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Or(e){e._valueTracker||(e._valueTracker=uf(e))}function ju(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ul(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}}function Fs(e,t){var n=t.checked;return te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ii(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Lt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wu(e,t){t=t.checked,t!=null&&Da(e,"checked",t,!1)}function Us(e,t){wu(e,t);var n=Lt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?As(e,t.type,n):t.hasOwnProperty("defaultValue")&&As(e,t.type,Lt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function bi(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function As(e,t,n){(t!=="number"||ul(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bn=Array.isArray;function fn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Lt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Bs(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return te({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Di(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(Bn(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Lt(n)}}function Nu(e,t){var n=Lt(t.value),r=Lt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Fi(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ku(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ws(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ku(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var zr,Su=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(zr=zr||document.createElement("div"),zr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=zr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function lr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Hn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},cf=["Webkit","ms","Moz","O"];Object.keys(Hn).forEach(function(e){cf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hn[t]=Hn[e]})});function Cu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Hn.hasOwnProperty(e)&&Hn[e]?(""+t).trim():t+"px"}function Eu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Cu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var df=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vs(e,t){if(t){if(df[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function Hs(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Ks=null;function Ba(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qs=null,pn=null,hn=null;function Ui(e){if(e=Cr(e)){if(typeof Qs!="function")throw Error(P(280));var t=e.stateNode;t&&(t=Ul(t),Qs(e.stateNode,e.type,t))}}function _u(e){pn?hn?hn.push(e):hn=[e]:pn=e}function Pu(){if(pn){var e=pn,t=hn;if(hn=pn=null,Ui(e),t)for(e=0;e<t.length;e++)Ui(t[e])}}function Lu(e,t){return e(t)}function Tu(){}var ss=!1;function Ru(e,t,n){if(ss)return e(t,n);ss=!0;try{return Lu(e,t,n)}finally{ss=!1,(pn!==null||hn!==null)&&(Tu(),Pu())}}function sr(e,t){var n=e.stateNode;if(n===null)return null;var r=Ul(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(P(231,t,typeof n));return n}var Ys=!1;if(st)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){Ys=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Ys=!1}function ff(e,t,n,r,l,a,i,o,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(h){this.onError(h)}}var Kn=!1,cl=null,dl=!1,Xs=null,pf={onError:function(e){Kn=!0,cl=e}};function hf(e,t,n,r,l,a,i,o,u){Kn=!1,cl=null,ff.apply(pf,arguments)}function mf(e,t,n,r,l,a,i,o,u){if(hf.apply(this,arguments),Kn){if(Kn){var d=cl;Kn=!1,cl=null}else throw Error(P(198));dl||(dl=!0,Xs=d)}}function Xt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Mu(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 Ai(e){if(Xt(e)!==e)throw Error(P(188))}function vf(e){var t=e.alternate;if(!t){if(t=Xt(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var a=l.alternate;if(a===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===a.child){for(a=l.child;a;){if(a===n)return Ai(l),e;if(a===r)return Ai(l),t;a=a.sibling}throw Error(P(188))}if(n.return!==r.return)n=l,r=a;else{for(var i=!1,o=l.child;o;){if(o===n){i=!0,n=l,r=a;break}if(o===r){i=!0,r=l,n=a;break}o=o.sibling}if(!i){for(o=a.child;o;){if(o===n){i=!0,n=a,r=l;break}if(o===r){i=!0,r=a,n=l;break}o=o.sibling}if(!i)throw Error(P(189))}}if(n.alternate!==r)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function Ou(e){return e=vf(e),e!==null?zu(e):null}function zu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zu(e);if(t!==null)return t;e=e.sibling}return null}var $u=Me.unstable_scheduleCallback,Bi=Me.unstable_cancelCallback,gf=Me.unstable_shouldYield,yf=Me.unstable_requestPaint,re=Me.unstable_now,xf=Me.unstable_getCurrentPriorityLevel,Wa=Me.unstable_ImmediatePriority,Iu=Me.unstable_UserBlockingPriority,fl=Me.unstable_NormalPriority,jf=Me.unstable_LowPriority,bu=Me.unstable_IdlePriority,Il=null,Je=null;function wf(e){if(Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(Il,e,void 0,(e.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Sf,Nf=Math.log,kf=Math.LN2;function Sf(e){return e>>>=0,e===0?32:31-(Nf(e)/kf|0)|0}var $r=64,Ir=4194304;function Wn(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~l;o!==0?r=Wn(o):(a&=i,a!==0&&(r=Wn(a)))}else i=n&~l,i!==0?r=Wn(i):a!==0&&(r=Wn(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,a=t&-t,l>=a||l===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-He(t),l=1<<n,r|=e[n],t&=~l;return r}function Cf(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ef(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-He(a),o=1<<i,u=l[i];u===-1?(!(o&n)||o&r)&&(l[i]=Cf(o,t)):u<=t&&(e.expiredLanes|=o),a&=~o}}function Gs(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Du(){var e=$r;return $r<<=1,!($r&4194240)&&($r=64),e}function as(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function kr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-He(t),e[t]=n}function _f(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-He(n),a=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~a}}function Va(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var K=0;function Fu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Uu,Ha,Au,Bu,Wu,Js=!1,br=[],jt=null,wt=null,Nt=null,ar=new Map,ir=new Map,ht=[],Pf="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 submit".split(" ");function Wi(e,t){switch(e){case"focusin":case"focusout":jt=null;break;case"dragenter":case"dragleave":wt=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ir.delete(t.pointerId)}}function $n(e,t,n,r,l,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[l]},t!==null&&(t=Cr(t),t!==null&&Ha(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Lf(e,t,n,r,l){switch(t){case"focusin":return jt=$n(jt,e,t,n,r,l),!0;case"dragenter":return wt=$n(wt,e,t,n,r,l),!0;case"mouseover":return Nt=$n(Nt,e,t,n,r,l),!0;case"pointerover":var a=l.pointerId;return ar.set(a,$n(ar.get(a)||null,e,t,n,r,l)),!0;case"gotpointercapture":return a=l.pointerId,ir.set(a,$n(ir.get(a)||null,e,t,n,r,l)),!0}return!1}function Vu(e){var t=Dt(e.target);if(t!==null){var n=Xt(t);if(n!==null){if(t=n.tag,t===13){if(t=Mu(n),t!==null){e.blockedOn=t,Wu(e.priority,function(){Au(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Zr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zs(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ks=r,n.target.dispatchEvent(r),Ks=null}else return t=Cr(n),t!==null&&Ha(t),e.blockedOn=n,!1;t.shift()}return!0}function Vi(e,t,n){Zr(e)&&n.delete(t)}function Tf(){Js=!1,jt!==null&&Zr(jt)&&(jt=null),wt!==null&&Zr(wt)&&(wt=null),Nt!==null&&Zr(Nt)&&(Nt=null),ar.forEach(Vi),ir.forEach(Vi)}function In(e,t){e.blockedOn===t&&(e.blockedOn=null,Js||(Js=!0,Me.unstable_scheduleCallback(Me.unstable_NormalPriority,Tf)))}function or(e){function t(l){return In(l,e)}if(0<br.length){In(br[0],e);for(var n=1;n<br.length;n++){var r=br[n];r.blockedOn===e&&(r.blockedOn=null)}}for(jt!==null&&In(jt,e),wt!==null&&In(wt,e),Nt!==null&&In(Nt,e),ar.forEach(t),ir.forEach(t),n=0;n<ht.length;n++)r=ht[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ht.length&&(n=ht[0],n.blockedOn===null);)Vu(n),n.blockedOn===null&&ht.shift()}var mn=ut.ReactCurrentBatchConfig,hl=!0;function Rf(e,t,n,r){var l=K,a=mn.transition;mn.transition=null;try{K=1,Ka(e,t,n,r)}finally{K=l,mn.transition=a}}function Mf(e,t,n,r){var l=K,a=mn.transition;mn.transition=null;try{K=4,Ka(e,t,n,r)}finally{K=l,mn.transition=a}}function Ka(e,t,n,r){if(hl){var l=Zs(e,t,n,r);if(l===null)vs(e,t,r,ml,n),Wi(e,r);else if(Lf(l,e,t,n,r))r.stopPropagation();else if(Wi(e,r),t&4&&-1<Pf.indexOf(e)){for(;l!==null;){var a=Cr(l);if(a!==null&&Uu(a),a=Zs(e,t,n,r),a===null&&vs(e,t,r,ml,n),a===l)break;l=a}l!==null&&r.stopPropagation()}else vs(e,t,r,null,n)}}var ml=null;function Zs(e,t,n,r){if(ml=null,e=Ba(r),e=Dt(e),e!==null)if(t=Xt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Mu(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ml=e,null}function Hu(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(xf()){case Wa:return 1;case Iu:return 4;case fl:case jf:return 16;case bu:return 536870912;default:return 16}default:return 16}}var vt=null,Qa=null,qr=null;function Ku(){if(qr)return qr;var e,t=Qa,n=t.length,r,l="value"in vt?vt.value:vt.textContent,a=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===l[a-r];r++);return qr=l.slice(e,1<r?1-r:void 0)}function el(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 Dr(){return!0}function Hi(){return!1}function ze(e){function t(n,r,l,a,i){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Dr:Hi,this.isPropagationStopped=Hi,this}return te(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Dr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Dr)},persist:function(){},isPersistent:Dr}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ya=ze(Pn),Sr=te({},Pn,{view:0,detail:0}),Of=ze(Sr),is,os,bn,bl=te({},Sr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xa,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!==bn&&(bn&&e.type==="mousemove"?(is=e.screenX-bn.screenX,os=e.screenY-bn.screenY):os=is=0,bn=e),is)},movementY:function(e){return"movementY"in e?e.movementY:os}}),Ki=ze(bl),zf=te({},bl,{dataTransfer:0}),$f=ze(zf),If=te({},Sr,{relatedTarget:0}),us=ze(If),bf=te({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0}),Df=ze(bf),Ff=te({},Pn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Uf=ze(Ff),Af=te({},Pn,{data:0}),Qi=ze(Af),Bf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wf={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"},Vf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vf[e])?!!t[e]:!1}function Xa(){return Hf}var Kf=te({},Sr,{key:function(e){if(e.key){var t=Bf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=el(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xa,charCode:function(e){return e.type==="keypress"?el(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?el(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qf=ze(Kf),Yf=te({},bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yi=ze(Yf),Xf=te({},Sr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xa}),Gf=ze(Xf),Jf=te({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zf=ze(Jf),qf=te({},bl,{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}),ep=ze(qf),tp=[9,13,27,32],Ga=st&&"CompositionEvent"in window,Qn=null;st&&"documentMode"in document&&(Qn=document.documentMode);var np=st&&"TextEvent"in window&&!Qn,Qu=st&&(!Ga||Qn&&8<Qn&&11>=Qn),Xi=" ",Gi=!1;function Yu(e,t){switch(e){case"keyup":return tp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tn=!1;function rp(e,t){switch(e){case"compositionend":return Xu(t);case"keypress":return t.which!==32?null:(Gi=!0,Xi);case"textInput":return e=t.data,e===Xi&&Gi?null:e;default:return null}}function lp(e,t){if(tn)return e==="compositionend"||!Ga&&Yu(e,t)?(e=Ku(),qr=Qa=vt=null,tn=!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 Qu&&t.locale!=="ko"?null:t.data;default:return null}}var sp={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 Ji(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sp[e.type]:t==="textarea"}function Gu(e,t,n,r){_u(r),t=vl(t,"onChange"),0<t.length&&(n=new Ya("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,ur=null;function ap(e){ic(e,0)}function Dl(e){var t=ln(e);if(ju(t))return e}function ip(e,t){if(e==="change")return t}var Ju=!1;if(st){var cs;if(st){var ds="oninput"in document;if(!ds){var Zi=document.createElement("div");Zi.setAttribute("oninput","return;"),ds=typeof Zi.oninput=="function"}cs=ds}else cs=!1;Ju=cs&&(!document.documentMode||9<document.documentMode)}function qi(){Yn&&(Yn.detachEvent("onpropertychange",Zu),ur=Yn=null)}function Zu(e){if(e.propertyName==="value"&&Dl(ur)){var t=[];Gu(t,ur,e,Ba(e)),Ru(ap,t)}}function op(e,t,n){e==="focusin"?(qi(),Yn=t,ur=n,Yn.attachEvent("onpropertychange",Zu)):e==="focusout"&&qi()}function up(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dl(ur)}function cp(e,t){if(e==="click")return Dl(t)}function dp(e,t){if(e==="input"||e==="change")return Dl(t)}function fp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qe=typeof Object.is=="function"?Object.is:fp;function cr(e,t){if(Qe(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!zs.call(t,l)||!Qe(e[l],t[l]))return!1}return!0}function eo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function to(e,t){var n=eo(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=eo(n)}}function qu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ec(){for(var e=window,t=ul();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ul(e.document)}return t}function Ja(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")}function pp(e){var t=ec(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qu(n.ownerDocument.documentElement,n)){if(r!==null&&Ja(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,a=Math.min(r.start,l);r=r.end===void 0?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=to(n,a);var i=to(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hp=st&&"documentMode"in document&&11>=document.documentMode,nn=null,qs=null,Xn=null,ea=!1;function no(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ea||nn==null||nn!==ul(r)||(r=nn,"selectionStart"in r&&Ja(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xn&&cr(Xn,r)||(Xn=r,r=vl(qs,"onSelect"),0<r.length&&(t=new Ya("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=nn)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var rn={animationend:Fr("Animation","AnimationEnd"),animationiteration:Fr("Animation","AnimationIteration"),animationstart:Fr("Animation","AnimationStart"),transitionend:Fr("Transition","TransitionEnd")},fs={},tc={};st&&(tc=document.createElement("div").style,"AnimationEvent"in window||(delete rn.animationend.animation,delete rn.animationiteration.animation,delete rn.animationstart.animation),"TransitionEvent"in window||delete rn.transitionend.transition);function Fl(e){if(fs[e])return fs[e];if(!rn[e])return e;var t=rn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tc)return fs[e]=t[n];return e}var nc=Fl("animationend"),rc=Fl("animationiteration"),lc=Fl("animationstart"),sc=Fl("transitionend"),ac=new Map,ro="abort auxClick 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(" ");function Rt(e,t){ac.set(e,t),Yt(t,[e])}for(var ps=0;ps<ro.length;ps++){var hs=ro[ps],mp=hs.toLowerCase(),vp=hs[0].toUpperCase()+hs.slice(1);Rt(mp,"on"+vp)}Rt(nc,"onAnimationEnd");Rt(rc,"onAnimationIteration");Rt(lc,"onAnimationStart");Rt("dblclick","onDoubleClick");Rt("focusin","onFocus");Rt("focusout","onBlur");Rt(sc,"onTransitionEnd");xn("onMouseEnter",["mouseout","mouseover"]);xn("onMouseLeave",["mouseout","mouseover"]);xn("onPointerEnter",["pointerout","pointerover"]);xn("onPointerLeave",["pointerout","pointerover"]);Yt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Yt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Yt("onBeforeInput",["compositionend","keypress","textInput","paste"]);Yt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Yt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Yt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vn="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(" "),gp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vn));function lo(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,mf(r,t,void 0,e),e.currentTarget=null}function ic(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],u=o.instance,d=o.currentTarget;if(o=o.listener,u!==a&&l.isPropagationStopped())break e;lo(l,o,d),a=u}else for(i=0;i<r.length;i++){if(o=r[i],u=o.instance,d=o.currentTarget,o=o.listener,u!==a&&l.isPropagationStopped())break e;lo(l,o,d),a=u}}}if(dl)throw e=Xs,dl=!1,Xs=null,e}function Y(e,t){var n=t[sa];n===void 0&&(n=t[sa]=new Set);var r=e+"__bubble";n.has(r)||(oc(t,e,2,!1),n.add(r))}function ms(e,t,n){var r=0;t&&(r|=4),oc(n,e,r,t)}var Ur="_reactListening"+Math.random().toString(36).slice(2);function dr(e){if(!e[Ur]){e[Ur]=!0,mu.forEach(function(n){n!=="selectionchange"&&(gp.has(n)||ms(n,!1,e),ms(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ur]||(t[Ur]=!0,ms("selectionchange",!1,t))}}function oc(e,t,n,r){switch(Hu(t)){case 1:var l=Rf;break;case 4:l=Mf;break;default:l=Ka}n=l.bind(null,t,n,e),l=void 0,!Ys||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function vs(e,t,n,r,l){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var o=r.stateNode.containerInfo;if(o===l||o.nodeType===8&&o.parentNode===l)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;i=i.return}for(;o!==null;){if(i=Dt(o),i===null)return;if(u=i.tag,u===5||u===6){r=a=i;continue e}o=o.parentNode}}r=r.return}Ru(function(){var d=a,h=Ba(n),f=[];e:{var m=ac.get(e);if(m!==void 0){var k=Ya,y=e;switch(e){case"keypress":if(el(n)===0)break e;case"keydown":case"keyup":k=Qf;break;case"focusin":y="focus",k=us;break;case"focusout":y="blur",k=us;break;case"beforeblur":case"afterblur":k=us;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":k=Ki;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":k=$f;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":k=Gf;break;case nc:case rc:case lc:k=Df;break;case sc:k=Zf;break;case"scroll":k=Of;break;case"wheel":k=ep;break;case"copy":case"cut":case"paste":k=Uf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":k=Yi}var N=(t&4)!==0,S=!N&&e==="scroll",p=N?m!==null?m+"Capture":null:m;N=[];for(var c=d,v;c!==null;){v=c;var g=v.stateNode;if(v.tag===5&&g!==null&&(v=g,p!==null&&(g=sr(c,p),g!=null&&N.push(fr(c,g,v)))),S)break;c=c.return}0<N.length&&(m=new k(m,y,null,n,h),f.push({event:m,listeners:N}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",k=e==="mouseout"||e==="pointerout",m&&n!==Ks&&(y=n.relatedTarget||n.fromElement)&&(Dt(y)||y[at]))break e;if((k||m)&&(m=h.window===h?h:(m=h.ownerDocument)?m.defaultView||m.parentWindow:window,k?(y=n.relatedTarget||n.toElement,k=d,y=y?Dt(y):null,y!==null&&(S=Xt(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(k=null,y=d),k!==y)){if(N=Ki,g="onMouseLeave",p="onMouseEnter",c="mouse",(e==="pointerout"||e==="pointerover")&&(N=Yi,g="onPointerLeave",p="onPointerEnter",c="pointer"),S=k==null?m:ln(k),v=y==null?m:ln(y),m=new N(g,c+"leave",k,n,h),m.target=S,m.relatedTarget=v,g=null,Dt(h)===d&&(N=new N(p,c+"enter",y,n,h),N.target=v,N.relatedTarget=S,g=N),S=g,k&&y)t:{for(N=k,p=y,c=0,v=N;v;v=Zt(v))c++;for(v=0,g=p;g;g=Zt(g))v++;for(;0<c-v;)N=Zt(N),c--;for(;0<v-c;)p=Zt(p),v--;for(;c--;){if(N===p||p!==null&&N===p.alternate)break t;N=Zt(N),p=Zt(p)}N=null}else N=null;k!==null&&so(f,m,k,N,!1),y!==null&&S!==null&&so(f,S,y,N,!0)}}e:{if(m=d?ln(d):window,k=m.nodeName&&m.nodeName.toLowerCase(),k==="select"||k==="input"&&m.type==="file")var j=ip;else if(Ji(m))if(Ju)j=dp;else{j=up;var w=op}else(k=m.nodeName)&&k.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(j=cp);if(j&&(j=j(e,d))){Gu(f,j,n,h);break e}w&&w(e,m,d),e==="focusout"&&(w=m._wrapperState)&&w.controlled&&m.type==="number"&&As(m,"number",m.value)}switch(w=d?ln(d):window,e){case"focusin":(Ji(w)||w.contentEditable==="true")&&(nn=w,qs=d,Xn=null);break;case"focusout":Xn=qs=nn=null;break;case"mousedown":ea=!0;break;case"contextmenu":case"mouseup":case"dragend":ea=!1,no(f,n,h);break;case"selectionchange":if(hp)break;case"keydown":case"keyup":no(f,n,h)}var C;if(Ga)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else tn?Yu(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(Qu&&n.locale!=="ko"&&(tn||_!=="onCompositionStart"?_==="onCompositionEnd"&&tn&&(C=Ku()):(vt=h,Qa="value"in vt?vt.value:vt.textContent,tn=!0)),w=vl(d,_),0<w.length&&(_=new Qi(_,e,null,n,h),f.push({event:_,listeners:w}),C?_.data=C:(C=Xu(n),C!==null&&(_.data=C)))),(C=np?rp(e,n):lp(e,n))&&(d=vl(d,"onBeforeInput"),0<d.length&&(h=new Qi("onBeforeInput","beforeinput",null,n,h),f.push({event:h,listeners:d}),h.data=C))}ic(f,t)})}function fr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,a=l.stateNode;l.tag===5&&a!==null&&(l=a,a=sr(e,n),a!=null&&r.unshift(fr(e,a,l)),a=sr(e,t),a!=null&&r.push(fr(e,a,l))),e=e.return}return r}function Zt(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function so(e,t,n,r,l){for(var a=t._reactName,i=[];n!==null&&n!==r;){var o=n,u=o.alternate,d=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&d!==null&&(o=d,l?(u=sr(n,a),u!=null&&i.unshift(fr(n,u,o))):l||(u=sr(n,a),u!=null&&i.push(fr(n,u,o)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var yp=/\r\n?/g,xp=/\u0000|\uFFFD/g;function ao(e){return(typeof e=="string"?e:""+e).replace(yp,`
38
- `).replace(xp,"")}function Ar(e,t,n){if(t=ao(t),ao(e)!==t&&n)throw Error(P(425))}function gl(){}var ta=null,na=null;function ra(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var la=typeof setTimeout=="function"?setTimeout:void 0,jp=typeof clearTimeout=="function"?clearTimeout:void 0,io=typeof Promise=="function"?Promise:void 0,wp=typeof queueMicrotask=="function"?queueMicrotask:typeof io<"u"?function(e){return io.resolve(null).then(e).catch(Np)}:la;function Np(e){setTimeout(function(){throw e})}function gs(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),or(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);or(t)}function kt(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==="$?")break;if(t==="/$")return null}}return e}function oo(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ln=Math.random().toString(36).slice(2),Ge="__reactFiber$"+Ln,pr="__reactProps$"+Ln,at="__reactContainer$"+Ln,sa="__reactEvents$"+Ln,kp="__reactListeners$"+Ln,Sp="__reactHandles$"+Ln;function Dt(e){var t=e[Ge];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[Ge]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=oo(e);e!==null;){if(n=e[Ge])return n;e=oo(e)}return t}e=n,n=e.parentNode}return null}function Cr(e){return e=e[Ge]||e[at],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ln(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function Ul(e){return e[pr]||null}var aa=[],sn=-1;function Mt(e){return{current:e}}function X(e){0>sn||(e.current=aa[sn],aa[sn]=null,sn--)}function Q(e,t){sn++,aa[sn]=e.current,e.current=t}var Tt={},ye=Mt(Tt),Ee=Mt(!1),Wt=Tt;function jn(e,t){var n=e.type.contextTypes;if(!n)return Tt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in n)l[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function _e(e){return e=e.childContextTypes,e!=null}function yl(){X(Ee),X(ye)}function uo(e,t,n){if(ye.current!==Tt)throw Error(P(168));Q(ye,t),Q(Ee,n)}function uc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(P(108,of(e)||"Unknown",l));return te({},n,r)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Tt,Wt=ye.current,Q(ye,e),Q(Ee,Ee.current),!0}function co(e,t,n){var r=e.stateNode;if(!r)throw Error(P(169));n?(e=uc(e,t,Wt),r.__reactInternalMemoizedMergedChildContext=e,X(Ee),X(ye),Q(ye,e)):X(Ee),Q(Ee,n)}var tt=null,Al=!1,ys=!1;function cc(e){tt===null?tt=[e]:tt.push(e)}function Cp(e){Al=!0,cc(e)}function Ot(){if(!ys&&tt!==null){ys=!0;var e=0,t=K;try{var n=tt;for(K=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tt=null,Al=!1}catch(l){throw tt!==null&&(tt=tt.slice(e+1)),$u(Wa,Ot),l}finally{K=t,ys=!1}}return null}var an=[],on=0,jl=null,wl=0,$e=[],Ie=0,Vt=null,nt=1,rt="";function It(e,t){an[on++]=wl,an[on++]=jl,jl=e,wl=t}function dc(e,t,n){$e[Ie++]=nt,$e[Ie++]=rt,$e[Ie++]=Vt,Vt=e;var r=nt;e=rt;var l=32-He(r)-1;r&=~(1<<l),n+=1;var a=32-He(t)+l;if(30<a){var i=l-l%5;a=(r&(1<<i)-1).toString(32),r>>=i,l-=i,nt=1<<32-He(t)+l|n<<l|r,rt=a+e}else nt=1<<a|n<<l|r,rt=e}function Za(e){e.return!==null&&(It(e,1),dc(e,1,0))}function qa(e){for(;e===jl;)jl=an[--on],an[on]=null,wl=an[--on],an[on]=null;for(;e===Vt;)Vt=$e[--Ie],$e[Ie]=null,rt=$e[--Ie],$e[Ie]=null,nt=$e[--Ie],$e[Ie]=null}var Re=null,Te=null,G=!1,Ve=null;function fc(e,t){var n=be(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fo(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Re=e,Te=kt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Re=e,Te=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Vt!==null?{id:nt,overflow:rt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=be(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Re=e,Te=null,!0):!1;default:return!1}}function ia(e){return(e.mode&1)!==0&&(e.flags&128)===0}function oa(e){if(G){var t=Te;if(t){var n=t;if(!fo(e,t)){if(ia(e))throw Error(P(418));t=kt(n.nextSibling);var r=Re;t&&fo(e,t)?fc(r,n):(e.flags=e.flags&-4097|2,G=!1,Re=e)}}else{if(ia(e))throw Error(P(418));e.flags=e.flags&-4097|2,G=!1,Re=e}}}function po(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Re=e}function Br(e){if(e!==Re)return!1;if(!G)return po(e),G=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ra(e.type,e.memoizedProps)),t&&(t=Te)){if(ia(e))throw pc(),Error(P(418));for(;t;)fc(e,t),t=kt(t.nextSibling)}if(po(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Te=kt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Te=null}}else Te=Re?kt(e.stateNode.nextSibling):null;return!0}function pc(){for(var e=Te;e;)e=kt(e.nextSibling)}function wn(){Te=Re=null,G=!1}function ei(e){Ve===null?Ve=[e]:Ve.push(e)}var Ep=ut.ReactCurrentBatchConfig;function Dn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(P(309));var r=n.stateNode}if(!r)throw Error(P(147,e));var l=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var o=l.refs;i===null?delete o[a]:o[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function Wr(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ho(e){var t=e._init;return t(e._payload)}function hc(e){function t(p,c){if(e){var v=p.deletions;v===null?(p.deletions=[c],p.flags|=16):v.push(c)}}function n(p,c){if(!e)return null;for(;c!==null;)t(p,c),c=c.sibling;return null}function r(p,c){for(p=new Map;c!==null;)c.key!==null?p.set(c.key,c):p.set(c.index,c),c=c.sibling;return p}function l(p,c){return p=_t(p,c),p.index=0,p.sibling=null,p}function a(p,c,v){return p.index=v,e?(v=p.alternate,v!==null?(v=v.index,v<c?(p.flags|=2,c):v):(p.flags|=2,c)):(p.flags|=1048576,c)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function o(p,c,v,g){return c===null||c.tag!==6?(c=Cs(v,p.mode,g),c.return=p,c):(c=l(c,v),c.return=p,c)}function u(p,c,v,g){var j=v.type;return j===en?h(p,c,v.props.children,g,v.key):c!==null&&(c.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ft&&ho(j)===c.type)?(g=l(c,v.props),g.ref=Dn(p,c,v),g.return=p,g):(g=il(v.type,v.key,v.props,null,p.mode,g),g.ref=Dn(p,c,v),g.return=p,g)}function d(p,c,v,g){return c===null||c.tag!==4||c.stateNode.containerInfo!==v.containerInfo||c.stateNode.implementation!==v.implementation?(c=Es(v,p.mode,g),c.return=p,c):(c=l(c,v.children||[]),c.return=p,c)}function h(p,c,v,g,j){return c===null||c.tag!==7?(c=Bt(v,p.mode,g,j),c.return=p,c):(c=l(c,v),c.return=p,c)}function f(p,c,v){if(typeof c=="string"&&c!==""||typeof c=="number")return c=Cs(""+c,p.mode,v),c.return=p,c;if(typeof c=="object"&&c!==null){switch(c.$$typeof){case Mr:return v=il(c.type,c.key,c.props,null,p.mode,v),v.ref=Dn(p,null,c),v.return=p,v;case qt:return c=Es(c,p.mode,v),c.return=p,c;case ft:var g=c._init;return f(p,g(c._payload),v)}if(Bn(c)||On(c))return c=Bt(c,p.mode,v,null),c.return=p,c;Wr(p,c)}return null}function m(p,c,v,g){var j=c!==null?c.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return j!==null?null:o(p,c,""+v,g);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Mr:return v.key===j?u(p,c,v,g):null;case qt:return v.key===j?d(p,c,v,g):null;case ft:return j=v._init,m(p,c,j(v._payload),g)}if(Bn(v)||On(v))return j!==null?null:h(p,c,v,g,null);Wr(p,v)}return null}function k(p,c,v,g,j){if(typeof g=="string"&&g!==""||typeof g=="number")return p=p.get(v)||null,o(c,p,""+g,j);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Mr:return p=p.get(g.key===null?v:g.key)||null,u(c,p,g,j);case qt:return p=p.get(g.key===null?v:g.key)||null,d(c,p,g,j);case ft:var w=g._init;return k(p,c,v,w(g._payload),j)}if(Bn(g)||On(g))return p=p.get(v)||null,h(c,p,g,j,null);Wr(c,g)}return null}function y(p,c,v,g){for(var j=null,w=null,C=c,_=c=0,$=null;C!==null&&_<v.length;_++){C.index>_?($=C,C=null):$=C.sibling;var T=m(p,C,v[_],g);if(T===null){C===null&&(C=$);break}e&&C&&T.alternate===null&&t(p,C),c=a(T,c,_),w===null?j=T:w.sibling=T,w=T,C=$}if(_===v.length)return n(p,C),G&&It(p,_),j;if(C===null){for(;_<v.length;_++)C=f(p,v[_],g),C!==null&&(c=a(C,c,_),w===null?j=C:w.sibling=C,w=C);return G&&It(p,_),j}for(C=r(p,C);_<v.length;_++)$=k(C,p,_,v[_],g),$!==null&&(e&&$.alternate!==null&&C.delete($.key===null?_:$.key),c=a($,c,_),w===null?j=$:w.sibling=$,w=$);return e&&C.forEach(function(D){return t(p,D)}),G&&It(p,_),j}function N(p,c,v,g){var j=On(v);if(typeof j!="function")throw Error(P(150));if(v=j.call(v),v==null)throw Error(P(151));for(var w=j=null,C=c,_=c=0,$=null,T=v.next();C!==null&&!T.done;_++,T=v.next()){C.index>_?($=C,C=null):$=C.sibling;var D=m(p,C,T.value,g);if(D===null){C===null&&(C=$);break}e&&C&&D.alternate===null&&t(p,C),c=a(D,c,_),w===null?j=D:w.sibling=D,w=D,C=$}if(T.done)return n(p,C),G&&It(p,_),j;if(C===null){for(;!T.done;_++,T=v.next())T=f(p,T.value,g),T!==null&&(c=a(T,c,_),w===null?j=T:w.sibling=T,w=T);return G&&It(p,_),j}for(C=r(p,C);!T.done;_++,T=v.next())T=k(C,p,_,T.value,g),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?_:T.key),c=a(T,c,_),w===null?j=T:w.sibling=T,w=T);return e&&C.forEach(function(W){return t(p,W)}),G&&It(p,_),j}function S(p,c,v,g){if(typeof v=="object"&&v!==null&&v.type===en&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Mr:e:{for(var j=v.key,w=c;w!==null;){if(w.key===j){if(j=v.type,j===en){if(w.tag===7){n(p,w.sibling),c=l(w,v.props.children),c.return=p,p=c;break e}}else if(w.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ft&&ho(j)===w.type){n(p,w.sibling),c=l(w,v.props),c.ref=Dn(p,w,v),c.return=p,p=c;break e}n(p,w);break}else t(p,w);w=w.sibling}v.type===en?(c=Bt(v.props.children,p.mode,g,v.key),c.return=p,p=c):(g=il(v.type,v.key,v.props,null,p.mode,g),g.ref=Dn(p,c,v),g.return=p,p=g)}return i(p);case qt:e:{for(w=v.key;c!==null;){if(c.key===w)if(c.tag===4&&c.stateNode.containerInfo===v.containerInfo&&c.stateNode.implementation===v.implementation){n(p,c.sibling),c=l(c,v.children||[]),c.return=p,p=c;break e}else{n(p,c);break}else t(p,c);c=c.sibling}c=Es(v,p.mode,g),c.return=p,p=c}return i(p);case ft:return w=v._init,S(p,c,w(v._payload),g)}if(Bn(v))return y(p,c,v,g);if(On(v))return N(p,c,v,g);Wr(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,c!==null&&c.tag===6?(n(p,c.sibling),c=l(c,v),c.return=p,p=c):(n(p,c),c=Cs(v,p.mode,g),c.return=p,p=c),i(p)):n(p,c)}return S}var Nn=hc(!0),mc=hc(!1),Nl=Mt(null),kl=null,un=null,ti=null;function ni(){ti=un=kl=null}function ri(e){var t=Nl.current;X(Nl),e._currentValue=t}function ua(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function vn(e,t){kl=e,ti=un=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ce=!0),e.firstContext=null)}function Fe(e){var t=e._currentValue;if(ti!==e)if(e={context:e,memoizedValue:t,next:null},un===null){if(kl===null)throw Error(P(308));un=e,kl.dependencies={lanes:0,firstContext:e}}else un=un.next=e;return t}var Ft=null;function li(e){Ft===null?Ft=[e]:Ft.push(e)}function vc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,li(t)):(n.next=l.next,l.next=n),t.interleaved=n,it(e,r)}function it(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var pt=!1;function si(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function lt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function St(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,V&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,it(e,n)}return l=r.interleaved,l===null?(t.next=t,li(r)):(t.next=l.next,l.next=t),r.interleaved=t,it(e,n)}function tl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Va(e,n)}}function mo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?l=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?l=a=t:a=a.next=t}else l=a=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Sl(e,t,n,r){var l=e.updateQueue;pt=!1;var a=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var u=o,d=u.next;u.next=null,i===null?a=d:i.next=d,i=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==i&&(o===null?h.firstBaseUpdate=d:o.next=d,h.lastBaseUpdate=u))}if(a!==null){var f=l.baseState;i=0,h=d=u=null,o=a;do{var m=o.lane,k=o.eventTime;if((r&m)===m){h!==null&&(h=h.next={eventTime:k,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var y=e,N=o;switch(m=t,k=n,N.tag){case 1:if(y=N.payload,typeof y=="function"){f=y.call(k,f,m);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=N.payload,m=typeof y=="function"?y.call(k,f,m):y,m==null)break e;f=te({},f,m);break e;case 2:pt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[o]:m.push(o))}else k={eventTime:k,lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(d=h=k,u=f):h=h.next=k,i|=m;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;m=o,o=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(h===null&&(u=f),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else a===null&&(l.shared.lanes=0);Kt|=i,e.lanes=i,e.memoizedState=f}}function vo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(P(191,l));l.call(r)}}}var Er={},Ze=Mt(Er),hr=Mt(Er),mr=Mt(Er);function Ut(e){if(e===Er)throw Error(P(174));return e}function ai(e,t){switch(Q(mr,t),Q(hr,e),Q(Ze,Er),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ws(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ws(t,e)}X(Ze),Q(Ze,t)}function kn(){X(Ze),X(hr),X(mr)}function yc(e){Ut(mr.current);var t=Ut(Ze.current),n=Ws(t,e.type);t!==n&&(Q(hr,e),Q(Ze,n))}function ii(e){hr.current===e&&(X(Ze),X(hr))}var Z=Mt(0);function Cl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 xs=[];function oi(){for(var e=0;e<xs.length;e++)xs[e]._workInProgressVersionPrimary=null;xs.length=0}var nl=ut.ReactCurrentDispatcher,js=ut.ReactCurrentBatchConfig,Ht=0,q=null,ae=null,ue=null,El=!1,Gn=!1,vr=0,_p=0;function he(){throw Error(P(321))}function ui(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Qe(e[n],t[n]))return!1;return!0}function ci(e,t,n,r,l,a){if(Ht=a,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nl.current=e===null||e.memoizedState===null?Rp:Mp,e=n(r,l),Gn){a=0;do{if(Gn=!1,vr=0,25<=a)throw Error(P(301));a+=1,ue=ae=null,t.updateQueue=null,nl.current=Op,e=n(r,l)}while(Gn)}if(nl.current=_l,t=ae!==null&&ae.next!==null,Ht=0,ue=ae=q=null,El=!1,t)throw Error(P(300));return e}function di(){var e=vr!==0;return vr=0,e}function Xe(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ue===null?q.memoizedState=ue=e:ue=ue.next=e,ue}function Ue(){if(ae===null){var e=q.alternate;e=e!==null?e.memoizedState:null}else e=ae.next;var t=ue===null?q.memoizedState:ue.next;if(t!==null)ue=t,ae=e;else{if(e===null)throw Error(P(310));ae=e,e={memoizedState:ae.memoizedState,baseState:ae.baseState,baseQueue:ae.baseQueue,queue:ae.queue,next:null},ue===null?q.memoizedState=ue=e:ue=ue.next=e}return ue}function gr(e,t){return typeof t=="function"?t(e):t}function ws(e){var t=Ue(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=ae,l=r.baseQueue,a=n.pending;if(a!==null){if(l!==null){var i=l.next;l.next=a.next,a.next=i}r.baseQueue=l=a,n.pending=null}if(l!==null){a=l.next,r=r.baseState;var o=i=null,u=null,d=a;do{var h=d.lane;if((Ht&h)===h)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:h,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(o=u=f,i=r):u=u.next=f,q.lanes|=h,Kt|=h}d=d.next}while(d!==null&&d!==a);u===null?i=r:u.next=o,Qe(r,t.memoizedState)||(Ce=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do a=l.lane,q.lanes|=a,Kt|=a,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ns(e){var t=Ue(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,a=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do a=e(a,i.action),i=i.next;while(i!==l);Qe(a,t.memoizedState)||(Ce=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function xc(){}function jc(e,t){var n=q,r=Ue(),l=t(),a=!Qe(r.memoizedState,l);if(a&&(r.memoizedState=l,Ce=!0),r=r.queue,fi(kc.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||ue!==null&&ue.memoizedState.tag&1){if(n.flags|=2048,yr(9,Nc.bind(null,n,r,l,t),void 0,null),ce===null)throw Error(P(349));Ht&30||wc(n,t,l)}return l}function wc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t={lastEffect:null,stores:null},q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nc(e,t,n,r){t.value=n,t.getSnapshot=r,Sc(t)&&Cc(e)}function kc(e,t,n){return n(function(){Sc(t)&&Cc(e)})}function Sc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Qe(e,n)}catch{return!0}}function Cc(e){var t=it(e,1);t!==null&&Ke(t,e,1,-1)}function go(e){var t=Xe();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:e},t.queue=e,e=e.dispatch=Tp.bind(null,q,e),[t.memoizedState,e]}function yr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=q.updateQueue,t===null?(t={lastEffect:null,stores:null},q.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ec(){return Ue().memoizedState}function rl(e,t,n,r){var l=Xe();q.flags|=e,l.memoizedState=yr(1|t,n,void 0,r===void 0?null:r)}function Bl(e,t,n,r){var l=Ue();r=r===void 0?null:r;var a=void 0;if(ae!==null){var i=ae.memoizedState;if(a=i.destroy,r!==null&&ui(r,i.deps)){l.memoizedState=yr(t,n,a,r);return}}q.flags|=e,l.memoizedState=yr(1|t,n,a,r)}function yo(e,t){return rl(8390656,8,e,t)}function fi(e,t){return Bl(2048,8,e,t)}function _c(e,t){return Bl(4,2,e,t)}function Pc(e,t){return Bl(4,4,e,t)}function Lc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tc(e,t,n){return n=n!=null?n.concat([e]):null,Bl(4,4,Lc.bind(null,t,e),n)}function pi(){}function Rc(e,t){var n=Ue();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ui(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Mc(e,t){var n=Ue();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ui(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Oc(e,t,n){return Ht&21?(Qe(n,t)||(n=Du(),q.lanes|=n,Kt|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ce=!0),e.memoizedState=n)}function Pp(e,t){var n=K;K=n!==0&&4>n?n:4,e(!0);var r=js.transition;js.transition={};try{e(!1),t()}finally{K=n,js.transition=r}}function zc(){return Ue().memoizedState}function Lp(e,t,n){var r=Et(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},$c(e))Ic(t,n);else if(n=vc(e,t,n,r),n!==null){var l=we();Ke(n,e,r,l),bc(n,t,r)}}function Tp(e,t,n){var r=Et(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if($c(e))Ic(t,l);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,o=a(i,n);if(l.hasEagerState=!0,l.eagerState=o,Qe(o,i)){var u=t.interleaved;u===null?(l.next=l,li(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=vc(e,t,l,r),n!==null&&(l=we(),Ke(n,e,r,l),bc(n,t,r))}}function $c(e){var t=e.alternate;return e===q||t!==null&&t===q}function Ic(e,t){Gn=El=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Va(e,n)}}var _l={readContext:Fe,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useInsertionEffect:he,useLayoutEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useMutableSource:he,useSyncExternalStore:he,useId:he,unstable_isNewReconciler:!1},Rp={readContext:Fe,useCallback:function(e,t){return Xe().memoizedState=[e,t===void 0?null:t],e},useContext:Fe,useEffect:yo,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,rl(4194308,4,Lc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return rl(4,2,e,t)},useMemo:function(e,t){var n=Xe();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xe();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Lp.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=Xe();return e={current:e},t.memoizedState=e},useState:go,useDebugValue:pi,useDeferredValue:function(e){return Xe().memoizedState=e},useTransition:function(){var e=go(!1),t=e[0];return e=Pp.bind(null,e[1]),Xe().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=q,l=Xe();if(G){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),ce===null)throw Error(P(349));Ht&30||wc(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,yo(kc.bind(null,r,a,e),[e]),r.flags|=2048,yr(9,Nc.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Xe(),t=ce.identifierPrefix;if(G){var n=rt,r=nt;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=vr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=_p++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Mp={readContext:Fe,useCallback:Rc,useContext:Fe,useEffect:fi,useImperativeHandle:Tc,useInsertionEffect:_c,useLayoutEffect:Pc,useMemo:Mc,useReducer:ws,useRef:Ec,useState:function(){return ws(gr)},useDebugValue:pi,useDeferredValue:function(e){var t=Ue();return Oc(t,ae.memoizedState,e)},useTransition:function(){var e=ws(gr)[0],t=Ue().memoizedState;return[e,t]},useMutableSource:xc,useSyncExternalStore:jc,useId:zc,unstable_isNewReconciler:!1},Op={readContext:Fe,useCallback:Rc,useContext:Fe,useEffect:fi,useImperativeHandle:Tc,useInsertionEffect:_c,useLayoutEffect:Pc,useMemo:Mc,useReducer:Ns,useRef:Ec,useState:function(){return Ns(gr)},useDebugValue:pi,useDeferredValue:function(e){var t=Ue();return ae===null?t.memoizedState=e:Oc(t,ae.memoizedState,e)},useTransition:function(){var e=Ns(gr)[0],t=Ue().memoizedState;return[e,t]},useMutableSource:xc,useSyncExternalStore:jc,useId:zc,unstable_isNewReconciler:!1};function Be(e,t){if(e&&e.defaultProps){t=te({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ca(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:te({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Wl={isMounted:function(e){return(e=e._reactInternals)?Xt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=we(),l=Et(e),a=lt(r,l);a.payload=t,n!=null&&(a.callback=n),t=St(e,a,l),t!==null&&(Ke(t,e,l,r),tl(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=we(),l=Et(e),a=lt(r,l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=St(e,a,l),t!==null&&(Ke(t,e,l,r),tl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=we(),r=Et(e),l=lt(n,r);l.tag=2,t!=null&&(l.callback=t),t=St(e,l,r),t!==null&&(Ke(t,e,r,n),tl(t,e,r))}};function xo(e,t,n,r,l,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!cr(n,r)||!cr(l,a):!0}function Dc(e,t,n){var r=!1,l=Tt,a=t.contextType;return typeof a=="object"&&a!==null?a=Fe(a):(l=_e(t)?Wt:ye.current,r=t.contextTypes,a=(r=r!=null)?jn(e,l):Tt),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Wl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function jo(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Wl.enqueueReplaceState(t,t.state,null)}function da(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},si(e);var a=t.contextType;typeof a=="object"&&a!==null?l.context=Fe(a):(a=_e(t)?Wt:ye.current,l.context=jn(e,a)),l.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ca(e,t,a,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Wl.enqueueReplaceState(l,l.state,null),Sl(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Sn(e,t){try{var n="",r=t;do n+=af(r),r=r.return;while(r);var l=n}catch(a){l=`
39
- Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:l,digest:null}}function ks(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function fa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var zp=typeof WeakMap=="function"?WeakMap:Map;function Fc(e,t,n){n=lt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ll||(Ll=!0,Na=r),fa(e,t)},n}function Uc(e,t,n){n=lt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){fa(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){fa(e,t),typeof r!="function"&&(Ct===null?Ct=new Set([this]):Ct.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function wo(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zp;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Yp.bind(null,e,t,n),t.then(e,e))}function No(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ko(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=lt(-1,1),t.tag=2,St(n,t,1))),n.lanes|=1),e)}var $p=ut.ReactCurrentOwner,Ce=!1;function je(e,t,n,r){t.child=e===null?mc(t,null,n,r):Nn(t,e.child,n,r)}function So(e,t,n,r,l){n=n.render;var a=t.ref;return vn(t,l),r=ci(e,t,n,r,a,l),n=di(),e!==null&&!Ce?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ot(e,t,l)):(G&&n&&Za(t),t.flags|=1,je(e,t,r,l),t.child)}function Co(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!wi(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ac(e,t,a,r,l)):(e=il(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&l)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:cr,n(i,r)&&e.ref===t.ref)return ot(e,t,l)}return t.flags|=1,e=_t(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(cr(a,r)&&e.ref===t.ref)if(Ce=!1,t.pendingProps=r=a,(e.lanes&l)!==0)e.flags&131072&&(Ce=!0);else return t.lanes=e.lanes,ot(e,t,l)}return pa(e,t,n,r,l)}function Bc(e,t,n){var r=t.pendingProps,l=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Q(dn,Le),Le|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Q(dn,Le),Le|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Q(dn,Le),Le|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Q(dn,Le),Le|=r;return je(e,t,l,n),t.child}function Wc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function pa(e,t,n,r,l){var a=_e(n)?Wt:ye.current;return a=jn(t,a),vn(t,l),n=ci(e,t,n,r,a,l),r=di(),e!==null&&!Ce?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,ot(e,t,l)):(G&&r&&Za(t),t.flags|=1,je(e,t,n,l),t.child)}function Eo(e,t,n,r,l){if(_e(n)){var a=!0;xl(t)}else a=!1;if(vn(t,l),t.stateNode===null)ll(e,t),Dc(t,n,r),da(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var u=i.context,d=n.contextType;typeof d=="object"&&d!==null?d=Fe(d):(d=_e(n)?Wt:ye.current,d=jn(t,d));var h=n.getDerivedStateFromProps,f=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==r||u!==d)&&jo(t,i,r,d),pt=!1;var m=t.memoizedState;i.state=m,Sl(t,r,i,l),u=t.memoizedState,o!==r||m!==u||Ee.current||pt?(typeof h=="function"&&(ca(t,n,h,r),u=t.memoizedState),(o=pt||xo(t,n,o,r,m,u,d))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=d,r=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,gc(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:Be(t.type,o),i.props=d,f=t.pendingProps,m=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=Fe(u):(u=_e(n)?Wt:ye.current,u=jn(t,u));var k=n.getDerivedStateFromProps;(h=typeof k=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||m!==u)&&jo(t,i,r,u),pt=!1,m=t.memoizedState,i.state=m,Sl(t,r,i,l);var y=t.memoizedState;o!==f||m!==y||Ee.current||pt?(typeof k=="function"&&(ca(t,n,k,r),y=t.memoizedState),(d=pt||xo(t,n,d,r,m,y,u)||!1)?(h||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=u,r=d):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return ha(e,t,n,r,a,l)}function ha(e,t,n,r,l,a){Wc(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&co(t,n,!1),ot(e,t,a);r=t.stateNode,$p.current=t;var o=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Nn(t,e.child,null,a),t.child=Nn(t,null,o,a)):je(e,t,o,a),t.memoizedState=r.state,l&&co(t,n,!0),t.child}function Vc(e){var t=e.stateNode;t.pendingContext?uo(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uo(e,t.context,!1),ai(e,t.containerInfo)}function _o(e,t,n,r,l){return wn(),ei(l),t.flags|=256,je(e,t,n,r),t.child}var ma={dehydrated:null,treeContext:null,retryLane:0};function va(e){return{baseLanes:e,cachePool:null,transitions:null}}function Hc(e,t,n){var r=t.pendingProps,l=Z.current,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(l&2)!==0),o?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),Q(Z,l&1),e===null)return oa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,a?(r=t.mode,a=t.child,i={mode:"hidden",children:i},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=Kl(i,r,0,null),e=Bt(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=va(n),t.memoizedState=ma,e):hi(t,i));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return Ip(e,t,i,r,o,l,n);if(a){a=r.fallback,i=t.mode,l=e.child,o=l.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=_t(l,u),r.subtreeFlags=l.subtreeFlags&14680064),o!==null?a=_t(o,a):(a=Bt(a,i,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,i=e.child.memoizedState,i=i===null?va(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~n,t.memoizedState=ma,r}return a=e.child,e=a.sibling,r=_t(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function hi(e,t){return t=Kl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vr(e,t,n,r){return r!==null&&ei(r),Nn(t,e.child,null,n),e=hi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ip(e,t,n,r,l,a,i){if(n)return t.flags&256?(t.flags&=-257,r=ks(Error(P(422))),Vr(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,l=t.mode,r=Kl({mode:"visible",children:r.children},l,0,null),a=Bt(a,l,i,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Nn(t,e.child,null,i),t.child.memoizedState=va(i),t.memoizedState=ma,a);if(!(t.mode&1))return Vr(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(P(419)),r=ks(a,r,void 0),Vr(e,t,i,r)}if(o=(i&e.childLanes)!==0,Ce||o){if(r=ce,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==a.retryLane&&(a.retryLane=l,it(e,l),Ke(r,e,l,-1))}return ji(),r=ks(Error(P(421))),Vr(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Xp.bind(null,e),l._reactRetry=t,null):(e=a.treeContext,Te=kt(l.nextSibling),Re=t,G=!0,Ve=null,e!==null&&($e[Ie++]=nt,$e[Ie++]=rt,$e[Ie++]=Vt,nt=e.id,rt=e.overflow,Vt=t),t=hi(t,r.children),t.flags|=4096,t)}function Po(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ua(e.return,t,n)}function Ss(e,t,n,r,l){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=l)}function Kc(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(je(e,t,r.children,n),r=Z.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Po(e,n,t);else if(e.tag===19)Po(e,n,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}r&=1}if(Q(Z,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Cl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Ss(t,!1,l,n,a);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Cl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Ss(t,!0,n,null,a);break;case"together":Ss(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ll(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ot(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=_t(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_t(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bp(e,t,n){switch(t.tag){case 3:Vc(t),wn();break;case 5:yc(t);break;case 1:_e(t.type)&&xl(t);break;case 4:ai(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;Q(Nl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Q(Z,Z.current&1),t.flags|=128,null):n&t.child.childLanes?Hc(e,t,n):(Q(Z,Z.current&1),e=ot(e,t,n),e!==null?e.sibling:null);Q(Z,Z.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kc(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Q(Z,Z.current),r)break;return null;case 22:case 23:return t.lanes=0,Bc(e,t,n)}return ot(e,t,n)}var Qc,ga,Yc,Xc;Qc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ga=function(){};Yc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Ut(Ze.current);var a=null;switch(n){case"input":l=Fs(e,l),r=Fs(e,r),a=[];break;case"select":l=te({},l,{value:void 0}),r=te({},r,{value:void 0}),a=[];break;case"textarea":l=Bs(e,l),r=Bs(e,r),a=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=gl)}Vs(n,r);var i;n=null;for(d in l)if(!r.hasOwnProperty(d)&&l.hasOwnProperty(d)&&l[d]!=null)if(d==="style"){var o=l[d];for(i in o)o.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(rr.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in r){var u=r[d];if(o=l!=null?l[d]:void 0,r.hasOwnProperty(d)&&u!==o&&(u!=null||o!=null))if(d==="style")if(o){for(i in o)!o.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&o[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(a||(a=[]),a.push(d,n)),n=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(a=a||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(rr.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&Y("scroll",e),a||o===u||(a=[])):(a=a||[]).push(d,u))}n&&(a=a||[]).push("style",n);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};Xc=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fn(e,t){if(!G)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function me(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Dp(e,t,n){var r=t.pendingProps;switch(qa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return me(t),null;case 1:return _e(t.type)&&yl(),me(t),null;case 3:return r=t.stateNode,kn(),X(Ee),X(ye),oi(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Br(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ve!==null&&(Ca(Ve),Ve=null))),ga(e,t),me(t),null;case 5:ii(t);var l=Ut(mr.current);if(n=t.type,e!==null&&t.stateNode!=null)Yc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(P(166));return me(t),null}if(e=Ut(Ze.current),Br(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Ge]=t,r[pr]=a,e=(t.mode&1)!==0,n){case"dialog":Y("cancel",r),Y("close",r);break;case"iframe":case"object":case"embed":Y("load",r);break;case"video":case"audio":for(l=0;l<Vn.length;l++)Y(Vn[l],r);break;case"source":Y("error",r);break;case"img":case"image":case"link":Y("error",r),Y("load",r);break;case"details":Y("toggle",r);break;case"input":Ii(r,a),Y("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Y("invalid",r);break;case"textarea":Di(r,a),Y("invalid",r)}Vs(n,a),l=null;for(var i in a)if(a.hasOwnProperty(i)){var o=a[i];i==="children"?typeof o=="string"?r.textContent!==o&&(a.suppressHydrationWarning!==!0&&Ar(r.textContent,o,e),l=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&Ar(r.textContent,o,e),l=["children",""+o]):rr.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&Y("scroll",r)}switch(n){case"input":Or(r),bi(r,a,!0);break;case"textarea":Or(r),Fi(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=gl)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ku(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ge]=t,e[pr]=r,Qc(e,t,!1,!1),t.stateNode=e;e:{switch(i=Hs(n,r),n){case"dialog":Y("cancel",e),Y("close",e),l=r;break;case"iframe":case"object":case"embed":Y("load",e),l=r;break;case"video":case"audio":for(l=0;l<Vn.length;l++)Y(Vn[l],e);l=r;break;case"source":Y("error",e),l=r;break;case"img":case"image":case"link":Y("error",e),Y("load",e),l=r;break;case"details":Y("toggle",e),l=r;break;case"input":Ii(e,r),l=Fs(e,r),Y("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=te({},r,{value:void 0}),Y("invalid",e);break;case"textarea":Di(e,r),l=Bs(e,r),Y("invalid",e);break;default:l=r}Vs(n,l),o=l;for(a in o)if(o.hasOwnProperty(a)){var u=o[a];a==="style"?Eu(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Su(e,u)):a==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&lr(e,u):typeof u=="number"&&lr(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(rr.hasOwnProperty(a)?u!=null&&a==="onScroll"&&Y("scroll",e):u!=null&&Da(e,a,u,i))}switch(n){case"input":Or(e),bi(e,r,!1);break;case"textarea":Or(e),Fi(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Lt(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?fn(e,!!r.multiple,a,!1):r.defaultValue!=null&&fn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=gl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return me(t),null;case 6:if(e&&t.stateNode!=null)Xc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(P(166));if(n=Ut(mr.current),Ut(Ze.current),Br(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ge]=t,(a=r.nodeValue!==n)&&(e=Re,e!==null))switch(e.tag){case 3:Ar(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ar(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ge]=t,t.stateNode=r}return me(t),null;case 13:if(X(Z),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(G&&Te!==null&&t.mode&1&&!(t.flags&128))pc(),wn(),t.flags|=98560,a=!1;else if(a=Br(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(P(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(P(317));a[Ge]=t}else wn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;me(t),a=!1}else Ve!==null&&(Ca(Ve),Ve=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Z.current&1?oe===0&&(oe=3):ji())),t.updateQueue!==null&&(t.flags|=4),me(t),null);case 4:return kn(),ga(e,t),e===null&&dr(t.stateNode.containerInfo),me(t),null;case 10:return ri(t.type._context),me(t),null;case 17:return _e(t.type)&&yl(),me(t),null;case 19:if(X(Z),a=t.memoizedState,a===null)return me(t),null;if(r=(t.flags&128)!==0,i=a.rendering,i===null)if(r)Fn(a,!1);else{if(oe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Cl(e),i!==null){for(t.flags|=128,Fn(a,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Q(Z,Z.current&1|2),t.child}e=e.sibling}a.tail!==null&&re()>Cn&&(t.flags|=128,r=!0,Fn(a,!1),t.lanes=4194304)}else{if(!r)if(e=Cl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!G)return me(t),null}else 2*re()-a.renderingStartTime>Cn&&n!==1073741824&&(t.flags|=128,r=!0,Fn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(n=a.last,n!==null?n.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=re(),t.sibling=null,n=Z.current,Q(Z,r?n&1|2:n&1),t):(me(t),null);case 22:case 23:return xi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Le&1073741824&&(me(t),t.subtreeFlags&6&&(t.flags|=8192)):me(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function Fp(e,t){switch(qa(t),t.tag){case 1:return _e(t.type)&&yl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return kn(),X(Ee),X(ye),oi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ii(t),null;case 13:if(X(Z),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));wn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(Z),null;case 4:return kn(),null;case 10:return ri(t.type._context),null;case 22:case 23:return xi(),null;case 24:return null;default:return null}}var Hr=!1,ge=!1,Up=typeof WeakSet=="function"?WeakSet:Set,O=null;function cn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ne(e,t,r)}else n.current=null}function ya(e,t,n){try{n()}catch(r){ne(e,t,r)}}var Lo=!1;function Ap(e,t){if(ta=hl,e=ec(),Ja(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,o=-1,u=-1,d=0,h=0,f=e,m=null;t:for(;;){for(var k;f!==n||l!==0&&f.nodeType!==3||(o=i+l),f!==a||r!==0&&f.nodeType!==3||(u=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(k=f.firstChild)!==null;)m=f,f=k;for(;;){if(f===e)break t;if(m===n&&++d===l&&(o=i),m===a&&++h===r&&(u=i),(k=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=k}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(na={focusedElem:e,selectionRange:n},hl=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var N=y.memoizedProps,S=y.memoizedState,p=t.stateNode,c=p.getSnapshotBeforeUpdate(t.elementType===t.type?N:Be(t.type,N),S);p.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(g){ne(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return y=Lo,Lo=!1,y}function Jn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,a!==void 0&&ya(t,n,a)}l=l.next}while(l!==r)}}function Vl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xa(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Gc(e){var t=e.alternate;t!==null&&(e.alternate=null,Gc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ge],delete t[pr],delete t[sa],delete t[kp],delete t[Sp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Jc(e){return e.tag===5||e.tag===3||e.tag===4}function To(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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.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 ja(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gl));else if(r!==4&&(e=e.child,e!==null))for(ja(e,t,n),e=e.sibling;e!==null;)ja(e,t,n),e=e.sibling}function wa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(wa(e,t,n),e=e.sibling;e!==null;)wa(e,t,n),e=e.sibling}var de=null,We=!1;function dt(e,t,n){for(n=n.child;n!==null;)Zc(e,t,n),n=n.sibling}function Zc(e,t,n){if(Je&&typeof Je.onCommitFiberUnmount=="function")try{Je.onCommitFiberUnmount(Il,n)}catch{}switch(n.tag){case 5:ge||cn(n,t);case 6:var r=de,l=We;de=null,dt(e,t,n),de=r,We=l,de!==null&&(We?(e=de,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):de.removeChild(n.stateNode));break;case 18:de!==null&&(We?(e=de,n=n.stateNode,e.nodeType===8?gs(e.parentNode,n):e.nodeType===1&&gs(e,n),or(e)):gs(de,n.stateNode));break;case 4:r=de,l=We,de=n.stateNode.containerInfo,We=!0,dt(e,t,n),de=r,We=l;break;case 0:case 11:case 14:case 15:if(!ge&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var a=l,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&ya(n,t,i),l=l.next}while(l!==r)}dt(e,t,n);break;case 1:if(!ge&&(cn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ne(n,t,o)}dt(e,t,n);break;case 21:dt(e,t,n);break;case 22:n.mode&1?(ge=(r=ge)||n.memoizedState!==null,dt(e,t,n),ge=r):dt(e,t,n);break;default:dt(e,t,n)}}function Ro(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Up),t.forEach(function(r){var l=Gp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ae(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var a=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 5:de=o.stateNode,We=!1;break e;case 3:de=o.stateNode.containerInfo,We=!0;break e;case 4:de=o.stateNode.containerInfo,We=!0;break e}o=o.return}if(de===null)throw Error(P(160));Zc(a,i,l),de=null,We=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(d){ne(l,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qc(t,e),t=t.sibling}function qc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ae(t,e),Ye(e),r&4){try{Jn(3,e,e.return),Vl(3,e)}catch(N){ne(e,e.return,N)}try{Jn(5,e,e.return)}catch(N){ne(e,e.return,N)}}break;case 1:Ae(t,e),Ye(e),r&512&&n!==null&&cn(n,n.return);break;case 5:if(Ae(t,e),Ye(e),r&512&&n!==null&&cn(n,n.return),e.flags&32){var l=e.stateNode;try{lr(l,"")}catch(N){ne(e,e.return,N)}}if(r&4&&(l=e.stateNode,l!=null)){var a=e.memoizedProps,i=n!==null?n.memoizedProps:a,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&wu(l,a),Hs(o,i);var d=Hs(o,a);for(i=0;i<u.length;i+=2){var h=u[i],f=u[i+1];h==="style"?Eu(l,f):h==="dangerouslySetInnerHTML"?Su(l,f):h==="children"?lr(l,f):Da(l,h,f,d)}switch(o){case"input":Us(l,a);break;case"textarea":Nu(l,a);break;case"select":var m=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!a.multiple;var k=a.value;k!=null?fn(l,!!a.multiple,k,!1):m!==!!a.multiple&&(a.defaultValue!=null?fn(l,!!a.multiple,a.defaultValue,!0):fn(l,!!a.multiple,a.multiple?[]:"",!1))}l[pr]=a}catch(N){ne(e,e.return,N)}}break;case 6:if(Ae(t,e),Ye(e),r&4){if(e.stateNode===null)throw Error(P(162));l=e.stateNode,a=e.memoizedProps;try{l.nodeValue=a}catch(N){ne(e,e.return,N)}}break;case 3:if(Ae(t,e),Ye(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{or(t.containerInfo)}catch(N){ne(e,e.return,N)}break;case 4:Ae(t,e),Ye(e);break;case 13:Ae(t,e),Ye(e),l=e.child,l.flags&8192&&(a=l.memoizedState!==null,l.stateNode.isHidden=a,!a||l.alternate!==null&&l.alternate.memoizedState!==null||(gi=re())),r&4&&Ro(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(ge=(d=ge)||h,Ae(t,e),ge=d):Ae(t,e),Ye(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!h&&e.mode&1)for(O=e,h=e.child;h!==null;){for(f=O=h;O!==null;){switch(m=O,k=m.child,m.tag){case 0:case 11:case 14:case 15:Jn(4,m,m.return);break;case 1:cn(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(N){ne(r,n,N)}}break;case 5:cn(m,m.return);break;case 22:if(m.memoizedState!==null){Oo(f);continue}}k!==null?(k.return=m,O=k):Oo(f)}h=h.sibling}e:for(h=null,f=e;;){if(f.tag===5){if(h===null){h=f;try{l=f.stateNode,d?(a=l.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=f.stateNode,u=f.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=Cu("display",i))}catch(N){ne(e,e.return,N)}}}else if(f.tag===6){if(h===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(N){ne(e,e.return,N)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;h===f&&(h=null),f=f.return}h===f&&(h=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ae(t,e),Ye(e),r&4&&Ro(e);break;case 21:break;default:Ae(t,e),Ye(e)}}function Ye(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Jc(n)){var r=n;break e}n=n.return}throw Error(P(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(lr(l,""),r.flags&=-33);var a=To(e);wa(e,a,l);break;case 3:case 4:var i=r.stateNode.containerInfo,o=To(e);ja(e,o,i);break;default:throw Error(P(161))}}catch(u){ne(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Bp(e,t,n){O=e,ed(e)}function ed(e,t,n){for(var r=(e.mode&1)!==0;O!==null;){var l=O,a=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||Hr;if(!i){var o=l.alternate,u=o!==null&&o.memoizedState!==null||ge;o=Hr;var d=ge;if(Hr=i,(ge=u)&&!d)for(O=l;O!==null;)i=O,u=i.child,i.tag===22&&i.memoizedState!==null?zo(l):u!==null?(u.return=i,O=u):zo(l);for(;a!==null;)O=a,ed(a),a=a.sibling;O=l,Hr=o,ge=d}Mo(e)}else l.subtreeFlags&8772&&a!==null?(a.return=l,O=a):Mo(e)}}function Mo(e){for(;O!==null;){var t=O;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ge||Vl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ge)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:Be(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&vo(t,a,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}vo(t,i,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var h=d.memoizedState;if(h!==null){var f=h.dehydrated;f!==null&&or(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}ge||t.flags&512&&xa(t)}catch(m){ne(t,t.return,m)}}if(t===e){O=null;break}if(n=t.sibling,n!==null){n.return=t.return,O=n;break}O=t.return}}function Oo(e){for(;O!==null;){var t=O;if(t===e){O=null;break}var n=t.sibling;if(n!==null){n.return=t.return,O=n;break}O=t.return}}function zo(e){for(;O!==null;){var t=O;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Vl(4,t)}catch(u){ne(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){ne(t,l,u)}}var a=t.return;try{xa(t)}catch(u){ne(t,a,u)}break;case 5:var i=t.return;try{xa(t)}catch(u){ne(t,i,u)}}}catch(u){ne(t,t.return,u)}if(t===e){O=null;break}var o=t.sibling;if(o!==null){o.return=t.return,O=o;break}O=t.return}}var Wp=Math.ceil,Pl=ut.ReactCurrentDispatcher,mi=ut.ReactCurrentOwner,De=ut.ReactCurrentBatchConfig,V=0,ce=null,se=null,fe=0,Le=0,dn=Mt(0),oe=0,xr=null,Kt=0,Hl=0,vi=0,Zn=null,Se=null,gi=0,Cn=1/0,et=null,Ll=!1,Na=null,Ct=null,Kr=!1,gt=null,Tl=0,qn=0,ka=null,sl=-1,al=0;function we(){return V&6?re():sl!==-1?sl:sl=re()}function Et(e){return e.mode&1?V&2&&fe!==0?fe&-fe:Ep.transition!==null?(al===0&&(al=Du()),al):(e=K,e!==0||(e=window.event,e=e===void 0?16:Hu(e.type)),e):1}function Ke(e,t,n,r){if(50<qn)throw qn=0,ka=null,Error(P(185));kr(e,n,r),(!(V&2)||e!==ce)&&(e===ce&&(!(V&2)&&(Hl|=n),oe===4&&mt(e,fe)),Pe(e,r),n===1&&V===0&&!(t.mode&1)&&(Cn=re()+500,Al&&Ot()))}function Pe(e,t){var n=e.callbackNode;Ef(e,t);var r=pl(e,e===ce?fe:0);if(r===0)n!==null&&Bi(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Bi(n),t===1)e.tag===0?Cp($o.bind(null,e)):cc($o.bind(null,e)),wp(function(){!(V&6)&&Ot()}),n=null;else{switch(Fu(r)){case 1:n=Wa;break;case 4:n=Iu;break;case 16:n=fl;break;case 536870912:n=bu;break;default:n=fl}n=od(n,td.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function td(e,t){if(sl=-1,al=0,V&6)throw Error(P(327));var n=e.callbackNode;if(gn()&&e.callbackNode!==n)return null;var r=pl(e,e===ce?fe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Rl(e,r);else{t=r;var l=V;V|=2;var a=rd();(ce!==e||fe!==t)&&(et=null,Cn=re()+500,At(e,t));do try{Kp();break}catch(o){nd(e,o)}while(!0);ni(),Pl.current=a,V=l,se!==null?t=0:(ce=null,fe=0,t=oe)}if(t!==0){if(t===2&&(l=Gs(e),l!==0&&(r=l,t=Sa(e,l))),t===1)throw n=xr,At(e,0),mt(e,r),Pe(e,re()),n;if(t===6)mt(e,r);else{if(l=e.current.alternate,!(r&30)&&!Vp(l)&&(t=Rl(e,r),t===2&&(a=Gs(e),a!==0&&(r=a,t=Sa(e,a))),t===1))throw n=xr,At(e,0),mt(e,r),Pe(e,re()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(P(345));case 2:bt(e,Se,et);break;case 3:if(mt(e,r),(r&130023424)===r&&(t=gi+500-re(),10<t)){if(pl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){we(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=la(bt.bind(null,e,Se,et),t);break}bt(e,Se,et);break;case 4:if(mt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var i=31-He(r);a=1<<i,i=t[i],i>l&&(l=i),r&=~a}if(r=l,r=re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Wp(r/1960))-r,10<r){e.timeoutHandle=la(bt.bind(null,e,Se,et),r);break}bt(e,Se,et);break;case 5:bt(e,Se,et);break;default:throw Error(P(329))}}}return Pe(e,re()),e.callbackNode===n?td.bind(null,e):null}function Sa(e,t){var n=Zn;return e.current.memoizedState.isDehydrated&&(At(e,t).flags|=256),e=Rl(e,t),e!==2&&(t=Se,Se=n,t!==null&&Ca(t)),e}function Ca(e){Se===null?Se=e:Se.push.apply(Se,e)}function Vp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],a=l.getSnapshot;l=l.value;try{if(!Qe(a(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 mt(e,t){for(t&=~vi,t&=~Hl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-He(t),r=1<<n;e[n]=-1,t&=~r}}function $o(e){if(V&6)throw Error(P(327));gn();var t=pl(e,0);if(!(t&1))return Pe(e,re()),null;var n=Rl(e,t);if(e.tag!==0&&n===2){var r=Gs(e);r!==0&&(t=r,n=Sa(e,r))}if(n===1)throw n=xr,At(e,0),mt(e,t),Pe(e,re()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bt(e,Se,et),Pe(e,re()),null}function yi(e,t){var n=V;V|=1;try{return e(t)}finally{V=n,V===0&&(Cn=re()+500,Al&&Ot())}}function Qt(e){gt!==null&&gt.tag===0&&!(V&6)&&gn();var t=V;V|=1;var n=De.transition,r=K;try{if(De.transition=null,K=1,e)return e()}finally{K=r,De.transition=n,V=t,!(V&6)&&Ot()}}function xi(){Le=dn.current,X(dn)}function At(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jp(n)),se!==null)for(n=se.return;n!==null;){var r=n;switch(qa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&yl();break;case 3:kn(),X(Ee),X(ye),oi();break;case 5:ii(r);break;case 4:kn();break;case 13:X(Z);break;case 19:X(Z);break;case 10:ri(r.type._context);break;case 22:case 23:xi()}n=n.return}if(ce=e,se=e=_t(e.current,null),fe=Le=t,oe=0,xr=null,vi=Hl=Kt=0,Se=Zn=null,Ft!==null){for(t=0;t<Ft.length;t++)if(n=Ft[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,a=n.pending;if(a!==null){var i=a.next;a.next=l,r.next=i}n.pending=r}Ft=null}return e}function nd(e,t){do{var n=se;try{if(ni(),nl.current=_l,El){for(var r=q.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}El=!1}if(Ht=0,ue=ae=q=null,Gn=!1,vr=0,mi.current=null,n===null||n.return===null){oe=1,xr=t,se=null;break}e:{var a=e,i=n.return,o=n,u=t;if(t=fe,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,h=o,f=h.tag;if(!(h.mode&1)&&(f===0||f===11||f===15)){var m=h.alternate;m?(h.updateQueue=m.updateQueue,h.memoizedState=m.memoizedState,h.lanes=m.lanes):(h.updateQueue=null,h.memoizedState=null)}var k=No(i);if(k!==null){k.flags&=-257,ko(k,i,o,a,t),k.mode&1&&wo(a,d,t),t=k,u=d;var y=t.updateQueue;if(y===null){var N=new Set;N.add(u),t.updateQueue=N}else y.add(u);break e}else{if(!(t&1)){wo(a,d,t),ji();break e}u=Error(P(426))}}else if(G&&o.mode&1){var S=No(i);if(S!==null){!(S.flags&65536)&&(S.flags|=256),ko(S,i,o,a,t),ei(Sn(u,o));break e}}a=u=Sn(u,o),oe!==4&&(oe=2),Zn===null?Zn=[a]:Zn.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var p=Fc(a,u,t);mo(a,p);break e;case 1:o=u;var c=a.type,v=a.stateNode;if(!(a.flags&128)&&(typeof c.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ct===null||!Ct.has(v)))){a.flags|=65536,t&=-t,a.lanes|=t;var g=Uc(a,o,t);mo(a,g);break e}}a=a.return}while(a!==null)}sd(n)}catch(j){t=j,se===n&&n!==null&&(se=n=n.return);continue}break}while(!0)}function rd(){var e=Pl.current;return Pl.current=_l,e===null?_l:e}function ji(){(oe===0||oe===3||oe===2)&&(oe=4),ce===null||!(Kt&268435455)&&!(Hl&268435455)||mt(ce,fe)}function Rl(e,t){var n=V;V|=2;var r=rd();(ce!==e||fe!==t)&&(et=null,At(e,t));do try{Hp();break}catch(l){nd(e,l)}while(!0);if(ni(),V=n,Pl.current=r,se!==null)throw Error(P(261));return ce=null,fe=0,oe}function Hp(){for(;se!==null;)ld(se)}function Kp(){for(;se!==null&&!gf();)ld(se)}function ld(e){var t=id(e.alternate,e,Le);e.memoizedProps=e.pendingProps,t===null?sd(e):se=t,mi.current=null}function sd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Fp(n,t),n!==null){n.flags&=32767,se=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{oe=6,se=null;return}}else if(n=Dp(n,t,Le),n!==null){se=n;return}if(t=t.sibling,t!==null){se=t;return}se=t=e}while(t!==null);oe===0&&(oe=5)}function bt(e,t,n){var r=K,l=De.transition;try{De.transition=null,K=1,Qp(e,t,n,r)}finally{De.transition=l,K=r}return null}function Qp(e,t,n,r){do gn();while(gt!==null);if(V&6)throw Error(P(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(_f(e,a),e===ce&&(se=ce=null,fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Kr||(Kr=!0,od(fl,function(){return gn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=De.transition,De.transition=null;var i=K;K=1;var o=V;V|=4,mi.current=null,Ap(e,n),qc(n,e),pp(na),hl=!!ta,na=ta=null,e.current=n,Bp(n),yf(),V=o,K=i,De.transition=a}else e.current=n;if(Kr&&(Kr=!1,gt=e,Tl=l),a=e.pendingLanes,a===0&&(Ct=null),wf(n.stateNode),Pe(e,re()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(Ll)throw Ll=!1,e=Na,Na=null,e;return Tl&1&&e.tag!==0&&gn(),a=e.pendingLanes,a&1?e===ka?qn++:(qn=0,ka=e):qn=0,Ot(),null}function gn(){if(gt!==null){var e=Fu(Tl),t=De.transition,n=K;try{if(De.transition=null,K=16>e?16:e,gt===null)var r=!1;else{if(e=gt,gt=null,Tl=0,V&6)throw Error(P(331));var l=V;for(V|=4,O=e.current;O!==null;){var a=O,i=a.child;if(O.flags&16){var o=a.deletions;if(o!==null){for(var u=0;u<o.length;u++){var d=o[u];for(O=d;O!==null;){var h=O;switch(h.tag){case 0:case 11:case 15:Jn(8,h,a)}var f=h.child;if(f!==null)f.return=h,O=f;else for(;O!==null;){h=O;var m=h.sibling,k=h.return;if(Gc(h),h===d){O=null;break}if(m!==null){m.return=k,O=m;break}O=k}}}var y=a.alternate;if(y!==null){var N=y.child;if(N!==null){y.child=null;do{var S=N.sibling;N.sibling=null,N=S}while(N!==null)}}O=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,O=i;else e:for(;O!==null;){if(a=O,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Jn(9,a,a.return)}var p=a.sibling;if(p!==null){p.return=a.return,O=p;break e}O=a.return}}var c=e.current;for(O=c;O!==null;){i=O;var v=i.child;if(i.subtreeFlags&2064&&v!==null)v.return=i,O=v;else e:for(i=c;O!==null;){if(o=O,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Vl(9,o)}}catch(j){ne(o,o.return,j)}if(o===i){O=null;break e}var g=o.sibling;if(g!==null){g.return=o.return,O=g;break e}O=o.return}}if(V=l,Ot(),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(Il,e)}catch{}r=!0}return r}finally{K=n,De.transition=t}}return!1}function Io(e,t,n){t=Sn(n,t),t=Fc(e,t,1),e=St(e,t,1),t=we(),e!==null&&(kr(e,1,t),Pe(e,t))}function ne(e,t,n){if(e.tag===3)Io(e,e,n);else for(;t!==null;){if(t.tag===3){Io(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ct===null||!Ct.has(r))){e=Sn(n,e),e=Uc(t,e,1),t=St(t,e,1),e=we(),t!==null&&(kr(t,1,e),Pe(t,e));break}}t=t.return}}function Yp(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=we(),e.pingedLanes|=e.suspendedLanes&n,ce===e&&(fe&n)===n&&(oe===4||oe===3&&(fe&130023424)===fe&&500>re()-gi?At(e,0):vi|=n),Pe(e,t)}function ad(e,t){t===0&&(e.mode&1?(t=Ir,Ir<<=1,!(Ir&130023424)&&(Ir=4194304)):t=1);var n=we();e=it(e,t),e!==null&&(kr(e,t,n),Pe(e,n))}function Xp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function Gp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(t),ad(e,n)}var id;id=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ee.current)Ce=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ce=!1,bp(e,t,n);Ce=!!(e.flags&131072)}else Ce=!1,G&&t.flags&1048576&&dc(t,wl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ll(e,t),e=t.pendingProps;var l=jn(t,ye.current);vn(t,n),l=ci(null,t,r,e,l,n);var a=di();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_e(r)?(a=!0,xl(t)):a=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,si(t),l.updater=Wl,t.stateNode=l,l._reactInternals=t,da(t,r,e,n),t=ha(null,t,r,!0,a,n)):(t.tag=0,G&&a&&Za(t),je(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ll(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Zp(r),e=Be(r,e),l){case 0:t=pa(null,t,r,e,n);break e;case 1:t=Eo(null,t,r,e,n);break e;case 11:t=So(null,t,r,e,n);break e;case 14:t=Co(null,t,r,Be(r.type,e),n);break e}throw Error(P(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Be(r,l),pa(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Be(r,l),Eo(e,t,r,l,n);case 3:e:{if(Vc(t),e===null)throw Error(P(387));r=t.pendingProps,a=t.memoizedState,l=a.element,gc(e,t),Sl(t,r,null,n);var i=t.memoizedState;if(r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){l=Sn(Error(P(423)),t),t=_o(e,t,r,n,l);break e}else if(r!==l){l=Sn(Error(P(424)),t),t=_o(e,t,r,n,l);break e}else for(Te=kt(t.stateNode.containerInfo.firstChild),Re=t,G=!0,Ve=null,n=mc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wn(),r===l){t=ot(e,t,n);break e}je(e,t,r,n)}t=t.child}return t;case 5:return yc(t),e===null&&oa(t),r=t.type,l=t.pendingProps,a=e!==null?e.memoizedProps:null,i=l.children,ra(r,l)?i=null:a!==null&&ra(r,a)&&(t.flags|=32),Wc(e,t),je(e,t,i,n),t.child;case 6:return e===null&&oa(t),null;case 13:return Hc(e,t,n);case 4:return ai(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Nn(t,null,r,n):je(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Be(r,l),So(e,t,r,l,n);case 7:return je(e,t,t.pendingProps,n),t.child;case 8:return je(e,t,t.pendingProps.children,n),t.child;case 12:return je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,a=t.memoizedProps,i=l.value,Q(Nl,r._currentValue),r._currentValue=i,a!==null)if(Qe(a.value,i)){if(a.children===l.children&&!Ee.current){t=ot(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){i=a.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(a.tag===1){u=lt(-1,n&-n),u.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?u.next=u:(u.next=h.next,h.next=u),d.pending=u}}a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),ua(a.return,n,t),o.lanes|=n;break}u=u.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(P(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),ua(i,n,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}je(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,vn(t,n),l=Fe(l),r=r(l),t.flags|=1,je(e,t,r,n),t.child;case 14:return r=t.type,l=Be(r,t.pendingProps),l=Be(r.type,l),Co(e,t,r,l,n);case 15:return Ac(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Be(r,l),ll(e,t),t.tag=1,_e(r)?(e=!0,xl(t)):e=!1,vn(t,n),Dc(t,r,l),da(t,r,l,n),ha(null,t,r,!0,e,n);case 19:return Kc(e,t,n);case 22:return Bc(e,t,n)}throw Error(P(156,t.tag))};function od(e,t){return $u(e,t)}function Jp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function be(e,t,n,r){return new Jp(e,t,n,r)}function wi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zp(e){if(typeof e=="function")return wi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ua)return 11;if(e===Aa)return 14}return 2}function _t(e,t){var n=e.alternate;return n===null?(n=be(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function il(e,t,n,r,l,a){var i=2;if(r=e,typeof e=="function")wi(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case en:return Bt(n.children,l,a,t);case Fa:i=8,l|=8;break;case $s:return e=be(12,n,t,l|2),e.elementType=$s,e.lanes=a,e;case Is:return e=be(13,n,t,l),e.elementType=Is,e.lanes=a,e;case bs:return e=be(19,n,t,l),e.elementType=bs,e.lanes=a,e;case yu:return Kl(n,l,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vu:i=10;break e;case gu:i=9;break e;case Ua:i=11;break e;case Aa:i=14;break e;case ft:i=16,r=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=be(i,n,t,l),t.elementType=e,t.type=r,t.lanes=a,t}function Bt(e,t,n,r){return e=be(7,e,r,t),e.lanes=n,e}function Kl(e,t,n,r){return e=be(22,e,r,t),e.elementType=yu,e.lanes=n,e.stateNode={isHidden:!1},e}function Cs(e,t,n){return e=be(6,e,null,t),e.lanes=n,e}function Es(e,t,n){return t=be(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=as(0),this.expirationTimes=as(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=as(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ni(e,t,n,r,l,a,i,o,u){return e=new qp(e,t,n,o,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=be(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},si(a),e}function eh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qt,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ud(e){if(!e)return Tt;e=e._reactInternals;e:{if(Xt(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_e(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(_e(n))return uc(e,n,t)}return t}function cd(e,t,n,r,l,a,i,o,u){return e=Ni(n,r,!0,e,l,a,i,o,u),e.context=ud(null),n=e.current,r=we(),l=Et(n),a=lt(r,l),a.callback=t??null,St(n,a,l),e.current.lanes=l,kr(e,l,r),Pe(e,r),e}function Ql(e,t,n,r){var l=t.current,a=we(),i=Et(l);return n=ud(n),t.context===null?t.context=n:t.pendingContext=n,t=lt(a,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=St(l,t,i),e!==null&&(Ke(e,l,i,a),tl(e,l,i)),i}function Ml(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function bo(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ki(e,t){bo(e,t),(e=e.alternate)&&bo(e,t)}function th(){return null}var dd=typeof reportError=="function"?reportError:function(e){console.error(e)};function Si(e){this._internalRoot=e}Yl.prototype.render=Si.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));Ql(e,t,null,null)};Yl.prototype.unmount=Si.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qt(function(){Ql(null,e,null,null)}),t[at]=null}};function Yl(e){this._internalRoot=e}Yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ht.length&&t!==0&&t<ht[n].priority;n++);ht.splice(n,0,e),n===0&&Vu(e)}};function Ci(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Do(){}function nh(e,t,n,r,l){if(l){if(typeof r=="function"){var a=r;r=function(){var d=Ml(i);a.call(d)}}var i=cd(t,r,e,0,null,!1,!1,"",Do);return e._reactRootContainer=i,e[at]=i.current,dr(e.nodeType===8?e.parentNode:e),Qt(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var o=r;r=function(){var d=Ml(u);o.call(d)}}var u=Ni(e,0,!1,null,null,!1,!1,"",Do);return e._reactRootContainer=u,e[at]=u.current,dr(e.nodeType===8?e.parentNode:e),Qt(function(){Ql(t,u,n,r)}),u}function Gl(e,t,n,r,l){var a=n._reactRootContainer;if(a){var i=a;if(typeof l=="function"){var o=l;l=function(){var u=Ml(i);o.call(u)}}Ql(t,i,e,l)}else i=nh(n,t,e,l,r);return Ml(i)}Uu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Wn(t.pendingLanes);n!==0&&(Va(t,n|1),Pe(t,re()),!(V&6)&&(Cn=re()+500,Ot()))}break;case 13:Qt(function(){var r=it(e,1);if(r!==null){var l=we();Ke(r,e,1,l)}}),ki(e,1)}};Ha=function(e){if(e.tag===13){var t=it(e,134217728);if(t!==null){var n=we();Ke(t,e,134217728,n)}ki(e,134217728)}};Au=function(e){if(e.tag===13){var t=Et(e),n=it(e,t);if(n!==null){var r=we();Ke(n,e,t,r)}ki(e,t)}};Bu=function(){return K};Wu=function(e,t){var n=K;try{return K=e,t()}finally{K=n}};Qs=function(e,t,n){switch(t){case"input":if(Us(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=Ul(r);if(!l)throw Error(P(90));ju(r),Us(r,l)}}}break;case"textarea":Nu(e,n);break;case"select":t=n.value,t!=null&&fn(e,!!n.multiple,t,!1)}};Lu=yi;Tu=Qt;var rh={usingClientEntryPoint:!1,Events:[Cr,ln,Ul,_u,Pu,yi]},Un={findFiberByHostInstance:Dt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lh={bundleType:Un.bundleType,version:Un.version,rendererPackageName:Un.rendererPackageName,rendererConfig:Un.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ut.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ou(e),e===null?null:e.stateNode},findFiberByHostInstance:Un.findFiberByHostInstance||th,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qr.isDisabled&&Qr.supportsFiber)try{Il=Qr.inject(lh),Je=Qr}catch{}}Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rh;Oe.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ci(t))throw Error(P(200));return eh(e,t,null,n)};Oe.createRoot=function(e,t){if(!Ci(e))throw Error(P(299));var n=!1,r="",l=dd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=Ni(e,1,!1,null,null,n,!1,r,l),e[at]=t.current,dr(e.nodeType===8?e.parentNode:e),new Si(t)};Oe.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=Ou(t),e=e===null?null:e.stateNode,e};Oe.flushSync=function(e){return Qt(e)};Oe.hydrate=function(e,t,n){if(!Xl(t))throw Error(P(200));return Gl(null,e,t,!0,n)};Oe.hydrateRoot=function(e,t,n){if(!Ci(e))throw Error(P(405));var r=n!=null&&n.hydratedSources||null,l=!1,a="",i=dd;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=cd(t,null,e,1,n??null,l,!1,a,i),e[at]=t.current,dr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new Yl(t)};Oe.render=function(e,t,n){if(!Xl(t))throw Error(P(200));return Gl(null,e,t,!1,n)};Oe.unmountComponentAtNode=function(e){if(!Xl(e))throw Error(P(40));return e._reactRootContainer?(Qt(function(){Gl(null,null,e,!1,function(){e._reactRootContainer=null,e[at]=null})}),!0):!1};Oe.unstable_batchedUpdates=yi;Oe.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Xl(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return Gl(e,t,n,!1,r)};Oe.version="18.3.1-next-f1338f8080-20240426";function fd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fd)}catch(e){console.error(e)}}fd(),fu.exports=Oe;var sh=fu.exports,pd,Fo=sh;pd=Fo.createRoot,Fo.hydrateRoot;/**
41
- * @remix-run/router v1.23.2
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}var yt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(yt||(yt={}));const Uo="popstate";function ah(e){e===void 0&&(e={});function t(r,l){let{pathname:a,search:i,hash:o}=r.location;return Ea("",{pathname:a,search:i,hash:o},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Ol(l)}return oh(t,n,null,e)}function ee(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ei(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ih(){return Math.random().toString(36).substr(2,8)}function Ao(e,t){return{usr:e.state,key:e.key,idx:t}}function Ea(e,t,n,r){return n===void 0&&(n=null),jr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tn(t):t,{state:n,key:t&&t.key||r||ih()})}function Ol(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Tn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function oh(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:a=!1}=r,i=l.history,o=yt.Pop,u=null,d=h();d==null&&(d=0,i.replaceState(jr({},i.state,{idx:d}),""));function h(){return(i.state||{idx:null}).idx}function f(){o=yt.Pop;let S=h(),p=S==null?null:S-d;d=S,u&&u({action:o,location:N.location,delta:p})}function m(S,p){o=yt.Push;let c=Ea(N.location,S,p);d=h()+1;let v=Ao(c,d),g=N.createHref(c);try{i.pushState(v,"",g)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;l.location.assign(g)}a&&u&&u({action:o,location:N.location,delta:1})}function k(S,p){o=yt.Replace;let c=Ea(N.location,S,p);d=h();let v=Ao(c,d),g=N.createHref(c);i.replaceState(v,"",g),a&&u&&u({action:o,location:N.location,delta:0})}function y(S){let p=l.location.origin!=="null"?l.location.origin:l.location.href,c=typeof S=="string"?S:Ol(S);return c=c.replace(/ $/,"%20"),ee(p,"No window.location.(origin|href) available to create URL for href: "+c),new URL(c,p)}let N={get action(){return o},get location(){return e(l,i)},listen(S){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Uo,f),u=S,()=>{l.removeEventListener(Uo,f),u=null}},createHref(S){return t(l,S)},createURL:y,encodeLocation(S){let p=y(S);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:m,replace:k,go(S){return i.go(S)}};return N}var Bo;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Bo||(Bo={}));function uh(e,t,n){return n===void 0&&(n="/"),ch(e,t,n)}function ch(e,t,n,r){let l=typeof t=="string"?Tn(t):t,a=En(l.pathname||"/",n);if(a==null)return null;let i=hd(e);dh(i);let o=null;for(let u=0;o==null&&u<i.length;++u){let d=Nh(a);o=jh(i[u],d)}return o}function hd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(a,i,o)=>{let u={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};u.relativePath.startsWith("/")&&(ee(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let d=Pt([r,u.relativePath]),h=n.concat(u);a.children&&a.children.length>0&&(ee(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),hd(a.children,t,h,d)),!(a.path==null&&!a.index)&&t.push({path:d,score:yh(d,a.index),routesMeta:h})};return e.forEach((a,i)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))l(a,i);else for(let u of md(a.path))l(a,i,u)}),t}function md(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return l?[a,""]:[a];let i=md(r.join("/")),o=[];return o.push(...i.map(u=>u===""?a:[a,u].join("/"))),l&&o.push(...i),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function dh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const fh=/^:[\w-]+$/,ph=3,hh=2,mh=1,vh=10,gh=-2,Wo=e=>e==="*";function yh(e,t){let n=e.split("/"),r=n.length;return n.some(Wo)&&(r+=gh),t&&(r+=hh),n.filter(l=>!Wo(l)).reduce((l,a)=>l+(fh.test(a)?ph:a===""?mh:vh),r)}function xh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function jh(e,t,n){let{routesMeta:r}=e,l={},a="/",i=[];for(let o=0;o<r.length;++o){let u=r[o],d=o===r.length-1,h=a==="/"?t:t.slice(a.length)||"/",f=_a({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},h),m=u.route;if(!f)return null;Object.assign(l,f.params),i.push({params:l,pathname:Pt([a,f.pathname]),pathnameBase:_h(Pt([a,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(a=Pt([a,f.pathnameBase]))}return i}function _a(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=wh(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let a=l[0],i=a.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:r.reduce((d,h,f)=>{let{paramName:m,isOptional:k}=h;if(m==="*"){let N=o[f]||"";i=a.slice(0,a.length-N.length).replace(/(.)\/+$/,"$1")}const y=o[f];return k&&!y?d[m]=void 0:d[m]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:i,pattern:e}}function wh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ei(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Nh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ei(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function En(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const kh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sh=e=>kh.test(e);function Ch(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Tn(e):e,a;if(n)if(Sh(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Ei(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?a=Vo(n.substring(1),"/"):a=Vo(n,t)}else a=t;return{pathname:a,search:Ph(r),hash:Lh(l)}}function Vo(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function _s(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Eh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _i(e,t){let n=Eh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Pi(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Tn(e):(l=jr({},e),ee(!l.pathname||!l.pathname.includes("?"),_s("?","pathname","search",l)),ee(!l.pathname||!l.pathname.includes("#"),_s("#","pathname","hash",l)),ee(!l.search||!l.search.includes("#"),_s("#","search","hash",l)));let a=e===""||l.pathname==="",i=a?"/":l.pathname,o;if(i==null)o=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),f-=1;l.pathname=m.join("/")}o=f>=0?t[f]:"/"}let u=Ch(l,o),d=i&&i!=="/"&&i.endsWith("/"),h=(a||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||h)&&(u.pathname+="/"),u}const Pt=e=>e.join("/").replace(/\/\/+/g,"/"),_h=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ph=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Lh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Th(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const vd=["post","put","patch","delete"];new Set(vd);const Rh=["get",...vd];new Set(Rh);/**
50
- * React Router v6.30.3
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wr.apply(this,arguments)}const Jl=x.createContext(null),gd=x.createContext(null),ct=x.createContext(null),Zl=x.createContext(null),zt=x.createContext({outlet:null,matches:[],isDataRoute:!1}),yd=x.createContext(null);function Mh(e,t){let{relative:n}=t===void 0?{}:t;Rn()||ee(!1);let{basename:r,navigator:l}=x.useContext(ct),{hash:a,pathname:i,search:o}=ql(e,{relative:n}),u=i;return r!=="/"&&(u=i==="/"?r:Pt([r,i])),l.createHref({pathname:u,search:o,hash:a})}function Rn(){return x.useContext(Zl)!=null}function $t(){return Rn()||ee(!1),x.useContext(Zl).location}function xd(e){x.useContext(ct).static||x.useLayoutEffect(e)}function _r(){let{isDataRoute:e}=x.useContext(zt);return e?Hh():Oh()}function Oh(){Rn()||ee(!1);let e=x.useContext(Jl),{basename:t,future:n,navigator:r}=x.useContext(ct),{matches:l}=x.useContext(zt),{pathname:a}=$t(),i=JSON.stringify(_i(l,n.v7_relativeSplatPath)),o=x.useRef(!1);return xd(()=>{o.current=!0}),x.useCallback(function(d,h){if(h===void 0&&(h={}),!o.current)return;if(typeof d=="number"){r.go(d);return}let f=Pi(d,JSON.parse(i),a,h.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Pt([t,f.pathname])),(h.replace?r.replace:r.push)(f,h.state,h)},[t,r,i,a,e])}function ql(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(ct),{matches:l}=x.useContext(zt),{pathname:a}=$t(),i=JSON.stringify(_i(l,r.v7_relativeSplatPath));return x.useMemo(()=>Pi(e,JSON.parse(i),a,n==="path"),[e,i,a,n])}function zh(e,t){return $h(e,t)}function $h(e,t,n,r){Rn()||ee(!1);let{navigator:l}=x.useContext(ct),{matches:a}=x.useContext(zt),i=a[a.length-1],o=i?i.params:{};i&&i.pathname;let u=i?i.pathnameBase:"/";i&&i.route;let d=$t(),h;if(t){var f;let S=typeof t=="string"?Tn(t):t;u==="/"||(f=S.pathname)!=null&&f.startsWith(u)||ee(!1),h=S}else h=d;let m=h.pathname||"/",k=m;if(u!=="/"){let S=u.replace(/^\//,"").split("/");k="/"+m.replace(/^\//,"").split("/").slice(S.length).join("/")}let y=uh(e,{pathname:k}),N=Uh(y&&y.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:Pt([u,l.encodeLocation?l.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Pt([u,l.encodeLocation?l.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),a,n,r);return t&&N?x.createElement(Zl.Provider,{value:{location:wr({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:yt.Pop}},N):N}function Ih(){let e=Vh(),t=Th(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,null)}const bh=x.createElement(Ih,null);class Dh extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(zt.Provider,{value:this.props.routeContext},x.createElement(yd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fh(e){let{routeContext:t,match:n,children:r}=e,l=x.useContext(Jl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(zt.Provider,{value:t},r)}function Uh(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=(l=n)==null?void 0:l.errors;if(o!=null){let h=i.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);h>=0||ee(!1),i=i.slice(0,Math.min(i.length,h+1))}let u=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<i.length;h++){let f=i[h];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=h),f.route.id){let{loaderData:m,errors:k}=n,y=f.route.loader&&m[f.route.id]===void 0&&(!k||k[f.route.id]===void 0);if(f.route.lazy||y){u=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}return i.reduceRight((h,f,m)=>{let k,y=!1,N=null,S=null;n&&(k=o&&f.route.id?o[f.route.id]:void 0,N=f.route.errorElement||bh,u&&(d<0&&m===0?(Kh("route-fallback"),y=!0,S=null):d===m&&(y=!0,S=f.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,m+1)),c=()=>{let v;return k?v=N:y?v=S:f.route.Component?v=x.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=h,x.createElement(Fh,{match:f,routeContext:{outlet:h,matches:p,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?x.createElement(Dh,{location:n.location,revalidation:n.revalidation,component:N,error:k,children:c(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):c()},null)}var jd=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(jd||{}),wd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wd||{});function Ah(e){let t=x.useContext(Jl);return t||ee(!1),t}function Bh(e){let t=x.useContext(gd);return t||ee(!1),t}function Wh(e){let t=x.useContext(zt);return t||ee(!1),t}function Nd(e){let t=Wh(),n=t.matches[t.matches.length-1];return n.route.id||ee(!1),n.route.id}function Vh(){var e;let t=x.useContext(yd),n=Bh(),r=Nd();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Hh(){let{router:e}=Ah(jd.UseNavigateStable),t=Nd(wd.UseNavigateStable),n=x.useRef(!1);return xd(()=>{n.current=!0}),x.useCallback(function(l,a){a===void 0&&(a={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,wr({fromRouteId:t},a)))},[e,t])}const Ho={};function Kh(e,t,n){Ho[e]||(Ho[e]=!0)}function Qh(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Yh(e){let{to:t,replace:n,state:r,relative:l}=e;Rn()||ee(!1);let{future:a,static:i}=x.useContext(ct),{matches:o}=x.useContext(zt),{pathname:u}=$t(),d=_r(),h=Pi(t,_i(o,a.v7_relativeSplatPath),u,l==="path"),f=JSON.stringify(h);return x.useEffect(()=>d(JSON.parse(f),{replace:n,state:r,relative:l}),[d,f,l,n,r]),null}function ve(e){ee(!1)}function Xh(e){let{basename:t="/",children:n=null,location:r,navigationType:l=yt.Pop,navigator:a,static:i=!1,future:o}=e;Rn()&&ee(!1);let u=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:u,navigator:a,static:i,future:wr({v7_relativeSplatPath:!1},o)}),[u,o,a,i]);typeof r=="string"&&(r=Tn(r));let{pathname:h="/",search:f="",hash:m="",state:k=null,key:y="default"}=r,N=x.useMemo(()=>{let S=En(h,u);return S==null?null:{location:{pathname:S,search:f,hash:m,state:k,key:y},navigationType:l}},[u,h,f,m,k,y,l]);return N==null?null:x.createElement(ct.Provider,{value:d},x.createElement(Zl.Provider,{children:n,value:N}))}function Gh(e){let{children:t,location:n}=e;return zh(Pa(t),n)}new Promise(()=>{});function Pa(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,l)=>{if(!x.isValidElement(r))return;let a=[...t,l];if(r.type===x.Fragment){n.push.apply(n,Pa(r.props.children,a));return}r.type!==ve&&ee(!1),!r.props.index||!r.props.children||ee(!1);let i={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Pa(r.props.children,a)),n.push(i)}),n}/**
59
- * React Router DOM v6.30.3
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function zl(){return zl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zl.apply(this,arguments)}function kd(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,a;for(a=0;a<r.length;a++)l=r[a],!(t.indexOf(l)>=0)&&(n[l]=e[l]);return n}function Jh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zh(e,t){return e.button===0&&(!t||t==="_self")&&!Jh(e)}function La(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function qh(e,t){let n=La(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(a=>{n.append(l,a)})}),n}const em=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tm=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],nm="6";try{window.__reactRouterVersion=nm}catch{}const rm=x.createContext({isTransitioning:!1}),lm="startTransition",Ko=Qd[lm];function sm(e){let{basename:t,children:n,future:r,window:l}=e,a=x.useRef();a.current==null&&(a.current=ah({window:l,v5Compat:!0}));let i=a.current,[o,u]=x.useState({action:i.action,location:i.location}),{v7_startTransition:d}=r||{},h=x.useCallback(f=>{d&&Ko?Ko(()=>u(f)):u(f)},[u,d]);return x.useLayoutEffect(()=>i.listen(h),[i,h]),x.useEffect(()=>Qh(r),[r]),x.createElement(Xh,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:i,future:r})}const am=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",im=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pr=x.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:a,replace:i,state:o,target:u,to:d,preventScrollReset:h,viewTransition:f}=t,m=kd(t,em),{basename:k}=x.useContext(ct),y,N=!1;if(typeof d=="string"&&im.test(d)&&(y=d,am))try{let v=new URL(window.location.href),g=d.startsWith("//")?new URL(v.protocol+d):new URL(d),j=En(g.pathname,k);g.origin===v.origin&&j!=null?d=j+g.search+g.hash:N=!0}catch{}let S=Mh(d,{relative:l}),p=um(d,{replace:i,state:o,target:u,preventScrollReset:h,relative:l,viewTransition:f});function c(v){r&&r(v),v.defaultPrevented||p(v)}return x.createElement("a",zl({},m,{href:y||S,onClick:N||a?r:c,ref:n,target:u}))}),Ta=x.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:a="",end:i=!1,style:o,to:u,viewTransition:d,children:h}=t,f=kd(t,tm),m=ql(u,{relative:f.relative}),k=$t(),y=x.useContext(gd),{navigator:N,basename:S}=x.useContext(ct),p=y!=null&&cm(m)&&d===!0,c=N.encodeLocation?N.encodeLocation(m).pathname:m.pathname,v=k.pathname,g=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;l||(v=v.toLowerCase(),g=g?g.toLowerCase():null,c=c.toLowerCase()),g&&S&&(g=En(g,S)||g);const j=c!=="/"&&c.endsWith("/")?c.length-1:c.length;let w=v===c||!i&&v.startsWith(c)&&v.charAt(j)==="/",C=g!=null&&(g===c||!i&&g.startsWith(c)&&g.charAt(c.length)==="/"),_={isActive:w,isPending:C,isTransitioning:p},$=w?r:void 0,T;typeof a=="function"?T=a(_):T=[a,w?"active":null,C?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let D=typeof o=="function"?o(_):o;return x.createElement(Pr,zl({},f,{"aria-current":$,className:T,ref:n,style:D,to:u,viewTransition:d}),typeof h=="function"?h(_):h)});var Ra;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ra||(Ra={}));var Qo;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qo||(Qo={}));function om(e){let t=x.useContext(Jl);return t||ee(!1),t}function um(e,t){let{target:n,replace:r,state:l,preventScrollReset:a,relative:i,viewTransition:o}=t===void 0?{}:t,u=_r(),d=$t(),h=ql(e,{relative:i});return x.useCallback(f=>{if(Zh(f,n)){f.preventDefault();let m=r!==void 0?r:Ol(d)===Ol(h);u(e,{replace:m,state:l,preventScrollReset:a,relative:i,viewTransition:o})}},[d,u,h,r,l,n,e,a,i,o])}function Sd(e){let t=x.useRef(La(e)),n=x.useRef(!1),r=$t(),l=x.useMemo(()=>qh(r.search,n.current?null:t.current),[r.search]),a=_r(),i=x.useCallback((o,u)=>{const d=La(typeof o=="function"?o(l):o);n.current=!0,a("?"+d,u)},[a,l]);return[l,i]}function cm(e,t){t===void 0&&(t={});let n=x.useContext(rm);n==null&&ee(!1);let{basename:r}=om(Ra.useViewTransitionState),l=ql(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=En(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=En(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _a(l.pathname,i)!=null||_a(l.pathname,a)!=null}const Yo="nlm.sidenav.collapsed",dm=[{to:"/live",label:"Live",icon:pm()},{to:"/pulse",label:"Pulse",icon:hm()},{to:"/river",label:"River",icon:mm()},{to:"/thread",label:"Thread",icon:vm()},{to:"/search",label:"Search",icon:gm()},{to:"/recall",label:"Recall",icon:ym()},{to:"/settings",label:"Settings",icon:xm()}];function fm(){const[e,t]=x.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(Yo)==="1");return x.useEffect(()=>{document.body.style.setProperty("--sidenav-w",e?"52px":"180px"),window.localStorage.setItem(Yo,e?"1":"0")},[e]),s.jsxs("nav",{className:`sidenav${e?" collapsed":""}`,"aria-label":"Primary navigation",children:[s.jsxs("div",{className:"sidenav-header",children:[s.jsx("span",{className:"sidenav-wordmark",children:"NLM"}),s.jsx("button",{className:"sidenav-toggle","aria-label":"Toggle sidebar",onClick:()=>t(n=>!n),children:e?Nm():wm()})]}),s.jsx("div",{className:"sidenav-items",children:dm.map(n=>s.jsxs(Ta,{to:n.to,className:({isActive:r})=>`sidenav-item${r?" active":""}`,"data-label":n.label,children:[s.jsx("span",{className:"item-icon",children:n.icon}),s.jsx("span",{className:"item-label",children:n.label})]},n.to))}),s.jsx("div",{className:"sidenav-footer",children:s.jsxs(Ta,{to:"/settings/data",className:"sidenav-item sidenav-data","data-label":"Data",children:[s.jsx("span",{className:"item-icon",children:jm()}),s.jsx("span",{className:"item-label",children:"Data"})]})})]})}function Gt(e,t=16){return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",children:e})}function pm(){return Gt(s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M19 12a7 7 0 00-14 0M22 12a10 10 0 00-20 0"})]}))}function hm(){return Gt(s.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"}))}function mm(){return Gt(s.jsx("path",{d:"M2 12c1.5-3 3-4.5 4.5-4.5S9 9 10.5 12s3 4.5 4.5 4.5S18 15 19.5 12 21 7.5 22 7.5"}))}function vm(){return Gt(s.jsxs(s.Fragment,{children:[s.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),s.jsx("circle",{cx:"18",cy:"6",r:"3"}),s.jsx("circle",{cx:"6",cy:"18",r:"3"}),s.jsx("path",{d:"M18 9a9 9 0 01-9 9"})]}))}function gm(){return Gt(s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}))}function ym(){return Gt(s.jsxs(s.Fragment,{children:[s.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"13"}),s.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),s.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"9"})]}))}function xm(){return Gt(s.jsxs(s.Fragment,{children:[s.jsx("path",{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"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]}))}function jm(){return s.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M21 12c0 1.657-4.03 3-9 3S3 13.657 3 12"}),s.jsx("path",{d:"M3 5v14c0 1.657 4.03 3 9 3s9-1.343 9-3V5"})]})}function wm(){return s.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Nm(){return s.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})})}async function km(e){const t=await fetch(e);if(!t.ok)throw new Error(`${e} → ${t.status}`);return t.json()}function er(e,t,n){const[r,l]=x.useState({data:n,error:null,lastUpdated:null,loading:!0});return x.useEffect(()=>{let a=!1;const i=async()=>{try{const u=await km(e);a||l({data:u,error:null,lastUpdated:Date.now(),loading:!1})}catch(u){a||l(d=>({...d,error:u instanceof Error?u.message:String(u),loading:!1}))}};i();const o=setInterval(i,t);return()=>{a=!0,clearInterval(o)}},[e,t]),r}function ol(e){if(!e)return"";const t=Date.parse(e);if(!Number.isFinite(t))return"";const n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const l=Math.floor(r/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function ie({w:e,h:t=12,radius:n=4,className:r}){const l={width:typeof e=="number"?`${e}px`:e??"100%",height:typeof t=="number"?`${t}px`:t,borderRadius:n};return s.jsx("span",{className:`skeleton${r?` ${r}`:""}`,style:l,"aria-hidden":"true"})}function Sm(){return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"kpi-row",children:[Array.from({length:4}).map((e,t)=>s.jsxs("div",{className:"kpi",children:[s.jsx(ie,{h:10,w:70}),s.jsx(ie,{h:28,w:90}),s.jsx(ie,{h:10,w:60})]},t)),s.jsx("div",{className:"kpi",children:s.jsx(ie,{h:56})})]}),s.jsx("div",{className:"pulse-grid",children:Array.from({length:4}).map((e,t)=>s.jsxs("section",{className:"card",children:[s.jsx("header",{className:"card-head",children:s.jsx(ie,{h:14,w:140})}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:"12px 0"},children:Array.from({length:5}).map((n,r)=>s.jsx(ie,{h:12,w:`${65+r*7%30}%`},r))})]},t))})]})}function Cm({rows:e=6}){return s.jsx("ul",{className:"session-list",children:Array.from({length:e}).map((t,n)=>s.jsxs("li",{className:"session-row session-row-detail",children:[s.jsx(ie,{h:18,w:56,radius:10}),s.jsxs("div",{className:"session-row-main",children:[s.jsx(ie,{h:13,w:`${50+n*11%35}%`}),s.jsx(ie,{h:11,w:`${30+n*13%50}%`})]}),s.jsx(ie,{h:10,w:48})]},n))})}function Em({rows:e=8,cols:t=6}){return s.jsx("tbody",{children:Array.from({length:e}).map((n,r)=>s.jsx("tr",{children:Array.from({length:t}).map((l,a)=>s.jsx("td",{children:s.jsx(ie,{h:12,w:a===0?"70%":a===t-1?"60%":"50%"})},a))},r))})}function _m(){return s.jsxs("div",{className:"drawer-body",children:[s.jsx("dl",{className:"kv-list",children:Array.from({length:5}).map((e,t)=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("dt",{className:"kv-label",children:s.jsx(ie,{h:10,w:70})}),s.jsx("dd",{className:"kv-value",children:s.jsx(ie,{h:12,w:`${40+t*13%50}%`})})]},t))}),s.jsx("h4",{className:"drawer-section",children:s.jsx(ie,{h:12,w:100})}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((e,t)=>s.jsx(ie,{h:12,w:`${55+t*7%35}%`},t))})]})}function Lr({sessionId:e,onClose:t,entityColor:n,onNavigate:r,prevSessionId:l,nextSessionId:a}){const[i,o]=x.useState(null),[u,d]=x.useState(null);return x.useEffect(()=>{o(null),d(null),fetch(`/api/session/${encodeURIComponent(e)}`).then(async h=>{if(!h.ok)throw new Error(`HTTP ${h.status}`);const f=await h.json();o({id:String(f.id??e),label:String(f.label??""),summary:String(f.summary??""),body:String(f.body??""),status:String(f.status??"closed"),startedAt:typeof f.startedAt=="string"?f.startedAt:null,endedAt:typeof f.endedAt=="string"?f.endedAt:null,durationMin:typeof f.durationMin=="number"?f.durationMin:null,runtime:String(f.runtime??""),entities:Array.isArray(f.entities)?f.entities:[],decisions:Array.isArray(f.decisions)?f.decisions:[],open:Array.isArray(f.open)?f.open:[],supersededBy:typeof f.supersededBy=="string"?f.supersededBy:null,supersedes:Array.isArray(f.supersedes)?f.supersedes:[]})}).catch(h=>d(h instanceof Error?h.message:String(h)))},[e]),x.useEffect(()=>{const h=f=>{if(f.key==="Escape"){t();return}f.key==="ArrowLeft"&&l!=null&&r&&r(l),f.key==="ArrowRight"&&a!=null&&r&&r(a)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,r,l,a]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"drawer-backdrop",onClick:t}),s.jsxs("aside",{className:"session-drawer",role:"dialog","aria-modal":"true",children:[s.jsxs("header",{className:"drawer-head",children:[n&&s.jsx("span",{className:"dot",style:{background:n}}),s.jsx("h3",{className:"drawer-title",children:(i==null?void 0:i.label)??e}),(l!=null||a!=null)&&r&&s.jsxs("div",{className:"drawer-nav",children:[s.jsx("button",{type:"button",className:"drawer-nav-btn",disabled:l==null,onClick:()=>l&&r(l),"aria-label":"Previous session",children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M15 18l-6-6 6-6"})})}),s.jsx("button",{type:"button",className:"drawer-nav-btn",disabled:a==null,onClick:()=>a&&r(a),"aria-label":"Next session",children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M9 18l6-6-6-6"})})})]}),s.jsx("button",{type:"button",className:"drawer-close",onClick:t,"aria-label":"Close",children:"×"})]}),u&&s.jsx("div",{className:"muted error drawer-body",children:u}),!i&&!u&&s.jsx(_m,{}),i&&s.jsxs("div",{className:"drawer-body",children:[i.supersededBy&&s.jsxs("div",{className:"supersedence-banner supersedence-banner--superseded",children:[s.jsx("span",{className:"supersedence-label",children:"Superseded by"}),r?s.jsx("button",{type:"button",className:"supersedence-link",onClick:()=>r(i.supersededBy),children:i.supersededBy}):s.jsx("span",{className:"supersedence-id mono small",children:i.supersededBy})]}),i.supersedes.length>0&&s.jsxs("div",{className:"supersedence-banner supersedence-banner--supersedes",children:[s.jsx("span",{className:"supersedence-label",children:"Supersedes"}),s.jsx("span",{className:"supersedence-ids",children:i.supersedes.map(h=>r?s.jsx("button",{type:"button",className:"supersedence-link",onClick:()=>r(h),children:h},h):s.jsx("span",{className:"supersedence-id mono small",children:h},h))})]}),i.summary&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Summary"}),s.jsx("p",{className:"drawer-paragraph",children:i.summary})]}),i.decisions.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Decisions"}),s.jsx("ul",{className:"drawer-list",children:i.decisions.map((h,f)=>s.jsxs("li",{children:[s.jsx("span",{className:"live-tag","data-kind":"decision",children:"decision"})," ",h]},f))})]}),i.open.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Open questions"}),s.jsx("ul",{className:"drawer-list",children:i.open.map((h,f)=>s.jsxs("li",{children:[s.jsx("span",{className:"live-tag","data-kind":"open",children:"open"})," ",h]},f))})]}),i.entities.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Entities"}),s.jsx("div",{className:"entity-chips",children:i.entities.map(h=>s.jsx(Pr,{to:`/thread?entity=${encodeURIComponent(h)}`,className:"chip",onClick:t,children:h},h))})]}),s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Status"}),s.jsx("dd",{className:"kv-value",children:s.jsx("span",{className:`chip-inline status-${i.status}`,children:i.status})}),s.jsx("dt",{className:"kv-label",children:"Started"}),s.jsx("dd",{className:"kv-value mono small",children:i.startedAt??"—"}),s.jsx("dt",{className:"kv-label",children:"Duration"}),s.jsxs("dd",{className:"kv-value",children:[i.durationMin??"—"," min"]}),s.jsx("dt",{className:"kv-label",children:"Runtime"}),s.jsx("dd",{className:"kv-value mono small",children:i.runtime}),s.jsx("dt",{className:"kv-label",children:"Session ID"}),s.jsx("dd",{className:"kv-value mono small",children:i.id})]}),i.body&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Transcript excerpt"}),s.jsxs("pre",{className:"drawer-body-text",children:[i.body.slice(0,3e3),i.body.length>3e3?`
68
-
69
- […truncated]`:""]})]})]})]})]})}const tr=3e3,Pm=tr*3;function Ps(e){const t=x.useRef(null),[n,r]=x.useState(new Set),l=e.join("|");return x.useEffect(()=>{if(e.length===0)return;if(t.current===null){t.current=new Set(e);return}const a=e.filter(o=>!t.current.has(o));for(const o of e)t.current.add(o);if(a.length===0)return;r(o=>new Set([...o,...a]));const i=setTimeout(()=>{r(o=>{const u=new Set(o);for(const d of a)u.delete(d);return u})},1200);return()=>clearTimeout(i)},[l]),n}function Lm(){const e=er("/api/recall/recent?limit=50",tr,{entries:[]}),t=er("/api/live/recent-writes?limit=50",tr,{writes:[]}),n=er("/api/live/recent-markers?limit=50",tr,{markers:[]}),[r,l]=x.useState(null),a=e.data.entries.map(f=>`${f.ts}|${f.source}|${f.query??""}`),i=t.data.writes.map(f=>f.id),o=n.data.markers.map(f=>`${f.sessionId}|${f.kind}|${f.text}`),u=Ps(a),d=Ps(i),h=Ps(o);return s.jsxs("div",{className:"live-page",children:[s.jsx(Tm,{reads:e,writes:t,markers:n}),s.jsxs("div",{className:"live-board",children:[s.jsx(Ls,{title:"Reads",count:e.data.entries.length,loading:e.loading,emptyLabel:"no recent recall",children:e.data.entries.map((f,m)=>{const k=a[m];return s.jsxs("div",{className:`live-row${u.has(k)?" is-new":""}`,children:[s.jsx("span",{className:"live-tag",children:f.source}),s.jsx("span",{className:"label",children:f.query??"(no query)"}),s.jsxs("div",{className:"body",children:[f.mode," · ",f.nResults," hit",f.nResults===1?"":"s"]}),s.jsx("div",{className:"meta",children:ol(f.ts)})]},k)})}),s.jsx(Ls,{title:"Writes",count:t.data.writes.length,loading:t.loading,emptyLabel:"no recent writes",children:t.data.writes.map(f=>s.jsxs(Xo,{fresh:d.has(f.id),onOpen:()=>l(f.id),children:[s.jsx("span",{className:"live-tag",children:f.runtime.split("/")[0]}),s.jsx("span",{className:"label",children:f.label}),s.jsx("div",{className:"body",children:f.summary}),s.jsxs("div",{className:"meta",children:[ol(f.createdAt)," · ",f.id]})]},f.id))}),s.jsx(Ls,{title:"Markers",count:n.data.markers.length,loading:n.loading,emptyLabel:"no recent markers",children:n.data.markers.map((f,m)=>{const k=o[m];return s.jsxs(Xo,{fresh:h.has(k),onOpen:()=>l(f.sessionId),children:[s.jsx("span",{className:"live-tag","data-kind":f.kind,children:f.kind}),s.jsx("span",{className:"label",children:f.text}),s.jsx("div",{className:"body",children:f.label}),s.jsx("div",{className:"meta",children:ol(f.createdAt)})]},k)})})]}),r&&s.jsx(Lr,{sessionId:r,onClose:()=>l(null)})]})}function Tm({reads:e,writes:t,markers:n}){const r=[e,t,n],l=r.every(f=>f.loading),a=r.map(f=>f.lastUpdated).filter(f=>f!==null),i=a.length>0?Math.max(...a):null,o=r.some(f=>f.error!==null),u=i!==null&&Date.now()-i>Pm;let d;l?d="connecting":u||o?d="reconnecting":d="live";const h=d==="connecting"?"Connecting…":d==="reconnecting"?"Reconnecting…":"Live";return s.jsxs("div",{className:"live-status",children:[s.jsx("span",{className:`live-status-dot live-status-${d}`,"aria-hidden":"true"}),s.jsx("span",{className:"live-status-label",children:h}),i!==null&&s.jsxs("span",{className:"muted small",children:["updated ",ol(new Date(i).toISOString())]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small mono",children:["polling every ",tr/1e3,"s"]})]})}function Ls({title:e,count:t,loading:n,emptyLabel:r,children:l}){const a=t===0;return s.jsxs("section",{className:"live-col",children:[s.jsxs("header",{className:"live-col-head",children:[s.jsx("span",{className:"live-col-title",children:e}),s.jsx("span",{className:"live-col-count",children:t})]}),s.jsx("div",{className:"live-col-body",children:a?s.jsx("div",{className:"live-empty",children:n?"loading…":r}):l})]})}function Xo({fresh:e,onOpen:t,children:n}){return s.jsx("div",{className:`live-row clickable${e?" is-new":""}`,onClick:t,role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())},children:n})}function Mn(e){const[t,n]=x.useState({data:null,loading:!0,error:null}),r=x.useRef(!1),l=x.useCallback(async()=>{try{const a=await fetch("/api/dataset");if(!a.ok)throw new Error(`HTTP ${a.status}`);const i=await a.json();r.current||n({data:i,loading:!1,error:null})}catch(a){if(!r.current){const i=a instanceof Error?a.message:String(a);n(o=>({data:o.data,loading:!1,error:i}))}}},[]);return x.useEffect(()=>(r.current=!1,l(),()=>{r.current=!0}),[e,l]),{...t,refetch:l}}function qe(e){if(!e)return"—";const t=Date.parse(e);if(!Number.isFinite(t))return"—";const n=Math.floor((Date.now()-t)/864e5);if(n<=0)return"today";if(n===1)return"1d";if(n<30)return`${n}d`;const r=Math.floor(n/30);return r<12?`${r}mo`:`${Math.floor(n/365)}y`}async function yn(e){const t=await fetch("/api/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,runtime:e.runtime??"web-ui"})});if(!t.ok)throw new Error(`POST /api/action → ${t.status}`);return(await t.json()).id}function Cd({openId:e,defaultText:t,onPromoted:n}){const[r,l]=x.useState(!1),[a,i]=x.useState(!1),[o,u]=x.useState(t),d=async()=>{const h=o.trim();if(h){i(!0);try{await yn({kind:"promote_open",subject_type:"open_question",subject_id:e,payload:{resolution:h,original_text:t}}),await n(),l(!1)}catch{i(!1)}}};return r?s.jsxs("div",{className:"promote-editor",onClick:h=>h.stopPropagation(),children:[s.jsx("input",{className:"form-input form-input-inline promote-input",value:o,onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),d()),h.key==="Escape"&&(h.preventDefault(),l(!1))},disabled:a,autoFocus:!0}),s.jsx("button",{type:"button",className:"chip",onClick:()=>void d(),disabled:a||!o.trim(),children:"save"}),s.jsx("button",{type:"button",className:"chip",onClick:()=>l(!1),disabled:a,children:"cancel"})]}):s.jsx("button",{type:"button",className:"chip promote-chip",onClick:()=>{u(t),l(!0)},children:"→ decision"})}function Rm(){const{data:e,loading:t,error:n,refetch:r}=Mn(),[l,a]=x.useState("all"),[i,o]=x.useState("oldest"),[u,d]=x.useState(null),[h,f]=x.useState(null),m=x.useMemo(()=>e?[...l==="all"?e.alerts:e.alerts.filter(c=>c.severity===l)].sort((c,v)=>i==="oldest"?v.age_days-c.age_days:c.age_days-v.age_days):[],[e,l,i]),k=async p=>{await yn({kind:"dismiss",subject_type:"alert",subject_id:p}),await r()},y=async(p,c)=>{const v=new Date(Date.now()+c*864e5).toISOString();await yn({kind:"snooze",subject_type:"alert",subject_id:p,payload:{snoozed_until:v}}),await r()},N=x.useMemo(()=>e?[...e.sessions].sort((p,c)=>(c.started_at??"").localeCompare(p.started_at??"")).slice(0,20):[],[e]);if(t&&!e)return s.jsx(Sm,{});if(n&&!e)return s.jsx("div",{className:"page-pad",children:s.jsx("div",{className:"muted error",children:n})});if(!e)return null;const S=u?e.alerts.find(p=>p.id===u)??null:null;return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"kpi-row",children:[s.jsx(Yr,{label:"This week",value:e.metrics.this_week,hint:`${e.metrics.last_week} last week`}),s.jsx(Yr,{label:"Sessions",value:e.meta.sessions_total,hint:"total"}),s.jsx(Yr,{label:"Entities",value:e.meta.entities_total,hint:"catalogued"}),s.jsx(Yr,{label:"Decisions",value:e.metrics.closed_decisions,hint:"non-superseded"}),s.jsx(zm,{values:e.metrics.sparkline})]}),s.jsxs("div",{className:"pulse-grid",children:[s.jsxs("section",{className:"card pulse-area-coherence",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:"Coherence"})}),s.jsx($m,{metrics:e.metrics})]}),s.jsxs("section",{className:"card pulse-area-runtimes",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:"Runtimes"})}),s.jsx(Im,{runtimes:e.runtimes})]}),s.jsxs("section",{className:"card pulse-scroll-card pulse-area-recent",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:"Recent sessions"})}),s.jsx("div",{className:"pulse-scroll-body",children:s.jsx("ul",{className:"session-list",children:N.map(p=>s.jsxs("li",{className:"session-row clickable",onClick:()=>f(p.id),role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),f(p.id))},children:[s.jsx("span",{className:`chip-inline status-${p.status}`,children:p.status}),s.jsx("span",{className:"session-label",children:p.label}),s.jsxs("span",{className:"session-meta",children:[qe(p.started_at)," · ",p.entities.slice(0,3).join(", "),p.entities.length>3?` +${p.entities.length-3}`:""]})]},p.id))})})]}),s.jsxs("section",{className:"card pulse-scroll-card pulse-area-stale",children:[s.jsxs("header",{className:"card-head card-head-stack",children:[s.jsxs("div",{className:"card-head-row",children:[s.jsx("h3",{children:"Stale alerts"}),s.jsxs("span",{className:"muted small",children:[m.length,m.length!==e.alerts.length?` / ${e.alerts.length}`:""]})]}),s.jsxs("div",{className:"card-filters",children:[s.jsx("div",{className:"filter-group",role:"group","aria-label":"Severity",children:["all","high","medium"].map(p=>s.jsx("button",{type:"button",className:`chip${l===p?" active":""}`,"data-severity":p==="all"?void 0:p,onClick:()=>a(p),children:p},p))}),s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Sort",children:[s.jsx("button",{type:"button",className:`chip${i==="oldest"?" active":""}`,onClick:()=>o("oldest"),children:"oldest"}),s.jsx("button",{type:"button",className:`chip${i==="recent"?" active":""}`,onClick:()=>o("recent"),children:"recent"})]})]})]}),s.jsx("div",{className:"pulse-scroll-body",children:s.jsxs("ul",{className:"alert-list",children:[m.map(p=>s.jsxs("li",{className:"alert-row clickable",onClick:()=>d(p.id),role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),d(p.id))},children:[s.jsx("span",{className:`chip-inline severity-${p.severity}`,children:p.severity}),s.jsx("span",{className:"alert-entity",children:p.entity}),s.jsx("span",{className:"alert-summary",children:p.summary}),s.jsxs("div",{className:"alert-actions",onClick:c=>c.stopPropagation(),children:[s.jsx("button",{type:"button",className:"chip",onClick:()=>void y(p.id,7),children:"snooze 7d"}),s.jsx("button",{type:"button",className:"chip",onClick:()=>void k(p.id),children:"dismiss"})]})]},p.id)),m.length===0&&s.jsx("li",{className:"muted alert-row-empty",children:e.alerts.length===0?"No stale alerts.":"No alerts match the current filters."})]})})]})]}),S&&s.jsx(Om,{alert:S,entity:e.entities.find(p=>p.canonical===S.entity)??null,entityColor:e.entity_colors[S.entity]??"#666",sessions:e.sessions,onClose:()=>d(null),onDismiss:async()=>{await k(S.id),d(null)},onSnooze:async p=>{await y(S.id,p),d(null)},onPromoted:r}),h&&s.jsx(Lr,{sessionId:h,onClose:()=>f(null),entityColor:(()=>{const p=e.sessions.find(v=>v.id===h),c=p==null?void 0:p.entities[0];return c?e.entity_colors[c]:void 0})()})]})}const Mm=[10,25,50];function Om({alert:e,entity:t,entityColor:n,sessions:r,onClose:l,onDismiss:a,onSnooze:i,onPromoted:o}){const u=_r(),[d,h]=x.useState(10),[f,m]=x.useState(0),k=x.useMemo(()=>r.filter(g=>g.entities.includes(e.entity)).sort((g,j)=>(j.started_at??"").localeCompare(g.started_at??"")),[r,e.entity]);x.useEffect(()=>{m(0)},[e.id,d]);const y=Math.max(1,Math.ceil(k.length/d)),N=Math.min(f,y-1),S=N*d,p=k.slice(S,S+d),c=x.useMemo(()=>k.flatMap(g=>g.open_questions.map(j=>({id:j.id,text:j.text,sid:g.id,when:g.started_at}))),[k]),v=x.useMemo(()=>k.flatMap(g=>g.decisions.map(j=>({text:j,sid:g.id,when:g.started_at}))),[k]);return x.useEffect(()=>{const g=j=>{j.key==="Escape"&&l()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[l]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"drawer-backdrop",onClick:l}),s.jsxs("aside",{className:"session-drawer",role:"dialog","aria-modal":"true","aria-label":`Alert detail: ${e.entity}`,children:[s.jsxs("header",{className:"drawer-head",children:[s.jsx("span",{className:"dot lg",style:{background:n}}),s.jsx("h3",{className:"drawer-title",children:e.entity}),s.jsx("span",{className:`chip-inline severity-${e.severity}`,children:e.severity}),s.jsx("button",{type:"button",className:"drawer-close",onClick:l,"aria-label":"Close",children:"×"})]}),s.jsxs("div",{className:"drawer-body",children:[s.jsx("p",{className:"drawer-paragraph",children:e.summary}),s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Last touch"}),s.jsxs("dd",{className:"kv-value",children:[e.age_days," day",e.age_days===1?"":"s"," ago"]}),s.jsx("dt",{className:"kv-label",children:"Last session"}),s.jsx("dd",{className:"kv-value mono small",children:e.last_touch_at??"—"}),t&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{className:"kv-label",children:"Entity type"}),s.jsx("dd",{className:"kv-value",children:t.type}),s.jsx("dt",{className:"kv-label",children:"Total sessions"}),s.jsx("dd",{className:"kv-value mono",children:t.session_count})]})]}),s.jsxs("div",{className:"drawer-actions",children:[s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>u(`/thread?entity=${encodeURIComponent(e.entity)}`),children:"Open thread"}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void i(7),children:"Snooze 7d"}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void i(30),children:"Snooze 30d"}),s.jsx("button",{type:"button",className:"btn btn-danger",onClick:()=>void a(),children:"Dismiss"})]}),c.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"drawer-section",children:["Open questions (",c.length,")"]}),s.jsx("ul",{className:"drawer-list",children:c.slice(0,12).map((g,j)=>s.jsxs("li",{className:"marker-row-promotable",children:[s.jsx("span",{className:"live-tag","data-kind":"open",children:"open"}),s.jsx("span",{className:"marker-text",children:g.text}),s.jsx(Cd,{openId:g.id,defaultText:g.text,onPromoted:o}),s.jsx("span",{className:"muted small",children:qe(g.when)})]},`${g.id}-${j}`))}),c.length>12&&s.jsxs("p",{className:"muted small",children:["Showing first 12 of ",c.length,"."]})]}),v.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"drawer-section",children:["Decisions (",v.length,")"]}),s.jsx("ul",{className:"drawer-list",children:v.slice(0,8).map((g,j)=>s.jsxs("li",{children:[s.jsx("span",{className:"live-tag","data-kind":"decision",children:"decision"}),s.jsx("span",{className:"marker-text",children:g.text}),s.jsx("span",{className:"muted small",children:qe(g.when)})]},`${g.sid}-${j}`))}),v.length>8&&s.jsxs("p",{className:"muted small",children:["Showing first 8 of ",v.length,"."]})]}),s.jsxs("h4",{className:"drawer-section",children:["Recent sessions (",k.length,")"]}),s.jsx("ul",{className:"session-list",children:p.map(g=>s.jsxs("li",{className:"session-row",children:[s.jsx("span",{className:`chip-inline status-${g.status}`,children:g.status}),s.jsxs("div",{className:"session-row-main",children:[s.jsx(Pr,{to:`/thread?entity=${encodeURIComponent(e.entity)}&session=${encodeURIComponent(g.id)}`,className:"session-label",children:g.label}),s.jsx("span",{className:"session-meta",children:g.summary})]}),s.jsx("span",{className:"muted small mono",children:qe(g.started_at)})]},g.id))}),k.length>0&&s.jsxs("div",{className:"pagination pagination-compact",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:d,onChange:g=>h(Number.parseInt(g.target.value,10)),children:Mm.map(g=>s.jsx("option",{value:g,children:g},g))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[S+1,"–",Math.min(S+d,k.length)," of ",k.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:N===0,onClick:()=>m(0),children:"«"}),s.jsx("button",{type:"button",className:"chip",disabled:N===0,onClick:()=>m(g=>Math.max(0,g-1)),children:"‹"}),s.jsxs("span",{className:"page-indicator mono",children:[N+1," / ",y]}),s.jsx("button",{type:"button",className:"chip",disabled:N>=y-1,onClick:()=>m(g=>Math.min(y-1,g+1)),children:"›"}),s.jsx("button",{type:"button",className:"chip",disabled:N>=y-1,onClick:()=>m(y-1),children:"»"})]})]})]})]})]})}function Yr({label:e,value:t,hint:n}){return s.jsxs("div",{className:"kpi",children:[s.jsx("span",{className:"kpi-label",children:e}),s.jsx("span",{className:"kpi-value",children:t.toLocaleString()}),n&&s.jsx("span",{className:"kpi-hint",children:n})]})}function zm({values:e}){const t=Math.max(1,...e);return s.jsxs("div",{className:"kpi kpi-sparkline",children:[s.jsx("span",{className:"kpi-label",children:"Last 7 days"}),s.jsx("div",{className:"sparkline",children:e.map((n,r)=>s.jsx("span",{className:"spark-bar",style:{height:`${n/t*100}%`},title:`${n} sessions`},r))})]})}function $m({metrics:e}){const t=e.healthy+e.sparse+e.stale,n=r=>t>0?r/t*100:0;return s.jsxs("div",{className:"bar-stack",children:[s.jsx(Ts,{tone:"active",label:"Healthy",value:e.healthy,pct:n(e.healthy)}),s.jsx(Ts,{tone:"warn",label:"Sparse",value:e.sparse,pct:n(e.sparse)}),s.jsx(Ts,{tone:"danger",label:"Stale",value:e.stale,pct:n(e.stale)})]})}function Im({runtimes:e}){return e.length===0?s.jsx("div",{className:"muted small",style:{padding:"8px 12px"},children:"No runtime activity yet."}):s.jsx("ul",{className:"runtime-list",children:e.map(t=>s.jsxs("li",{className:"runtime-row",children:[s.jsx("span",{className:`runtime-dot runtime-${t.status}`,title:t.status}),s.jsx("span",{className:"runtime-name mono",children:t.name}),s.jsxs("span",{className:"runtime-counts muted small",children:[t.this_week,s.jsx("span",{className:"runtime-counts-sep",children:"·"}),s.jsxs("span",{className:"runtime-counts-prev",children:[t.last_week," prev"]})]}),s.jsx("span",{className:"muted small mono runtime-age",children:qe(t.last_session_at)})]},t.name))})}function Ts({tone:e,label:t,value:n,pct:r}){const l=Math.round(r);return s.jsxs("div",{className:"bar-item",children:[s.jsx("span",{className:"bar-label",children:t}),s.jsx("div",{className:"bar-track",title:`${n.toLocaleString()} entit${n===1?"y":"ies"} · ${l}% of total`,children:s.jsx("div",{className:`bar-fill tone-${e}`,style:{width:`${r}%`}})}),s.jsxs("span",{className:"bar-value mono",children:[n.toLocaleString(),s.jsxs("span",{className:"bar-pct muted small",children:[" · ",l,"%"]})]})]})}const Ed="nlm.settings.views",xt={landing:"live",riverDensity:"comfortable",threadSort:"recent"};function es(){if(typeof window>"u")return xt;try{const e=window.localStorage.getItem(Ed);return e?{...xt,...JSON.parse(e)}:xt}catch{return xt}}function bm(e){typeof window>"u"||window.localStorage.setItem(Ed,JSON.stringify(e))}const Go={"7d":7,"30d":30,"90d":90,all:null};function Dm(){const{data:e,loading:t,error:n}=Mn(),[r,l]=x.useState("30d"),[a,i]=x.useState(null),[o,u]=x.useState(null),[d,h]=x.useState(null),f=_r(),[m]=x.useState(()=>es().riverDensity),k=x.useRef(null),y=x.useRef(null),[N,S]=x.useState(null),p=x.useMemo(()=>{if(!e)return null;const w=Go[r],C=e.sessions.filter(I=>I.started_at!==null),_=Date.now(),$=w?C.filter(I=>(_-Date.parse(I.started_at))/864e5<=w):C,T=new Map,D=new Map,W=new Set;for(const I of $){const H=(I.started_at??"").slice(0,10);if(!H)continue;W.add(H);const M=I.status==="superseded";for(const z of I.entities)if(M){const b=D.get(z)??new Map;b.set(H,(b.get(H)??0)+1),D.set(z,b)}else{const b=T.get(z)??new Map;b.set(H,(b.get(H)??0)+1),T.set(z,b)}}for(const[I]of D)T.has(I)||T.set(I,new Map);const L=[...W].sort(),R=[...T.entries()].map(([I,H])=>({entity:I,total:[...H.values()].reduce((M,z)=>M+z,0),perDate:H,supersededPerDate:D.get(I)??new Map})).sort((I,H)=>H.total-I.total).slice(0,24),F=new Set($.filter(I=>I.started_at&&_-Date.parse(I.started_at)<864e5).flatMap(I=>I.entities));return{dates:L,laneRows:R,total:$.length,recentEntities:F}},[e,r]),c=(w,C)=>{if(!e)return;const _=e.sessions.filter($=>($.started_at??"").slice(0,10)===C&&$.entities.includes(w)).sort(($,T)=>(T.started_at??"").localeCompare($.started_at??""));if(_.length!==0){if(_.length===1){h(_[0].id);return}u({entity:w,date:C,sessions:_})}},v=w=>{if(!k.current)return;const C=k.current.getBoundingClientRect();y.current={startX:w.clientX,rect:C}},g=w=>{if(!y.current)return;const{startX:C,rect:_}=y.current,$=Math.min(C,w.clientX)-_.left,T=Math.max(C,w.clientX)-_.left;if(T-$<6){S(null);return}S({from:$,to:T})},j=()=>{if(!y.current||!N||!p){y.current=null,S(null);return}const w=k.current,C=w==null?void 0:w.querySelector(".river-lane-label"),_=(C==null?void 0:C.offsetWidth)??0,$=(w==null?void 0:w.offsetWidth)??0,D=Math.max(1,$-_)/p.dates.length,W=_+12,L=Math.max(0,Math.floor((N.from-W)/D)),R=Math.min(p.dates.length-1,Math.floor((N.to-W)/D));if(R<=L){y.current=null,S(null);return}const F=p.dates[L],I=p.dates[R];if(F&&I){const H=Math.max(1,Math.ceil((Date.parse(I)-Date.parse(F))/864e5));l(H<=7?"7d":H<=30?"30d":H<=90?"90d":"all")}y.current=null,S(null)};return t&&!e?s.jsxs("div",{className:"page-pad",children:[s.jsx("div",{className:"river-toolbar",children:s.jsx(ie,{h:22,w:80})}),s.jsx("div",{className:"card",style:{padding:12},children:Array.from({length:8}).map((w,C)=>s.jsxs("div",{className:"river-row",style:{marginBottom:3},children:[s.jsx(ie,{h:14,w:160}),s.jsx(ie,{h:20})]},C))})]}):n&&!e?s.jsx("div",{className:"page-pad",children:s.jsx("div",{className:"muted error",children:n})}):!e||!p?null:s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"river-toolbar",children:[s.jsx("span",{className:"page-title",children:"River"}),s.jsxs("span",{className:"muted small",children:[p.total," sessions · ",p.laneRows.length," lanes · ",p.dates.length," days"]}),s.jsx("span",{className:"header-spacer"}),Object.keys(Go).map(w=>s.jsx("button",{type:"button",className:`ctrl-btn${w===r?" active":""}`,onClick:()=>l(w),children:w},w)),s.jsxs("div",{className:"river-legend","aria-label":"Activity scale",children:[s.jsx("span",{className:"muted small",children:"less"}),[0,1,2,3,4].map(w=>s.jsx("span",{className:`river-legend-cell tier-${w}`},w)),s.jsx("span",{className:"muted small",children:"more"})]})]}),s.jsxs("div",{className:`river-grid card river-density-${m}`,ref:k,onMouseDown:v,onMouseMove:g,onMouseUp:j,onMouseLeave:()=>{y.current=null,S(null),i(null)},style:{"--cells":p.dates.length},children:[N&&s.jsx("div",{className:"river-drag-rect",style:{left:`${N.from}px`,width:`${N.to-N.from}px`}}),s.jsxs("div",{className:"river-row river-row-dates",children:[s.jsx("div",{className:"river-lane-label river-lane-label--header","aria-hidden":"true"}),s.jsx("div",{className:"river-cells",children:(()=>{const w=p.dates.length,C=w<=60?1:w<=120?2:w<=250?7:14;return p.dates.map((_,$)=>{const D=["river-date-cell",_.slice(8,10)==="01"?"river-date-cell--month-start":""].filter(Boolean).join(" ");return s.jsx("div",{className:D,title:_,children:$%C===0?_.slice(5):""},_)})})()})]}),p.laneRows.map(({entity:w,perDate:C,supersededPerDate:_,total:$})=>{const T=p.recentEntities.has(w);return s.jsxs("div",{className:"river-row",children:[s.jsxs("button",{type:"button",className:"river-lane-label",onClick:()=>f(`/thread?entity=${encodeURIComponent(w)}`),children:[s.jsx("span",{className:`dot${T?" dot-pulse":""}`,style:{background:e.entity_colors[w]??"#666"}}),s.jsx("span",{className:"river-lane-name",children:w}),s.jsx("span",{className:"muted small",children:$})]}),s.jsx("div",{className:"river-cells",children:p.dates.map(D=>{const W=C.get(D)??0,L=_.get(D)??0,R=W>0||L>0,F=["river-cell",`tier-${Um(W)}`,L>0?"has-corrections":""].filter(Boolean).join(" ");return s.jsx("div",{className:F,onMouseEnter:I=>i({entity:w,date:D,count:W,superseded:L,x:I.clientX,y:I.clientY}),onMouseLeave:()=>i(null),onClick:()=>R&&c(w,D),style:R?{cursor:"pointer"}:{}},D)})})]},w)})]}),p.laneRows.length===0&&s.jsx("div",{className:"muted",children:"No entities in this window."}),a&&(a.count>0||a.superseded>0)&&s.jsxs("div",{className:"river-hover",style:{left:a.x+12,top:a.y+12},children:[s.jsx("span",{className:"dot",style:{background:e.entity_colors[a.entity]??"#666"}}),s.jsx("span",{className:"river-hover-name",children:a.entity}),s.jsxs("span",{className:"muted small",children:[a.date,a.count>0&&` · ${a.count} session${a.count===1?"":"s"}`,a.superseded>0&&` · ${a.superseded} corrected`]})]}),o&&s.jsx(Fm,{state:o,entityColor:e.entity_colors[o.entity]??"#666",onClose:()=>u(null),onPick:w=>{u(null),h(w)},onOpenThread:()=>f(`/thread?entity=${encodeURIComponent(o.entity)}`)}),d&&(()=>{const w=o?o.sessions:[...e.sessions].filter(W=>W.started_at!==null).sort((W,L)=>(L.started_at??"").localeCompare(W.started_at??"")),C=w.findIndex(W=>W.id===d),_=C<w.length-1?w[C+1].id:null,$=C>0?w[C-1].id:null,T=e.sessions.find(W=>W.id===d),D=T==null?void 0:T.entities[0];return s.jsx(Lr,{sessionId:d,onClose:()=>h(null),onNavigate:h,prevSessionId:_,nextSessionId:$,entityColor:D?e.entity_colors[D]:void 0})})()]})}function Fm({state:e,entityColor:t,onClose:n,onPick:r,onOpenThread:l}){return x.useEffect(()=>{const a=i=>{i.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"drawer-backdrop",onClick:n}),s.jsxs("aside",{className:"session-drawer",role:"dialog","aria-modal":"true","aria-label":`Sessions on ${e.date}`,children:[s.jsxs("header",{className:"drawer-head",children:[s.jsx("span",{className:"dot lg",style:{background:t}}),s.jsx("h3",{className:"drawer-title",children:e.entity}),s.jsx("span",{className:"muted small",children:e.date}),s.jsx("button",{type:"button",className:"drawer-close",onClick:n,"aria-label":"Close",children:"×"})]}),s.jsxs("div",{className:"drawer-body",children:[s.jsxs("p",{className:"muted small",children:[e.sessions.length," sessions on this day. Pick one to inspect."]}),s.jsx("div",{className:"drawer-actions",children:s.jsx("button",{type:"button",className:"btn btn-accent",onClick:l,children:"Open thread"})}),s.jsx("ul",{className:"session-list",children:e.sessions.map(a=>s.jsxs("li",{className:"session-row session-row-detail clickable",onClick:()=>r(a.id),role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r(a.id))},children:[s.jsx("span",{className:`chip-inline status-${a.status}`,children:a.status}),s.jsxs("div",{className:"session-row-main",children:[s.jsx("span",{className:"session-label",children:a.label}),s.jsx("span",{className:"session-meta",children:a.summary})]}),s.jsx("span",{className:"muted small mono",children:qe(a.started_at)})]},a.id))})]})]})]})}function Um(e){return e===0?0:e===1?1:e<=3?2:e<=6?3:4}const Am=[10,25,50,100];function Bm(e,t,n){const r=e.label.toLowerCase(),l=e.summary.toLowerCase(),a=e.decisions.join(" ").toLowerCase(),i=e.open.join(" ").toLowerCase(),o={label:0,entity:0,decision:0,open:0,summary:0};for(const m of t){r.includes(m)&&(o.label+=3);for(const k of e.entities){const y=k.toLowerCase();if(y===m){o.entity+=4;break}else if(y.includes(m)){o.entity+=2;break}}a.includes(m)&&(o.decision+=2),i.includes(m)&&(o.open+=2),l.includes(m)&&(o.summary+=1)}if(n&&(r.includes(n)||a.includes(n)||i.includes(n))){const m=Object.keys(o).reduce((k,y)=>o[k]>=o[y]?k:y);o[m]+=5}const u=Object.values(o).reduce((m,k)=>m+k,0),d=["label","entity","decision","open","summary"];let h="summary",f=-1;for(const m of d)o[m]>f&&(f=o[m],h=m);return{score:u,matchedField:h}}function Wm(e,t,n=60){const r=e.toLowerCase();let l=-1;for(const o of t){const u=r.indexOf(o);u!==-1&&(l===-1||u<l)&&(l=u)}if(l===-1)return e.slice(0,n*2);const a=Math.max(0,l-n),i=Math.min(e.length,l+n);return(a>0?"…":"")+e.slice(a,i)+(i<e.length?"…":"")}function Vm(e,t){let n=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");for(const r of t)n=n.replace(new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"),l=>`<mark>${l}</mark>`);return n}function Hm(){const{data:e,loading:t,error:n}=Mn(),[r,l]=Sd(),a=r.get("q")??"",[i,o]=x.useState(a),[u,d]=x.useState(r.get("entity")??""),[h,f]=x.useState("all"),[m,k]=x.useState("all"),[y,N]=x.useState("recent"),[S,p]=x.useState(25),[c,v]=x.useState(0),[g,j]=x.useState(r.get("session")),w=E=>{const U=new URLSearchParams(r);U.set("session",E),l(U),j(E)},C=()=>{const E=new URLSearchParams(r);E.delete("session"),l(E),j(null)};x.useEffect(()=>{const E=setTimeout(()=>{const U=new URLSearchParams(r);i?U.set("q",i):U.delete("q"),l(U)},200);return()=>clearTimeout(E)},[i]),x.useEffect(()=>{const E=new URLSearchParams(r);u?E.set("entity",u):E.delete("entity"),l(E)},[u]);const _=x.useMemo(()=>a.toLowerCase().split(/\s+/).filter(Boolean),[a]),$=_.join(" "),T=x.useMemo(()=>{if(!e)return[];const E=e.sessions.filter(B=>!(u&&!B.entities.includes(u)||h!=="all"&&B.runtime!==h||m!=="all"&&B.status!==m));if(_.length===0)return[...E].sort((le,xe)=>(xe.started_at??"").localeCompare(le.started_at??"")).map(le=>({session:le,score:0,matchedField:"summary"}));const U=E.map(B=>{const{score:le,matchedField:xe}=Bm(B,_,$);return{session:B,score:le,matchedField:xe}}).filter(B=>B.score>0);return y==="recent"?U.sort((B,le)=>(le.session.started_at??"").localeCompare(B.session.started_at??"")):U.sort((B,le)=>le.score-B.score),U},[e,_,$,u,h,m,y]);x.useEffect(()=>{v(0)},[T,h,m,u]);const D=Math.max(1,Math.ceil(T.length/S)),W=Math.min(c,D-1),L=W*S,R=T.slice(L,L+S),F=x.useMemo(()=>{if(!e)return[];const E=new Map;for(const U of e.sessions)E.set(U.runtime,(E.get(U.runtime)??0)+1);return[...E.entries()].sort((U,B)=>B[1]-U[1]).map(([U])=>U)},[e]),I=x.useMemo(()=>{const E=new Map;for(const{session:U}of T)for(const B of U.entities)E.set(B,(E.get(B)??0)+1);return[...E.entries()].sort((U,B)=>B[1]-U[1]).map(([U])=>U)},[T]),H=a!==""||u!==""||h!=="all"||m!=="all",M=()=>{o(""),d(""),f("all"),k("all"),N("recent");const E=new URLSearchParams;g&&E.set("session",g),l(E)},z=R.findIndex(E=>E.session.id===g),b=z<R.length-1?R[z+1].session.id:null,J=z>0?R[z-1].session.id:null;return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"search-header",children:[s.jsx("form",{onSubmit:E=>E.preventDefault(),className:"search-bar",children:s.jsxs("div",{className:"search-wrap",style:{flex:1},children:[s.jsx("input",{className:"search-input search-big",placeholder:"search sessions, decisions, open questions…",value:i,onChange:E=>o(E.target.value),autoFocus:!0}),i.length>0&&s.jsx("button",{type:"button",className:"search-clear",onClick:()=>o(""),"aria-label":"Clear search",children:s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),s.jsxs("div",{className:"thread-filters",children:[F.length>1&&s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Agent filter",children:[s.jsx("button",{type:"button",className:`chip${h==="all"?" active":""}`,onClick:()=>f("all"),children:"all"}),F.map(E=>{const U=T.filter(B=>B.session.runtime===E).length;return s.jsxs("button",{type:"button",className:`chip${h===E?" active":""}`,onClick:()=>f(E),children:[E," · ",U]},E)})]}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Status filter",children:["all","active","idle","closed","superseded"].map(E=>{const U=E==="all"?T.length:T.filter(B=>B.session.status===E).length;return s.jsxs("button",{type:"button",className:`chip${m===E?" active":""}`,"data-status":E==="all"?void 0:E,onClick:()=>k(E),children:[E," · ",U]},E)})}),a!==""&&s.jsx("div",{className:"filter-group",role:"group","aria-label":"Sort order",children:["relevance","recent"].map(E=>s.jsx("button",{type:"button",className:`chip${y===E?" active":""}`,onClick:()=>N(E),children:E},E))}),I.length>0&&s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Entity filter",style:{flexWrap:"wrap"},children:[s.jsx("button",{type:"button",className:`chip${u===""?" active":""}`,onClick:()=>d(""),children:"all entities"}),I.slice(0,12).map(E=>s.jsx("button",{type:"button",className:`chip${u===E?" active":""}`,onClick:()=>d(u===E?"":E),children:E},E)),I.length>12&&s.jsxs("select",{className:"form-input form-input-inline",value:u,onChange:E=>d(E.target.value),children:[s.jsx("option",{value:"",children:"more entities…"}),I.slice(12).map(E=>s.jsx("option",{value:E,children:E},E))]})]})]})]}),t&&!e&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),!H&&s.jsx("p",{className:"muted small search-hint",children:"Showing recent sessions. Type to search across labels, decisions, open questions, and summaries."}),s.jsxs("div",{className:"muted small search-meta",children:[T.length," result",T.length===1?"":"s",H&&s.jsx("button",{type:"button",className:"link-button",style:{marginLeft:8},onClick:M,children:"clear filters"})]}),s.jsxs("ul",{className:"session-list",children:[R.map(({session:E,matchedField:U})=>{let B=E.summary;return _.length>0&&(U==="decision"?B=E.decisions.find(le=>_.some(xe=>le.toLowerCase().includes(xe)))??E.summary:U==="open"&&(B=E.open.find(le=>_.some(xe=>le.toLowerCase().includes(xe)))??E.summary)),s.jsxs("li",{className:`session-row session-row-detail clickable${g===E.id?" is-active":""}`,onClick:()=>w(E.id),children:[s.jsx("span",{className:`chip-inline status-${E.status}`,children:E.status}),s.jsxs("div",{className:"session-row-main",children:[s.jsx("span",{className:"session-label",children:E.label}),s.jsx("span",{className:"session-meta",children:E.entities.slice(0,4).map(le=>s.jsx("span",{className:"chip-inline",style:{marginRight:4},children:le},le))}),_.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"live-tag","data-kind":U,children:U}),s.jsx("div",{className:"match-snippet",dangerouslySetInnerHTML:{__html:Vm(Wm(B,_),_)}})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},children:[s.jsx("span",{className:"muted small mono",children:qe(E.started_at)}),s.jsx("span",{className:"chip-inline",children:E.runtime})]})]},E.id)}),R.length===0&&e&&s.jsx("li",{className:"muted empty-row",children:T.length===0?"No sessions match the current filters.":"No sessions on this page."})]}),T.length>0&&s.jsxs("div",{className:"pagination",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:S,onChange:E=>p(Number.parseInt(E.target.value,10)),children:Am.map(E=>s.jsx("option",{value:E,children:E},E))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[L+1,"–",Math.min(L+S,T.length)," of ",T.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:W===0,onClick:()=>v(0),children:"« first"}),s.jsx("button",{type:"button",className:"chip",disabled:W===0,onClick:()=>v(E=>Math.max(0,E-1)),children:"‹ prev"}),s.jsxs("span",{className:"page-indicator mono",children:[W+1," / ",D]}),s.jsx("button",{type:"button",className:"chip",disabled:W>=D-1,onClick:()=>v(E=>Math.min(D-1,E+1)),children:"next ›"}),s.jsx("button",{type:"button",className:"chip",disabled:W>=D-1,onClick:()=>v(D-1),children:"last »"})]})]}),g&&s.jsx(Lr,{sessionId:g,onClose:C,onNavigate:w,prevSessionId:b,nextSessionId:J})]})}function Km(){const{data:e,loading:t,error:n,refetch:r}=Mn(),[l,a]=Sd(),i=l.get("entity")??"",o=l.get("session"),[u,d]=x.useState(()=>es().threadSort),[h,f]=x.useState(!1),[m,k]=x.useState(!1),y=x.useMemo(()=>{if(!e||!i)return[];const g=e.sessions.filter(j=>j.entities.includes(i));return g.sort((j,w)=>{const C=j.started_at??"",_=w.started_at??"";return u==="recent"?_.localeCompare(C):C.localeCompare(_)}),g},[e,i,u]),N=i&&e?e.entity_colors[i]??"#666":"#666";x.useEffect(()=>{i&&e&&(document.title=`${i} — Thread`)},[i,e]);const S=g=>{const j=new URLSearchParams(l);j.set("session",g),a(j)},p=()=>{const g=new URLSearchParams(l);g.delete("session"),a(g)};if(t&&!e)return s.jsxs("div",{className:"page-pad",children:[s.jsx(ie,{h:22,w:220}),s.jsx("div",{style:{marginTop:16},children:s.jsx(Cm,{rows:8})})]});if(n&&!e)return s.jsx("div",{className:"page-pad",children:s.jsx("div",{className:"muted error",children:n})});if(!e)return null;if(!i)return s.jsx(Gm,{data:e});const c=y.flatMap(g=>g.decisions.map(j=>({d:j,sid:g.id,when:g.started_at}))),v=y.flatMap(g=>g.open_questions.map(j=>({id:j.id,q:j.text,sid:g.id,when:g.started_at})));return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"thread-header",children:[s.jsx("span",{className:"dot lg",style:{background:N}}),s.jsx("h2",{className:"page-title",children:i}),s.jsxs("span",{className:"muted",children:[y.length," session",y.length===1?"":"s"]}),s.jsx("span",{className:"header-spacer"}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Sort order",children:["recent","oldest"].map(g=>s.jsx("button",{type:"button",className:`chip${u===g?" active":""}`,onClick:()=>d(g),children:g==="recent"?"recent first":"oldest first"},g))})]}),s.jsxs("div",{className:"thread-grid",children:[s.jsxs("section",{className:"card",children:[s.jsxs("header",{className:"card-head",children:[s.jsx("h3",{children:"Decisions"}),s.jsx("span",{className:"muted small",children:c.length})]}),s.jsxs("ul",{className:"marker-list",children:[(h?c:c.slice(0,30)).map((g,j)=>s.jsxs("li",{className:"marker-row",children:[s.jsx("span",{className:"live-tag","data-kind":"decision",children:"decision"}),s.jsx("span",{className:"marker-text",children:g.d}),s.jsx("button",{type:"button",className:"link-button",onClick:()=>S(g.sid),children:qe(g.when)})]},j)),c.length===0&&s.jsx("li",{className:"muted empty-row",children:"No decisions captured yet."}),c.length>30&&s.jsx("li",{style:{padding:"8px 14px"},children:s.jsx("button",{type:"button",className:"link-button",onClick:()=>f(g=>!g),children:h?"Show less":`Showing 30 of ${c.length} — show all`})})]})]}),s.jsxs("section",{className:"card",children:[s.jsxs("header",{className:"card-head",children:[s.jsx("h3",{children:"Open questions"}),s.jsx("span",{className:"muted small",children:v.length})]}),s.jsxs("ul",{className:"marker-list",children:[(m?v:v.slice(0,30)).map((g,j)=>s.jsxs("li",{className:"marker-row marker-row-promotable",children:[s.jsx("span",{className:"live-tag","data-kind":"open",children:"open"}),s.jsx("span",{className:"marker-text",children:g.q}),s.jsxs("div",{className:"marker-actions",children:[s.jsx(Cd,{openId:g.id,defaultText:g.q,onPromoted:r}),s.jsx("button",{type:"button",className:"link-button",onClick:()=>S(g.sid),children:qe(g.when)})]})]},`${g.id}-${j}`)),v.length===0&&s.jsx("li",{className:"muted empty-row",children:"No open questions captured yet."}),v.length>30&&s.jsx("li",{style:{padding:"8px 14px"},children:s.jsx("button",{type:"button",className:"link-button",onClick:()=>k(g=>!g),children:m?"Show less":`Showing 30 of ${v.length} — show all`})})]})]})]}),s.jsx(Ym,{thread:y,entity:i,onOpenSession:S}),o&&(()=>{const g=y.findIndex(C=>C.id===o),j=g<y.length-1?y[g+1].id:null,w=g>0?y[g-1].id:null;return s.jsx(Lr,{sessionId:o,onClose:p,onNavigate:S,prevSessionId:j,nextSessionId:w,entityColor:N})})()]})}const Qm=[10,25,50,100];function Ym({thread:e,entity:t,onOpenSession:n}){const[r,l]=x.useState("all"),[a,i]=x.useState(""),[o,u]=x.useState("all"),[d,h]=x.useState("all"),[f,m]=x.useState(25),[k,y]=x.useState(0),N=x.useMemo(()=>{const j=new Map;for(const w of e)j.set(w.runtime,(j.get(w.runtime)??0)+1);return[...j.entries()].sort((w,C)=>C[1]-w[1]).map(([w])=>w)},[e]),S=x.useMemo(()=>{const j=a.toLowerCase().trim();return e.filter(w=>r!=="all"&&w.runtime!==r||o!=="all"&&w.status!==o||d==="decisions"&&w.decisions.length===0||d==="open"&&w.open_questions.length===0?!1:j?w.label.toLowerCase().includes(j)||w.summary.toLowerCase().includes(j)||w.decisions.some(C=>C.toLowerCase().includes(j))||w.open.some(C=>C.toLowerCase().includes(j)):!0)},[e,a,o,d,r]);x.useEffect(()=>{y(0)},[a,o,d,f,r]),x.useEffect(()=>{l("all")},[t]);const p=Math.max(1,Math.ceil(S.length/f)),c=Math.min(k,p-1),v=c*f,g=S.slice(v,v+f);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"thread-sessions-head",children:[s.jsx("h3",{className:"section-title thread-sessions-title",children:"Sessions"}),s.jsxs("div",{className:"search-wrap",children:[s.jsx("input",{className:"search-input",placeholder:"search label, summary, decisions, open…",value:a,onChange:j=>i(j.target.value),onKeyDown:j=>{j.key==="Escape"&&i("")}}),a&&s.jsx("button",{type:"button",className:"search-clear",onClick:()=>i(""),"aria-label":"Clear search",children:s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),s.jsxs("div",{className:"thread-filters",children:[N.length>1&&s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Agent filter",children:[s.jsx("button",{type:"button",className:`chip${r==="all"?" active":""}`,onClick:()=>l("all"),children:"all"}),N.map(j=>{const w=e.filter(C=>C.runtime===j).length;return s.jsxs("button",{type:"button",className:`chip${r===j?" active":""}`,onClick:()=>l(j),children:[j," · ",w]},j)})]}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Status filter",children:["all","active","idle","closed","superseded"].map(j=>{const w=j==="all"?e.length:e.filter(C=>C.status===j).length;return s.jsxs("button",{type:"button",className:`chip${o===j?" active":""}`,"data-status":j==="all"?void 0:j,onClick:()=>u(j),children:[j," · ",w]},j)})}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Marker filter",children:["all","decisions","open"].map(j=>{const w=j==="decisions"?e.filter(C=>C.decisions.length>0).length:e.filter(C=>C.open_questions.length>0).length;return s.jsx("button",{type:"button",className:`chip${d===j?" active":""}`,"data-marker":j==="all"?void 0:j,onClick:()=>h(j),children:j==="all"?"all":`${j} · ${w}`},j)})}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[S.length," match",S.length===1?"":"es"]})]}),s.jsxs("ul",{className:"session-list",children:[g.map(j=>s.jsxs("li",{className:"session-row session-row-detail clickable",onClick:()=>n(j.id),children:[s.jsx("span",{className:`chip-inline status-${j.status}`,children:j.status}),s.jsxs("div",{className:"session-row-main",children:[s.jsx("span",{className:"session-label",children:j.label}),s.jsx("span",{className:"session-meta",children:j.summary})]}),s.jsx("span",{className:"muted small mono",children:qe(j.started_at)})]},j.id)),g.length===0&&s.jsx("li",{className:"muted empty-row",children:e.length===0?"No sessions yet.":"No sessions match the current filters."})]}),S.length>0&&s.jsxs("div",{className:"pagination",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:f,onChange:j=>m(Number.parseInt(j.target.value,10)),children:Qm.map(j=>s.jsx("option",{value:j,children:j},j))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[v+1,"–",Math.min(v+f,S.length)," of ",S.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:c===0,onClick:()=>y(0),children:"« first"}),s.jsx("button",{type:"button",className:"chip",disabled:c===0,onClick:()=>y(j=>Math.max(0,j-1)),children:"‹ prev"}),s.jsxs("span",{className:"page-indicator mono",children:[c+1," / ",p]}),s.jsx("button",{type:"button",className:"chip",disabled:c>=p-1,onClick:()=>y(j=>Math.min(p-1,j+1)),children:"next ›"}),s.jsx("button",{type:"button",className:"chip",disabled:c>=p-1,onClick:()=>y(p-1),children:"last »"})]})]})]})}const Xm=[24,48,96];function Gm({data:e}){const[t,n]=x.useState("all"),[r,l]=x.useState(""),[a,i]=x.useState("most-active"),[o,u]=x.useState(48),[d,h]=x.useState(0),f=x.useMemo(()=>{const c=new Map;for(const v of e.sessions)for(const g of v.entities){let j=c.get(g);j||(j=new Set,c.set(g,j)),j.add(v.runtime)}return c},[e.sessions]),m=x.useMemo(()=>[...e.runtimes].sort((c,v)=>v.sessions_total-c.sessions_total),[e.runtimes]),k=x.useMemo(()=>{const c=r.toLowerCase().trim(),v=c?e.entities.filter(j=>j.canonical.toLowerCase().includes(c)):[...e.entities],g=t==="all"?v:v.filter(j=>{var w;return((w=f.get(j.canonical))==null?void 0:w.has(t))??!1});return g.sort((j,w)=>a==="most-active"?w.session_count-j.session_count:a==="least-active"?j.session_count-w.session_count:a==="a-z"?j.canonical.localeCompare(w.canonical):w.canonical.localeCompare(j.canonical)),g},[e.entities,r,a,t,f]);x.useEffect(()=>{h(0)},[r,a,o,t]);const y=Math.max(1,Math.ceil(k.length/o)),N=Math.min(d,y-1),S=N*o,p=k.slice(S,S+o);return s.jsxs("div",{className:"page-pad",children:[s.jsx("h2",{className:"page-title",children:"Thread"}),s.jsx("p",{className:"muted",children:"Pick an entity to view its reasoning history."}),s.jsxs("div",{className:"thread-sessions-head",style:{marginTop:16},children:[s.jsxs("div",{className:"search-wrap",style:{maxWidth:320},children:[s.jsx("input",{className:"search-input",placeholder:"search entities…",value:r,onChange:c=>l(c.target.value),onKeyDown:c=>{c.key==="Escape"&&l("")}}),r&&s.jsx("button",{type:"button",className:"search-clear",onClick:()=>l(""),"aria-label":"Clear search",children:s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),s.jsx("span",{className:"header-spacer"}),s.jsx("span",{className:"muted small",children:r?`${k.length} of ${e.entities.length} entities`:`${e.entities.length} entities`})]}),s.jsxs("div",{className:"thread-filters",children:[s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Agent filter",children:[s.jsx("button",{type:"button",className:`chip${t==="all"?" active":""}`,onClick:()=>n("all"),children:"all"}),m.map(c=>s.jsxs("button",{type:"button",className:`chip${t===c.name?" active":""}`,onClick:()=>n(c.name),children:[c.name," · ",c.sessions_total]},c.name))]}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Sort order",children:["most-active","least-active","a-z","z-a"].map(c=>s.jsx("button",{type:"button",className:`chip${a===c?" active":""}`,onClick:()=>i(c),children:c==="most-active"?"most active":c==="least-active"?"least active":c},c))})]}),s.jsxs("ul",{className:"entity-grid",children:[p.map(c=>s.jsx("li",{children:s.jsxs(Pr,{to:`/thread?entity=${encodeURIComponent(c.canonical)}`,className:"card card-lift entity-card",children:[s.jsx("span",{className:"dot",style:{background:e.entity_colors[c.canonical]??"#666"}}),s.jsx("span",{className:"entity-name",children:c.canonical}),s.jsx("span",{className:"muted small",children:c.session_count})]})},c.canonical)),p.length===0&&s.jsx("li",{style:{gridColumn:"1 / -1"},className:"muted empty-row",children:"No entities match."})]}),k.length>o&&s.jsxs("div",{className:"pagination",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:o,onChange:c=>u(Number.parseInt(c.target.value,10)),children:Xm.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[S+1,"–",Math.min(S+o,k.length)," of ",k.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:N===0,onClick:()=>h(0),children:"« first"}),s.jsx("button",{type:"button",className:"chip",disabled:N===0,onClick:()=>h(c=>Math.max(0,c-1)),children:"‹ prev"}),s.jsxs("span",{className:"page-indicator mono",children:[N+1," / ",y]}),s.jsx("button",{type:"button",className:"chip",disabled:N>=y-1,onClick:()=>h(c=>Math.min(y-1,c+1)),children:"next ›"}),s.jsx("button",{type:"button",className:"chip",disabled:N>=y-1,onClick:()=>h(y-1),children:"last »"})]})]})]})}const Jm={days:7,total:0,with_results:0,hit_rate:0,by_source:{},top_queries:[],log_present:!1},Zm={days:7,total:0,with_results:0,hit_rate:0,by_source:{},top_subjects:[],top_predicates:[],log_present:!1},qm=[7,30,90];function ev(){const[e,t]=x.useState(7),n=er(`/api/recall/stats?days=${e}`,3e4,Jm),r=er(`/api/recall/facts/stats?days=${e}`,3e4,Zm);return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"recall-head",children:[s.jsxs("p",{className:"muted small recall-note",children:["Hit rate measures whether recall returned something — not whether the agent used it. Watch ",s.jsx("strong",{children:"by source"})," for adoption and ",s.jsx("strong",{children:"hit rate"})," for whether the corpus covers what's being asked."]}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Time window",children:qm.map(l=>s.jsxs("button",{type:"button",className:`chip${e===l?" active":""}`,onClick:()=>t(l),children:[l,"d"]},l))})]}),s.jsx(Jo,{title:"Session recall",subtitle:"What the orchestrator pulls when answering questions about past work — the human-operator surface.",stats:n.data,error:n.error,topLabel:"Top queries",topRows:n.data.top_queries.map(l=>({label:l.query,count:l.count}))}),s.jsx(Jo,{title:"Fact recall",subtitle:"Structured facts agents pull mid-task — the orchestrator surface.",stats:r.data,error:r.error,topLabel:"Top subjects",topRows:r.data.top_subjects.map(l=>({label:l.subject,count:l.count})),extraLabel:"Top predicates",extraRows:r.data.top_predicates.map(l=>({label:l.predicate,count:l.count}))})]})}function Jo({title:e,subtitle:t,stats:n,error:r,topLabel:l,topRows:a,extraLabel:i,extraRows:o}){const u=n.total-n.with_results,d=Object.entries(n.by_source).map(([h,f])=>({label:h,count:f})).sort((h,f)=>f.count-h.count);return s.jsxs("section",{className:"recall-block",children:[s.jsxs("header",{className:"recall-block-head",children:[s.jsx("h2",{className:"page-title",children:e}),s.jsx("p",{className:"muted small",children:t})]}),r&&s.jsx("div",{className:"muted error small",children:r}),n.log_present?n.total===0?s.jsxs("div",{className:"card recall-empty muted",children:["No queries in the last ",n.days," days. The log exists but this window is empty."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"kpi-row",children:[s.jsx(Xr,{label:"Queries",value:n.total,hint:`last ${n.days}d`}),s.jsx(Xr,{label:"Hit rate",value:`${Math.round(n.hit_rate*100)}%`,hint:`${n.with_results.toLocaleString()} returned ≥1`}),s.jsx(Xr,{label:"Zero-result",value:u,hint:u>0?"corpus gaps":"full coverage"}),s.jsx(Xr,{label:"Sources",value:d.length,hint:"distinct callers"})]}),s.jsxs("div",{className:"recall-cards",children:[s.jsx(Rs,{title:"By source",rows:d,emptyText:"No sources recorded."}),s.jsx(Rs,{title:l,rows:a,emptyText:"None recorded."}),i&&o&&s.jsx(Rs,{title:i,rows:o,emptyText:"None recorded."})]})]}):s.jsx("div",{className:"card recall-empty muted",children:"No query log on disk yet — nothing has called this recall surface."})]})}function Xr({label:e,value:t,hint:n}){return s.jsxs("div",{className:"kpi",children:[s.jsx("span",{className:"kpi-label",children:e}),s.jsx("span",{className:"kpi-value",children:typeof t=="number"?t.toLocaleString():t}),n&&s.jsx("span",{className:"kpi-hint",children:n})]})}function Rs({title:e,rows:t,emptyText:n}){const r=Math.max(1,...t.map(l=>l.count));return s.jsxs("section",{className:"card",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:e})}),s.jsxs("div",{className:"bar-stack recall-bars",children:[t.length===0&&s.jsx("div",{className:"muted small recall-bars-empty",children:n}),t.map(l=>s.jsxs("div",{className:"bar-item",children:[s.jsx("span",{className:"bar-label recall-bar-label",title:l.label,children:l.label}),s.jsx("div",{className:"bar-track",children:s.jsx("div",{className:"bar-fill tone-active",style:{width:`${l.count/r*100}%`}})}),s.jsx("span",{className:"bar-value mono",children:l.count.toLocaleString()})]},l.label))]})]})}const tv=[{to:"/settings",label:"Overview"},{to:"/settings/sources",label:"Sources"},{to:"/settings/providers",label:"Providers"},{to:"/settings/classifier",label:"Classifier"},{to:"/settings/labels",label:"Labels"},{to:"/settings/data",label:"Data"},{to:"/settings/views",label:"Views"}];function Jt(){return s.jsx("div",{className:"subnav",children:tv.map(e=>s.jsx(Ta,{to:e.to,end:e.to==="/settings",className:({isActive:t})=>`subnav-link${t?" active":""}`,children:e.label},e.to))})}const nv=[{to:"/settings/sources",title:"Sources",body:()=>"Transcript origins the daemon scans. Add Claude Code, Hermes, pi.dev, custom JSONL directories, or webhook ingest."},{to:"/settings/providers",title:"Providers",body:()=>"LLM endpoints (DeepSeek, Ollama, OpenAI, Anthropic, OpenRouter, custom). Manage keys and test connections."},{to:"/settings/labels",title:"Labels",body:({entities:e})=>`${e} entities catalogued. Promote candidates and edit types.`},{to:"/settings/classifier",title:"Classifier",body:({classifierProvider:e})=>e?`Active provider: ${e}.`:"Classifier provider unknown."},{to:"/settings/data",title:"Data",body:({sessions:e})=>`${e} sessions in the canonical store. Inspect path and backup posture.`},{to:"/settings/views",title:"Views",body:()=>"Default landing page, density, sort, density tier."}];function rv(){const{data:e}=Mn(),t={sessions:(e==null?void 0:e.meta.sessions_total)??0,entities:(e==null?void 0:e.meta.entities_total)??0,classifierProvider:null};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Jt,{}),s.jsx("div",{className:"settings-grid",children:nv.map(n=>s.jsxs(Pr,{to:n.to,className:"card card-lift settings-card",children:[s.jsx("h3",{className:"settings-card-title",children:n.title}),s.jsx("p",{className:"settings-card-body",children:n.body(t)})]},n.to))})]})}function lv(e){if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=100?0:1)} ${t[r]}`}function sv(){var f;const[e,t]=x.useState(null),[n,r]=x.useState(null),[l,a]=x.useState(null),[i,o]=x.useState(!1),u=x.useRef(null),d=x.useCallback(async()=>{try{const m=await fetch("/api/data/stats");if(!m.ok)throw new Error(`HTTP ${m.status}`);t(await m.json()),r(null)}catch(m){r(m instanceof Error?m.message:String(m))}},[]);x.useEffect(()=>{d()},[d]);const h=async()=>{var k,y;const m=(y=(k=u.current)==null?void 0:k.files)==null?void 0:y[0];if(m&&confirm(`Restore from "${m.name}"? Your current database is archived (not deleted), and the new one takes effect after the daemon restarts.`)){o(!0),a(null);try{const N=new FormData;N.append("file",m);const p=await(await fetch("/api/data/restore",{method:"POST",body:N})).json();a(p),p.staged&&u.current&&(u.current.value="")}catch(N){a({error:N instanceof Error?N.message:String(N)})}finally{o(!1)}}};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Jt,{}),s.jsx("h2",{className:"page-title",children:"Data"}),!e&&!n&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),e&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-title",children:"Storage"}),s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Canonical SQLite"}),s.jsx("dd",{className:"kv-value mono",children:e.dbPath}),s.jsx("dt",{className:"kv-label",children:"On disk"}),s.jsxs("dd",{className:"kv-value mono",children:[lv(e.dbBytes),!e.dbPresent&&s.jsx("span",{className:"muted small",children:" · file missing"})]}),s.jsx("dt",{className:"kv-label",children:"Schema version"}),s.jsxs("dd",{className:"kv-value mono",children:[e.schemaVersion??"—",e.migrations.length>0&&s.jsxs("span",{className:"muted small",children:[" · ",e.migrations.length," migrations applied"]})]})]}),s.jsx("h3",{className:"section-title",children:"Tables"}),s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Table"}),s.jsx("th",{children:"Rows"})]})}),s.jsx("tbody",{children:e.tables.map(m=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono small",children:m.name}),s.jsx("td",{className:"mono",children:m.rows.toLocaleString()})]},m.name))})]}),e.runtimes.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-title",children:"Sessions by runtime"}),s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Runtime"}),s.jsx("th",{children:"Sessions"})]})}),s.jsx("tbody",{children:e.runtimes.map(m=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono small",children:m.runtime}),s.jsx("td",{className:"mono",children:m.n.toLocaleString()})]},m.runtime))})]})]}),s.jsx("h3",{className:"section-title",children:"Backup"}),s.jsx("p",{className:"muted small",children:"Downloads a clean, defragmented snapshot of the canonical store. Safe to run while the daemon is ingesting."}),s.jsx("div",{className:"form-row",children:s.jsx("a",{className:"btn btn-accent",href:"/api/data/backup",download:!0,children:"Download backup"})}),s.jsx("h3",{className:"section-title",children:"Restore"}),s.jsxs("p",{className:"muted small",children:["Replace the canonical store with an ",s.jsx("code",{children:".sqlite"})," backup. The current database is archived alongside it (",s.jsx("code",{children:".pre-restore-<timestamp>"}),"), never deleted. Takes effect on the next daemon restart."]}),s.jsxs("div",{className:"form-row",children:[s.jsx("input",{ref:u,type:"file",accept:".sqlite,application/x-sqlite3",className:"file-input",disabled:i}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void h(),disabled:i,children:i?"Validating…":"Restore from backup"})]}),(l==null?void 0:l.staged)&&s.jsx("div",{className:"card",style:{borderColor:"var(--accent)",padding:"0.75rem 1rem",marginTop:"0.75rem"},children:s.jsxs("p",{className:"small",style:{margin:0},children:["Backup validated and staged (",(f=l.sessions)==null?void 0:f.toLocaleString()," sessions, schema v",l.schemaVersion,").",s.jsx("strong",{children:" Restart the daemon"})," to apply it. Your current database will be archived automatically."]})}),(l==null?void 0:l.error)&&s.jsx("p",{className:"muted error small",children:l.error})]})]})}function av(){const[e,t]=x.useState(()=>es()),[n,r]=x.useState(!1),l=x.useRef(!0);x.useEffect(()=>{if(l.current){l.current=!1;return}bm(e),r(!0);const i=setTimeout(()=>r(!1),1800);return()=>clearTimeout(i)},[e]);const a=e.landing===xt.landing&&e.riverDensity===xt.riverDensity&&e.threadSort===xt.threadSort;return s.jsxs("div",{className:"page-pad",children:[s.jsx(Jt,{}),s.jsxs("div",{className:"form-row",style:{justifyContent:"space-between"},children:[s.jsx("h2",{className:"page-title",style:{margin:0},children:"Views"}),n&&s.jsx("span",{className:"muted small",children:"Saved"})]}),s.jsxs("div",{className:"form-grid",children:[s.jsx(Ms,{label:"Default landing",children:s.jsxs("select",{className:"form-input",value:e.landing,onChange:i=>t({...e,landing:i.target.value}),children:[s.jsx("option",{value:"live",children:"Live"}),s.jsx("option",{value:"pulse",children:"Pulse"}),s.jsx("option",{value:"river",children:"River"}),s.jsx("option",{value:"thread",children:"Thread"}),s.jsx("option",{value:"search",children:"Search"})]})}),s.jsx(Ms,{label:"River density",children:s.jsxs("select",{className:"form-input",value:e.riverDensity,onChange:i=>t({...e,riverDensity:i.target.value}),children:[s.jsx("option",{value:"compact",children:"Compact"}),s.jsx("option",{value:"comfortable",children:"Comfortable"}),s.jsx("option",{value:"spacious",children:"Spacious"})]})}),s.jsx(Ms,{label:"Thread sort",children:s.jsxs("select",{className:"form-input",value:e.threadSort,onChange:i=>t({...e,threadSort:i.target.value}),children:[s.jsx("option",{value:"recent",children:"Most recent first"}),s.jsx("option",{value:"oldest",children:"Oldest first"})]})})]}),s.jsx("div",{className:"form-row",children:s.jsx("button",{type:"button",className:"btn",onClick:()=>t(xt),disabled:a,children:"Reset to defaults"})}),s.jsx("p",{className:"muted small",children:"Preferences are stored per-device in localStorage. Landing applies on next load; River density and Thread sort apply when you open those pages."})]})}function Ms({label:e,children:t}){return s.jsxs("label",{className:"form-field",children:[s.jsx("span",{className:"form-label",children:e}),t]})}const Os=["candidate","project","tool","contact","service","concept"],iv=["all","active","snoozed","retired"],ov=[{value:"sessions-desc",label:"Sessions (high → low)"},{value:"sessions-asc",label:"Sessions (low → high)"},{value:"name-asc",label:"Name (A → Z)"},{value:"name-desc",label:"Name (Z → A)"},{value:"recent",label:"Most recently seen"},{value:"oldest",label:"Least recently seen"}],uv=[25,50,100,200];function cv(){const{data:e,loading:t,error:n,refetch:r}=Mn(),[l,a]=x.useState(""),[i,o]=x.useState("all"),[u,d]=x.useState("all"),[h,f]=x.useState("sessions-desc"),[m,k]=x.useState(50),[y,N]=x.useState(0),[S,p]=x.useState(null),c=(e==null?void 0:e.entities)??[],v=x.useMemo(()=>{const L=new Set(Os);for(const R of c)L.add(R.type);return["all",...[...L].sort()]},[c]),g=x.useMemo(()=>{const L=l.toLowerCase().trim(),F=[...c.filter(I=>i!=="all"&&I.type!==i||u!=="all"&&I.status!==u?!1:L?I.canonical.toLowerCase().includes(L)||I.type.toLowerCase().includes(L):!0)];return F.sort((I,H)=>{switch(h){case"sessions-desc":return H.session_count-I.session_count;case"sessions-asc":return I.session_count-H.session_count;case"name-asc":return I.canonical.localeCompare(H.canonical);case"name-desc":return H.canonical.localeCompare(I.canonical);case"recent":return(H.last_seen_session??"").localeCompare(I.last_seen_session??"");case"oldest":return(I.last_seen_session??"").localeCompare(H.last_seen_session??"")}}),F},[c,l,i,u,h]);x.useEffect(()=>{N(0)},[l,i,u,h,m]);const j=Math.max(1,Math.ceil(g.length/m)),w=Math.min(y,j-1),C=w*m,_=g.slice(C,C+m),$=async(L,R)=>{p(L);try{await R(),await r()}finally{p(null)}},T=(L,R)=>$(L,()=>yn({kind:"label_entity",subject_type:"entity",subject_id:L,payload:{new_type:R}}).then(()=>{})),D=L=>$(L,()=>yn({kind:"retire_entity",subject_type:"entity",subject_id:L}).then(()=>{})),W=L=>{const R=new Date(Date.now()+2592e6).toISOString();return $(L,()=>yn({kind:"snooze",subject_type:"entity",subject_id:L,payload:{snoozed_until:R}}).then(()=>{}))};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Jt,{}),s.jsxs("div",{className:"page-header",children:[s.jsx("h2",{className:"page-title",children:"Labels"}),s.jsx("input",{className:"search-input",placeholder:"search canonical or type…",value:l,onChange:L=>a(L.target.value)})]}),s.jsxs("div",{className:"thread-filters",children:[s.jsx("div",{className:"filter-group",role:"group","aria-label":"Status filter",children:iv.map(L=>s.jsx("button",{type:"button",className:`chip${u===L?" active":""}`,onClick:()=>d(L),children:L},L))}),s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Type filter",children:[s.jsx("label",{className:"form-label",children:"Type"}),s.jsx("select",{className:"form-input form-input-inline",value:i,onChange:L=>o(L.target.value),children:v.map(L=>s.jsx("option",{value:L,children:L},L))})]}),s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Sort",children:[s.jsx("label",{className:"form-label",children:"Sort"}),s.jsx("select",{className:"form-input form-input-inline",value:h,onChange:L=>f(L.target.value),children:ov.map(L=>s.jsx("option",{value:L.value,children:L.label},L.value))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[g.length," match",g.length===1?"":"es"]})]}),n&&s.jsx("div",{className:"muted error",children:n}),s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Canonical"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Status"}),s.jsx("th",{className:"right",children:"Sessions"}),s.jsx("th",{children:"Last seen"}),s.jsx("th",{children:"Actions"})]})}),t&&!e&&s.jsx(Em,{rows:8,cols:6}),s.jsxs("tbody",{children:[_.map(L=>{const R=S===L.canonical;return s.jsxs("tr",{className:R?"row-busy":"",children:[s.jsxs("td",{className:"canonical",children:[s.jsx("span",{className:"dot",style:{background:(e==null?void 0:e.entity_colors[L.canonical])??"#666"}}),L.canonical]}),s.jsx("td",{children:s.jsx("select",{className:"form-input form-input-inline",value:Os.includes(L.type)?L.type:"candidate",onChange:F=>void T(L.canonical,F.target.value),disabled:R,children:Os.map(F=>s.jsx("option",{value:F,children:F},F))})}),s.jsx("td",{children:s.jsx("span",{className:`chip-inline status-${L.status}`,children:L.status})}),s.jsx("td",{className:"right mono",children:L.session_count}),s.jsx("td",{className:"mono small",children:L.last_seen_session??"—"}),s.jsxs("td",{className:"row-actions",children:[s.jsx("button",{type:"button",className:"chip",disabled:R,onClick:()=>void W(L.canonical),children:"snooze 30d"}),s.jsx("button",{type:"button",className:"chip",disabled:R,onClick:()=>void D(L.canonical),children:"retire"})]})]},L.canonical)}),_.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"muted small empty-row",children:c.length===0?"No entities yet.":"No entities match the current filters."})})]})]}),g.length>0&&s.jsxs("div",{className:"pagination",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:m,onChange:L=>k(Number.parseInt(L.target.value,10)),children:uv.map(L=>s.jsx("option",{value:L,children:L},L))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[C+1,"–",Math.min(C+m,g.length)," of ",g.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:w===0,onClick:()=>N(0),children:"« first"}),s.jsx("button",{type:"button",className:"chip",disabled:w===0,onClick:()=>N(L=>Math.max(0,L-1)),children:"‹ prev"}),s.jsxs("span",{className:"page-indicator mono",children:[w+1," / ",j]}),s.jsx("button",{type:"button",className:"chip",disabled:w>=j-1,onClick:()=>N(L=>Math.min(j-1,L+1)),children:"next ›"}),s.jsx("button",{type:"button",className:"chip",disabled:w>=j-1,onClick:()=>N(j-1),children:"last »"})]})]}),s.jsx("p",{className:"muted small",children:"Changes are append-only actions; refresh re-applies the overlay over the persisted store."})]})}const dv=["claude-code","codex","hermes","pi","jsonl-generic","webhook"],fv=["deepseek","ollama","openai","anthropic","openrouter","openai-compatible"],nr={deepseek:"DeepSeek",ollama:"Ollama",openai:"OpenAI",anthropic:"Anthropic",openrouter:"OpenRouter","openai-compatible":"OpenAI-compatible"},_d={"claude-code":"Claude Code",codex:"Codex",hermes:"Hermes",pi:"pi.dev","jsonl-generic":"Custom JSONL",webhook:"Webhook"},Zo={"claude-code":{name:"Claude Code",runtimeLabel:"claude-code",pathOrUrl:"~/.claude/projects",parseConfig:{}},codex:{name:"Codex",runtimeLabel:"codex",pathOrUrl:"~/.codex/sessions",parseConfig:{}},hermes:{name:"Hermes",runtimeLabel:"hermes",pathOrUrl:"~/.hermes/sessions",parseConfig:{}},pi:{name:"pi.dev",runtimeLabel:"pi",pathOrUrl:"~/.pi/transcripts",parseConfig:{}},"jsonl-generic":{name:"",runtimeLabel:"",pathOrUrl:"",parseConfig:{idField:"session_id",textField:"text",startedAtField:"started_at",endedAtField:"ended_at"}},webhook:{name:"",runtimeLabel:"",pathOrUrl:null,parseConfig:{}}},qo={deepseek:{baseUrl:"https://api.deepseek.com",defaultModel:"deepseek-v4-flash"},ollama:{baseUrl:"http://localhost:11434",defaultModel:"phi4-mini:latest"},openai:{baseUrl:"https://api.openai.com/v1",defaultModel:"gpt-4o-mini"},anthropic:{baseUrl:"https://api.anthropic.com",defaultModel:"claude-haiku-4-5-20251001"},openrouter:{baseUrl:"https://openrouter.ai/api/v1",defaultModel:"anthropic/claude-haiku-4-5"},"openai-compatible":{baseUrl:"",defaultModel:null}};async function pv(){const e=await fetch("/api/sources");if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.json()).sources}async function Pd(){const e=await fetch("/api/providers");if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.json()).providers}async function hv(e){const t=await fetch(`/api/providers/${e}/models`),n=await t.json();if(!t.ok||n.error)throw new Error(n.error??`HTTP ${t.status}`);return n.models??[]}async function Li(e){return await(await fetch(`/api/providers/${e}/test`,{method:"POST"})).json()}function mv(){const[e,t]=x.useState(null),[n,r]=x.useState([]),[l,a]=x.useState([]),[i,o]=x.useState(null),[u,d]=x.useState(null),[h,f]=x.useState(""),[m,k]=x.useState(null),[y,N]=x.useState(null),[S,p]=x.useState(!1),[c,v]=x.useState(null),[g,j]=x.useState(null),w=x.useCallback(async()=>{try{const[R,F]=await Promise.all([fetch("/api/classifier/info").then(z=>z.json()),Pd()]);t(R),r(F);const I=F.find(z=>z.kind===R.provider&&z.enabled),H=F.find(z=>z.enabled)??F[0]??null,M=I??H;d(M?M.id:null),f(R.model),j(null)}catch(R){j(R instanceof Error?R.message:String(R))}},[]);x.useEffect(()=>{w()},[w]);const C=x.useMemo(()=>n.find(R=>R.id===u)??null,[n,u]);x.useEffect(()=>{if(!C){a([]);return}let R=!1;return o(null),a([]),hv(C.id).then(F=>{R||(a(F),(!h||!F.includes(h))&&f(C.defaultModel??F[0]??""))}).catch(F=>{R||o(F instanceof Error?F.message:String(F))}),()=>{R=!0}},[C==null?void 0:C.id]);const _=C?`${C.id}|${h}`:"",$=(m==null?void 0:m.ok)===!0&&y===_,D=(e&&C?C.kind!==e.provider||h!==e.model:!1)&&h.length>0&&!S&&$,W=async()=>{if(C){p(!0),k(null),N(null);try{const R=await Li(C.id);k(R),R.ok&&N(_)}catch(R){k({ok:!1,latencyMs:0,error:R instanceof Error?R.message:String(R)})}finally{p(!1)}}},L=async()=>{if(C){p(!0),v(null);try{const R=await fetch("/api/classifier",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:C.kind,model:h})}),F=await R.json();!R.ok||F.error?v(`Error: ${F.error??R.statusText}`):(v(`Active: ${F.provider} · ${F.model}`),await w())}catch(R){v(`Error: ${R instanceof Error?R.message:String(R)}`)}finally{p(!1)}}};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Jt,{}),s.jsx("h2",{className:"page-title",children:"Classifier"}),!e&&!g&&s.jsx("div",{className:"muted",children:"Loading…"}),g&&s.jsx("div",{className:"muted error",children:g}),e&&s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Active provider"}),s.jsx("dd",{className:"kv-value mono",children:e.provider}),s.jsx("dt",{className:"kv-label",children:"Active model"}),s.jsx("dd",{className:"kv-value mono",children:e.model})]}),s.jsx("h3",{className:"section-title",children:"Switch model"}),n.length===0?s.jsxs("p",{className:"muted small",children:["No providers configured. Add one on the ",s.jsx("a",{href:"/settings/providers",children:"Providers"})," page first."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Provider"}),s.jsx("select",{className:"form-input form-input-inline",value:u??"",onChange:R=>{d(Number.parseInt(R.target.value,10)),k(null),N(null)},disabled:S,children:n.map(R=>s.jsxs("option",{value:R.id,disabled:!R.enabled,children:[R.name," (",nr[R.kind],")",R.enabled?"":" — disabled",R.kind!=="ollama"&&!R.hasApiKey?" — no key":""]},R.id))}),s.jsx("label",{className:"form-label",children:"Model"}),s.jsxs("select",{className:"form-input form-input-inline",value:h,onChange:R=>{f(R.target.value),N(null)},disabled:S||l.length===0,children:[l.map(R=>s.jsx("option",{value:R,children:R},R)),!l.includes(h)&&h&&s.jsx("option",{value:h,children:h})]}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void W(),disabled:S||!C,children:S&&!m?"Testing…":"Test connection"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>void L(),disabled:!D,title:$?void 0:"Run a successful test before saving",children:S&&(m!=null&&m.ok)?"Saving…":"Save"})]}),i&&s.jsxs("p",{className:"muted error small",children:["Model list failed: ",i]}),m&&s.jsx("p",{className:`small ${m.ok?"muted":"muted error"}`,children:m.ok?`Connection OK · ${m.modelCount??"?"} models · ${m.latencyMs}ms`:`Connection failed: ${m.error??"unknown"} (${m.latencyMs}ms)`}),c&&s.jsx("p",{className:"muted small",children:c}),s.jsx("p",{className:"muted small",children:"Save is gated on a passing connection test for the selected provider + model."})]}),s.jsx("h3",{className:"section-title",children:"Embedder"}),s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Provider"}),s.jsx("dd",{className:"kv-value mono",children:e.embedder.provider}),s.jsx("dt",{className:"kv-label",children:"Model"}),s.jsx("dd",{className:"kv-value mono",children:e.embedder.model}),s.jsx("dt",{className:"kv-label",children:"Dimensions"}),s.jsx("dd",{className:"kv-value mono",children:e.embedder.dims})]}),s.jsx("p",{className:"muted small",children:"Embedder is fixed at build time. Recall vectors must match the index dims, so it isn't hot-swappable. DeepSeek has no embeddings endpoint; Ollama serves both classification (optional) and embedding (always)."})]})]})}function vv(){const[e,t]=x.useState([]),[n,r]=x.useState(null),[l,a]=x.useState(!0),[i,o]=x.useState(!1),[u,d]=x.useState(null),h=x.useCallback(async()=>{a(!0);try{t(await pv()),r(null)}catch(y){r(y instanceof Error?y.message:String(y))}finally{a(!1)}},[]);x.useEffect(()=>{h()},[h]);const f=async y=>{await fetch(`/api/sources/${y.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!y.enabled})}),await h()},m=async y=>{confirm(`Delete source "${y.name}"? This stops scanning but leaves ingested sessions in place.`)&&(await fetch(`/api/sources/${y.id}`,{method:"DELETE"}),await h())},k=async y=>{if(!confirm(`Regenerate token for "${y.name}"? Any client using the current token will stop working.`))return;const N=await fetch(`/api/sources/${y.id}/regenerate-token`,{method:"POST"}),S=await N.json();S.token?(d({name:y.name,token:S.token}),await h()):alert(`Failed: ${S.error??N.statusText}`)};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Jt,{}),s.jsxs("div",{className:"form-row",style:{justifyContent:"space-between"},children:[s.jsx("h2",{className:"page-title",style:{margin:0},children:"Sources"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>o(!0),children:"Add source"})]}),u&&s.jsx(gv,{name:u.name,token:u.token,onDismiss:()=>d(null)}),l&&e.length===0&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),e.length>0&&s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Kind"}),s.jsx("th",{children:"Runtime"}),s.jsx("th",{children:"Path / URL"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:e.map(y=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:y.name}),s.jsx("td",{children:_d[y.kind]}),s.jsx("td",{className:"mono small",children:y.runtimeLabel}),s.jsx("td",{className:"mono small",children:y.pathOrUrl??(y.kind==="webhook"?"—":"")}),s.jsx("td",{children:s.jsx("span",{className:`chip-inline ${y.enabled?"status-active":"status-stale"}`,children:y.enabled?"enabled":"disabled"})}),s.jsx("td",{children:s.jsxs("div",{className:"form-row",style:{gap:"0.5rem"},children:[s.jsx("button",{type:"button",className:"btn small",onClick:()=>void f(y),children:y.enabled?"Disable":"Enable"}),y.kind==="webhook"&&s.jsx("button",{type:"button",className:"btn small",onClick:()=>void k(y),children:"Regenerate token"}),s.jsx("button",{type:"button",className:"btn small",onClick:()=>void m(y),children:"Delete"})]})})]},y.id))})]}),!l&&e.length===0&&s.jsx("p",{className:"muted small",children:'No sources yet. Click "Add source" to scan your first transcript directory.'}),i&&s.jsx(yv,{onClose:()=>o(!1),onCreated:y=>{o(!1),y.kind==="webhook"&&y.token&&d({name:y.name,token:y.token}),h()}})]})}function gv({name:e,token:t,onDismiss:n}){return s.jsxs("div",{className:"card",style:{borderColor:"var(--accent)",padding:"1rem",marginTop:"1rem"},children:[s.jsxs("h3",{className:"section-title",style:{marginTop:0},children:['One-time token for "',e,'"']}),s.jsxs("p",{className:"muted small",children:["Copy this now. It's stored hashed on the daemon and won't be shown again. Send sessions with"," ",s.jsx("code",{children:"Authorization: Bearer <token>"})," to ",s.jsx("code",{children:"POST /api/ingest"}),"."]}),s.jsx("pre",{className:"mono",style:{padding:"0.5rem",overflow:"auto"},children:t}),s.jsxs("div",{className:"form-row",children:[s.jsx("button",{type:"button",className:"btn",onClick:()=>void navigator.clipboard.writeText(t),children:"Copy"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:n,children:"I've stored it"})]})]})}function yv({onClose:e,onCreated:t}){const[n,r]=x.useState("claude-code"),l=Zo[n],[a,i]=x.useState(l.name),[o,u]=x.useState(l.runtimeLabel),[d,h]=x.useState(l.pathOrUrl??""),[f,m]=x.useState({idField:"session_id",textField:"text",startedAtField:"started_at",endedAtField:"ended_at"}),[k,y]=x.useState(!1),[N,S]=x.useState(null);x.useEffect(()=>{const j=Zo[n];i(j.name),u(j.runtimeLabel),h(j.pathOrUrl??""),S(null)},[n]);const p=n!=="webhook",c=n==="jsonl-generic",v=async()=>{y(!0),S(null);try{const j={kind:n,name:a,runtimeLabel:o};p&&(j.pathOrUrl=d),c&&(j.parseConfig=f);const w=await fetch("/api/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)}),C=await w.json();if(!w.ok||C.error){S(C.error??w.statusText);return}t(C)}catch(j){S(j instanceof Error?j.message:String(j))}finally{y(!1)}},g=!k&&a.length>0&&o.length>0&&(!p||d.length>0);return s.jsxs("div",{className:"card",style:{padding:"1rem",marginTop:"1rem"},children:[s.jsx("h3",{className:"section-title",style:{marginTop:0},children:"Add source"}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Kind"}),s.jsx("select",{className:"form-input form-input-inline",value:n,onChange:j=>r(j.target.value),disabled:k,children:dv.map(j=>s.jsx("option",{value:j,children:_d[j]},j))})]}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Name"}),s.jsx("input",{className:"form-input form-input-inline",value:a,onChange:j=>i(j.target.value),placeholder:c||n==="webhook"?"e.g. my-agent":"",disabled:k}),s.jsx("label",{className:"form-label",children:"Runtime label"}),s.jsx("input",{className:"form-input form-input-inline",value:o,onChange:j=>u(j.target.value),placeholder:"appears on Pulse Runtimes card",disabled:k})]}),p&&s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:n==="jsonl-generic"?"Directory":"Path"}),s.jsx("input",{className:"form-input form-input-inline",style:{minWidth:"32rem"},value:d,onChange:j=>h(j.target.value),placeholder:"absolute or ~/ path to JSONL directory",disabled:k})]}),c&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"section-title",style:{fontSize:"0.875rem"},children:"JSONL field mapping"}),s.jsx("p",{className:"muted small",children:"How to read your JSONL files. Each row should be one session. Use dot.notation for nested fields."}),["idField","textField","startedAtField","endedAtField"].map(j=>s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:j}),s.jsx("input",{className:"form-input form-input-inline",value:f[j],onChange:w=>m({...f,[j]:w.target.value}),disabled:k})]},j))]}),n==="webhook"&&s.jsxs("p",{className:"muted small",children:["A bearer token will be generated and shown ",s.jsx("strong",{children:"once"})," when you create this source. Use it to ",s.jsx("code",{children:"POST /api/ingest"})," from any agent or script."]}),N&&s.jsx("p",{className:"muted error small",children:N}),s.jsxs("div",{className:"form-row",children:[s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>void v(),disabled:!g,children:k?"Creating…":"Create"}),s.jsx("button",{type:"button",className:"btn",onClick:e,disabled:k,children:"Cancel"})]})]})}function xv(){const[e,t]=x.useState([]),[n,r]=x.useState(null),[l,a]=x.useState(!0),[i,o]=x.useState(!1),[u,d]=x.useState({}),h=x.useCallback(async()=>{a(!0);try{t(await Pd()),r(null)}catch(y){r(y instanceof Error?y.message:String(y))}finally{a(!1)}},[]);x.useEffect(()=>{h()},[h]);const f=async y=>{await fetch(`/api/providers/${y.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!y.enabled})}),await h()},m=async y=>{confirm(`Delete provider "${y.name}"? The Classifier will fall back to another provider if this one was active.`)&&(await fetch(`/api/providers/${y.id}`,{method:"DELETE"}),await h())},k=async y=>{d(N=>({...N,[y.id]:"running"}));try{const N=await Li(y.id);d(S=>({...S,[y.id]:N}))}catch(N){d(S=>({...S,[y.id]:{ok:!1,latencyMs:0,error:N instanceof Error?N.message:String(N)}}))}};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Jt,{}),s.jsxs("div",{className:"form-row",style:{justifyContent:"space-between"},children:[s.jsx("h2",{className:"page-title",style:{margin:0},children:"Providers"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>o(!0),children:"Add provider"})]}),l&&e.length===0&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),e.length>0&&s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Kind"}),s.jsx("th",{children:"Base URL"}),s.jsx("th",{children:"Default model"}),s.jsx("th",{children:"API key"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Last test"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:e.map(y=>{const N=u[y.id];return s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:y.name}),s.jsx("td",{children:nr[y.kind]}),s.jsx("td",{className:"mono small",children:y.baseUrl??"—"}),s.jsx("td",{className:"mono small",children:y.defaultModel??"—"}),s.jsx("td",{children:y.kind==="ollama"||y.kind==="openai-compatible"?s.jsx("span",{className:"muted small",children:y.hasApiKey?"set":"n/a"}):s.jsx("span",{className:`chip-inline ${y.hasApiKey?"status-active":"status-stale"}`,children:y.hasApiKey?"set":"missing"})}),s.jsx("td",{children:s.jsx("span",{className:`chip-inline ${y.enabled?"status-active":"status-stale"}`,children:y.enabled?"enabled":"disabled"})}),s.jsxs("td",{className:"small",children:[N==="running"&&s.jsx("span",{className:"muted",children:"testing…"}),N&&N!=="running"&&N.ok&&s.jsxs("span",{className:"muted",children:["OK · ",N.modelCount," models · ",N.latencyMs,"ms"]}),N&&N!=="running"&&!N.ok&&s.jsxs("span",{className:"muted error",children:["fail: ",N.error]})]}),s.jsx("td",{children:s.jsxs("div",{className:"form-row",style:{gap:"0.5rem"},children:[s.jsx("button",{type:"button",className:"btn small",onClick:()=>void k(y),children:"Test"}),s.jsx("button",{type:"button",className:"btn small",onClick:()=>void f(y),children:y.enabled?"Disable":"Enable"}),s.jsx("button",{type:"button",className:"btn small",onClick:()=>void m(y),children:"Delete"})]})})]},y.id)})})]}),!l&&e.length===0&&s.jsx("p",{className:"muted small",children:'No providers yet. Click "Add provider" to wire up DeepSeek, Ollama, or any OpenAI-compatible endpoint.'}),i&&s.jsx(jv,{onClose:()=>o(!1),onCreated:()=>{o(!1),h()}})]})}function jv({onClose:e,onCreated:t}){const[n,r]=x.useState("deepseek"),l=qo[n],[a,i]=x.useState(nr[n]),[o,u]=x.useState(l.baseUrl??""),[d,h]=x.useState(""),[f,m]=x.useState(l.defaultModel??""),[k,y]=x.useState(!1),[N,S]=x.useState(null),[p,c]=x.useState(null);x.useEffect(()=>{const w=qo[n];i(nr[n]),u(w.baseUrl??""),m(w.defaultModel??""),c(null),S(null)},[n]);const v=n!=="ollama"&&n!=="openai-compatible",g=async w=>{y(!0),S(null);try{const C={kind:n,name:a};o&&(C.baseUrl=o),d&&(C.apiKey=d),f&&(C.defaultModel=f);const _=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),$=await _.json();if(!_.ok||$.error){S($.error??_.statusText);return}if(w){const T=await Li($.id);if(c(T),!T.ok)return}t()}catch(C){S(C instanceof Error?C.message:String(C))}finally{y(!1)}},j=!k&&a.length>0&&(!v||d.length>0);return s.jsxs("div",{className:"card",style:{padding:"1rem",marginTop:"1rem"},children:[s.jsx("h3",{className:"section-title",style:{marginTop:0},children:"Add provider"}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Kind"}),s.jsx("select",{className:"form-input form-input-inline",value:n,onChange:w=>r(w.target.value),disabled:k,children:fv.map(w=>s.jsx("option",{value:w,children:nr[w]},w))}),s.jsx("label",{className:"form-label",children:"Name"}),s.jsx("input",{className:"form-input form-input-inline",value:a,onChange:w=>i(w.target.value),placeholder:"Display name (must be unique)",disabled:k})]}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Base URL"}),s.jsx("input",{className:"form-input form-input-inline",style:{minWidth:"28rem"},value:o,onChange:w=>u(w.target.value),placeholder:n==="openai-compatible"?"https://your-endpoint/v1":"",disabled:k})]}),s.jsxs("div",{className:"form-row",children:[s.jsxs("label",{className:"form-label",children:["API key",v?"":" (optional)"]}),s.jsx("input",{type:"password",className:"form-input form-input-inline",style:{minWidth:"28rem"},value:d,onChange:w=>h(w.target.value),autoComplete:"off",disabled:k})]}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Default model"}),s.jsx("input",{className:"form-input form-input-inline",value:f,onChange:w=>m(w.target.value),placeholder:"optional",disabled:k})]}),p&&!p.ok&&s.jsxs("p",{className:"muted error small",children:["Saved, but test failed: ",p.error," (",p.latencyMs,"ms). You can edit or delete from the list."]}),N&&s.jsx("p",{className:"muted error small",children:N}),s.jsxs("div",{className:"form-row",children:[s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>void g(!0),disabled:!j,children:k?"Saving…":"Save & test"}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void g(!1),disabled:!j,children:"Save without testing"}),s.jsx("button",{type:"button",className:"btn",onClick:e,disabled:k,children:"Cancel"})]})]})}function wv({page:e}){return s.jsxs("div",{className:"stub-shell",children:[s.jsxs("span",{className:"stub-name",children:["/",e]}),s.jsx("p",{children:"not yet ported from the Astro UI."}),s.jsx("p",{className:"stub-hint",children:"Tracked in NocoDB #95 (Vite + React SPA port)."})]})}function Nv(){return s.jsxs("div",{className:"page-shell",children:[s.jsx(fm,{}),s.jsxs("div",{className:"page-main",children:[s.jsx(kv,{}),s.jsxs(Gh,{children:[s.jsx(ve,{path:"/",element:s.jsx(Yh,{to:`/${es().landing}`,replace:!0})}),s.jsx(ve,{path:"/live",element:s.jsx(Lm,{})}),s.jsx(ve,{path:"/pulse",element:s.jsx(Rm,{})}),s.jsx(ve,{path:"/river",element:s.jsx(Dm,{})}),s.jsx(ve,{path:"/thread",element:s.jsx(Km,{})}),s.jsx(ve,{path:"/search",element:s.jsx(Hm,{})}),s.jsx(ve,{path:"/recall",element:s.jsx(ev,{})}),s.jsx(ve,{path:"/settings",element:s.jsx(rv,{})}),s.jsx(ve,{path:"/settings/sources",element:s.jsx(vv,{})}),s.jsx(ve,{path:"/settings/providers",element:s.jsx(xv,{})}),s.jsx(ve,{path:"/settings/labels",element:s.jsx(cv,{})}),s.jsx(ve,{path:"/settings/classifier",element:s.jsx(mv,{})}),s.jsx(ve,{path:"/settings/data",element:s.jsx(sv,{})}),s.jsx(ve,{path:"/settings/views",element:s.jsx(av,{})}),s.jsx(ve,{path:"*",element:s.jsx(wv,{page:"not found"})})]})]})]})}function kv(){const{pathname:e}=$t(),t=e.replace(/^\//,"").replace(/\/+$/,"")||"live";return s.jsxs("header",{className:"app-header",children:[s.jsx("span",{className:"wordmark-page",children:t}),s.jsx("span",{className:"header-spacer"}),s.jsx("span",{className:"status-dot","aria-hidden":"true"}),s.jsx("span",{className:"header-info",children:"nlm-memory · :3940"})]})}const Ld=document.getElementById("root");if(!Ld)throw new Error("missing #root");pd(Ld).render(s.jsx(cu.StrictMode,{children:s.jsx(sm,{basename:"/ui",children:s.jsx(Nv,{})})}));