claude-session-viewer 0.3.7 → 0.3.8

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,70 +0,0 @@
1
- var Ay=Object.defineProperty;var Jd=t=>{throw TypeError(t)};var zy=(t,e,n)=>e in t?Ay(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var q=(t,e,n)=>zy(t,typeof e!="symbol"?e+"":e,n),Cl=(t,e,n)=>e.has(t)||Jd("Cannot "+n);var _=(t,e,n)=>(Cl(t,e,"read from private field"),n?n.call(t):e.get(t)),W=(t,e,n)=>e.has(t)?Jd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),F=(t,e,n,s)=>(Cl(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),Y=(t,e,n)=>(Cl(t,e,"access private method"),n);var _o=(t,e,n,s)=>({set _(r){F(t,e,r,n)},get _(){return _(t,e,s)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function By(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tg={exports:{}},nl={},ng={exports:{}},U={};/**
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 uo=Symbol.for("react.element"),Wy=Symbol.for("react.portal"),$y=Symbol.for("react.fragment"),Hy=Symbol.for("react.strict_mode"),Uy=Symbol.for("react.profiler"),Vy=Symbol.for("react.provider"),Qy=Symbol.for("react.context"),Yy=Symbol.for("react.forward_ref"),Ky=Symbol.for("react.suspense"),Xy=Symbol.for("react.memo"),qy=Symbol.for("react.lazy"),Zd=Symbol.iterator;function Gy(t){return t===null||typeof t!="object"?null:(t=Zd&&t[Zd]||t["@@iterator"],typeof t=="function"?t:null)}var sg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rg=Object.assign,ig={};function zr(t,e,n){this.props=t,this.context=e,this.refs=ig,this.updater=n||sg}zr.prototype.isReactComponent={};zr.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};zr.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function og(){}og.prototype=zr.prototype;function Rc(t,e,n){this.props=t,this.context=e,this.refs=ig,this.updater=n||sg}var Oc=Rc.prototype=new og;Oc.constructor=Rc;rg(Oc,zr.prototype);Oc.isPureReactComponent=!0;var eh=Array.isArray,ag=Object.prototype.hasOwnProperty,Dc={current:null},lg={key:!0,ref:!0,__self:!0,__source:!0};function ug(t,e,n){var s,r={},i=null,o=null;if(e!=null)for(s in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)ag.call(e,s)&&!lg.hasOwnProperty(s)&&(r[s]=e[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}if(t&&t.defaultProps)for(s in a=t.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return{$$typeof:uo,type:t,key:i,ref:o,props:r,_owner:Dc.current}}function Jy(t,e){return{$$typeof:uo,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Lc(t){return typeof t=="object"&&t!==null&&t.$$typeof===uo}function Zy(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var th=/\/+/g;function jl(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Zy(""+t.key):e.toString(36)}function ta(t,e,n,s,r){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case uo:case Wy:o=!0}}if(o)return o=t,r=r(o),t=s===""?"."+jl(o,0):s,eh(r)?(n="",t!=null&&(n=t.replace(th,"$&/")+"/"),ta(r,e,n,"",function(u){return u})):r!=null&&(Lc(r)&&(r=Jy(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(th,"$&/")+"/")+t)),e.push(r)),1;if(o=0,s=s===""?".":s+":",eh(t))for(var a=0;a<t.length;a++){i=t[a];var l=s+jl(i,a);o+=ta(i,e,n,l,r)}else if(l=Gy(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=s+jl(i,a++),o+=ta(i,e,n,l,r);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function So(t,e,n){if(t==null)return t;var s=[],r=0;return ta(t,s,"","",function(i){return e.call(n,i,r++)}),s}function ex(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Ze={current:null},na={transition:null},tx={ReactCurrentDispatcher:Ze,ReactCurrentBatchConfig:na,ReactCurrentOwner:Dc};function cg(){throw Error("act(...) is not supported in production builds of React.")}U.Children={map:So,forEach:function(t,e,n){So(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return So(t,function(){e++}),e},toArray:function(t){return So(t,function(e){return e})||[]},only:function(t){if(!Lc(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};U.Component=zr;U.Fragment=$y;U.Profiler=Uy;U.PureComponent=Rc;U.StrictMode=Hy;U.Suspense=Ky;U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tx;U.act=cg;U.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=rg({},t.props),r=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=Dc.current),e.key!==void 0&&(r=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)ag.call(e,l)&&!lg.hasOwnProperty(l)&&(s[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];s.children=a}return{$$typeof:uo,type:t.type,key:r,ref:i,props:s,_owner:o}};U.createContext=function(t){return t={$$typeof:Qy,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Vy,_context:t},t.Consumer=t};U.createElement=ug;U.createFactory=function(t){var e=ug.bind(null,t);return e.type=t,e};U.createRef=function(){return{current:null}};U.forwardRef=function(t){return{$$typeof:Yy,render:t}};U.isValidElement=Lc;U.lazy=function(t){return{$$typeof:qy,_payload:{_status:-1,_result:t},_init:ex}};U.memo=function(t,e){return{$$typeof:Xy,type:t,compare:e===void 0?null:e}};U.startTransition=function(t){var e=na.transition;na.transition={};try{t()}finally{na.transition=e}};U.unstable_act=cg;U.useCallback=function(t,e){return Ze.current.useCallback(t,e)};U.useContext=function(t){return Ze.current.useContext(t)};U.useDebugValue=function(){};U.useDeferredValue=function(t){return Ze.current.useDeferredValue(t)};U.useEffect=function(t,e){return Ze.current.useEffect(t,e)};U.useId=function(){return Ze.current.useId()};U.useImperativeHandle=function(t,e,n){return Ze.current.useImperativeHandle(t,e,n)};U.useInsertionEffect=function(t,e){return Ze.current.useInsertionEffect(t,e)};U.useLayoutEffect=function(t,e){return Ze.current.useLayoutEffect(t,e)};U.useMemo=function(t,e){return Ze.current.useMemo(t,e)};U.useReducer=function(t,e,n){return Ze.current.useReducer(t,e,n)};U.useRef=function(t){return Ze.current.useRef(t)};U.useState=function(t){return Ze.current.useState(t)};U.useSyncExternalStore=function(t,e,n){return Ze.current.useSyncExternalStore(t,e,n)};U.useTransition=function(){return Ze.current.useTransition()};U.version="18.3.1";ng.exports=U;var S=ng.exports;const nx=By(S);/**
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 sx=S,rx=Symbol.for("react.element"),ix=Symbol.for("react.fragment"),ox=Object.prototype.hasOwnProperty,ax=sx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lx={key:!0,ref:!0,__self:!0,__source:!0};function dg(t,e,n){var s,r={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(s in e)ox.call(e,s)&&!lx.hasOwnProperty(s)&&(r[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps,e)r[s]===void 0&&(r[s]=e[s]);return{$$typeof:rx,type:t,key:i,ref:o,props:r,_owner:ax.current}}nl.Fragment=ix;nl.jsx=dg;nl.jsxs=dg;tg.exports=nl;var c=tg.exports,gu={},hg={exports:{}},gt={},fg={exports:{}},pg={};/**
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(t){function e(E,A){var z=E.length;E.push(A);e:for(;0<z;){var X=z-1>>>1,O=E[X];if(0<r(O,A))E[X]=A,E[z]=O,z=X;else break e}}function n(E){return E.length===0?null:E[0]}function s(E){if(E.length===0)return null;var A=E[0],z=E.pop();if(z!==A){E[0]=z;e:for(var X=0,O=E.length,Q=O>>>1;X<Q;){var H=2*(X+1)-1,Z=E[H],$=H+1,ve=E[$];if(0>r(Z,z))$<O&&0>r(ve,Z)?(E[X]=ve,E[$]=z,X=$):(E[X]=Z,E[H]=z,X=H);else if($<O&&0>r(ve,z))E[X]=ve,E[$]=z,X=$;else break e}}return A}function r(E,A){var z=E.sortIndex-A.sortIndex;return z!==0?z:E.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,h=null,f=3,p=!1,x=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=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(E){for(var A=n(u);A!==null;){if(A.callback===null)s(u);else if(A.startTime<=E)s(u),A.sortIndex=A.expirationTime,e(l,A);else break;A=n(u)}}function w(E){if(m=!1,v(E),!x)if(n(l)!==null)x=!0,B(j);else{var A=n(u);A!==null&&ae(w,A.startTime-E)}}function j(E,A){x=!1,m&&(m=!1,g(N),N=-1),p=!0;var z=f;try{for(v(A),h=n(l);h!==null&&(!(h.expirationTime>A)||E&&!M());){var X=h.callback;if(typeof X=="function"){h.callback=null,f=h.priorityLevel;var O=X(h.expirationTime<=A);A=t.unstable_now(),typeof O=="function"?h.callback=O:h===n(l)&&s(l),v(A)}else s(l);h=n(l)}if(h!==null)var Q=!0;else{var H=n(u);H!==null&&ae(w,H.startTime-A),Q=!1}return Q}finally{h=null,f=z,p=!1}}var P=!1,k=null,N=-1,R=5,C=-1;function M(){return!(t.unstable_now()-C<R)}function L(){if(k!==null){var E=t.unstable_now();C=E;var A=!0;try{A=k(!0,E)}finally{A?V():(P=!1,k=null)}}else P=!1}var V;if(typeof y=="function")V=function(){y(L)};else if(typeof MessageChannel<"u"){var ke=new MessageChannel,te=ke.port2;ke.port1.onmessage=L,V=function(){te.postMessage(null)}}else V=function(){b(L,0)};function B(E){k=E,P||(P=!0,V())}function ae(E,A){N=b(function(){E(t.unstable_now())},A)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(E){E.callback=null},t.unstable_continueExecution=function(){x||p||(x=!0,B(j))},t.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<E?Math.floor(1e3/E):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(E){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var z=f;f=A;try{return E()}finally{f=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(E,A){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=f;f=E;try{return A()}finally{f=z}},t.unstable_scheduleCallback=function(E,A,z){var X=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?X+z:X):z=X,E){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,E={id:d++,callback:A,priorityLevel:E,startTime:z,expirationTime:O,sortIndex:-1},z>X?(E.sortIndex=z,e(u,E),n(l)===null&&E===n(u)&&(m?(g(N),N=-1):m=!0,ae(w,z-X))):(E.sortIndex=O,e(l,E),x||p||(x=!0,B(j))),E},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(E){var A=f;return function(){var z=f;f=A;try{return E.apply(this,arguments)}finally{f=z}}}})(pg);fg.exports=pg;var ux=fg.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 cx=S,pt=ux;function T(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var gg=new Set,Ri={};function Vs(t,e){Mr(t,e),Mr(t+"Capture",e)}function Mr(t,e){for(Ri[t]=e,t=0;t<e.length;t++)gg.add(e[t])}var xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mu=Object.prototype.hasOwnProperty,dx=/^[: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]*$/,nh={},sh={};function hx(t){return mu.call(sh,t)?!0:mu.call(nh,t)?!1:dx.test(t)?sh[t]=!0:(nh[t]=!0,!1)}function fx(t,e,n,s){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function px(t,e,n,s){if(e===null||typeof e>"u"||fx(t,e,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function et(t,e,n,s,r,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=s,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ae[t]=new et(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ae[e]=new et(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ae[t]=new et(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ae[t]=new et(t,2,!1,t,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(t){Ae[t]=new et(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ae[t]=new et(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ae[t]=new et(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ae[t]=new et(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ae[t]=new et(t,5,!1,t.toLowerCase(),null,!1,!1)});var Fc=/[\-:]([a-z])/g;function Ic(t){return t[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(t){var e=t.replace(Fc,Ic);Ae[e]=new et(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Fc,Ic);Ae[e]=new et(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Fc,Ic);Ae[e]=new et(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ae[t]=new et(t,1,!1,t.toLowerCase(),null,!1,!1)});Ae.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ae[t]=new et(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ac(t,e,n,s){var r=Ae.hasOwnProperty(e)?Ae[e]:null;(r!==null?r.type!==0:s||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(px(e,n,r,s)&&(n=null),s||r===null?hx(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):r.mustUseProperty?t[r.propertyName]=n===null?r.type===3?!1:"":n:(e=r.attributeName,s=r.attributeNamespace,n===null?t.removeAttribute(e):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?t.setAttributeNS(s,e,n):t.setAttribute(e,n))))}var _n=cx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Co=Symbol.for("react.element"),qs=Symbol.for("react.portal"),Gs=Symbol.for("react.fragment"),zc=Symbol.for("react.strict_mode"),yu=Symbol.for("react.profiler"),mg=Symbol.for("react.provider"),yg=Symbol.for("react.context"),Bc=Symbol.for("react.forward_ref"),xu=Symbol.for("react.suspense"),vu=Symbol.for("react.suspense_list"),Wc=Symbol.for("react.memo"),Pn=Symbol.for("react.lazy"),xg=Symbol.for("react.offscreen"),rh=Symbol.iterator;function Yr(t){return t===null||typeof t!="object"?null:(t=rh&&t[rh]||t["@@iterator"],typeof t=="function"?t:null)}var xe=Object.assign,Nl;function ui(t){if(Nl===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Nl=e&&e[1]||""}return`
34
- `+Nl+t}var El=!1;function Pl(t,e){if(!t||El)return"";El=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var s=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){s=u}t.call(e.prototype)}else{try{throw Error()}catch(u){s=u}t()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var r=u.stack.split(`
35
- `),i=s.stack.split(`
36
- `),o=r.length-1,a=i.length-1;1<=o&&0<=a&&r[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==i[a]){var l=`
37
- `+r[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{El=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ui(t):""}function gx(t){switch(t.tag){case 5:return ui(t.type);case 16:return ui("Lazy");case 13:return ui("Suspense");case 19:return ui("SuspenseList");case 0:case 2:case 15:return t=Pl(t.type,!1),t;case 11:return t=Pl(t.type.render,!1),t;case 1:return t=Pl(t.type,!0),t;default:return""}}function bu(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Gs:return"Fragment";case qs:return"Portal";case yu:return"Profiler";case zc:return"StrictMode";case xu:return"Suspense";case vu:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case yg:return(t.displayName||"Context")+".Consumer";case mg:return(t._context.displayName||"Context")+".Provider";case Bc:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Wc:return e=t.displayName||null,e!==null?e:bu(t.type)||"Memo";case Pn:e=t._payload,t=t._init;try{return bu(t(e))}catch{}}return null}function mx(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bu(e);case 8:return e===zc?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function rs(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vg(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function yx(t){var e=vg(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),s=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function jo(t){t._valueTracker||(t._valueTracker=yx(t))}function bg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),s="";return t&&(s=vg(t)?t.checked?"true":"false":t.value),t=s,t!==n?(e.setValue(t),!0):!1}function va(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function wu(t,e){var n=e.checked;return xe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function ih(t,e){var n=e.defaultValue==null?"":e.defaultValue,s=e.checked!=null?e.checked:e.defaultChecked;n=rs(e.value!=null?e.value:n),t._wrapperState={initialChecked:s,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function wg(t,e){e=e.checked,e!=null&&Ac(t,"checked",e,!1)}function ku(t,e){wg(t,e);var n=rs(e.value),s=e.type;if(n!=null)s==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(s==="submit"||s==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?_u(t,e.type,n):e.hasOwnProperty("defaultValue")&&_u(t,e.type,rs(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function oh(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var s=e.type;if(!(s!=="submit"&&s!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function _u(t,e,n){(e!=="number"||va(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ci=Array.isArray;function ur(t,e,n,s){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&s&&(t[n].defaultSelected=!0)}else{for(n=""+rs(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,s&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function Su(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(T(91));return xe({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ah(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(T(92));if(ci(n)){if(1<n.length)throw Error(T(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:rs(n)}}function kg(t,e){var n=rs(e.value),s=rs(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),s!=null&&(t.defaultValue=""+s)}function lh(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function _g(t){switch(t){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 Cu(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?_g(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var No,Sg=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,s,r){MSApp.execUnsafeLocalFunction(function(){return t(e,n,s,r)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(No=No||document.createElement("div"),No.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=No.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Oi(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var xi={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},xx=["Webkit","ms","Moz","O"];Object.keys(xi).forEach(function(t){xx.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),xi[e]=xi[t]})});function Cg(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||xi.hasOwnProperty(t)&&xi[t]?(""+e).trim():e+"px"}function jg(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Cg(n,e[n],s);n==="float"&&(n="cssFloat"),s?t.setProperty(n,r):t[n]=r}}var vx=xe({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 ju(t,e){if(e){if(vx[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(T(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(T(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(T(61))}if(e.style!=null&&typeof e.style!="object")throw Error(T(62))}}function Nu(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Eu=null;function $c(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Pu=null,cr=null,dr=null;function uh(t){if(t=fo(t)){if(typeof Pu!="function")throw Error(T(280));var e=t.stateNode;e&&(e=al(e),Pu(t.stateNode,t.type,e))}}function Ng(t){cr?dr?dr.push(t):dr=[t]:cr=t}function Eg(){if(cr){var t=cr,e=dr;if(dr=cr=null,uh(t),e)for(t=0;t<e.length;t++)uh(e[t])}}function Pg(t,e){return t(e)}function Mg(){}var Ml=!1;function Tg(t,e,n){if(Ml)return t(e,n);Ml=!0;try{return Pg(t,e,n)}finally{Ml=!1,(cr!==null||dr!==null)&&(Mg(),Eg())}}function Di(t,e){var n=t.stateNode;if(n===null)return null;var s=al(n);if(s===null)return null;n=s[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(T(231,e,typeof n));return n}var Mu=!1;if(xn)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){Mu=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{Mu=!1}function bx(t,e,n,s,r,i,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var vi=!1,ba=null,wa=!1,Tu=null,wx={onError:function(t){vi=!0,ba=t}};function kx(t,e,n,s,r,i,o,a,l){vi=!1,ba=null,bx.apply(wx,arguments)}function _x(t,e,n,s,r,i,o,a,l){if(kx.apply(this,arguments),vi){if(vi){var u=ba;vi=!1,ba=null}else throw Error(T(198));wa||(wa=!0,Tu=u)}}function Qs(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Rg(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function ch(t){if(Qs(t)!==t)throw Error(T(188))}function Sx(t){var e=t.alternate;if(!e){if(e=Qs(t),e===null)throw Error(T(188));return e!==t?null:t}for(var n=t,s=e;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return ch(r),t;if(i===s)return ch(r),e;i=i.sibling}throw Error(T(188))}if(n.return!==s.return)n=r,s=i;else{for(var o=!1,a=r.child;a;){if(a===n){o=!0,n=r,s=i;break}if(a===s){o=!0,s=r,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,s=r;break}if(a===s){o=!0,s=i,n=r;break}a=a.sibling}if(!o)throw Error(T(189))}}if(n.alternate!==s)throw Error(T(190))}if(n.tag!==3)throw Error(T(188));return n.stateNode.current===n?t:e}function Og(t){return t=Sx(t),t!==null?Dg(t):null}function Dg(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Dg(t);if(e!==null)return e;t=t.sibling}return null}var Lg=pt.unstable_scheduleCallback,dh=pt.unstable_cancelCallback,Cx=pt.unstable_shouldYield,jx=pt.unstable_requestPaint,_e=pt.unstable_now,Nx=pt.unstable_getCurrentPriorityLevel,Hc=pt.unstable_ImmediatePriority,Fg=pt.unstable_UserBlockingPriority,ka=pt.unstable_NormalPriority,Ex=pt.unstable_LowPriority,Ig=pt.unstable_IdlePriority,sl=null,tn=null;function Px(t){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(sl,t,void 0,(t.current.flags&128)===128)}catch{}}var Bt=Math.clz32?Math.clz32:Rx,Mx=Math.log,Tx=Math.LN2;function Rx(t){return t>>>=0,t===0?32:31-(Mx(t)/Tx|0)|0}var Eo=64,Po=4194304;function di(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function _a(t,e){var n=t.pendingLanes;if(n===0)return 0;var s=0,r=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~r;a!==0?s=di(a):(i&=o,i!==0&&(s=di(i)))}else o=n&~r,o!==0?s=di(o):i!==0&&(s=di(i));if(s===0)return 0;if(e!==0&&e!==s&&!(e&r)&&(r=s&-s,i=e&-e,r>=i||r===16&&(i&4194240)!==0))return e;if(s&4&&(s|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=s;0<e;)n=31-Bt(e),r=1<<n,s|=t[n],e&=~r;return s}function Ox(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 Dx(t,e){for(var n=t.suspendedLanes,s=t.pingedLanes,r=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Bt(i),a=1<<o,l=r[o];l===-1?(!(a&n)||a&s)&&(r[o]=Ox(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function Ru(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Ag(){var t=Eo;return Eo<<=1,!(Eo&4194240)&&(Eo=64),t}function Tl(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function co(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Bt(e),t[e]=n}function Lx(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var s=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-Bt(n),i=1<<r;e[r]=0,s[r]=-1,t[r]=-1,n&=~i}}function Uc(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var s=31-Bt(n),r=1<<s;r&e|t[s]&e&&(t[s]|=e),n&=~r}}var ie=0;function zg(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Bg,Vc,Wg,$g,Hg,Ou=!1,Mo=[],Qn=null,Yn=null,Kn=null,Li=new Map,Fi=new Map,Tn=[],Fx="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 hh(t,e){switch(t){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":Yn=null;break;case"mouseover":case"mouseout":Kn=null;break;case"pointerover":case"pointerout":Li.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fi.delete(e.pointerId)}}function Xr(t,e,n,s,r,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},e!==null&&(e=fo(e),e!==null&&Vc(e)),t):(t.eventSystemFlags|=s,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function Ix(t,e,n,s,r){switch(e){case"focusin":return Qn=Xr(Qn,t,e,n,s,r),!0;case"dragenter":return Yn=Xr(Yn,t,e,n,s,r),!0;case"mouseover":return Kn=Xr(Kn,t,e,n,s,r),!0;case"pointerover":var i=r.pointerId;return Li.set(i,Xr(Li.get(i)||null,t,e,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Fi.set(i,Xr(Fi.get(i)||null,t,e,n,s,r)),!0}return!1}function Ug(t){var e=bs(t.target);if(e!==null){var n=Qs(e);if(n!==null){if(e=n.tag,e===13){if(e=Rg(n),e!==null){t.blockedOn=e,Hg(t.priority,function(){Wg(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function sa(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Du(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var s=new n.constructor(n.type,n);Eu=s,n.target.dispatchEvent(s),Eu=null}else return e=fo(n),e!==null&&Vc(e),t.blockedOn=n,!1;e.shift()}return!0}function fh(t,e,n){sa(t)&&n.delete(e)}function Ax(){Ou=!1,Qn!==null&&sa(Qn)&&(Qn=null),Yn!==null&&sa(Yn)&&(Yn=null),Kn!==null&&sa(Kn)&&(Kn=null),Li.forEach(fh),Fi.forEach(fh)}function qr(t,e){t.blockedOn===e&&(t.blockedOn=null,Ou||(Ou=!0,pt.unstable_scheduleCallback(pt.unstable_NormalPriority,Ax)))}function Ii(t){function e(r){return qr(r,t)}if(0<Mo.length){qr(Mo[0],t);for(var n=1;n<Mo.length;n++){var s=Mo[n];s.blockedOn===t&&(s.blockedOn=null)}}for(Qn!==null&&qr(Qn,t),Yn!==null&&qr(Yn,t),Kn!==null&&qr(Kn,t),Li.forEach(e),Fi.forEach(e),n=0;n<Tn.length;n++)s=Tn[n],s.blockedOn===t&&(s.blockedOn=null);for(;0<Tn.length&&(n=Tn[0],n.blockedOn===null);)Ug(n),n.blockedOn===null&&Tn.shift()}var hr=_n.ReactCurrentBatchConfig,Sa=!0;function zx(t,e,n,s){var r=ie,i=hr.transition;hr.transition=null;try{ie=1,Qc(t,e,n,s)}finally{ie=r,hr.transition=i}}function Bx(t,e,n,s){var r=ie,i=hr.transition;hr.transition=null;try{ie=4,Qc(t,e,n,s)}finally{ie=r,hr.transition=i}}function Qc(t,e,n,s){if(Sa){var r=Du(t,e,n,s);if(r===null)Wl(t,e,s,Ca,n),hh(t,s);else if(Ix(r,t,e,n,s))s.stopPropagation();else if(hh(t,s),e&4&&-1<Fx.indexOf(t)){for(;r!==null;){var i=fo(r);if(i!==null&&Bg(i),i=Du(t,e,n,s),i===null&&Wl(t,e,s,Ca,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Wl(t,e,s,null,n)}}var Ca=null;function Du(t,e,n,s){if(Ca=null,t=$c(s),t=bs(t),t!==null)if(e=Qs(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Rg(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Ca=t,null}function Vg(t){switch(t){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(Nx()){case Hc:return 1;case Fg:return 4;case ka:case Ex:return 16;case Ig:return 536870912;default:return 16}default:return 16}}var Wn=null,Yc=null,ra=null;function Qg(){if(ra)return ra;var t,e=Yc,n=e.length,s,r="value"in Wn?Wn.value:Wn.textContent,i=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(s=1;s<=o&&e[n-s]===r[i-s];s++);return ra=r.slice(t,1<s?1-s:void 0)}function ia(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function To(){return!0}function ph(){return!1}function mt(t){function e(n,s,r,i,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?To:ph,this.isPropagationStopped=ph,this}return xe(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=To)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=To)},persist:function(){},isPersistent:To}),e}var Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kc=mt(Br),ho=xe({},Br,{view:0,detail:0}),Wx=mt(ho),Rl,Ol,Gr,rl=xe({},ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Gr&&(Gr&&t.type==="mousemove"?(Rl=t.screenX-Gr.screenX,Ol=t.screenY-Gr.screenY):Ol=Rl=0,Gr=t),Rl)},movementY:function(t){return"movementY"in t?t.movementY:Ol}}),gh=mt(rl),$x=xe({},rl,{dataTransfer:0}),Hx=mt($x),Ux=xe({},ho,{relatedTarget:0}),Dl=mt(Ux),Vx=xe({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),Qx=mt(Vx),Yx=xe({},Br,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Kx=mt(Yx),Xx=xe({},Br,{data:0}),mh=mt(Xx),qx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gx={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"},Jx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zx(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Jx[t])?!!e[t]:!1}function Xc(){return Zx}var ev=xe({},ho,{key:function(t){if(t.key){var e=qx[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ia(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Gx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xc,charCode:function(t){return t.type==="keypress"?ia(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ia(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),tv=mt(ev),nv=xe({},rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yh=mt(nv),sv=xe({},ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xc}),rv=mt(sv),iv=xe({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),ov=mt(iv),av=xe({},rl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),lv=mt(av),uv=[9,13,27,32],qc=xn&&"CompositionEvent"in window,bi=null;xn&&"documentMode"in document&&(bi=document.documentMode);var cv=xn&&"TextEvent"in window&&!bi,Yg=xn&&(!qc||bi&&8<bi&&11>=bi),xh=" ",vh=!1;function Kg(t,e){switch(t){case"keyup":return uv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Js=!1;function dv(t,e){switch(t){case"compositionend":return Xg(e);case"keypress":return e.which!==32?null:(vh=!0,xh);case"textInput":return t=e.data,t===xh&&vh?null:t;default:return null}}function hv(t,e){if(Js)return t==="compositionend"||!qc&&Kg(t,e)?(t=Qg(),ra=Yc=Wn=null,Js=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Yg&&e.locale!=="ko"?null:e.data;default:return null}}var fv={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 bh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!fv[t.type]:e==="textarea"}function qg(t,e,n,s){Ng(s),e=ja(e,"onChange"),0<e.length&&(n=new Kc("onChange","change",null,n,s),t.push({event:n,listeners:e}))}var wi=null,Ai=null;function pv(t){am(t,0)}function il(t){var e=tr(t);if(bg(e))return t}function gv(t,e){if(t==="change")return e}var Gg=!1;if(xn){var Ll;if(xn){var Fl="oninput"in document;if(!Fl){var wh=document.createElement("div");wh.setAttribute("oninput","return;"),Fl=typeof wh.oninput=="function"}Ll=Fl}else Ll=!1;Gg=Ll&&(!document.documentMode||9<document.documentMode)}function kh(){wi&&(wi.detachEvent("onpropertychange",Jg),Ai=wi=null)}function Jg(t){if(t.propertyName==="value"&&il(Ai)){var e=[];qg(e,Ai,t,$c(t)),Tg(pv,e)}}function mv(t,e,n){t==="focusin"?(kh(),wi=e,Ai=n,wi.attachEvent("onpropertychange",Jg)):t==="focusout"&&kh()}function yv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return il(Ai)}function xv(t,e){if(t==="click")return il(e)}function vv(t,e){if(t==="input"||t==="change")return il(e)}function bv(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var $t=typeof Object.is=="function"?Object.is:bv;function zi(t,e){if($t(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!mu.call(e,r)||!$t(t[r],e[r]))return!1}return!0}function _h(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Sh(t,e){var n=_h(t);t=0;for(var s;n;){if(n.nodeType===3){if(s=t+n.textContent.length,t<=e&&s>=e)return{node:n,offset:e-t};t=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_h(n)}}function Zg(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Zg(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function em(){for(var t=window,e=va();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=va(t.document)}return e}function Gc(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function wv(t){var e=em(),n=t.focusedElem,s=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Zg(n.ownerDocument.documentElement,n)){if(s!==null&&Gc(n)){if(e=s.start,t=s.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,i=Math.min(s.start,r);s=s.end===void 0?i:Math.min(s.end,r),!t.extend&&i>s&&(r=s,s=i,i=r),r=Sh(n,i);var o=Sh(n,s);r&&o&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),i>s?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var kv=xn&&"documentMode"in document&&11>=document.documentMode,Zs=null,Lu=null,ki=null,Fu=!1;function Ch(t,e,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fu||Zs==null||Zs!==va(s)||(s=Zs,"selectionStart"in s&&Gc(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ki&&zi(ki,s)||(ki=s,s=ja(Lu,"onSelect"),0<s.length&&(e=new Kc("onSelect","select",null,e,n),t.push({event:e,listeners:s}),e.target=Zs)))}function Ro(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var er={animationend:Ro("Animation","AnimationEnd"),animationiteration:Ro("Animation","AnimationIteration"),animationstart:Ro("Animation","AnimationStart"),transitionend:Ro("Transition","TransitionEnd")},Il={},tm={};xn&&(tm=document.createElement("div").style,"AnimationEvent"in window||(delete er.animationend.animation,delete er.animationiteration.animation,delete er.animationstart.animation),"TransitionEvent"in window||delete er.transitionend.transition);function ol(t){if(Il[t])return Il[t];if(!er[t])return t;var e=er[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in tm)return Il[t]=e[n];return t}var nm=ol("animationend"),sm=ol("animationiteration"),rm=ol("animationstart"),im=ol("transitionend"),om=new Map,jh="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 ls(t,e){om.set(t,e),Vs(e,[t])}for(var Al=0;Al<jh.length;Al++){var zl=jh[Al],_v=zl.toLowerCase(),Sv=zl[0].toUpperCase()+zl.slice(1);ls(_v,"on"+Sv)}ls(nm,"onAnimationEnd");ls(sm,"onAnimationIteration");ls(rm,"onAnimationStart");ls("dblclick","onDoubleClick");ls("focusin","onFocus");ls("focusout","onBlur");ls(im,"onTransitionEnd");Mr("onMouseEnter",["mouseout","mouseover"]);Mr("onMouseLeave",["mouseout","mouseover"]);Mr("onPointerEnter",["pointerout","pointerover"]);Mr("onPointerLeave",["pointerout","pointerover"]);Vs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Vs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Vs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Vs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Vs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Vs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hi="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(" "),Cv=new Set("cancel close invalid load scroll toggle".split(" ").concat(hi));function Nh(t,e,n){var s=t.type||"unknown-event";t.currentTarget=n,_x(s,e,void 0,t),t.currentTarget=null}function am(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var s=t[n],r=s.event;s=s.listeners;e:{var i=void 0;if(e)for(var o=s.length-1;0<=o;o--){var a=s[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&r.isPropagationStopped())break e;Nh(r,a,u),i=l}else for(o=0;o<s.length;o++){if(a=s[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&r.isPropagationStopped())break e;Nh(r,a,u),i=l}}}if(wa)throw t=Tu,wa=!1,Tu=null,t}function de(t,e){var n=e[Wu];n===void 0&&(n=e[Wu]=new Set);var s=t+"__bubble";n.has(s)||(lm(e,t,2,!1),n.add(s))}function Bl(t,e,n){var s=0;e&&(s|=4),lm(n,t,s,e)}var Oo="_reactListening"+Math.random().toString(36).slice(2);function Bi(t){if(!t[Oo]){t[Oo]=!0,gg.forEach(function(n){n!=="selectionchange"&&(Cv.has(n)||Bl(n,!1,t),Bl(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Oo]||(e[Oo]=!0,Bl("selectionchange",!1,e))}}function lm(t,e,n,s){switch(Vg(e)){case 1:var r=zx;break;case 4:r=Bx;break;default:r=Qc}n=r.bind(null,e,n,t),r=void 0,!Mu||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),s?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function Wl(t,e,n,s,r){var i=s;if(!(e&1)&&!(e&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var a=s.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=s.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;o=o.return}for(;a!==null;){if(o=bs(a),o===null)return;if(l=o.tag,l===5||l===6){s=i=o;continue e}a=a.parentNode}}s=s.return}Tg(function(){var u=i,d=$c(n),h=[];e:{var f=om.get(t);if(f!==void 0){var p=Kc,x=t;switch(t){case"keypress":if(ia(n)===0)break e;case"keydown":case"keyup":p=tv;break;case"focusin":x="focus",p=Dl;break;case"focusout":x="blur",p=Dl;break;case"beforeblur":case"afterblur":p=Dl;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":p=gh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Hx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=rv;break;case nm:case sm:case rm:p=Qx;break;case im:p=ov;break;case"scroll":p=Wx;break;case"wheel":p=lv;break;case"copy":case"cut":case"paste":p=Kx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=yh}var m=(e&4)!==0,b=!m&&t==="scroll",g=m?f!==null?f+"Capture":null:f;m=[];for(var y=u,v;y!==null;){v=y;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,g!==null&&(w=Di(y,g),w!=null&&m.push(Wi(y,w,v)))),b)break;y=y.return}0<m.length&&(f=new p(f,x,null,n,d),h.push({event:f,listeners:m}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==Eu&&(x=n.relatedTarget||n.fromElement)&&(bs(x)||x[vn]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=u,x=x?bs(x):null,x!==null&&(b=Qs(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(p=null,x=u),p!==x)){if(m=gh,w="onMouseLeave",g="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(m=yh,w="onPointerLeave",g="onPointerEnter",y="pointer"),b=p==null?f:tr(p),v=x==null?f:tr(x),f=new m(w,y+"leave",p,n,d),f.target=b,f.relatedTarget=v,w=null,bs(d)===u&&(m=new m(g,y+"enter",x,n,d),m.target=v,m.relatedTarget=b,w=m),b=w,p&&x)t:{for(m=p,g=x,y=0,v=m;v;v=Ys(v))y++;for(v=0,w=g;w;w=Ys(w))v++;for(;0<y-v;)m=Ys(m),y--;for(;0<v-y;)g=Ys(g),v--;for(;y--;){if(m===g||g!==null&&m===g.alternate)break t;m=Ys(m),g=Ys(g)}m=null}else m=null;p!==null&&Eh(h,f,p,m,!1),x!==null&&b!==null&&Eh(h,b,x,m,!0)}}e:{if(f=u?tr(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=gv;else if(bh(f))if(Gg)j=vv;else{j=yv;var P=mv}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=xv);if(j&&(j=j(t,u))){qg(h,j,n,d);break e}P&&P(t,f,u),t==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&_u(f,"number",f.value)}switch(P=u?tr(u):window,t){case"focusin":(bh(P)||P.contentEditable==="true")&&(Zs=P,Lu=u,ki=null);break;case"focusout":ki=Lu=Zs=null;break;case"mousedown":Fu=!0;break;case"contextmenu":case"mouseup":case"dragend":Fu=!1,Ch(h,n,d);break;case"selectionchange":if(kv)break;case"keydown":case"keyup":Ch(h,n,d)}var k;if(qc)e:{switch(t){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Js?Kg(t,n)&&(N="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(Yg&&n.locale!=="ko"&&(Js||N!=="onCompositionStart"?N==="onCompositionEnd"&&Js&&(k=Qg()):(Wn=d,Yc="value"in Wn?Wn.value:Wn.textContent,Js=!0)),P=ja(u,N),0<P.length&&(N=new mh(N,t,null,n,d),h.push({event:N,listeners:P}),k?N.data=k:(k=Xg(n),k!==null&&(N.data=k)))),(k=cv?dv(t,n):hv(t,n))&&(u=ja(u,"onBeforeInput"),0<u.length&&(d=new mh("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=k))}am(h,e)})}function Wi(t,e,n){return{instance:t,listener:e,currentTarget:n}}function ja(t,e){for(var n=e+"Capture",s=[];t!==null;){var r=t,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Di(t,n),i!=null&&s.unshift(Wi(t,i,r)),i=Di(t,e),i!=null&&s.push(Wi(t,i,r))),t=t.return}return s}function Ys(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Eh(t,e,n,s,r){for(var i=e._reactName,o=[];n!==null&&n!==s;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===s)break;a.tag===5&&u!==null&&(a=u,r?(l=Di(n,i),l!=null&&o.unshift(Wi(n,l,a))):r||(l=Di(n,i),l!=null&&o.push(Wi(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var jv=/\r\n?/g,Nv=/\u0000|\uFFFD/g;function Ph(t){return(typeof t=="string"?t:""+t).replace(jv,`
38
- `).replace(Nv,"")}function Do(t,e,n){if(e=Ph(e),Ph(t)!==e&&n)throw Error(T(425))}function Na(){}var Iu=null,Au=null;function zu(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Bu=typeof setTimeout=="function"?setTimeout:void 0,Ev=typeof clearTimeout=="function"?clearTimeout:void 0,Mh=typeof Promise=="function"?Promise:void 0,Pv=typeof queueMicrotask=="function"?queueMicrotask:typeof Mh<"u"?function(t){return Mh.resolve(null).then(t).catch(Mv)}:Bu;function Mv(t){setTimeout(function(){throw t})}function $l(t,e){var n=e,s=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(s===0){t.removeChild(r),Ii(e);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Ii(e)}function Xn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Th(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Wr=Math.random().toString(36).slice(2),en="__reactFiber$"+Wr,$i="__reactProps$"+Wr,vn="__reactContainer$"+Wr,Wu="__reactEvents$"+Wr,Tv="__reactListeners$"+Wr,Rv="__reactHandles$"+Wr;function bs(t){var e=t[en];if(e)return e;for(var n=t.parentNode;n;){if(e=n[vn]||n[en]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Th(t);t!==null;){if(n=t[en])return n;t=Th(t)}return e}t=n,n=t.parentNode}return null}function fo(t){return t=t[en]||t[vn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function tr(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(T(33))}function al(t){return t[$i]||null}var $u=[],nr=-1;function us(t){return{current:t}}function fe(t){0>nr||(t.current=$u[nr],$u[nr]=null,nr--)}function ue(t,e){nr++,$u[nr]=t.current,t.current=e}var is={},Qe=us(is),at=us(!1),Is=is;function Tr(t,e){var n=t.type.contextTypes;if(!n)return is;var s=t.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===e)return s.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=e[i];return s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function lt(t){return t=t.childContextTypes,t!=null}function Ea(){fe(at),fe(Qe)}function Rh(t,e,n){if(Qe.current!==is)throw Error(T(168));ue(Qe,e),ue(at,n)}function um(t,e,n){var s=t.stateNode;if(e=e.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var r in s)if(!(r in e))throw Error(T(108,mx(t)||"Unknown",r));return xe({},n,s)}function Pa(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||is,Is=Qe.current,ue(Qe,t),ue(at,at.current),!0}function Oh(t,e,n){var s=t.stateNode;if(!s)throw Error(T(169));n?(t=um(t,e,Is),s.__reactInternalMemoizedMergedChildContext=t,fe(at),fe(Qe),ue(Qe,t)):fe(at),ue(at,n)}var cn=null,ll=!1,Hl=!1;function cm(t){cn===null?cn=[t]:cn.push(t)}function Ov(t){ll=!0,cm(t)}function cs(){if(!Hl&&cn!==null){Hl=!0;var t=0,e=ie;try{var n=cn;for(ie=1;t<n.length;t++){var s=n[t];do s=s(!0);while(s!==null)}cn=null,ll=!1}catch(r){throw cn!==null&&(cn=cn.slice(t+1)),Lg(Hc,cs),r}finally{ie=e,Hl=!1}}return null}var sr=[],rr=0,Ma=null,Ta=0,kt=[],_t=0,As=null,pn=1,gn="";function ms(t,e){sr[rr++]=Ta,sr[rr++]=Ma,Ma=t,Ta=e}function dm(t,e,n){kt[_t++]=pn,kt[_t++]=gn,kt[_t++]=As,As=t;var s=pn;t=gn;var r=32-Bt(s)-1;s&=~(1<<r),n+=1;var i=32-Bt(e)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,pn=1<<32-Bt(e)+r|n<<r|s,gn=i+t}else pn=1<<i|n<<r|s,gn=t}function Jc(t){t.return!==null&&(ms(t,1),dm(t,1,0))}function Zc(t){for(;t===Ma;)Ma=sr[--rr],sr[rr]=null,Ta=sr[--rr],sr[rr]=null;for(;t===As;)As=kt[--_t],kt[_t]=null,gn=kt[--_t],kt[_t]=null,pn=kt[--_t],kt[_t]=null}var ft=null,dt=null,pe=!1,It=null;function hm(t,e){var n=St(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Dh(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,ft=t,dt=Xn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,ft=t,dt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=As!==null?{id:pn,overflow:gn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=St(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,ft=t,dt=null,!0):!1;default:return!1}}function Hu(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Uu(t){if(pe){var e=dt;if(e){var n=e;if(!Dh(t,e)){if(Hu(t))throw Error(T(418));e=Xn(n.nextSibling);var s=ft;e&&Dh(t,e)?hm(s,n):(t.flags=t.flags&-4097|2,pe=!1,ft=t)}}else{if(Hu(t))throw Error(T(418));t.flags=t.flags&-4097|2,pe=!1,ft=t}}}function Lh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ft=t}function Lo(t){if(t!==ft)return!1;if(!pe)return Lh(t),pe=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!zu(t.type,t.memoizedProps)),e&&(e=dt)){if(Hu(t))throw fm(),Error(T(418));for(;e;)hm(t,e),e=Xn(e.nextSibling)}if(Lh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(T(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){dt=Xn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}dt=null}}else dt=ft?Xn(t.stateNode.nextSibling):null;return!0}function fm(){for(var t=dt;t;)t=Xn(t.nextSibling)}function Rr(){dt=ft=null,pe=!1}function ed(t){It===null?It=[t]:It.push(t)}var Dv=_n.ReactCurrentBatchConfig;function Jr(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(T(309));var s=n.stateNode}if(!s)throw Error(T(147,t));var r=s,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=r.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(T(284));if(!n._owner)throw Error(T(290,t))}return t}function Fo(t,e){throw t=Object.prototype.toString.call(e),Error(T(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Fh(t){var e=t._init;return e(t._payload)}function pm(t){function e(g,y){if(t){var v=g.deletions;v===null?(g.deletions=[y],g.flags|=16):v.push(y)}}function n(g,y){if(!t)return null;for(;y!==null;)e(g,y),y=y.sibling;return null}function s(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function r(g,y){return g=Zn(g,y),g.index=0,g.sibling=null,g}function i(g,y,v){return g.index=v,t?(v=g.alternate,v!==null?(v=v.index,v<y?(g.flags|=2,y):v):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return t&&g.alternate===null&&(g.flags|=2),g}function a(g,y,v,w){return y===null||y.tag!==6?(y=ql(v,g.mode,w),y.return=g,y):(y=r(y,v),y.return=g,y)}function l(g,y,v,w){var j=v.type;return j===Gs?d(g,y,v.props.children,w,v.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Pn&&Fh(j)===y.type)?(w=r(y,v.props),w.ref=Jr(g,y,v),w.return=g,w):(w=ha(v.type,v.key,v.props,null,g.mode,w),w.ref=Jr(g,y,v),w.return=g,w)}function u(g,y,v,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=Gl(v,g.mode,w),y.return=g,y):(y=r(y,v.children||[]),y.return=g,y)}function d(g,y,v,w,j){return y===null||y.tag!==7?(y=Ls(v,g.mode,w,j),y.return=g,y):(y=r(y,v),y.return=g,y)}function h(g,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=ql(""+y,g.mode,v),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Co:return v=ha(y.type,y.key,y.props,null,g.mode,v),v.ref=Jr(g,null,y),v.return=g,v;case qs:return y=Gl(y,g.mode,v),y.return=g,y;case Pn:var w=y._init;return h(g,w(y._payload),v)}if(ci(y)||Yr(y))return y=Ls(y,g.mode,v,null),y.return=g,y;Fo(g,y)}return null}function f(g,y,v,w){var j=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return j!==null?null:a(g,y,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Co:return v.key===j?l(g,y,v,w):null;case qs:return v.key===j?u(g,y,v,w):null;case Pn:return j=v._init,f(g,y,j(v._payload),w)}if(ci(v)||Yr(v))return j!==null?null:d(g,y,v,w,null);Fo(g,v)}return null}function p(g,y,v,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(v)||null,a(y,g,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Co:return g=g.get(w.key===null?v:w.key)||null,l(y,g,w,j);case qs:return g=g.get(w.key===null?v:w.key)||null,u(y,g,w,j);case Pn:var P=w._init;return p(g,y,v,P(w._payload),j)}if(ci(w)||Yr(w))return g=g.get(v)||null,d(y,g,w,j,null);Fo(y,w)}return null}function x(g,y,v,w){for(var j=null,P=null,k=y,N=y=0,R=null;k!==null&&N<v.length;N++){k.index>N?(R=k,k=null):R=k.sibling;var C=f(g,k,v[N],w);if(C===null){k===null&&(k=R);break}t&&k&&C.alternate===null&&e(g,k),y=i(C,y,N),P===null?j=C:P.sibling=C,P=C,k=R}if(N===v.length)return n(g,k),pe&&ms(g,N),j;if(k===null){for(;N<v.length;N++)k=h(g,v[N],w),k!==null&&(y=i(k,y,N),P===null?j=k:P.sibling=k,P=k);return pe&&ms(g,N),j}for(k=s(g,k);N<v.length;N++)R=p(k,g,N,v[N],w),R!==null&&(t&&R.alternate!==null&&k.delete(R.key===null?N:R.key),y=i(R,y,N),P===null?j=R:P.sibling=R,P=R);return t&&k.forEach(function(M){return e(g,M)}),pe&&ms(g,N),j}function m(g,y,v,w){var j=Yr(v);if(typeof j!="function")throw Error(T(150));if(v=j.call(v),v==null)throw Error(T(151));for(var P=j=null,k=y,N=y=0,R=null,C=v.next();k!==null&&!C.done;N++,C=v.next()){k.index>N?(R=k,k=null):R=k.sibling;var M=f(g,k,C.value,w);if(M===null){k===null&&(k=R);break}t&&k&&M.alternate===null&&e(g,k),y=i(M,y,N),P===null?j=M:P.sibling=M,P=M,k=R}if(C.done)return n(g,k),pe&&ms(g,N),j;if(k===null){for(;!C.done;N++,C=v.next())C=h(g,C.value,w),C!==null&&(y=i(C,y,N),P===null?j=C:P.sibling=C,P=C);return pe&&ms(g,N),j}for(k=s(g,k);!C.done;N++,C=v.next())C=p(k,g,N,C.value,w),C!==null&&(t&&C.alternate!==null&&k.delete(C.key===null?N:C.key),y=i(C,y,N),P===null?j=C:P.sibling=C,P=C);return t&&k.forEach(function(L){return e(g,L)}),pe&&ms(g,N),j}function b(g,y,v,w){if(typeof v=="object"&&v!==null&&v.type===Gs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Co:e:{for(var j=v.key,P=y;P!==null;){if(P.key===j){if(j=v.type,j===Gs){if(P.tag===7){n(g,P.sibling),y=r(P,v.props.children),y.return=g,g=y;break e}}else if(P.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Pn&&Fh(j)===P.type){n(g,P.sibling),y=r(P,v.props),y.ref=Jr(g,P,v),y.return=g,g=y;break e}n(g,P);break}else e(g,P);P=P.sibling}v.type===Gs?(y=Ls(v.props.children,g.mode,w,v.key),y.return=g,g=y):(w=ha(v.type,v.key,v.props,null,g.mode,w),w.ref=Jr(g,y,v),w.return=g,g=w)}return o(g);case qs:e:{for(P=v.key;y!==null;){if(y.key===P)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(g,y.sibling),y=r(y,v.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else e(g,y);y=y.sibling}y=Gl(v,g.mode,w),y.return=g,g=y}return o(g);case Pn:return P=v._init,b(g,y,P(v._payload),w)}if(ci(v))return x(g,y,v,w);if(Yr(v))return m(g,y,v,w);Fo(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(g,y.sibling),y=r(y,v),y.return=g,g=y):(n(g,y),y=ql(v,g.mode,w),y.return=g,g=y),o(g)):n(g,y)}return b}var Or=pm(!0),gm=pm(!1),Ra=us(null),Oa=null,ir=null,td=null;function nd(){td=ir=Oa=null}function sd(t){var e=Ra.current;fe(Ra),t._currentValue=e}function Vu(t,e,n){for(;t!==null;){var s=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,s!==null&&(s.childLanes|=e)):s!==null&&(s.childLanes&e)!==e&&(s.childLanes|=e),t===n)break;t=t.return}}function fr(t,e){Oa=t,td=ir=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ot=!0),t.firstContext=null)}function Nt(t){var e=t._currentValue;if(td!==t)if(t={context:t,memoizedValue:e,next:null},ir===null){if(Oa===null)throw Error(T(308));ir=t,Oa.dependencies={lanes:0,firstContext:t}}else ir=ir.next=t;return e}var ws=null;function rd(t){ws===null?ws=[t]:ws.push(t)}function mm(t,e,n,s){var r=e.interleaved;return r===null?(n.next=n,rd(e)):(n.next=r.next,r.next=n),e.interleaved=n,bn(t,s)}function bn(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Mn=!1;function id(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ym(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function mn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function qn(t,e,n){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,G&2){var r=s.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),s.pending=e,bn(t,n)}return r=s.interleaved,r===null?(e.next=e,rd(s)):(e.next=r.next,r.next=e),s.interleaved=e,bn(t,n)}function oa(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,Uc(t,n)}}function Ih(t,e){var n=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?r=i=e:i=i.next=e}else r=i=e;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,effects:s.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Da(t,e,n,s){var r=t.updateQueue;Mn=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var h=r.baseState;o=0,d=u=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((s&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=t,m=a;switch(f=e,p=n,m.tag){case 1:if(x=m.payload,typeof x=="function"){h=x.call(p,h,f);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=m.payload,f=typeof x=="function"?x.call(p,h,f):x,f==null)break e;h=xe({},h,f);break e;case 2:Mn=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=r.effects,f===null?r.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=h):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);if(d===null&&(l=h),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=d,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else i===null&&(r.shared.lanes=0);Bs|=o,t.lanes=o,t.memoizedState=h}}function Ah(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var s=t[e],r=s.callback;if(r!==null){if(s.callback=null,s=n,typeof r!="function")throw Error(T(191,r));r.call(s)}}}var po={},nn=us(po),Hi=us(po),Ui=us(po);function ks(t){if(t===po)throw Error(T(174));return t}function od(t,e){switch(ue(Ui,e),ue(Hi,t),ue(nn,po),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Cu(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Cu(e,t)}fe(nn),ue(nn,e)}function Dr(){fe(nn),fe(Hi),fe(Ui)}function xm(t){ks(Ui.current);var e=ks(nn.current),n=Cu(e,t.type);e!==n&&(ue(Hi,t),ue(nn,n))}function ad(t){Hi.current===t&&(fe(nn),fe(Hi))}var me=us(0);function La(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ul=[];function ld(){for(var t=0;t<Ul.length;t++)Ul[t]._workInProgressVersionPrimary=null;Ul.length=0}var aa=_n.ReactCurrentDispatcher,Vl=_n.ReactCurrentBatchConfig,zs=0,ye=null,Ee=null,Re=null,Fa=!1,_i=!1,Vi=0,Lv=0;function Be(){throw Error(T(321))}function ud(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!$t(t[n],e[n]))return!1;return!0}function cd(t,e,n,s,r,i){if(zs=i,ye=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,aa.current=t===null||t.memoizedState===null?zv:Bv,t=n(s,r),_i){i=0;do{if(_i=!1,Vi=0,25<=i)throw Error(T(301));i+=1,Re=Ee=null,e.updateQueue=null,aa.current=Wv,t=n(s,r)}while(_i)}if(aa.current=Ia,e=Ee!==null&&Ee.next!==null,zs=0,Re=Ee=ye=null,Fa=!1,e)throw Error(T(300));return t}function dd(){var t=Vi!==0;return Vi=0,t}function Xt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Re===null?ye.memoizedState=Re=t:Re=Re.next=t,Re}function Et(){if(Ee===null){var t=ye.alternate;t=t!==null?t.memoizedState:null}else t=Ee.next;var e=Re===null?ye.memoizedState:Re.next;if(e!==null)Re=e,Ee=t;else{if(t===null)throw Error(T(310));Ee=t,t={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Re===null?ye.memoizedState=Re=t:Re=Re.next=t}return Re}function Qi(t,e){return typeof e=="function"?e(t):e}function Ql(t){var e=Et(),n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=t;var s=Ee,r=s.baseQueue,i=n.pending;if(i!==null){if(r!==null){var o=r.next;r.next=i.next,i.next=o}s.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,s=s.baseState;var a=o=null,l=null,u=i;do{var d=u.lane;if((zs&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:t(s,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=h,o=s):l=l.next=h,ye.lanes|=d,Bs|=d}u=u.next}while(u!==null&&u!==i);l===null?o=s:l.next=a,$t(s,e.memoizedState)||(ot=!0),e.memoizedState=s,e.baseState=o,e.baseQueue=l,n.lastRenderedState=s}if(t=n.interleaved,t!==null){r=t;do i=r.lane,ye.lanes|=i,Bs|=i,r=r.next;while(r!==t)}else r===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Yl(t){var e=Et(),n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=t;var s=n.dispatch,r=n.pending,i=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do i=t(i,o.action),o=o.next;while(o!==r);$t(i,e.memoizedState)||(ot=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,s]}function vm(){}function bm(t,e){var n=ye,s=Et(),r=e(),i=!$t(s.memoizedState,r);if(i&&(s.memoizedState=r,ot=!0),s=s.queue,hd(_m.bind(null,n,s,t),[t]),s.getSnapshot!==e||i||Re!==null&&Re.memoizedState.tag&1){if(n.flags|=2048,Yi(9,km.bind(null,n,s,r,e),void 0,null),Oe===null)throw Error(T(349));zs&30||wm(n,e,r)}return r}function wm(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ye.updateQueue,e===null?(e={lastEffect:null,stores:null},ye.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function km(t,e,n,s){e.value=n,e.getSnapshot=s,Sm(e)&&Cm(t)}function _m(t,e,n){return n(function(){Sm(e)&&Cm(t)})}function Sm(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!$t(t,n)}catch{return!0}}function Cm(t){var e=bn(t,1);e!==null&&Wt(e,t,1,-1)}function zh(t){var e=Xt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:t},e.queue=t,t=t.dispatch=Av.bind(null,ye,t),[e.memoizedState,t]}function Yi(t,e,n,s){return t={tag:t,create:e,destroy:n,deps:s,next:null},e=ye.updateQueue,e===null?(e={lastEffect:null,stores:null},ye.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(s=n.next,n.next=t,t.next=s,e.lastEffect=t)),t}function jm(){return Et().memoizedState}function la(t,e,n,s){var r=Xt();ye.flags|=t,r.memoizedState=Yi(1|e,n,void 0,s===void 0?null:s)}function ul(t,e,n,s){var r=Et();s=s===void 0?null:s;var i=void 0;if(Ee!==null){var o=Ee.memoizedState;if(i=o.destroy,s!==null&&ud(s,o.deps)){r.memoizedState=Yi(e,n,i,s);return}}ye.flags|=t,r.memoizedState=Yi(1|e,n,i,s)}function Bh(t,e){return la(8390656,8,t,e)}function hd(t,e){return ul(2048,8,t,e)}function Nm(t,e){return ul(4,2,t,e)}function Em(t,e){return ul(4,4,t,e)}function Pm(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Mm(t,e,n){return n=n!=null?n.concat([t]):null,ul(4,4,Pm.bind(null,e,t),n)}function fd(){}function Tm(t,e){var n=Et();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&ud(e,s[1])?s[0]:(n.memoizedState=[t,e],t)}function Rm(t,e){var n=Et();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&ud(e,s[1])?s[0]:(t=t(),n.memoizedState=[t,e],t)}function Om(t,e,n){return zs&21?($t(n,e)||(n=Ag(),ye.lanes|=n,Bs|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ot=!0),t.memoizedState=n)}function Fv(t,e){var n=ie;ie=n!==0&&4>n?n:4,t(!0);var s=Vl.transition;Vl.transition={};try{t(!1),e()}finally{ie=n,Vl.transition=s}}function Dm(){return Et().memoizedState}function Iv(t,e,n){var s=Jn(t);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Lm(t))Fm(e,n);else if(n=mm(t,e,n,s),n!==null){var r=Je();Wt(n,t,s,r),Im(n,e,s)}}function Av(t,e,n){var s=Jn(t),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Lm(t))Fm(e,r);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(r.hasEagerState=!0,r.eagerState=a,$t(a,o)){var l=e.interleaved;l===null?(r.next=r,rd(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}n=mm(t,e,r,s),n!==null&&(r=Je(),Wt(n,t,s,r),Im(n,e,s))}}function Lm(t){var e=t.alternate;return t===ye||e!==null&&e===ye}function Fm(t,e){_i=Fa=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Im(t,e,n){if(n&4194240){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,Uc(t,n)}}var Ia={readContext:Nt,useCallback:Be,useContext:Be,useEffect:Be,useImperativeHandle:Be,useInsertionEffect:Be,useLayoutEffect:Be,useMemo:Be,useReducer:Be,useRef:Be,useState:Be,useDebugValue:Be,useDeferredValue:Be,useTransition:Be,useMutableSource:Be,useSyncExternalStore:Be,useId:Be,unstable_isNewReconciler:!1},zv={readContext:Nt,useCallback:function(t,e){return Xt().memoizedState=[t,e===void 0?null:e],t},useContext:Nt,useEffect:Bh,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,la(4194308,4,Pm.bind(null,e,t),n)},useLayoutEffect:function(t,e){return la(4194308,4,t,e)},useInsertionEffect:function(t,e){return la(4,2,t,e)},useMemo:function(t,e){var n=Xt();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var s=Xt();return e=n!==void 0?n(e):e,s.memoizedState=s.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},s.queue=t,t=t.dispatch=Iv.bind(null,ye,t),[s.memoizedState,t]},useRef:function(t){var e=Xt();return t={current:t},e.memoizedState=t},useState:zh,useDebugValue:fd,useDeferredValue:function(t){return Xt().memoizedState=t},useTransition:function(){var t=zh(!1),e=t[0];return t=Fv.bind(null,t[1]),Xt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var s=ye,r=Xt();if(pe){if(n===void 0)throw Error(T(407));n=n()}else{if(n=e(),Oe===null)throw Error(T(349));zs&30||wm(s,e,n)}r.memoizedState=n;var i={value:n,getSnapshot:e};return r.queue=i,Bh(_m.bind(null,s,i,t),[t]),s.flags|=2048,Yi(9,km.bind(null,s,i,n,e),void 0,null),n},useId:function(){var t=Xt(),e=Oe.identifierPrefix;if(pe){var n=gn,s=pn;n=(s&~(1<<32-Bt(s)-1)).toString(32)+n,e=":"+e+"R"+n,n=Vi++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=Lv++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Bv={readContext:Nt,useCallback:Tm,useContext:Nt,useEffect:hd,useImperativeHandle:Mm,useInsertionEffect:Nm,useLayoutEffect:Em,useMemo:Rm,useReducer:Ql,useRef:jm,useState:function(){return Ql(Qi)},useDebugValue:fd,useDeferredValue:function(t){var e=Et();return Om(e,Ee.memoizedState,t)},useTransition:function(){var t=Ql(Qi)[0],e=Et().memoizedState;return[t,e]},useMutableSource:vm,useSyncExternalStore:bm,useId:Dm,unstable_isNewReconciler:!1},Wv={readContext:Nt,useCallback:Tm,useContext:Nt,useEffect:hd,useImperativeHandle:Mm,useInsertionEffect:Nm,useLayoutEffect:Em,useMemo:Rm,useReducer:Yl,useRef:jm,useState:function(){return Yl(Qi)},useDebugValue:fd,useDeferredValue:function(t){var e=Et();return Ee===null?e.memoizedState=t:Om(e,Ee.memoizedState,t)},useTransition:function(){var t=Yl(Qi)[0],e=Et().memoizedState;return[t,e]},useMutableSource:vm,useSyncExternalStore:bm,useId:Dm,unstable_isNewReconciler:!1};function Ot(t,e){if(t&&t.defaultProps){e=xe({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Qu(t,e,n,s){e=t.memoizedState,n=n(s,e),n=n==null?e:xe({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var cl={isMounted:function(t){return(t=t._reactInternals)?Qs(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var s=Je(),r=Jn(t),i=mn(s,r);i.payload=e,n!=null&&(i.callback=n),e=qn(t,i,r),e!==null&&(Wt(e,t,r,s),oa(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var s=Je(),r=Jn(t),i=mn(s,r);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=qn(t,i,r),e!==null&&(Wt(e,t,r,s),oa(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Je(),s=Jn(t),r=mn(n,s);r.tag=2,e!=null&&(r.callback=e),e=qn(t,r,s),e!==null&&(Wt(e,t,s,n),oa(e,t,s))}};function Wh(t,e,n,s,r,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,i,o):e.prototype&&e.prototype.isPureReactComponent?!zi(n,s)||!zi(r,i):!0}function Am(t,e,n){var s=!1,r=is,i=e.contextType;return typeof i=="object"&&i!==null?i=Nt(i):(r=lt(e)?Is:Qe.current,s=e.contextTypes,i=(s=s!=null)?Tr(t,r):is),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=cl,t.stateNode=e,e._reactInternals=t,s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=i),e}function $h(t,e,n,s){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,s),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,s),e.state!==t&&cl.enqueueReplaceState(e,e.state,null)}function Yu(t,e,n,s){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},id(t);var i=e.contextType;typeof i=="object"&&i!==null?r.context=Nt(i):(i=lt(e)?Is:Qe.current,r.context=Tr(t,i)),r.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Qu(t,e,i,n),r.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&cl.enqueueReplaceState(r,r.state,null),Da(t,n,r,s),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308)}function Lr(t,e){try{var n="",s=e;do n+=gx(s),s=s.return;while(s);var r=n}catch(i){r=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:t,source:e,stack:r,digest:null}}function Kl(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Ku(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var $v=typeof WeakMap=="function"?WeakMap:Map;function zm(t,e,n){n=mn(-1,n),n.tag=3,n.payload={element:null};var s=e.value;return n.callback=function(){za||(za=!0,rc=s),Ku(t,e)},n}function Bm(t,e,n){n=mn(-1,n),n.tag=3;var s=t.type.getDerivedStateFromError;if(typeof s=="function"){var r=e.value;n.payload=function(){return s(r)},n.callback=function(){Ku(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ku(t,e),typeof s!="function"&&(Gn===null?Gn=new Set([this]):Gn.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Hh(t,e,n){var s=t.pingCache;if(s===null){s=t.pingCache=new $v;var r=new Set;s.set(e,r)}else r=s.get(e),r===void 0&&(r=new Set,s.set(e,r));r.has(n)||(r.add(n),t=nb.bind(null,t,e,n),e.then(t,t))}function Uh(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Vh(t,e,n,s,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=mn(-1,1),e.tag=2,qn(n,e,1))),n.lanes|=1),t)}var Hv=_n.ReactCurrentOwner,ot=!1;function Ge(t,e,n,s){e.child=t===null?gm(e,null,n,s):Or(e,t.child,n,s)}function Qh(t,e,n,s,r){n=n.render;var i=e.ref;return fr(e,r),s=cd(t,e,n,s,i,r),n=dd(),t!==null&&!ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,wn(t,e,r)):(pe&&n&&Jc(e),e.flags|=1,Ge(t,e,s,r),e.child)}function Yh(t,e,n,s,r){if(t===null){var i=n.type;return typeof i=="function"&&!wd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,Wm(t,e,i,s,r)):(t=ha(n.type,null,s,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&r)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:zi,n(o,s)&&t.ref===e.ref)return wn(t,e,r)}return e.flags|=1,t=Zn(i,s),t.ref=e.ref,t.return=e,e.child=t}function Wm(t,e,n,s,r){if(t!==null){var i=t.memoizedProps;if(zi(i,s)&&t.ref===e.ref)if(ot=!1,e.pendingProps=s=i,(t.lanes&r)!==0)t.flags&131072&&(ot=!0);else return e.lanes=t.lanes,wn(t,e,r)}return Xu(t,e,n,s,r)}function $m(t,e,n){var s=e.pendingProps,r=s.children,i=t!==null?t.memoizedState:null;if(s.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(ar,ct),ct|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ue(ar,ct),ct|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,ue(ar,ct),ct|=s}else i!==null?(s=i.baseLanes|n,e.memoizedState=null):s=n,ue(ar,ct),ct|=s;return Ge(t,e,r,n),e.child}function Hm(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Xu(t,e,n,s,r){var i=lt(n)?Is:Qe.current;return i=Tr(e,i),fr(e,r),n=cd(t,e,n,s,i,r),s=dd(),t!==null&&!ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,wn(t,e,r)):(pe&&s&&Jc(e),e.flags|=1,Ge(t,e,n,r),e.child)}function Kh(t,e,n,s,r){if(lt(n)){var i=!0;Pa(e)}else i=!1;if(fr(e,r),e.stateNode===null)ua(t,e),Am(e,n,s),Yu(e,n,s,r),s=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Nt(u):(u=lt(n)?Is:Qe.current,u=Tr(e,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==s||l!==u)&&$h(e,o,s,u),Mn=!1;var f=e.memoizedState;o.state=f,Da(e,s,o,r),l=e.memoizedState,a!==s||f!==l||at.current||Mn?(typeof d=="function"&&(Qu(e,n,d,s),l=e.memoizedState),(a=Mn||Wh(e,n,a,s,f,l,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=s,e.memoizedState=l),o.props=s,o.state=l,o.context=u,s=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),s=!1)}else{o=e.stateNode,ym(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Ot(e.type,a),o.props=u,h=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Nt(l):(l=lt(n)?Is:Qe.current,l=Tr(e,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&$h(e,o,s,l),Mn=!1,f=e.memoizedState,o.state=f,Da(e,s,o,r);var x=e.memoizedState;a!==h||f!==x||at.current||Mn?(typeof p=="function"&&(Qu(e,n,p,s),x=e.memoizedState),(u=Mn||Wh(e,n,u,s,f,x,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,x,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,x,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=s,e.memoizedState=x),o.props=s,o.state=x,o.context=l,s=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),s=!1)}return qu(t,e,n,s,i,r)}function qu(t,e,n,s,r,i){Hm(t,e);var o=(e.flags&128)!==0;if(!s&&!o)return r&&Oh(e,n,!1),wn(t,e,i);s=e.stateNode,Hv.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return e.flags|=1,t!==null&&o?(e.child=Or(e,t.child,null,i),e.child=Or(e,null,a,i)):Ge(t,e,a,i),e.memoizedState=s.state,r&&Oh(e,n,!0),e.child}function Um(t){var e=t.stateNode;e.pendingContext?Rh(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Rh(t,e.context,!1),od(t,e.containerInfo)}function Xh(t,e,n,s,r){return Rr(),ed(r),e.flags|=256,Ge(t,e,n,s),e.child}var Gu={dehydrated:null,treeContext:null,retryLane:0};function Ju(t){return{baseLanes:t,cachePool:null,transitions:null}}function Vm(t,e,n){var s=e.pendingProps,r=me.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(r&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(r|=1),ue(me,r&1),t===null)return Uu(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=s.children,t=s.fallback,i?(s=e.mode,i=e.child,o={mode:"hidden",children:o},!(s&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=fl(o,s,0,null),t=Ls(t,s,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Ju(n),e.memoizedState=Gu,t):pd(e,o));if(r=t.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Uv(t,e,o,s,a,r,n);if(i){i=s.fallback,o=e.mode,r=t.child,a=r.sibling;var l={mode:"hidden",children:s.children};return!(o&1)&&e.child!==r?(s=e.child,s.childLanes=0,s.pendingProps=l,e.deletions=null):(s=Zn(r,l),s.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=Zn(a,i):(i=Ls(i,o,n,null),i.flags|=2),i.return=e,s.return=e,s.sibling=i,e.child=s,s=i,i=e.child,o=t.child.memoizedState,o=o===null?Ju(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=Gu,s}return i=t.child,t=i.sibling,s=Zn(i,{mode:"visible",children:s.children}),!(e.mode&1)&&(s.lanes=n),s.return=e,s.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=s,e.memoizedState=null,s}function pd(t,e){return e=fl({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Io(t,e,n,s){return s!==null&&ed(s),Or(e,t.child,null,n),t=pd(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Uv(t,e,n,s,r,i,o){if(n)return e.flags&256?(e.flags&=-257,s=Kl(Error(T(422))),Io(t,e,o,s)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=s.fallback,r=e.mode,s=fl({mode:"visible",children:s.children},r,0,null),i=Ls(i,r,o,null),i.flags|=2,s.return=e,i.return=e,s.sibling=i,e.child=s,e.mode&1&&Or(e,t.child,null,o),e.child.memoizedState=Ju(o),e.memoizedState=Gu,i);if(!(e.mode&1))return Io(t,e,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var a=s.dgst;return s=a,i=Error(T(419)),s=Kl(i,s,void 0),Io(t,e,o,s)}if(a=(o&t.childLanes)!==0,ot||a){if(s=Oe,s!==null){switch(o&-o){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(s.suspendedLanes|o)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,bn(t,r),Wt(s,t,r,-1))}return bd(),s=Kl(Error(T(421))),Io(t,e,o,s)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=sb.bind(null,t),r._reactRetry=e,null):(t=i.treeContext,dt=Xn(r.nextSibling),ft=e,pe=!0,It=null,t!==null&&(kt[_t++]=pn,kt[_t++]=gn,kt[_t++]=As,pn=t.id,gn=t.overflow,As=e),e=pd(e,s.children),e.flags|=4096,e)}function qh(t,e,n){t.lanes|=e;var s=t.alternate;s!==null&&(s.lanes|=e),Vu(t.return,e,n)}function Xl(t,e,n,s,r){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=r)}function Qm(t,e,n){var s=e.pendingProps,r=s.revealOrder,i=s.tail;if(Ge(t,e,s.children,n),s=me.current,s&2)s=s&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qh(t,n,e);else if(t.tag===19)qh(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}s&=1}if(ue(me,s),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&La(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Xl(e,!1,r,n,i);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&La(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Xl(e,!0,n,null,i);break;case"together":Xl(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ua(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function wn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Bs|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(T(153));if(e.child!==null){for(t=e.child,n=Zn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Zn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Vv(t,e,n){switch(e.tag){case 3:Um(e),Rr();break;case 5:xm(e);break;case 1:lt(e.type)&&Pa(e);break;case 4:od(e,e.stateNode.containerInfo);break;case 10:var s=e.type._context,r=e.memoizedProps.value;ue(Ra,s._currentValue),s._currentValue=r;break;case 13:if(s=e.memoizedState,s!==null)return s.dehydrated!==null?(ue(me,me.current&1),e.flags|=128,null):n&e.child.childLanes?Vm(t,e,n):(ue(me,me.current&1),t=wn(t,e,n),t!==null?t.sibling:null);ue(me,me.current&1);break;case 19:if(s=(n&e.childLanes)!==0,t.flags&128){if(s)return Qm(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ue(me,me.current),s)break;return null;case 22:case 23:return e.lanes=0,$m(t,e,n)}return wn(t,e,n)}var Ym,Zu,Km,Xm;Ym=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Zu=function(){};Km=function(t,e,n,s){var r=t.memoizedProps;if(r!==s){t=e.stateNode,ks(nn.current);var i=null;switch(n){case"input":r=wu(t,r),s=wu(t,s),i=[];break;case"select":r=xe({},r,{value:void 0}),s=xe({},s,{value:void 0}),i=[];break;case"textarea":r=Su(t,r),s=Su(t,s),i=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(t.onclick=Na)}ju(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ri.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in s){var l=s[u];if(a=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ri.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&de("scroll",t),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};Xm=function(t,e,n,s){n!==s&&(e.flags|=4)};function Zr(t,e){if(!pe)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function We(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,s=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&14680064,s|=r.flags&14680064,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=s,t.childLanes=n,e}function Qv(t,e,n){var s=e.pendingProps;switch(Zc(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(e),null;case 1:return lt(e.type)&&Ea(),We(e),null;case 3:return s=e.stateNode,Dr(),fe(at),fe(Qe),ld(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Lo(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,It!==null&&(ac(It),It=null))),Zu(t,e),We(e),null;case 5:ad(e);var r=ks(Ui.current);if(n=e.type,t!==null&&e.stateNode!=null)Km(t,e,n,s,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!s){if(e.stateNode===null)throw Error(T(166));return We(e),null}if(t=ks(nn.current),Lo(e)){s=e.stateNode,n=e.type;var i=e.memoizedProps;switch(s[en]=e,s[$i]=i,t=(e.mode&1)!==0,n){case"dialog":de("cancel",s),de("close",s);break;case"iframe":case"object":case"embed":de("load",s);break;case"video":case"audio":for(r=0;r<hi.length;r++)de(hi[r],s);break;case"source":de("error",s);break;case"img":case"image":case"link":de("error",s),de("load",s);break;case"details":de("toggle",s);break;case"input":ih(s,i),de("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},de("invalid",s);break;case"textarea":ah(s,i),de("invalid",s)}ju(n,i),r=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?s.textContent!==a&&(i.suppressHydrationWarning!==!0&&Do(s.textContent,a,t),r=["children",a]):typeof a=="number"&&s.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Do(s.textContent,a,t),r=["children",""+a]):Ri.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&de("scroll",s)}switch(n){case"input":jo(s),oh(s,i,!0);break;case"textarea":jo(s),lh(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=Na)}s=r,e.updateQueue=s,s!==null&&(e.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=_g(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof s.is=="string"?t=o.createElement(n,{is:s.is}):(t=o.createElement(n),n==="select"&&(o=t,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):t=o.createElementNS(t,n),t[en]=e,t[$i]=s,Ym(t,e,!1,!1),e.stateNode=t;e:{switch(o=Nu(n,s),n){case"dialog":de("cancel",t),de("close",t),r=s;break;case"iframe":case"object":case"embed":de("load",t),r=s;break;case"video":case"audio":for(r=0;r<hi.length;r++)de(hi[r],t);r=s;break;case"source":de("error",t),r=s;break;case"img":case"image":case"link":de("error",t),de("load",t),r=s;break;case"details":de("toggle",t),r=s;break;case"input":ih(t,s),r=wu(t,s),de("invalid",t);break;case"option":r=s;break;case"select":t._wrapperState={wasMultiple:!!s.multiple},r=xe({},s,{value:void 0}),de("invalid",t);break;case"textarea":ah(t,s),r=Su(t,s),de("invalid",t);break;default:r=s}ju(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?jg(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Sg(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Oi(t,l):typeof l=="number"&&Oi(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ri.hasOwnProperty(i)?l!=null&&i==="onScroll"&&de("scroll",t):l!=null&&Ac(t,i,l,o))}switch(n){case"input":jo(t),oh(t,s,!1);break;case"textarea":jo(t),lh(t);break;case"option":s.value!=null&&t.setAttribute("value",""+rs(s.value));break;case"select":t.multiple=!!s.multiple,i=s.value,i!=null?ur(t,!!s.multiple,i,!1):s.defaultValue!=null&&ur(t,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(t.onclick=Na)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return We(e),null;case 6:if(t&&e.stateNode!=null)Xm(t,e,t.memoizedProps,s);else{if(typeof s!="string"&&e.stateNode===null)throw Error(T(166));if(n=ks(Ui.current),ks(nn.current),Lo(e)){if(s=e.stateNode,n=e.memoizedProps,s[en]=e,(i=s.nodeValue!==n)&&(t=ft,t!==null))switch(t.tag){case 3:Do(s.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Do(s.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[en]=e,e.stateNode=s}return We(e),null;case 13:if(fe(me),s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(pe&&dt!==null&&e.mode&1&&!(e.flags&128))fm(),Rr(),e.flags|=98560,i=!1;else if(i=Lo(e),s!==null&&s.dehydrated!==null){if(t===null){if(!i)throw Error(T(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(T(317));i[en]=e}else Rr(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;We(e),i=!1}else It!==null&&(ac(It),It=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(s=s!==null,s!==(t!==null&&t.memoizedState!==null)&&s&&(e.child.flags|=8192,e.mode&1&&(t===null||me.current&1?Me===0&&(Me=3):bd())),e.updateQueue!==null&&(e.flags|=4),We(e),null);case 4:return Dr(),Zu(t,e),t===null&&Bi(e.stateNode.containerInfo),We(e),null;case 10:return sd(e.type._context),We(e),null;case 17:return lt(e.type)&&Ea(),We(e),null;case 19:if(fe(me),i=e.memoizedState,i===null)return We(e),null;if(s=(e.flags&128)!==0,o=i.rendering,o===null)if(s)Zr(i,!1);else{if(Me!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=La(t),o!==null){for(e.flags|=128,Zr(i,!1),s=o.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),e.subtreeFlags=0,s=n,n=e.child;n!==null;)i=n,t=s,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return ue(me,me.current&1|2),e.child}t=t.sibling}i.tail!==null&&_e()>Fr&&(e.flags|=128,s=!0,Zr(i,!1),e.lanes=4194304)}else{if(!s)if(t=La(o),t!==null){if(e.flags|=128,s=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Zr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!pe)return We(e),null}else 2*_e()-i.renderingStartTime>Fr&&n!==1073741824&&(e.flags|=128,s=!0,Zr(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_e(),e.sibling=null,n=me.current,ue(me,s?n&1|2:n&1),e):(We(e),null);case 22:case 23:return vd(),s=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==s&&(e.flags|=8192),s&&e.mode&1?ct&1073741824&&(We(e),e.subtreeFlags&6&&(e.flags|=8192)):We(e),null;case 24:return null;case 25:return null}throw Error(T(156,e.tag))}function Yv(t,e){switch(Zc(e),e.tag){case 1:return lt(e.type)&&Ea(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Dr(),fe(at),fe(Qe),ld(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return ad(e),null;case 13:if(fe(me),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(T(340));Rr()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return fe(me),null;case 4:return Dr(),null;case 10:return sd(e.type._context),null;case 22:case 23:return vd(),null;case 24:return null;default:return null}}var Ao=!1,He=!1,Kv=typeof WeakSet=="function"?WeakSet:Set,I=null;function or(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){we(t,e,s)}else n.current=null}function ec(t,e,n){try{n()}catch(s){we(t,e,s)}}var Gh=!1;function Xv(t,e){if(Iu=Sa,t=em(),Gc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==n||r!==0&&h.nodeType!==3||(a=o+r),h!==i||s!==0&&h.nodeType!==3||(l=o+s),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++u===r&&(a=o),f===i&&++d===s&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Au={focusedElem:t,selectionRange:n},Sa=!1,I=e;I!==null;)if(e=I,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,I=t;else for(;I!==null;){e=I;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var m=x.memoizedProps,b=x.memoizedState,g=e.stateNode,y=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:Ot(e.type,m),b);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=e.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(T(163))}}catch(w){we(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,I=t;break}I=e.return}return x=Gh,Gh=!1,x}function Si(t,e,n){var s=e.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&t)===t){var i=r.destroy;r.destroy=void 0,i!==void 0&&ec(e,n,i)}r=r.next}while(r!==s)}}function dl(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var s=n.create;n.destroy=s()}n=n.next}while(n!==e)}}function tc(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function qm(t){var e=t.alternate;e!==null&&(t.alternate=null,qm(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[en],delete e[$i],delete e[Wu],delete e[Tv],delete e[Rv])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Gm(t){return t.tag===5||t.tag===3||t.tag===4}function Jh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function nc(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Na));else if(s!==4&&(t=t.child,t!==null))for(nc(t,e,n),t=t.sibling;t!==null;)nc(t,e,n),t=t.sibling}function sc(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(s!==4&&(t=t.child,t!==null))for(sc(t,e,n),t=t.sibling;t!==null;)sc(t,e,n),t=t.sibling}var Le=null,Ft=!1;function Cn(t,e,n){for(n=n.child;n!==null;)Jm(t,e,n),n=n.sibling}function Jm(t,e,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(sl,n)}catch{}switch(n.tag){case 5:He||or(n,e);case 6:var s=Le,r=Ft;Le=null,Cn(t,e,n),Le=s,Ft=r,Le!==null&&(Ft?(t=Le,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Le.removeChild(n.stateNode));break;case 18:Le!==null&&(Ft?(t=Le,n=n.stateNode,t.nodeType===8?$l(t.parentNode,n):t.nodeType===1&&$l(t,n),Ii(t)):$l(Le,n.stateNode));break;case 4:s=Le,r=Ft,Le=n.stateNode.containerInfo,Ft=!0,Cn(t,e,n),Le=s,Ft=r;break;case 0:case 11:case 14:case 15:if(!He&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var i=r,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&ec(n,e,o),r=r.next}while(r!==s)}Cn(t,e,n);break;case 1:if(!He&&(or(n,e),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(a){we(n,e,a)}Cn(t,e,n);break;case 21:Cn(t,e,n);break;case 22:n.mode&1?(He=(s=He)||n.memoizedState!==null,Cn(t,e,n),He=s):Cn(t,e,n);break;default:Cn(t,e,n)}}function Zh(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Kv),e.forEach(function(s){var r=rb.bind(null,t,s);n.has(s)||(n.add(s),s.then(r,r))})}}function Rt(t,e){var n=e.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Le=a.stateNode,Ft=!1;break e;case 3:Le=a.stateNode.containerInfo,Ft=!0;break e;case 4:Le=a.stateNode.containerInfo,Ft=!0;break e}a=a.return}if(Le===null)throw Error(T(160));Jm(i,o,r),Le=null,Ft=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){we(r,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Zm(e,t),e=e.sibling}function Zm(t,e){var n=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Rt(e,t),Qt(t),s&4){try{Si(3,t,t.return),dl(3,t)}catch(m){we(t,t.return,m)}try{Si(5,t,t.return)}catch(m){we(t,t.return,m)}}break;case 1:Rt(e,t),Qt(t),s&512&&n!==null&&or(n,n.return);break;case 5:if(Rt(e,t),Qt(t),s&512&&n!==null&&or(n,n.return),t.flags&32){var r=t.stateNode;try{Oi(r,"")}catch(m){we(t,t.return,m)}}if(s&4&&(r=t.stateNode,r!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&wg(r,i),Nu(a,o);var u=Nu(a,i);for(o=0;o<l.length;o+=2){var d=l[o],h=l[o+1];d==="style"?jg(r,h):d==="dangerouslySetInnerHTML"?Sg(r,h):d==="children"?Oi(r,h):Ac(r,d,h,u)}switch(a){case"input":ku(r,i);break;case"textarea":kg(r,i);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ur(r,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?ur(r,!!i.multiple,i.defaultValue,!0):ur(r,!!i.multiple,i.multiple?[]:"",!1))}r[$i]=i}catch(m){we(t,t.return,m)}}break;case 6:if(Rt(e,t),Qt(t),s&4){if(t.stateNode===null)throw Error(T(162));r=t.stateNode,i=t.memoizedProps;try{r.nodeValue=i}catch(m){we(t,t.return,m)}}break;case 3:if(Rt(e,t),Qt(t),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Ii(e.containerInfo)}catch(m){we(t,t.return,m)}break;case 4:Rt(e,t),Qt(t);break;case 13:Rt(e,t),Qt(t),r=t.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(yd=_e())),s&4&&Zh(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(He=(u=He)||d,Rt(e,t),He=u):Rt(e,t),Qt(t),s&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(I=t,d=t.child;d!==null;){for(h=I=d;I!==null;){switch(f=I,p=f.child,f.tag){case 0:case 11:case 14:case 15:Si(4,f,f.return);break;case 1:or(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){s=f,n=f.return;try{e=s,x.props=e.memoizedProps,x.state=e.memoizedState,x.componentWillUnmount()}catch(m){we(s,n,m)}}break;case 5:or(f,f.return);break;case 22:if(f.memoizedState!==null){tf(h);continue}}p!==null?(p.return=f,I=p):tf(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{r=h.stateNode,u?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Cg("display",o))}catch(m){we(t,t.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){we(t,t.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Rt(e,t),Qt(t),s&4&&Zh(t);break;case 21:break;default:Rt(e,t),Qt(t)}}function Qt(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Gm(n)){var s=n;break e}n=n.return}throw Error(T(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Oi(r,""),s.flags&=-33);var i=Jh(t);sc(t,i,r);break;case 3:case 4:var o=s.stateNode.containerInfo,a=Jh(t);nc(t,a,o);break;default:throw Error(T(161))}}catch(l){we(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function qv(t,e,n){I=t,e0(t)}function e0(t,e,n){for(var s=(t.mode&1)!==0;I!==null;){var r=I,i=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||Ao;if(!o){var a=r.alternate,l=a!==null&&a.memoizedState!==null||He;a=Ao;var u=He;if(Ao=o,(He=l)&&!u)for(I=r;I!==null;)o=I,l=o.child,o.tag===22&&o.memoizedState!==null?nf(r):l!==null?(l.return=o,I=l):nf(r);for(;i!==null;)I=i,e0(i),i=i.sibling;I=r,Ao=a,He=u}ef(t)}else r.subtreeFlags&8772&&i!==null?(i.return=r,I=i):ef(t)}}function ef(t){for(;I!==null;){var e=I;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:He||dl(5,e);break;case 1:var s=e.stateNode;if(e.flags&4&&!He)if(n===null)s.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:Ot(e.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Ah(e,i,s);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Ah(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&Ii(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(T(163))}He||e.flags&512&&tc(e)}catch(f){we(e,e.return,f)}}if(e===t){I=null;break}if(n=e.sibling,n!==null){n.return=e.return,I=n;break}I=e.return}}function tf(t){for(;I!==null;){var e=I;if(e===t){I=null;break}var n=e.sibling;if(n!==null){n.return=e.return,I=n;break}I=e.return}}function nf(t){for(;I!==null;){var e=I;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{dl(4,e)}catch(l){we(e,n,l)}break;case 1:var s=e.stateNode;if(typeof s.componentDidMount=="function"){var r=e.return;try{s.componentDidMount()}catch(l){we(e,r,l)}}var i=e.return;try{tc(e)}catch(l){we(e,i,l)}break;case 5:var o=e.return;try{tc(e)}catch(l){we(e,o,l)}}}catch(l){we(e,e.return,l)}if(e===t){I=null;break}var a=e.sibling;if(a!==null){a.return=e.return,I=a;break}I=e.return}}var Gv=Math.ceil,Aa=_n.ReactCurrentDispatcher,gd=_n.ReactCurrentOwner,jt=_n.ReactCurrentBatchConfig,G=0,Oe=null,Ne=null,Ie=0,ct=0,ar=us(0),Me=0,Ki=null,Bs=0,hl=0,md=0,Ci=null,rt=null,yd=0,Fr=1/0,un=null,za=!1,rc=null,Gn=null,zo=!1,$n=null,Ba=0,ji=0,ic=null,ca=-1,da=0;function Je(){return G&6?_e():ca!==-1?ca:ca=_e()}function Jn(t){return t.mode&1?G&2&&Ie!==0?Ie&-Ie:Dv.transition!==null?(da===0&&(da=Ag()),da):(t=ie,t!==0||(t=window.event,t=t===void 0?16:Vg(t.type)),t):1}function Wt(t,e,n,s){if(50<ji)throw ji=0,ic=null,Error(T(185));co(t,n,s),(!(G&2)||t!==Oe)&&(t===Oe&&(!(G&2)&&(hl|=n),Me===4&&Rn(t,Ie)),ut(t,s),n===1&&G===0&&!(e.mode&1)&&(Fr=_e()+500,ll&&cs()))}function ut(t,e){var n=t.callbackNode;Dx(t,e);var s=_a(t,t===Oe?Ie:0);if(s===0)n!==null&&dh(n),t.callbackNode=null,t.callbackPriority=0;else if(e=s&-s,t.callbackPriority!==e){if(n!=null&&dh(n),e===1)t.tag===0?Ov(sf.bind(null,t)):cm(sf.bind(null,t)),Pv(function(){!(G&6)&&cs()}),n=null;else{switch(zg(s)){case 1:n=Hc;break;case 4:n=Fg;break;case 16:n=ka;break;case 536870912:n=Ig;break;default:n=ka}n=l0(n,t0.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function t0(t,e){if(ca=-1,da=0,G&6)throw Error(T(327));var n=t.callbackNode;if(pr()&&t.callbackNode!==n)return null;var s=_a(t,t===Oe?Ie:0);if(s===0)return null;if(s&30||s&t.expiredLanes||e)e=Wa(t,s);else{e=s;var r=G;G|=2;var i=s0();(Oe!==t||Ie!==e)&&(un=null,Fr=_e()+500,Ds(t,e));do try{eb();break}catch(a){n0(t,a)}while(!0);nd(),Aa.current=i,G=r,Ne!==null?e=0:(Oe=null,Ie=0,e=Me)}if(e!==0){if(e===2&&(r=Ru(t),r!==0&&(s=r,e=oc(t,r))),e===1)throw n=Ki,Ds(t,0),Rn(t,s),ut(t,_e()),n;if(e===6)Rn(t,s);else{if(r=t.current.alternate,!(s&30)&&!Jv(r)&&(e=Wa(t,s),e===2&&(i=Ru(t),i!==0&&(s=i,e=oc(t,i))),e===1))throw n=Ki,Ds(t,0),Rn(t,s),ut(t,_e()),n;switch(t.finishedWork=r,t.finishedLanes=s,e){case 0:case 1:throw Error(T(345));case 2:ys(t,rt,un);break;case 3:if(Rn(t,s),(s&130023424)===s&&(e=yd+500-_e(),10<e)){if(_a(t,0)!==0)break;if(r=t.suspendedLanes,(r&s)!==s){Je(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=Bu(ys.bind(null,t,rt,un),e);break}ys(t,rt,un);break;case 4:if(Rn(t,s),(s&4194240)===s)break;for(e=t.eventTimes,r=-1;0<s;){var o=31-Bt(s);i=1<<o,o=e[o],o>r&&(r=o),s&=~i}if(s=r,s=_e()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Gv(s/1960))-s,10<s){t.timeoutHandle=Bu(ys.bind(null,t,rt,un),s);break}ys(t,rt,un);break;case 5:ys(t,rt,un);break;default:throw Error(T(329))}}}return ut(t,_e()),t.callbackNode===n?t0.bind(null,t):null}function oc(t,e){var n=Ci;return t.current.memoizedState.isDehydrated&&(Ds(t,e).flags|=256),t=Wa(t,e),t!==2&&(e=rt,rt=n,e!==null&&ac(e)),t}function ac(t){rt===null?rt=t:rt.push.apply(rt,t)}function Jv(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!$t(i(),r))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Rn(t,e){for(e&=~md,e&=~hl,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Bt(e),s=1<<n;t[n]=-1,e&=~s}}function sf(t){if(G&6)throw Error(T(327));pr();var e=_a(t,0);if(!(e&1))return ut(t,_e()),null;var n=Wa(t,e);if(t.tag!==0&&n===2){var s=Ru(t);s!==0&&(e=s,n=oc(t,s))}if(n===1)throw n=Ki,Ds(t,0),Rn(t,e),ut(t,_e()),n;if(n===6)throw Error(T(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ys(t,rt,un),ut(t,_e()),null}function xd(t,e){var n=G;G|=1;try{return t(e)}finally{G=n,G===0&&(Fr=_e()+500,ll&&cs())}}function Ws(t){$n!==null&&$n.tag===0&&!(G&6)&&pr();var e=G;G|=1;var n=jt.transition,s=ie;try{if(jt.transition=null,ie=1,t)return t()}finally{ie=s,jt.transition=n,G=e,!(G&6)&&cs()}}function vd(){ct=ar.current,fe(ar)}function Ds(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Ev(n)),Ne!==null)for(n=Ne.return;n!==null;){var s=n;switch(Zc(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Ea();break;case 3:Dr(),fe(at),fe(Qe),ld();break;case 5:ad(s);break;case 4:Dr();break;case 13:fe(me);break;case 19:fe(me);break;case 10:sd(s.type._context);break;case 22:case 23:vd()}n=n.return}if(Oe=t,Ne=t=Zn(t.current,null),Ie=ct=e,Me=0,Ki=null,md=hl=Bs=0,rt=Ci=null,ws!==null){for(e=0;e<ws.length;e++)if(n=ws[e],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,i=n.pending;if(i!==null){var o=i.next;i.next=r,s.next=o}n.pending=s}ws=null}return t}function n0(t,e){do{var n=Ne;try{if(nd(),aa.current=Ia,Fa){for(var s=ye.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Fa=!1}if(zs=0,Re=Ee=ye=null,_i=!1,Vi=0,gd.current=null,n===null||n.return===null){Me=1,Ki=e,Ne=null;break}e:{var i=t,o=n.return,a=n,l=e;if(e=Ie,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Uh(o);if(p!==null){p.flags&=-257,Vh(p,o,a,i,e),p.mode&1&&Hh(i,u,e),e=p,l=u;var x=e.updateQueue;if(x===null){var m=new Set;m.add(l),e.updateQueue=m}else x.add(l);break e}else{if(!(e&1)){Hh(i,u,e),bd();break e}l=Error(T(426))}}else if(pe&&a.mode&1){var b=Uh(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Vh(b,o,a,i,e),ed(Lr(l,a));break e}}i=l=Lr(l,a),Me!==4&&(Me=2),Ci===null?Ci=[i]:Ci.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var g=zm(i,l,e);Ih(i,g);break e;case 1:a=l;var y=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Gn===null||!Gn.has(v)))){i.flags|=65536,e&=-e,i.lanes|=e;var w=Bm(i,a,e);Ih(i,w);break e}}i=i.return}while(i!==null)}i0(n)}catch(j){e=j,Ne===n&&n!==null&&(Ne=n=n.return);continue}break}while(!0)}function s0(){var t=Aa.current;return Aa.current=Ia,t===null?Ia:t}function bd(){(Me===0||Me===3||Me===2)&&(Me=4),Oe===null||!(Bs&268435455)&&!(hl&268435455)||Rn(Oe,Ie)}function Wa(t,e){var n=G;G|=2;var s=s0();(Oe!==t||Ie!==e)&&(un=null,Ds(t,e));do try{Zv();break}catch(r){n0(t,r)}while(!0);if(nd(),G=n,Aa.current=s,Ne!==null)throw Error(T(261));return Oe=null,Ie=0,Me}function Zv(){for(;Ne!==null;)r0(Ne)}function eb(){for(;Ne!==null&&!Cx();)r0(Ne)}function r0(t){var e=a0(t.alternate,t,ct);t.memoizedProps=t.pendingProps,e===null?i0(t):Ne=e,gd.current=null}function i0(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Yv(n,e),n!==null){n.flags&=32767,Ne=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Me=6,Ne=null;return}}else if(n=Qv(n,e,ct),n!==null){Ne=n;return}if(e=e.sibling,e!==null){Ne=e;return}Ne=e=t}while(e!==null);Me===0&&(Me=5)}function ys(t,e,n){var s=ie,r=jt.transition;try{jt.transition=null,ie=1,tb(t,e,n,s)}finally{jt.transition=r,ie=s}return null}function tb(t,e,n,s){do pr();while($n!==null);if(G&6)throw Error(T(327));n=t.finishedWork;var r=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(T(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(Lx(t,i),t===Oe&&(Ne=Oe=null,Ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||zo||(zo=!0,l0(ka,function(){return pr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=jt.transition,jt.transition=null;var o=ie;ie=1;var a=G;G|=4,gd.current=null,Xv(t,n),Zm(n,t),wv(Au),Sa=!!Iu,Au=Iu=null,t.current=n,qv(n),jx(),G=a,ie=o,jt.transition=i}else t.current=n;if(zo&&(zo=!1,$n=t,Ba=r),i=t.pendingLanes,i===0&&(Gn=null),Px(n.stateNode),ut(t,_e()),e!==null)for(s=t.onRecoverableError,n=0;n<e.length;n++)r=e[n],s(r.value,{componentStack:r.stack,digest:r.digest});if(za)throw za=!1,t=rc,rc=null,t;return Ba&1&&t.tag!==0&&pr(),i=t.pendingLanes,i&1?t===ic?ji++:(ji=0,ic=t):ji=0,cs(),null}function pr(){if($n!==null){var t=zg(Ba),e=jt.transition,n=ie;try{if(jt.transition=null,ie=16>t?16:t,$n===null)var s=!1;else{if(t=$n,$n=null,Ba=0,G&6)throw Error(T(331));var r=G;for(G|=4,I=t.current;I!==null;){var i=I,o=i.child;if(I.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(I=u;I!==null;){var d=I;switch(d.tag){case 0:case 11:case 15:Si(8,d,i)}var h=d.child;if(h!==null)h.return=d,I=h;else for(;I!==null;){d=I;var f=d.sibling,p=d.return;if(qm(d),d===u){I=null;break}if(f!==null){f.return=p,I=f;break}I=p}}}var x=i.alternate;if(x!==null){var m=x.child;if(m!==null){x.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(m!==null)}}I=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,I=o;else e:for(;I!==null;){if(i=I,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Si(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,I=g;break e}I=i.return}}var y=t.current;for(I=y;I!==null;){o=I;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,I=v;else e:for(o=y;I!==null;){if(a=I,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:dl(9,a)}}catch(j){we(a,a.return,j)}if(a===o){I=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,I=w;break e}I=a.return}}if(G=r,cs(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(sl,t)}catch{}s=!0}return s}finally{ie=n,jt.transition=e}}return!1}function rf(t,e,n){e=Lr(n,e),e=zm(t,e,1),t=qn(t,e,1),e=Je(),t!==null&&(co(t,1,e),ut(t,e))}function we(t,e,n){if(t.tag===3)rf(t,t,n);else for(;e!==null;){if(e.tag===3){rf(e,t,n);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Gn===null||!Gn.has(s))){t=Lr(n,t),t=Bm(e,t,1),e=qn(e,t,1),t=Je(),e!==null&&(co(e,1,t),ut(e,t));break}}e=e.return}}function nb(t,e,n){var s=t.pingCache;s!==null&&s.delete(e),e=Je(),t.pingedLanes|=t.suspendedLanes&n,Oe===t&&(Ie&n)===n&&(Me===4||Me===3&&(Ie&130023424)===Ie&&500>_e()-yd?Ds(t,0):md|=n),ut(t,e)}function o0(t,e){e===0&&(t.mode&1?(e=Po,Po<<=1,!(Po&130023424)&&(Po=4194304)):e=1);var n=Je();t=bn(t,e),t!==null&&(co(t,e,n),ut(t,n))}function sb(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),o0(t,n)}function rb(t,e){var n=0;switch(t.tag){case 13:var s=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=t.stateNode;break;default:throw Error(T(314))}s!==null&&s.delete(e),o0(t,n)}var a0;a0=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||at.current)ot=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ot=!1,Vv(t,e,n);ot=!!(t.flags&131072)}else ot=!1,pe&&e.flags&1048576&&dm(e,Ta,e.index);switch(e.lanes=0,e.tag){case 2:var s=e.type;ua(t,e),t=e.pendingProps;var r=Tr(e,Qe.current);fr(e,n),r=cd(null,e,s,t,r,n);var i=dd();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,lt(s)?(i=!0,Pa(e)):i=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,id(e),r.updater=cl,e.stateNode=r,r._reactInternals=e,Yu(e,s,t,n),e=qu(null,e,s,!0,i,n)):(e.tag=0,pe&&i&&Jc(e),Ge(null,e,r,n),e=e.child),e;case 16:s=e.elementType;e:{switch(ua(t,e),t=e.pendingProps,r=s._init,s=r(s._payload),e.type=s,r=e.tag=ob(s),t=Ot(s,t),r){case 0:e=Xu(null,e,s,t,n);break e;case 1:e=Kh(null,e,s,t,n);break e;case 11:e=Qh(null,e,s,t,n);break e;case 14:e=Yh(null,e,s,Ot(s.type,t),n);break e}throw Error(T(306,s,""))}return e;case 0:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),Xu(t,e,s,r,n);case 1:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),Kh(t,e,s,r,n);case 3:e:{if(Um(e),t===null)throw Error(T(387));s=e.pendingProps,i=e.memoizedState,r=i.element,ym(t,e),Da(e,s,null,n);var o=e.memoizedState;if(s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){r=Lr(Error(T(423)),e),e=Xh(t,e,s,n,r);break e}else if(s!==r){r=Lr(Error(T(424)),e),e=Xh(t,e,s,n,r);break e}else for(dt=Xn(e.stateNode.containerInfo.firstChild),ft=e,pe=!0,It=null,n=gm(e,null,s,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Rr(),s===r){e=wn(t,e,n);break e}Ge(t,e,s,n)}e=e.child}return e;case 5:return xm(e),t===null&&Uu(e),s=e.type,r=e.pendingProps,i=t!==null?t.memoizedProps:null,o=r.children,zu(s,r)?o=null:i!==null&&zu(s,i)&&(e.flags|=32),Hm(t,e),Ge(t,e,o,n),e.child;case 6:return t===null&&Uu(e),null;case 13:return Vm(t,e,n);case 4:return od(e,e.stateNode.containerInfo),s=e.pendingProps,t===null?e.child=Or(e,null,s,n):Ge(t,e,s,n),e.child;case 11:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),Qh(t,e,s,r,n);case 7:return Ge(t,e,e.pendingProps,n),e.child;case 8:return Ge(t,e,e.pendingProps.children,n),e.child;case 12:return Ge(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(s=e.type._context,r=e.pendingProps,i=e.memoizedProps,o=r.value,ue(Ra,s._currentValue),s._currentValue=o,i!==null)if($t(i.value,o)){if(i.children===r.children&&!at.current){e=wn(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===s){if(i.tag===1){l=mn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Vu(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(T(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Vu(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Ge(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,s=e.pendingProps.children,fr(e,n),r=Nt(r),s=s(r),e.flags|=1,Ge(t,e,s,n),e.child;case 14:return s=e.type,r=Ot(s,e.pendingProps),r=Ot(s.type,r),Yh(t,e,s,r,n);case 15:return Wm(t,e,e.type,e.pendingProps,n);case 17:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),ua(t,e),e.tag=1,lt(s)?(t=!0,Pa(e)):t=!1,fr(e,n),Am(e,s,r),Yu(e,s,r,n),qu(null,e,s,!0,t,n);case 19:return Qm(t,e,n);case 22:return $m(t,e,n)}throw Error(T(156,e.tag))};function l0(t,e){return Lg(t,e)}function ib(t,e,n,s){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(t,e,n,s){return new ib(t,e,n,s)}function wd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ob(t){if(typeof t=="function")return wd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Bc)return 11;if(t===Wc)return 14}return 2}function Zn(t,e){var n=t.alternate;return n===null?(n=St(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function ha(t,e,n,s,r,i){var o=2;if(s=t,typeof t=="function")wd(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Gs:return Ls(n.children,r,i,e);case zc:o=8,r|=8;break;case yu:return t=St(12,n,e,r|2),t.elementType=yu,t.lanes=i,t;case xu:return t=St(13,n,e,r),t.elementType=xu,t.lanes=i,t;case vu:return t=St(19,n,e,r),t.elementType=vu,t.lanes=i,t;case xg:return fl(n,r,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case mg:o=10;break e;case yg:o=9;break e;case Bc:o=11;break e;case Wc:o=14;break e;case Pn:o=16,s=null;break e}throw Error(T(130,t==null?t:typeof t,""))}return e=St(o,n,e,r),e.elementType=t,e.type=s,e.lanes=i,e}function Ls(t,e,n,s){return t=St(7,t,s,e),t.lanes=n,t}function fl(t,e,n,s){return t=St(22,t,s,e),t.elementType=xg,t.lanes=n,t.stateNode={isHidden:!1},t}function ql(t,e,n){return t=St(6,t,null,e),t.lanes=n,t}function Gl(t,e,n){return e=St(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function ab(t,e,n,s,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Tl(0),this.expirationTimes=Tl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tl(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function kd(t,e,n,s,r,i,o,a,l){return t=new ab(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=St(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},id(i),t}function lb(t,e,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qs,key:s==null?null:""+s,children:t,containerInfo:e,implementation:n}}function u0(t){if(!t)return is;t=t._reactInternals;e:{if(Qs(t)!==t||t.tag!==1)throw Error(T(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(lt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(T(171))}if(t.tag===1){var n=t.type;if(lt(n))return um(t,n,e)}return e}function c0(t,e,n,s,r,i,o,a,l){return t=kd(n,s,!0,t,r,i,o,a,l),t.context=u0(null),n=t.current,s=Je(),r=Jn(n),i=mn(s,r),i.callback=e??null,qn(n,i,r),t.current.lanes=r,co(t,r,s),ut(t,s),t}function pl(t,e,n,s){var r=e.current,i=Je(),o=Jn(r);return n=u0(n),e.context===null?e.context=n:e.pendingContext=n,e=mn(i,o),e.payload={element:t},s=s===void 0?null:s,s!==null&&(e.callback=s),t=qn(r,e,o),t!==null&&(Wt(t,r,o,i),oa(t,r,o)),o}function $a(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function of(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function _d(t,e){of(t,e),(t=t.alternate)&&of(t,e)}function ub(){return null}var d0=typeof reportError=="function"?reportError:function(t){console.error(t)};function Sd(t){this._internalRoot=t}gl.prototype.render=Sd.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(T(409));pl(t,e,null,null)};gl.prototype.unmount=Sd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ws(function(){pl(null,t,null,null)}),e[vn]=null}};function gl(t){this._internalRoot=t}gl.prototype.unstable_scheduleHydration=function(t){if(t){var e=$g();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Tn.length&&e!==0&&e<Tn[n].priority;n++);Tn.splice(n,0,t),n===0&&Ug(t)}};function Cd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ml(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function af(){}function cb(t,e,n,s,r){if(r){if(typeof s=="function"){var i=s;s=function(){var u=$a(o);i.call(u)}}var o=c0(e,s,t,0,null,!1,!1,"",af);return t._reactRootContainer=o,t[vn]=o.current,Bi(t.nodeType===8?t.parentNode:t),Ws(),o}for(;r=t.lastChild;)t.removeChild(r);if(typeof s=="function"){var a=s;s=function(){var u=$a(l);a.call(u)}}var l=kd(t,0,!1,null,null,!1,!1,"",af);return t._reactRootContainer=l,t[vn]=l.current,Bi(t.nodeType===8?t.parentNode:t),Ws(function(){pl(e,l,n,s)}),l}function yl(t,e,n,s,r){var i=n._reactRootContainer;if(i){var o=i;if(typeof r=="function"){var a=r;r=function(){var l=$a(o);a.call(l)}}pl(e,o,t,r)}else o=cb(n,e,t,r,s);return $a(o)}Bg=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=di(e.pendingLanes);n!==0&&(Uc(e,n|1),ut(e,_e()),!(G&6)&&(Fr=_e()+500,cs()))}break;case 13:Ws(function(){var s=bn(t,1);if(s!==null){var r=Je();Wt(s,t,1,r)}}),_d(t,1)}};Vc=function(t){if(t.tag===13){var e=bn(t,134217728);if(e!==null){var n=Je();Wt(e,t,134217728,n)}_d(t,134217728)}};Wg=function(t){if(t.tag===13){var e=Jn(t),n=bn(t,e);if(n!==null){var s=Je();Wt(n,t,e,s)}_d(t,e)}};$g=function(){return ie};Hg=function(t,e){var n=ie;try{return ie=t,e()}finally{ie=n}};Pu=function(t,e,n){switch(e){case"input":if(ku(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var s=n[e];if(s!==t&&s.form===t.form){var r=al(s);if(!r)throw Error(T(90));bg(s),ku(s,r)}}}break;case"textarea":kg(t,n);break;case"select":e=n.value,e!=null&&ur(t,!!n.multiple,e,!1)}};Pg=xd;Mg=Ws;var db={usingClientEntryPoint:!1,Events:[fo,tr,al,Ng,Eg,xd]},ei={findFiberByHostInstance:bs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hb={bundleType:ei.bundleType,version:ei.version,rendererPackageName:ei.rendererPackageName,rendererConfig:ei.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_n.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Og(t),t===null?null:t.stateNode},findFiberByHostInstance:ei.findFiberByHostInstance||ub,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 Bo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bo.isDisabled&&Bo.supportsFiber)try{sl=Bo.inject(hb),tn=Bo}catch{}}gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=db;gt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cd(e))throw Error(T(200));return lb(t,e,null,n)};gt.createRoot=function(t,e){if(!Cd(t))throw Error(T(299));var n=!1,s="",r=d0;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(s=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=kd(t,1,!1,null,null,n,!1,s,r),t[vn]=e.current,Bi(t.nodeType===8?t.parentNode:t),new Sd(e)};gt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(T(188)):(t=Object.keys(t).join(","),Error(T(268,t)));return t=Og(e),t=t===null?null:t.stateNode,t};gt.flushSync=function(t){return Ws(t)};gt.hydrate=function(t,e,n){if(!ml(e))throw Error(T(200));return yl(null,t,e,!0,n)};gt.hydrateRoot=function(t,e,n){if(!Cd(t))throw Error(T(405));var s=n!=null&&n.hydratedSources||null,r=!1,i="",o=d0;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=c0(e,null,t,1,n??null,r,!1,i,o),t[vn]=e.current,Bi(t),s)for(t=0;t<s.length;t++)n=s[t],r=n._getVersion,r=r(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,r]:e.mutableSourceEagerHydrationData.push(n,r);return new gl(e)};gt.render=function(t,e,n){if(!ml(e))throw Error(T(200));return yl(null,t,e,!1,n)};gt.unmountComponentAtNode=function(t){if(!ml(t))throw Error(T(40));return t._reactRootContainer?(Ws(function(){yl(null,null,t,!1,function(){t._reactRootContainer=null,t[vn]=null})}),!0):!1};gt.unstable_batchedUpdates=xd;gt.unstable_renderSubtreeIntoContainer=function(t,e,n,s){if(!ml(n))throw Error(T(200));if(t==null||t._reactInternals===void 0)throw Error(T(38));return yl(t,e,n,!1,s)};gt.version="18.3.1-next-f1338f8080-20240426";function h0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h0)}catch(t){console.error(t)}}h0(),hg.exports=gt;var fb=hg.exports,lf=fb;gu.createRoot=lf.createRoot,gu.hydrateRoot=lf.hydrateRoot;var go=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pb={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},On,Tc,Vp,gb=(Vp=class{constructor(){W(this,On,pb);W(this,Tc,!1)}setTimeoutProvider(t){F(this,On,t)}setTimeout(t,e){return _(this,On).setTimeout(t,e)}clearTimeout(t){_(this,On).clearTimeout(t)}setInterval(t,e){return _(this,On).setInterval(t,e)}clearInterval(t){_(this,On).clearInterval(t)}},On=new WeakMap,Tc=new WeakMap,Vp),_s=new gb;function mb(t){setTimeout(t,0)}var $s=typeof window>"u"||"Deno"in globalThis;function st(){}function yb(t,e){return typeof t=="function"?t(e):t}function lc(t){return typeof t=="number"&&t>=0&&t!==1/0}function f0(t,e){return Math.max(t+(e||0)-Date.now(),0)}function es(t,e){return typeof t=="function"?t(e):t}function wt(t,e){return typeof t=="function"?t(e):t}function uf(t,e){const{type:n="all",exact:s,fetchStatus:r,predicate:i,queryKey:o,stale:a}=t;if(o){if(s){if(e.queryHash!==jd(o,e.options))return!1}else if(!qi(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||r&&r!==e.state.fetchStatus||i&&!i(e))}function cf(t,e){const{exact:n,status:s,predicate:r,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Xi(e.options.mutationKey)!==Xi(i))return!1}else if(!qi(e.options.mutationKey,i))return!1}return!(s&&e.state.status!==s||r&&!r(e))}function jd(t,e){return((e==null?void 0:e.queryKeyHashFn)||Xi)(t)}function Xi(t){return JSON.stringify(t,(e,n)=>cc(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function qi(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>qi(t[n],e[n])):!1}var xb=Object.prototype.hasOwnProperty;function p0(t,e){if(t===e)return t;const n=df(t)&&df(e);if(!n&&!(cc(t)&&cc(e)))return e;const r=(n?t:Object.keys(t)).length,i=n?e:Object.keys(e),o=i.length,a=n?new Array(o):{};let l=0;for(let u=0;u<o;u++){const d=n?u:i[u],h=t[d],f=e[d];if(h===f){a[d]=h,(n?u<r:xb.call(t,d))&&l++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){a[d]=f;continue}const p=p0(h,f);a[d]=p,p===h&&l++}return r===o&&l===r?t:a}function uc(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function df(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function cc(t){if(!hf(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!hf(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function hf(t){return Object.prototype.toString.call(t)==="[object Object]"}function vb(t){return new Promise(e=>{_s.setTimeout(e,t)})}function dc(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?p0(t,e):e}function bb(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function wb(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var Nd=Symbol();function g0(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Nd?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function m0(t,e){return typeof t=="function"?t(...e):!!t}function kb(t,e,n){let s=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??(r=e()),s||(s=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),t}var Cs,Dn,xr,Qp,_b=(Qp=class extends go{constructor(){super();W(this,Cs);W(this,Dn);W(this,xr);F(this,xr,e=>{if(!$s&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Dn)||this.setEventListener(_(this,xr))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,Dn))==null||e.call(this),F(this,Dn,void 0))}setEventListener(e){var n;F(this,xr,e),(n=_(this,Dn))==null||n.call(this),F(this,Dn,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){_(this,Cs)!==e&&(F(this,Cs,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof _(this,Cs)=="boolean"?_(this,Cs):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Cs=new WeakMap,Dn=new WeakMap,xr=new WeakMap,Qp),Ed=new _b;function hc(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});n.status="pending",n.catch(()=>{});function s(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{s({status:"fulfilled",value:r}),t(r)},n.reject=r=>{s({status:"rejected",reason:r}),e(r)},n}var Sb=mb;function Cb(){let t=[],e=0,n=a=>{a()},s=a=>{a()},r=Sb;const i=a=>{e?t.push(a):r(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&r(()=>{s(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{r=a}}}var Fe=Cb(),vr,Ln,br,Yp,jb=(Yp=class extends go{constructor(){super();W(this,vr,!0);W(this,Ln);W(this,br);F(this,br,e=>{if(!$s&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){_(this,Ln)||this.setEventListener(_(this,br))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,Ln))==null||e.call(this),F(this,Ln,void 0))}setEventListener(e){var n;F(this,br,e),(n=_(this,Ln))==null||n.call(this),F(this,Ln,e(this.setOnline.bind(this)))}setOnline(e){_(this,vr)!==e&&(F(this,vr,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return _(this,vr)}},vr=new WeakMap,Ln=new WeakMap,br=new WeakMap,Yp),Ha=new jb;function Nb(t){return Math.min(1e3*2**t,3e4)}function y0(t){return(t??"online")==="online"?Ha.isOnline():!0}var fc=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function x0(t){let e=!1,n=0,s;const r=hc(),i=()=>r.status!=="pending",o=m=>{var b;if(!i()){const g=new fc(m);f(g),(b=t.onCancel)==null||b.call(t,g)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Ed.isFocused()&&(t.networkMode==="always"||Ha.isOnline())&&t.canRun(),d=()=>y0(t.networkMode)&&t.canRun(),h=m=>{i()||(s==null||s(),r.resolve(m))},f=m=>{i()||(s==null||s(),r.reject(m))},p=()=>new Promise(m=>{var b;s=g=>{(i()||u())&&m(g)},(b=t.onPause)==null||b.call(t)}).then(()=>{var m;s=void 0,i()||(m=t.onContinue)==null||m.call(t)}),x=()=>{if(i())return;let m;const b=n===0?t.initialPromise:void 0;try{m=b??t.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(h).catch(g=>{var P;if(i())return;const y=t.retry??($s?0:3),v=t.retryDelay??Nb,w=typeof v=="function"?v(n,g):v,j=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,g);if(e||!j){f(g);return}n++,(P=t.onFail)==null||P.call(t,n,g),vb(w).then(()=>u()?void 0:p()).then(()=>{e?f(g):x()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(s==null||s(),r),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?x():p().then(x),r)}}var js,Kp,v0=(Kp=class{constructor(){W(this,js)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lc(this.gcTime)&&F(this,js,_s.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??($s?1/0:5*60*1e3))}clearGcTimeout(){_(this,js)&&(_s.clearTimeout(_(this,js)),F(this,js,void 0))}},js=new WeakMap,Kp),Ns,wr,bt,Es,Te,ro,Ps,Dt,on,Xp,Eb=(Xp=class extends v0{constructor(e){super();W(this,Dt);W(this,Ns);W(this,wr);W(this,bt);W(this,Es);W(this,Te);W(this,ro);W(this,Ps);F(this,Ps,!1),F(this,ro,e.defaultOptions),this.setOptions(e.options),this.observers=[],F(this,Es,e.client),F(this,bt,_(this,Es).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,F(this,Ns,pf(this.options)),this.state=e.state??_(this,Ns),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=_(this,Te))==null?void 0:e.promise}setOptions(e){if(this.options={..._(this,ro),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=pf(this.options);n.data!==void 0&&(this.setState(ff(n.data,n.dataUpdatedAt)),F(this,Ns,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,bt).remove(this)}setData(e,n){const s=dc(this.state.data,e,this.options);return Y(this,Dt,on).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e,n){Y(this,Dt,on).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var s,r;const n=(s=_(this,Te))==null?void 0:s.promise;return(r=_(this,Te))==null||r.cancel(e),n?n.then(st).catch(st):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ns))}isActive(){return this.observers.some(e=>wt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>es(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!f0(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Te))==null||n.continue()}onOnline(){var n;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Te))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),_(this,bt).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(_(this,Te)&&(_(this,Ps)?_(this,Te).cancel({revert:!0}):_(this,Te).cancelRetry()),this.scheduleGc()),_(this,bt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Y(this,Dt,on).call(this,{type:"invalidate"})}async fetch(e,n){var l,u,d,h,f,p,x,m,b,g,y,v;if(this.state.fetchStatus!=="idle"&&((l=_(this,Te))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Te))return _(this,Te).continueRetry(),_(this,Te).promise}if(e&&this.setOptions(e),!this.options.queryFn){const w=this.observers.find(j=>j.options.queryFn);w&&this.setOptions(w.options)}const s=new AbortController,r=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(F(this,Ps,!0),s.signal)})},i=()=>{const w=g0(this.options,n),P=(()=>{const k={client:_(this,Es),queryKey:this.queryKey,meta:this.meta};return r(k),k})();return F(this,Ps,!1),this.options.persister?this.options.persister(w,P,this):w(P)},a=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,Es),state:this.state,fetchFn:i};return r(w),w})();(u=this.options.behavior)==null||u.onFetch(a,this),F(this,wr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Y(this,Dt,on).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),F(this,Te,x0({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:w=>{w instanceof fc&&w.revert&&this.setState({..._(this,wr),fetchStatus:"idle"}),s.abort()},onFail:(w,j)=>{Y(this,Dt,on).call(this,{type:"failed",failureCount:w,error:j})},onPause:()=>{Y(this,Dt,on).call(this,{type:"pause"})},onContinue:()=>{Y(this,Dt,on).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await _(this,Te).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(p=(f=_(this,bt).config).onSuccess)==null||p.call(f,w,this),(m=(x=_(this,bt).config).onSettled)==null||m.call(x,w,this.state.error,this),w}catch(w){if(w instanceof fc){if(w.silent)return _(this,Te).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Y(this,Dt,on).call(this,{type:"error",error:w}),(g=(b=_(this,bt).config).onError)==null||g.call(b,w,this),(v=(y=_(this,bt).config).onSettled)==null||v.call(y,this.state.data,w,this),w}finally{this.scheduleGc()}}},Ns=new WeakMap,wr=new WeakMap,bt=new WeakMap,Es=new WeakMap,Te=new WeakMap,ro=new WeakMap,Ps=new WeakMap,Dt=new WeakSet,on=function(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...b0(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...ff(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return F(this,wr,e.manual?r:void 0),r;case"error":const i=e.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),Fe.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),_(this,bt).notify({query:this,type:"updated",action:e})})},Xp);function b0(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y0(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ff(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pf(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,s=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var nt,K,io,Xe,Ms,kr,hn,Fn,oo,_r,Sr,Ts,Rs,In,Cr,ne,fi,pc,gc,mc,yc,xc,vc,bc,w0,qp,Pb=(qp=class extends go{constructor(e,n){super();W(this,ne);W(this,nt);W(this,K);W(this,io);W(this,Xe);W(this,Ms);W(this,kr);W(this,hn);W(this,Fn);W(this,oo);W(this,_r);W(this,Sr);W(this,Ts);W(this,Rs);W(this,In);W(this,Cr,new Set);this.options=n,F(this,nt,e),F(this,Fn,null),F(this,hn,hc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,K).addObserver(this),gf(_(this,K),this.options)?Y(this,ne,fi).call(this):this.updateResult(),Y(this,ne,yc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wc(_(this,K),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wc(_(this,K),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Y(this,ne,xc).call(this),Y(this,ne,vc).call(this),_(this,K).removeObserver(this)}setOptions(e){const n=this.options,s=_(this,K);if(this.options=_(this,nt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wt(this.options.enabled,_(this,K))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Y(this,ne,bc).call(this),_(this,K).setOptions(this.options),n._defaulted&&!uc(this.options,n)&&_(this,nt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,K),observer:this});const r=this.hasListeners();r&&mf(_(this,K),s,this.options,n)&&Y(this,ne,fi).call(this),this.updateResult(),r&&(_(this,K)!==s||wt(this.options.enabled,_(this,K))!==wt(n.enabled,_(this,K))||es(this.options.staleTime,_(this,K))!==es(n.staleTime,_(this,K)))&&Y(this,ne,pc).call(this);const i=Y(this,ne,gc).call(this);r&&(_(this,K)!==s||wt(this.options.enabled,_(this,K))!==wt(n.enabled,_(this,K))||i!==_(this,In))&&Y(this,ne,mc).call(this,i)}getOptimisticResult(e){const n=_(this,nt).getQueryCache().build(_(this,nt),e),s=this.createResult(n,e);return Tb(this,s)&&(F(this,Xe,s),F(this,kr,this.options),F(this,Ms,_(this,K).state)),s}getCurrentResult(){return _(this,Xe)}trackResult(e,n){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),n==null||n(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,hn).status==="pending"&&_(this,hn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){_(this,Cr).add(e)}getCurrentQuery(){return _(this,K)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=_(this,nt).defaultQueryOptions(e),s=_(this,nt).getQueryCache().build(_(this,nt),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return Y(this,ne,fi).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Xe)))}createResult(e,n){var R;const s=_(this,K),r=this.options,i=_(this,Xe),o=_(this,Ms),a=_(this,kr),u=e!==s?e.state:_(this,io),{state:d}=e;let h={...d},f=!1,p;if(n._optimisticResults){const C=this.hasListeners(),M=!C&&gf(e,n),L=C&&mf(e,s,n,r);(M||L)&&(h={...h,...b0(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:m,status:b}=h;p=h.data;let g=!1;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let C;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(C=i.data,g=!0):C=typeof n.placeholderData=="function"?n.placeholderData((R=_(this,Sr))==null?void 0:R.state.data,_(this,Sr)):n.placeholderData,C!==void 0&&(b="success",p=dc(i==null?void 0:i.data,C,n),f=!0)}if(n.select&&p!==void 0&&!g)if(i&&p===(o==null?void 0:o.data)&&n.select===_(this,oo))p=_(this,_r);else try{F(this,oo,n.select),p=n.select(p),p=dc(i==null?void 0:i.data,p,n),F(this,_r,p),F(this,Fn,null)}catch(C){F(this,Fn,C)}_(this,Fn)&&(x=_(this,Fn),p=_(this,_r),m=Date.now(),b="error");const y=h.fetchStatus==="fetching",v=b==="pending",w=b==="error",j=v&&y,P=p!==void 0,N={status:b,fetchStatus:h.fetchStatus,isPending:v,isSuccess:b==="success",isError:w,isInitialLoading:j,isLoading:j,data:p,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:m,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:w&&!P,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&P,isStale:Pd(e,n),refetch:this.refetch,promise:_(this,hn),isEnabled:wt(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const C=V=>{N.status==="error"?V.reject(N.error):N.data!==void 0&&V.resolve(N.data)},M=()=>{const V=F(this,hn,N.promise=hc());C(V)},L=_(this,hn);switch(L.status){case"pending":e.queryHash===s.queryHash&&C(L);break;case"fulfilled":(N.status==="error"||N.data!==L.value)&&M();break;case"rejected":(N.status!=="error"||N.error!==L.reason)&&M();break}}return N}updateResult(){const e=_(this,Xe),n=this.createResult(_(this,K),this.options);if(F(this,Ms,_(this,K).state),F(this,kr,this.options),_(this,Ms).data!==void 0&&F(this,Sr,_(this,K)),uc(n,e))return;F(this,Xe,n);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!_(this,Cr).size)return!0;const o=new Set(i??_(this,Cr));return this.options.throwOnError&&o.add("error"),Object.keys(_(this,Xe)).some(a=>{const l=a;return _(this,Xe)[l]!==e[l]&&o.has(l)})};Y(this,ne,w0).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Y(this,ne,yc).call(this)}},nt=new WeakMap,K=new WeakMap,io=new WeakMap,Xe=new WeakMap,Ms=new WeakMap,kr=new WeakMap,hn=new WeakMap,Fn=new WeakMap,oo=new WeakMap,_r=new WeakMap,Sr=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,In=new WeakMap,Cr=new WeakMap,ne=new WeakSet,fi=function(e){Y(this,ne,bc).call(this);let n=_(this,K).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(st)),n},pc=function(){Y(this,ne,xc).call(this);const e=es(this.options.staleTime,_(this,K));if($s||_(this,Xe).isStale||!lc(e))return;const s=f0(_(this,Xe).dataUpdatedAt,e)+1;F(this,Ts,_s.setTimeout(()=>{_(this,Xe).isStale||this.updateResult()},s))},gc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,K)):this.options.refetchInterval)??!1},mc=function(e){Y(this,ne,vc).call(this),F(this,In,e),!($s||wt(this.options.enabled,_(this,K))===!1||!lc(_(this,In))||_(this,In)===0)&&F(this,Rs,_s.setInterval(()=>{(this.options.refetchIntervalInBackground||Ed.isFocused())&&Y(this,ne,fi).call(this)},_(this,In)))},yc=function(){Y(this,ne,pc).call(this),Y(this,ne,mc).call(this,Y(this,ne,gc).call(this))},xc=function(){_(this,Ts)&&(_s.clearTimeout(_(this,Ts)),F(this,Ts,void 0))},vc=function(){_(this,Rs)&&(_s.clearInterval(_(this,Rs)),F(this,Rs,void 0))},bc=function(){const e=_(this,nt).getQueryCache().build(_(this,nt),this.options);if(e===_(this,K))return;const n=_(this,K);F(this,K,e),F(this,io,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},w0=function(e){Fe.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(_(this,Xe))}),_(this,nt).getQueryCache().notify({query:_(this,K),type:"observerResultsUpdated"})})},qp);function Mb(t,e){return wt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function gf(t,e){return Mb(t,e)||t.state.data!==void 0&&wc(t,e,e.refetchOnMount)}function wc(t,e,n){if(wt(e.enabled,t)!==!1&&es(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&Pd(t,e)}return!1}function mf(t,e,n,s){return(t!==e||wt(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Pd(t,n)}function Pd(t,e){return wt(e.enabled,t)!==!1&&t.isStaleByTime(es(e.staleTime,t))}function Tb(t,e){return!uc(t.getCurrentResult(),e)}function yf(t){return{onFetch:(e,n)=>{var d,h,f,p,x;const s=e.options,r=(f=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((p=e.state.data)==null?void 0:p.pages)||[],o=((x=e.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const b=v=>{kb(v,()=>e.signal,()=>m=!0)},g=g0(e.options,e.fetchOptions),y=async(v,w,j)=>{if(m)return Promise.reject();if(w==null&&v.pages.length)return Promise.resolve(v);const k=(()=>{const M={client:e.client,queryKey:e.queryKey,pageParam:w,direction:j?"backward":"forward",meta:e.options.meta};return b(M),M})(),N=await g(k),{maxPages:R}=e.options,C=j?wb:bb;return{pages:C(v.pages,N,R),pageParams:C(v.pageParams,w,R)}};if(r&&i.length){const v=r==="backward",w=v?Rb:xf,j={pages:i,pageParams:o},P=w(s,j);a=await y(j,P,v)}else{const v=t??i.length;do{const w=l===0?o[0]??s.initialPageParam:xf(s,a);if(l>0&&w==null)break;a=await y(a,w),l++}while(l<v)}return a};e.options.persister?e.fetchFn=()=>{var m,b;return(b=(m=e.options).persister)==null?void 0:b.call(m,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function xf(t,{pages:e,pageParams:n}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,n[s],n):void 0}function Rb(t,{pages:e,pageParams:n}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,n[0],n):void 0}var ao,Gt,qe,Os,Jt,En,Gp,Ob=(Gp=class extends v0{constructor(e){super();W(this,Jt);W(this,ao);W(this,Gt);W(this,qe);W(this,Os);F(this,ao,e.client),this.mutationId=e.mutationId,F(this,qe,e.mutationCache),F(this,Gt,[]),this.state=e.state||Db(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){_(this,Gt).includes(e)||(_(this,Gt).push(e),this.clearGcTimeout(),_(this,qe).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){F(this,Gt,_(this,Gt).filter(n=>n!==e)),this.scheduleGc(),_(this,qe).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){_(this,Gt).length||(this.state.status==="pending"?this.scheduleGc():_(this,qe).remove(this))}continue(){var e;return((e=_(this,Os))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,d,h,f,p,x,m,b,g,y,v,w,j,P,k,N,R;const n=()=>{Y(this,Jt,En).call(this,{type:"continue"})},s={client:_(this,ao),meta:this.options.meta,mutationKey:this.options.mutationKey};F(this,Os,x0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(C,M)=>{Y(this,Jt,En).call(this,{type:"failed",failureCount:C,error:M})},onPause:()=>{Y(this,Jt,En).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,qe).canRun(this)}));const r=this.state.status==="pending",i=!_(this,Os).canStart();try{if(r)n();else{Y(this,Jt,En).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=_(this,qe).config).onMutate)==null?void 0:a.call(o,e,this,s));const M=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,s));M!==this.state.context&&Y(this,Jt,En).call(this,{type:"pending",context:M,variables:e,isPaused:i})}const C=await _(this,Os).start();return await((h=(d=_(this,qe).config).onSuccess)==null?void 0:h.call(d,C,e,this.state.context,this,s)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,C,e,this.state.context,s)),await((m=(x=_(this,qe).config).onSettled)==null?void 0:m.call(x,C,null,this.state.variables,this.state.context,this,s)),await((g=(b=this.options).onSettled)==null?void 0:g.call(b,C,null,e,this.state.context,s)),Y(this,Jt,En).call(this,{type:"success",data:C}),C}catch(C){try{await((v=(y=_(this,qe).config).onError)==null?void 0:v.call(y,C,e,this.state.context,this,s))}catch(M){Promise.reject(M)}try{await((j=(w=this.options).onError)==null?void 0:j.call(w,C,e,this.state.context,s))}catch(M){Promise.reject(M)}try{await((k=(P=_(this,qe).config).onSettled)==null?void 0:k.call(P,void 0,C,this.state.variables,this.state.context,this,s))}catch(M){Promise.reject(M)}try{await((R=(N=this.options).onSettled)==null?void 0:R.call(N,void 0,C,e,this.state.context,s))}catch(M){Promise.reject(M)}throw Y(this,Jt,En).call(this,{type:"error",error:C}),C}finally{_(this,qe).runNext(this)}}},ao=new WeakMap,Gt=new WeakMap,qe=new WeakMap,Os=new WeakMap,Jt=new WeakSet,En=function(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Fe.batch(()=>{_(this,Gt).forEach(s=>{s.onMutationUpdate(e)}),_(this,qe).notify({mutation:this,type:"updated",action:e})})},Gp);function Db(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fn,Lt,lo,Jp,Lb=(Jp=class extends go{constructor(e={}){super();W(this,fn);W(this,Lt);W(this,lo);this.config=e,F(this,fn,new Set),F(this,Lt,new Map),F(this,lo,0)}build(e,n,s){const r=new Ob({client:e,mutationCache:this,mutationId:++_o(this,lo)._,options:e.defaultMutationOptions(n),state:s});return this.add(r),r}add(e){_(this,fn).add(e);const n=Wo(e);if(typeof n=="string"){const s=_(this,Lt).get(n);s?s.push(e):_(this,Lt).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(_(this,fn).delete(e)){const n=Wo(e);if(typeof n=="string"){const s=_(this,Lt).get(n);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&_(this,Lt).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Wo(e);if(typeof n=="string"){const s=_(this,Lt).get(n),r=s==null?void 0:s.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){var s;const n=Wo(e);if(typeof n=="string"){const r=(s=_(this,Lt).get(n))==null?void 0:s.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Fe.batch(()=>{_(this,fn).forEach(e=>{this.notify({type:"removed",mutation:e})}),_(this,fn).clear(),_(this,Lt).clear()})}getAll(){return Array.from(_(this,fn))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>cf(n,s))}findAll(e={}){return this.getAll().filter(n=>cf(e,n))}notify(e){Fe.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Fe.batch(()=>Promise.all(e.map(n=>n.continue().catch(st))))}},fn=new WeakMap,Lt=new WeakMap,lo=new WeakMap,Jp);function Wo(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Zt,Zp,Fb=(Zp=class extends go{constructor(e={}){super();W(this,Zt);this.config=e,F(this,Zt,new Map)}build(e,n,s){const r=n.queryKey,i=n.queryHash??jd(r,n);let o=this.get(i);return o||(o=new Eb({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){_(this,Zt).has(e.queryHash)||(_(this,Zt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=_(this,Zt).get(e.queryHash);n&&(e.destroy(),n===e&&_(this,Zt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Fe.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return _(this,Zt).get(e)}getAll(){return[..._(this,Zt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>uf(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>uf(e,s)):n}notify(e){Fe.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Fe.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Fe.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Zt=new WeakMap,Zp),be,An,zn,jr,Nr,Bn,Er,Pr,eg,Ib=(eg=class{constructor(t={}){W(this,be);W(this,An);W(this,zn);W(this,jr);W(this,Nr);W(this,Bn);W(this,Er);W(this,Pr);F(this,be,t.queryCache||new Fb),F(this,An,t.mutationCache||new Lb),F(this,zn,t.defaultOptions||{}),F(this,jr,new Map),F(this,Nr,new Map),F(this,Bn,0)}mount(){_o(this,Bn)._++,_(this,Bn)===1&&(F(this,Er,Ed.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,be).onFocus())})),F(this,Pr,Ha.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,be).onOnline())})))}unmount(){var t,e;_o(this,Bn)._--,_(this,Bn)===0&&((t=_(this,Er))==null||t.call(this),F(this,Er,void 0),(e=_(this,Pr))==null||e.call(this),F(this,Pr,void 0))}isFetching(t){return _(this,be).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return _(this,An).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,be).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=_(this,be).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(es(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return _(this,be).findAll(t).map(({queryKey:e,state:n})=>{const s=n.data;return[e,s]})}setQueryData(t,e,n){const s=this.defaultQueryOptions({queryKey:t}),r=_(this,be).get(s.queryHash),i=r==null?void 0:r.state.data,o=yb(e,i);if(o!==void 0)return _(this,be).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Fe.batch(()=>_(this,be).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,be).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=_(this,be);Fe.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=_(this,be);return Fe.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},s=Fe.batch(()=>_(this,be).findAll(t).map(r=>r.cancel(n)));return Promise.all(s).then(st).catch(st)}invalidateQueries(t,e={}){return Fe.batch(()=>(_(this,be).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},s=Fe.batch(()=>_(this,be).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(st)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(st)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=_(this,be).build(this,e);return n.isStaleByTime(es(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(st).catch(st)}fetchInfiniteQuery(t){return t.behavior=yf(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(st).catch(st)}ensureInfiniteQueryData(t){return t.behavior=yf(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ha.isOnline()?_(this,An).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,be)}getMutationCache(){return _(this,An)}getDefaultOptions(){return _(this,zn)}setDefaultOptions(t){F(this,zn,t)}setQueryDefaults(t,e){_(this,jr).set(Xi(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[..._(this,jr).values()],n={};return e.forEach(s=>{qi(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){_(this,Nr).set(Xi(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[..._(this,Nr).values()],n={};return e.forEach(s=>{qi(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={..._(this,zn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=jd(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Nd&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{..._(this,zn).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){_(this,be).clear(),_(this,An).clear()}},be=new WeakMap,An=new WeakMap,zn=new WeakMap,jr=new WeakMap,Nr=new WeakMap,Bn=new WeakMap,Er=new WeakMap,Pr=new WeakMap,eg),k0=S.createContext(void 0),Ab=t=>{const e=S.useContext(k0);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},zb=({client:t,children:e})=>(S.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(k0.Provider,{value:t,children:e})),_0=S.createContext(!1),Bb=()=>S.useContext(_0);_0.Provider;function Wb(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var $b=S.createContext(Wb()),Hb=()=>S.useContext($b),Ub=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?m0(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},Vb=t=>{S.useEffect(()=>{t.clearReset()},[t])},Qb=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(r&&t.data===void 0||m0(n,[t.error,s])),Yb=t=>{if(t.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Kb=(t,e)=>t.isLoading&&t.isFetching&&!e,Xb=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,vf=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function qb(t,e,n){var f,p,x,m;const s=Bb(),r=Hb(),i=Ab(),o=i.defaultQueryOptions(t);(p=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o);const a=i.getQueryCache().get(o.queryHash);o._optimisticResults=s?"isRestoring":"optimistic",Yb(o),Ub(o,r,a),Vb(r);const l=!i.getQueryCache().get(o.queryHash),[u]=S.useState(()=>new e(i,o)),d=u.getOptimisticResult(o),h=!s&&t.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(b=>{const g=h?u.subscribe(Fe.batchCalls(b)):st;return u.updateResult(),g},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),S.useEffect(()=>{u.setOptions(o)},[o,u]),Xb(o,d))throw vf(o,u,r);if(Qb({result:d,errorResetBoundary:r,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw d.error;if((m=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||m.call(x,o,d),o.experimental_prefetchInRender&&!$s&&Kb(d,s)){const b=l?vf(o,u,r):a==null?void 0:a.promise;b==null||b.catch(st).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?d:u.trackResult(d)}function xl(t,e){return qb(t,Pb)}/**
41
- * react-router v7.11.0
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
- */var bf="popstate";function Gb(t={}){function e(s,r){let{pathname:i,search:o,hash:a}=s.location;return kc("",{pathname:i,search:o,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Gi(r)}return Zb(e,n,null,t)}function ge(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Pt(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Jb(){return Math.random().toString(36).substring(2,10)}function wf(t,e){return{usr:t.state,key:t.key,idx:e}}function kc(t,e,n=null,s){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?$r(e):e,state:n,key:e&&e.key||s||Jb()}}function Gi({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function $r(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let s=t.indexOf("?");s>=0&&(e.search=t.substring(s),t=t.substring(0,s)),t&&(e.pathname=t)}return e}function Zb(t,e,n,s={}){let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,a="POP",l=null,u=d();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function d(){return(o.state||{idx:null}).idx}function h(){a="POP";let b=d(),g=b==null?null:b-u;u=b,l&&l({action:a,location:m.location,delta:g})}function f(b,g){a="PUSH";let y=kc(m.location,b,g);u=d()+1;let v=wf(y,u),w=m.createHref(y);try{o.pushState(v,"",w)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;r.location.assign(w)}i&&l&&l({action:a,location:m.location,delta:1})}function p(b,g){a="REPLACE";let y=kc(m.location,b,g);u=d();let v=wf(y,u),w=m.createHref(y);o.replaceState(v,"",w),i&&l&&l({action:a,location:m.location,delta:0})}function x(b){return ew(b)}let m={get action(){return a},get location(){return t(r,o)},listen(b){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(bf,h),l=b,()=>{r.removeEventListener(bf,h),l=null}},createHref(b){return e(r,b)},createURL:x,encodeLocation(b){let g=x(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:p,go(b){return o.go(b)}};return m}function ew(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ge(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:Gi(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function S0(t,e,n="/"){return tw(t,e,n,!1)}function tw(t,e,n,s){let r=typeof e=="string"?$r(e):e,i=kn(r.pathname||"/",n);if(i==null)return null;let o=C0(t);nw(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=fw(i);a=dw(o[l],u,s)}return a}function C0(t,e=[],n=[],s="",r=!1){let i=(o,a,l=r,u)=>{let d={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(s)&&l)return;ge(d.relativePath.startsWith(s),`Absolute route path "${d.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(s.length)}let h=yn([s,d.relativePath]),f=n.concat(d);o.children&&o.children.length>0&&(ge(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),C0(o.children,e,f,h,l)),!(o.path==null&&!o.index)&&e.push({path:h,score:uw(h,o.index),routesMeta:f})};return t.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,a);else for(let u of j0(o.path))i(o,a,!0,u)}),e}function j0(t){let e=t.split("/");if(e.length===0)return[];let[n,...s]=e,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=j0(s.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),r&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function nw(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:cw(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var sw=/^:[\w-]+$/,rw=3,iw=2,ow=1,aw=10,lw=-2,kf=t=>t==="*";function uw(t,e){let n=t.split("/"),s=n.length;return n.some(kf)&&(s+=lw),e&&(s+=iw),n.filter(r=>!kf(r)).reduce((r,i)=>r+(sw.test(i)?rw:i===""?ow:aw),s)}function cw(t,e){return t.length===e.length&&t.slice(0,-1).every((s,r)=>s===e[r])?t[t.length-1]-e[e.length-1]:0}function dw(t,e,n=!1){let{routesMeta:s}=t,r={},i="/",o=[];for(let a=0;a<s.length;++a){let l=s[a],u=a===s.length-1,d=i==="/"?e:e.slice(i.length)||"/",h=Ua({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!h&&u&&n&&!s[s.length-1].route.index&&(h=Ua({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(r,h.params),o.push({params:r,pathname:yn([i,h.pathname]),pathnameBase:yw(yn([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=yn([i,h.pathnameBase]))}return o}function Ua(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=hw(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:s.reduce((u,{paramName:d,isOptional:h},f)=>{if(d==="*"){let x=a[f]||"";o=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const p=a[f];return h&&!p?u[d]=void 0:u[d]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function hw(t,e=!1,n=!0){Pt(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(s.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),s]}function fw(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Pt(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function kn(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,s=t.charAt(n);return s&&s!=="/"?null:t.slice(n)||"/"}var N0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pw=t=>N0.test(t);function gw(t,e="/"){let{pathname:n,search:s="",hash:r=""}=typeof t=="string"?$r(t):t,i;if(n)if(pw(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Pt(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${n}`)}n.startsWith("/")?i=_f(n.substring(1),"/"):i=_f(n,e)}else i=e;return{pathname:i,search:xw(s),hash:vw(r)}}function _f(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Jl(t,e,n,s){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(s)}]. 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 mw(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Md(t){let e=mw(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function Td(t,e,n,s=!1){let r;typeof t=="string"?r=$r(t):(r={...t},ge(!r.pathname||!r.pathname.includes("?"),Jl("?","pathname","search",r)),ge(!r.pathname||!r.pathname.includes("#"),Jl("#","pathname","hash",r)),ge(!r.search||!r.search.includes("#"),Jl("#","search","hash",r)));let i=t===""||r.pathname==="",o=i?"/":r.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;r.pathname=f.join("/")}a=h>=0?e[h]:"/"}let l=gw(r,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}var yn=t=>t.join("/").replace(/\/\/+/g,"/"),yw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),xw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,vw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,bw=class{constructor(t,e,n,s=!1){this.status=t,this.statusText=e||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ww(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function kw(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var E0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function P0(t,e){let n=t;if(typeof n!="string"||!N0.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(E0)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),a=kn(o.pathname,e);o.origin===i.origin&&a!=null?n=a+o.search+o.hash:r=!0}catch{Pt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var M0=["POST","PUT","PATCH","DELETE"];new Set(M0);var _w=["GET",...M0];new Set(_w);var Hr=S.createContext(null);Hr.displayName="DataRouter";var vl=S.createContext(null);vl.displayName="DataRouterState";var Sw=S.createContext(!1),T0=S.createContext({isTransitioning:!1});T0.displayName="ViewTransition";var Cw=S.createContext(new Map);Cw.displayName="Fetchers";var jw=S.createContext(null);jw.displayName="Await";var yt=S.createContext(null);yt.displayName="Navigation";var mo=S.createContext(null);mo.displayName="Location";var Ht=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ht.displayName="Route";var Rd=S.createContext(null);Rd.displayName="RouteError";var R0="REACT_ROUTER_ERROR",Nw="REDIRECT",Ew="ROUTE_ERROR_RESPONSE";function Pw(t){if(t.startsWith(`${R0}:${Nw}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function Mw(t){if(t.startsWith(`${R0}:${Ew}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new bw(e.status,e.statusText,e.data)}catch{}}function Tw(t,{relative:e}={}){ge(Ur(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=S.useContext(yt),{hash:r,pathname:i,search:o}=xo(t,{relative:e}),a=i;return n!=="/"&&(a=i==="/"?n:yn([n,i])),s.createHref({pathname:a,search:o,hash:r})}function Ur(){return S.useContext(mo)!=null}function Sn(){return ge(Ur(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(mo).location}var O0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function D0(t){S.useContext(yt).static||S.useLayoutEffect(t)}function yo(){let{isDataRoute:t}=S.useContext(Ht);return t?Uw():Rw()}function Rw(){ge(Ur(),"useNavigate() may be used only in the context of a <Router> component.");let t=S.useContext(Hr),{basename:e,navigator:n}=S.useContext(yt),{matches:s}=S.useContext(Ht),{pathname:r}=Sn(),i=JSON.stringify(Md(s)),o=S.useRef(!1);return D0(()=>{o.current=!0}),S.useCallback((l,u={})=>{if(Pt(o.current,O0),!o.current)return;if(typeof l=="number"){n.go(l);return}let d=Td(l,JSON.parse(i),r,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:yn([e,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[e,n,i,r,t])}S.createContext(null);function L0(){let{matches:t}=S.useContext(Ht),e=t[t.length-1];return e?e.params:{}}function xo(t,{relative:e}={}){let{matches:n}=S.useContext(Ht),{pathname:s}=Sn(),r=JSON.stringify(Md(n));return S.useMemo(()=>Td(t,JSON.parse(r),s,e==="path"),[t,r,s,e])}function Ow(t,e){return F0(t,e)}function F0(t,e,n,s,r){var y;ge(Ur(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=S.useContext(yt),{matches:o}=S.useContext(Ht),a=o[o.length-1],l=a?a.params:{},u=a?a.pathname:"/",d=a?a.pathnameBase:"/",h=a&&a.route;{let v=h&&h.path||"";A0(u,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
-
51
- Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let f=Sn(),p;if(e){let v=typeof e=="string"?$r(e):e;ge(d==="/"||((y=v.pathname)==null?void 0:y.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${v.pathname}" was given in the \`location\` prop.`),p=v}else p=f;let x=p.pathname||"/",m=x;if(d!=="/"){let v=d.replace(/^\//,"").split("/");m="/"+x.replace(/^\//,"").split("/").slice(v.length).join("/")}let b=S0(t,{pathname:m});Pt(h||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Pt(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Aw(b&&b.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:yn([d,i.encodeLocation?i.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?d:yn([d,i.encodeLocation?i.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),o,n,s,r);return e&&g?S.createElement(mo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},g):g}function Dw(){let t=Hw(),e=ww(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:s},i={padding:"2px 4px",backgroundColor:s},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:i},"ErrorBoundary")," or"," ",S.createElement("code",{style:i},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},e),n?S.createElement("pre",{style:r},n):null,o)}var Lw=S.createElement(Dw,null),I0=class extends S.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,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=Mw(t.digest);n&&(t=n)}let e=t!==void 0?S.createElement(Ht.Provider,{value:this.props.routeContext},S.createElement(Rd.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?S.createElement(Fw,{error:t},e):e}};I0.contextType=Sw;var Zl=new WeakMap;function Fw({children:t,error:e}){let{basename:n}=S.useContext(yt);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=Pw(e.digest);if(s){let r=Zl.get(e);if(r)throw r;let i=P0(s.location,n);if(E0&&!Zl.get(e))if(i.isExternal||s.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:s.replace}));throw Zl.set(e,o),o}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function Iw({routeContext:t,match:e,children:n}){let s=S.useContext(Hr);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),S.createElement(Ht.Provider,{value:t},n)}function Aw(t,e=[],n=null,s=null,r=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,o=n==null?void 0:n.errors;if(o!=null){let d=i.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);ge(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,d+1))}let a=!1,l=-1;if(n)for(let d=0;d<i.length;d++){let h=i[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=d),h.route.id){let{loaderData:f,errors:p}=n,x=h.route.loader&&!f.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||x){a=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}let u=n&&s?(d,h)=>{var f,p;s(d,{location:n.location,params:((p=(f=n.matches)==null?void 0:f[0])==null?void 0:p.params)??{},unstable_pattern:kw(n.matches),errorInfo:h})}:void 0;return i.reduceRight((d,h,f)=>{let p,x=!1,m=null,b=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,m=h.route.errorElement||Lw,a&&(l<0&&f===0?(A0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,b=null):l===f&&(x=!0,b=h.route.hydrateFallbackElement||null)));let g=e.concat(i.slice(0,f+1)),y=()=>{let v;return p?v=m:x?v=b:h.route.Component?v=S.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=d,S.createElement(Iw,{match:h,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?S.createElement(I0,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:u}):y()},null)}function Od(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zw(t){let e=S.useContext(Hr);return ge(e,Od(t)),e}function Bw(t){let e=S.useContext(vl);return ge(e,Od(t)),e}function Ww(t){let e=S.useContext(Ht);return ge(e,Od(t)),e}function Dd(t){let e=Ww(t),n=e.matches[e.matches.length-1];return ge(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function $w(){return Dd("useRouteId")}function Hw(){var s;let t=S.useContext(Rd),e=Bw("useRouteError"),n=Dd("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function Uw(){let{router:t}=zw("useNavigate"),e=Dd("useNavigate"),n=S.useRef(!1);return D0(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{Pt(n.current,O0),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...i}))},[t,e])}var Sf={};function A0(t,e,n){!e&&!Sf[t]&&(Sf[t]=!0,Pt(!1,n))}S.memo(Vw);function Vw({routes:t,future:e,state:n,onError:s}){return F0(t,void 0,n,s,e)}function Qw({to:t,replace:e,state:n,relative:s}){ge(Ur(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=S.useContext(yt);Pt(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=S.useContext(Ht),{pathname:o}=Sn(),a=yo(),l=Td(t,Md(i),o,s==="path"),u=JSON.stringify(l);return S.useEffect(()=>{a(JSON.parse(u),{replace:e,state:n,relative:s})},[a,u,s,e,n]),null}function pi(t){ge(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Yw({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:r,static:i=!1,unstable_useTransitions:o}){ge(!Ur(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=S.useMemo(()=>({basename:a,navigator:r,static:i,unstable_useTransitions:o,future:{}}),[a,r,i,o]);typeof n=="string"&&(n=$r(n));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:p="default"}=n,x=S.useMemo(()=>{let m=kn(u,a);return m==null?null:{location:{pathname:m,search:d,hash:h,state:f,key:p},navigationType:s}},[a,u,d,h,f,p,s]);return Pt(x!=null,`<Router basename="${a}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:S.createElement(yt.Provider,{value:l},S.createElement(mo.Provider,{children:e,value:x}))}function Kw({children:t,location:e}){return Ow(_c(t),e)}function _c(t,e=[]){let n=[];return S.Children.forEach(t,(s,r)=>{if(!S.isValidElement(s))return;let i=[...e,r];if(s.type===S.Fragment){n.push.apply(n,_c(s.props.children,i));return}ge(s.type===pi,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ge(!s.props.index||!s.props.children,"An index route cannot have child routes.");let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=_c(s.props.children,i)),n.push(o)}),n}var fa="get",pa="application/x-www-form-urlencoded";function bl(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Xw(t){return bl(t)&&t.tagName.toLowerCase()==="button"}function qw(t){return bl(t)&&t.tagName.toLowerCase()==="form"}function Gw(t){return bl(t)&&t.tagName.toLowerCase()==="input"}function Jw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Zw(t,e){return t.button===0&&(!e||e==="_self")&&!Jw(t)}var $o=null;function e1(){if($o===null)try{new FormData(document.createElement("form"),0),$o=!1}catch{$o=!0}return $o}var t1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function eu(t){return t!=null&&!t1.has(t)?(Pt(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pa}"`),null):t}function n1(t,e){let n,s,r,i,o;if(qw(t)){let a=t.getAttribute("action");s=a?kn(a,e):null,n=t.getAttribute("method")||fa,r=eu(t.getAttribute("enctype"))||pa,i=new FormData(t)}else if(Xw(t)||Gw(t)&&(t.type==="submit"||t.type==="image")){let a=t.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=t.getAttribute("formaction")||a.getAttribute("action");if(s=l?kn(l,e):null,n=t.getAttribute("formmethod")||a.getAttribute("method")||fa,r=eu(t.getAttribute("formenctype"))||eu(a.getAttribute("enctype"))||pa,i=new FormData(a,t),!e1()){let{name:u,type:d,value:h}=t;if(d==="image"){let f=u?`${u}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}else u&&i.append(u,h)}}else{if(bl(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=fa,s=null,r=pa,o=t}return i&&r==="text/plain"&&(o=i,i=void 0),{action:s,method:n.toLowerCase(),encType:r,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ld(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function s1(t,e,n){let s=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return s.pathname==="/"?s.pathname=`_root.${n}`:e&&kn(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${n}`,s}async function r1(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function i1(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function o1(t,e,n){let s=await Promise.all(t.map(async r=>{let i=e.routes[r.route.id];if(i){let o=await r1(i,n);return o.links?o.links():[]}return[]}));return c1(s.flat(1).filter(i1).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Cf(t,e,n,s,r,i){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>{var d;return n[u].pathname!==l.pathname||((d=n[u].route.path)==null?void 0:d.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return i==="assets"?e.filter((l,u)=>o(l,u)||a(l,u)):i==="data"?e.filter((l,u)=>{var h;let d=s.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(o(l,u)||a(l,u))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(t,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function a1(t,e,{includeHydrateFallback:n}={}){return l1(t.map(s=>{let r=e.routes[s.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function l1(t){return[...new Set(t)]}function u1(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function c1(t,e){let n=new Set;return new Set(e),t.reduce((s,r)=>{let i=JSON.stringify(u1(r));return n.has(i)||(n.add(i),s.push({key:i,link:r})),s},[])}function z0(){let t=S.useContext(Hr);return Ld(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function d1(){let t=S.useContext(vl);return Ld(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Fd=S.createContext(void 0);Fd.displayName="FrameworkContext";function B0(){let t=S.useContext(Fd);return Ld(t,"You must render this element inside a <HydratedRouter> element"),t}function h1(t,e){let n=S.useContext(Fd),[s,r]=S.useState(!1),[i,o]=S.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=e,f=S.useRef(null);S.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let m=g=>{g.forEach(y=>{o(y.isIntersecting)})},b=new IntersectionObserver(m,{threshold:.5});return f.current&&b.observe(f.current),()=>{b.disconnect()}}},[t]),S.useEffect(()=>{if(s){let m=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(m)}}},[s]);let p=()=>{r(!0)},x=()=>{r(!1),o(!1)};return n?t!=="intent"?[i,f,{}]:[i,f,{onFocus:ti(a,p),onBlur:ti(l,x),onMouseEnter:ti(u,p),onMouseLeave:ti(d,x),onTouchStart:ti(h,p)}]:[!1,f,{}]}function ti(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function f1({page:t,...e}){let{router:n}=z0(),s=S.useMemo(()=>S0(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?S.createElement(g1,{page:t,matches:s,...e}):null}function p1(t){let{manifest:e,routeModules:n}=B0(),[s,r]=S.useState([]);return S.useEffect(()=>{let i=!1;return o1(t,e,n).then(o=>{i||r(o)}),()=>{i=!0}},[t,e,n]),s}function g1({page:t,matches:e,...n}){let s=Sn(),{manifest:r,routeModules:i}=B0(),{basename:o}=z0(),{loaderData:a,matches:l}=d1(),u=S.useMemo(()=>Cf(t,e,l,r,s,"data"),[t,e,l,r,s]),d=S.useMemo(()=>Cf(t,e,l,r,s,"assets"),[t,e,l,r,s]),h=S.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let x=new Set,m=!1;if(e.forEach(g=>{var v;let y=r.routes[g.route.id];!y||!y.hasLoader||(!u.some(w=>w.route.id===g.route.id)&&g.route.id in a&&((v=i[g.route.id])!=null&&v.shouldRevalidate)||y.hasClientLoader?m=!0:x.add(g.route.id))}),x.size===0)return[];let b=s1(t,o,"data");return m&&x.size>0&&b.searchParams.set("_routes",e.filter(g=>x.has(g.route.id)).map(g=>g.route.id).join(",")),[b.pathname+b.search]},[o,a,s,r,u,e,t,i]),f=S.useMemo(()=>a1(d,r),[d,r]),p=p1(d);return S.createElement(S.Fragment,null,h.map(x=>S.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),f.map(x=>S.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),p.map(({key:x,link:m})=>S.createElement("link",{key:x,nonce:n.nonce,...m})))}function m1(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var y1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{y1&&(window.__reactRouterVersion="7.11.0")}catch{}function x1({basename:t,children:e,unstable_useTransitions:n,window:s}){let r=S.useRef();r.current==null&&(r.current=Gb({window:s,v5Compat:!0}));let i=r.current,[o,a]=S.useState({action:i.action,location:i.location}),l=S.useCallback(u=>{n===!1?a(u):S.startTransition(()=>a(u))},[n]);return S.useLayoutEffect(()=>i.listen(l),[i,l]),S.createElement(Yw,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:i,unstable_useTransitions:n})}var W0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Id=S.forwardRef(function({onClick:e,discover:n="render",prefetch:s="none",relative:r,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},x){let{basename:m,unstable_useTransitions:b}=S.useContext(yt),g=typeof u=="string"&&W0.test(u),y=P0(u,m);u=y.to;let v=Tw(u,{relative:r}),[w,j,P]=h1(s,p),k=k1(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:r,viewTransition:h,unstable_defaultShouldRevalidate:f,unstable_useTransitions:b});function N(C){e&&e(C),C.defaultPrevented||k(C)}let R=S.createElement("a",{...p,...P,href:y.absoluteURL||v,onClick:y.isExternal||i?e:N,ref:m1(x,j),target:l,"data-discover":!g&&n==="render"?"true":void 0});return w&&!g?S.createElement(S.Fragment,null,R,S.createElement(f1,{page:v})):R});Id.displayName="Link";var v1=S.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:r=!1,style:i,to:o,viewTransition:a,children:l,...u},d){let h=xo(o,{relative:u.relative}),f=Sn(),p=S.useContext(vl),{navigator:x,basename:m}=S.useContext(yt),b=p!=null&&N1(h)&&a===!0,g=x.encodeLocation?x.encodeLocation(h).pathname:h.pathname,y=f.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(y=y.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=kn(v,m)||v);const w=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let j=y===g||!r&&y.startsWith(g)&&y.charAt(w)==="/",P=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)==="/"),k={isActive:j,isPending:P,isTransitioning:b},N=j?e:void 0,R;typeof s=="function"?R=s(k):R=[s,j?"active":null,P?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let C=typeof i=="function"?i(k):i;return S.createElement(Id,{...u,"aria-current":N,className:R,ref:d,style:C,to:o,viewTransition:a},typeof l=="function"?l(k):l)});v1.displayName="NavLink";var b1=S.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:r,state:i,method:o=fa,action:a,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},x)=>{let{unstable_useTransitions:m}=S.useContext(yt),b=C1(),g=j1(a,{relative:u}),y=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&W0.test(a),w=j=>{if(l&&l(j),j.defaultPrevented)return;j.preventDefault();let P=j.nativeEvent.submitter,k=(P==null?void 0:P.getAttribute("formmethod"))||o,N=()=>b(P||j.currentTarget,{fetcherKey:e,method:k,navigate:n,replace:r,state:i,relative:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f});m&&n!==!1?S.startTransition(()=>N()):N()};return S.createElement("form",{ref:x,method:y,action:g,onSubmit:s?l:w,...p,"data-discover":!v&&t==="render"?"true":void 0})});b1.displayName="Form";function w1(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $0(t){let e=S.useContext(Hr);return ge(e,w1(t)),e}function k1(t,{target:e,replace:n,state:s,preventScrollReset:r,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a,unstable_useTransitions:l}={}){let u=yo(),d=Sn(),h=xo(t,{relative:i});return S.useCallback(f=>{if(Zw(f,e)){f.preventDefault();let p=n!==void 0?n:Gi(d)===Gi(h),x=()=>u(t,{replace:p,state:s,preventScrollReset:r,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a});l?S.startTransition(()=>x()):x()}},[d,u,h,n,s,e,t,r,i,o,a,l])}var _1=0,S1=()=>`__${String(++_1)}__`;function C1(){let{router:t}=$0("useSubmit"),{basename:e}=S.useContext(yt),n=$w(),s=t.fetch,r=t.navigate;return S.useCallback(async(i,o={})=>{let{action:a,method:l,encType:u,formData:d,body:h}=n1(i,e);if(o.navigate===!1){let f=o.fetcherKey||S1();await s(f,n,o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:d,body:h,formMethod:o.method||l,formEncType:o.encType||u,flushSync:o.flushSync})}else await r(o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:d,body:h,formMethod:o.method||l,formEncType:o.encType||u,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[s,r,e,n])}function j1(t,{relative:e}={}){let{basename:n}=S.useContext(yt),s=S.useContext(Ht);ge(s,"useFormAction must be used inside a RouteContext");let[r]=s.matches.slice(-1),i={...xo(t||".",{relative:e})},o=Sn();if(t==null){i.search=o.search;let a=new URLSearchParams(i.search),l=a.getAll("index");if(l.some(d=>d==="")){a.delete("index"),l.filter(h=>h).forEach(h=>a.append("index",h));let d=a.toString();i.search=d?`?${d}`:""}}return(!t||t===".")&&r.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:yn([n,i.pathname])),Gi(i)}function N1(t,{relative:e}={}){let n=S.useContext(T0);ge(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=$0("useViewTransitionState"),r=xo(t,{relative:e});if(!n.isTransitioning)return!1;let i=kn(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=kn(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Ua(r.pathname,o)!=null||Ua(r.pathname,i)!=null}function Ut(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Hs(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const H0=6048e5,E1=864e5;let P1={};function wl(){return P1}function Ji(t,e){var a,l,u,d;const n=wl(),s=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,r=Ut(t),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function Va(t){return Ji(t,{weekStartsOn:1})}function U0(t){const e=Ut(t),n=e.getFullYear(),s=Hs(t,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const r=Va(s),i=Hs(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Va(i);return e.getTime()>=r.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function jf(t){const e=Ut(t);return e.setHours(0,0,0,0),e}function Nf(t){const e=Ut(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function M1(t,e){const n=jf(t),s=jf(e),r=+n-Nf(n),i=+s-Nf(s);return Math.round((r-i)/E1)}function T1(t){const e=U0(t),n=Hs(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Va(n)}function R1(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function O1(t){if(!R1(t)&&typeof t!="number")return!1;const e=Ut(t);return!isNaN(Number(e))}function D1(t){const e=Ut(t),n=Hs(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const L1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},F1=(t,e,n)=>{let s;const r=L1[t];return typeof r=="string"?s=r:e===1?s=r.one:s=r.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function tu(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const I1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},A1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},B1={date:tu({formats:I1,defaultWidth:"full"}),time:tu({formats:A1,defaultWidth:"full"}),dateTime:tu({formats:z1,defaultWidth:"full"})},W1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$1=(t,e,n,s)=>W1[t];function ni(t){return(e,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return r[i]}}const H1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},U1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},V1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Q1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Y1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},K1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},X1=(t,e)=>{const n=Number(t),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},q1={ordinalNumber:X1,era:ni({values:H1,defaultWidth:"wide"}),quarter:ni({values:U1,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ni({values:V1,defaultWidth:"wide"}),day:ni({values:Q1,defaultWidth:"wide"}),dayPeriod:ni({values:Y1,defaultWidth:"wide",formattingValues:K1,defaultFormattingWidth:"wide"})};function si(t){return(e,n={})=>{const s=n.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=e.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?J1(a,h=>h.test(o)):G1(a,h=>h.test(o));let u;u=t.valueCallback?t.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=e.slice(o.length);return{value:u,rest:d}}}function G1(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function J1(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Z1(t){return(e,n={})=>{const s=e.match(t.matchPattern);if(!s)return null;const r=s[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(r.length);return{value:o,rest:a}}}const ek=/^(\d+)(th|st|nd|rd)?/i,tk=/\d+/i,nk={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sk={any:[/^b/i,/^(a|c)/i]},rk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ik={any:[/1/i,/2/i,/3/i,/4/i]},ok={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ak={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lk={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},uk={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ck={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dk={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},hk={ordinalNumber:Z1({matchPattern:ek,parsePattern:tk,valueCallback:t=>parseInt(t,10)}),era:si({matchPatterns:nk,defaultMatchWidth:"wide",parsePatterns:sk,defaultParseWidth:"any"}),quarter:si({matchPatterns:rk,defaultMatchWidth:"wide",parsePatterns:ik,defaultParseWidth:"any",valueCallback:t=>t+1}),month:si({matchPatterns:ok,defaultMatchWidth:"wide",parsePatterns:ak,defaultParseWidth:"any"}),day:si({matchPatterns:lk,defaultMatchWidth:"wide",parsePatterns:uk,defaultParseWidth:"any"}),dayPeriod:si({matchPatterns:ck,defaultMatchWidth:"any",parsePatterns:dk,defaultParseWidth:"any"})},fk={code:"en-US",formatDistance:F1,formatLong:B1,formatRelative:$1,localize:q1,match:hk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function pk(t){const e=Ut(t);return M1(e,D1(e))+1}function gk(t){const e=Ut(t),n=+Va(e)-+T1(e);return Math.round(n/H0)+1}function V0(t,e){var d,h,f,p;const n=Ut(t),s=n.getFullYear(),r=wl(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=Hs(t,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const a=Ji(o,e),l=Hs(t,0);l.setFullYear(s,0,i),l.setHours(0,0,0,0);const u=Ji(l,e);return n.getTime()>=a.getTime()?s+1:n.getTime()>=u.getTime()?s:s-1}function mk(t,e){var a,l,u,d;const n=wl(),s=(e==null?void 0:e.firstWeekContainsDate)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,r=V0(t,e),i=Hs(t,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),Ji(i,e)}function yk(t,e){const n=Ut(t),s=+Ji(n,e)-+mk(n,e);return Math.round(s/H0)+1}function se(t,e){const n=t<0?"-":"",s=Math.abs(t).toString().padStart(e,"0");return n+s}const jn={y(t,e){const n=t.getFullYear(),s=n>0?n:1-n;return se(e==="yy"?s%100:s,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):se(n+1,2)},d(t,e){return se(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return se(t.getHours()%12||12,e.length)},H(t,e){return se(t.getHours(),e.length)},m(t,e){return se(t.getMinutes(),e.length)},s(t,e){return se(t.getSeconds(),e.length)},S(t,e){const n=e.length,s=t.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return se(r,e.length)}},Ks={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ef={G:function(t,e,n){const s=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const s=t.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return jn.y(t,e)},Y:function(t,e,n,s){const r=V0(t,s),i=r>0?r:1-r;if(e==="YY"){const o=i%100;return se(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):se(i,e.length)},R:function(t,e){const n=U0(t);return se(n,e.length)},u:function(t,e){const n=t.getFullYear();return se(n,e.length)},Q:function(t,e,n){const s=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return se(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(t,e,n){const s=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return se(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(t,e,n){const s=t.getMonth();switch(e){case"M":case"MM":return jn.M(t,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(t,e,n){const s=t.getMonth();switch(e){case"L":return String(s+1);case"LL":return se(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(t,e,n,s){const r=yk(t,s);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):se(r,e.length)},I:function(t,e,n){const s=gk(t);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):se(s,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):jn.d(t,e)},D:function(t,e,n){const s=pk(t);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):se(s,e.length)},E:function(t,e,n){const s=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(t,e,n,s){const r=t.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return se(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,s){const r=t.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return se(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const s=t.getDay(),r=s===0?7:s;switch(e){case"i":return String(r);case"ii":return se(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const s=t.getHours();let r;switch(s===12?r=Ks.noon:s===0?r=Ks.midnight:r=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const s=t.getHours();let r;switch(s>=17?r=Ks.evening:s>=12?r=Ks.afternoon:s>=4?r=Ks.morning:r=Ks.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let s=t.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return jn.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):jn.H(t,e)},K:function(t,e,n){const s=t.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):se(s,e.length)},k:function(t,e,n){let s=t.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):se(s,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):jn.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):jn.s(t,e)},S:function(t,e){return jn.S(t,e)},X:function(t,e,n){const s=t.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Mf(s);case"XXXX":case"XX":return xs(s);case"XXXXX":case"XXX":default:return xs(s,":")}},x:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"x":return Mf(s);case"xxxx":case"xx":return xs(s);case"xxxxx":case"xxx":default:return xs(s,":")}},O:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Pf(s,":");case"OOOO":default:return"GMT"+xs(s,":")}},z:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Pf(s,":");case"zzzz":default:return"GMT"+xs(s,":")}},t:function(t,e,n){const s=Math.trunc(t.getTime()/1e3);return se(s,e.length)},T:function(t,e,n){const s=t.getTime();return se(s,e.length)}};function Pf(t,e=""){const n=t>0?"-":"+",s=Math.abs(t),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+e+se(i,2)}function Mf(t,e){return t%60===0?(t>0?"-":"+")+se(Math.abs(t)/60,2):xs(t,e)}function xs(t,e=""){const n=t>0?"-":"+",s=Math.abs(t),r=se(Math.trunc(s/60),2),i=se(s%60,2);return n+r+e+i}const Tf=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q0=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},xk=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return Tf(t,e);let i;switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",Tf(s,e)).replace("{{time}}",Q0(r,e))},vk={p:Q0,P:xk},bk=/^D+$/,wk=/^Y+$/,kk=["D","DD","YY","YYYY"];function _k(t){return bk.test(t)}function Sk(t){return wk.test(t)}function Ck(t,e,n){const s=jk(t,e,n);if(console.warn(s),kk.includes(t))throw new RangeError(s)}function jk(t,e,n){const s=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Nk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ek=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pk=/^'([^]*?)'?$/,Mk=/''/g,Tk=/[a-zA-Z]/;function ht(t,e,n){var d,h,f,p;const s=wl(),r=s.locale??fk,i=s.firstWeekContainsDate??((h=(d=s.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,o=s.weekStartsOn??((p=(f=s.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,a=Ut(t);if(!O1(a))throw new RangeError("Invalid time value");let l=e.match(Ek).map(x=>{const m=x[0];if(m==="p"||m==="P"){const b=vk[m];return b(x,r.formatLong)}return x}).join("").match(Nk).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const m=x[0];if(m==="'")return{isToken:!1,value:Rk(x)};if(Ef[m])return{isToken:!0,value:x};if(m.match(Tk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return l.map(x=>{if(!x.isToken)return x.value;const m=x.value;(Sk(m)||_k(m))&&Ck(m,e,String(t));const b=Ef[m[0]];return b(a,m,r.localize,u)}).join("")}function Rk(t){const e=t.match(Pk);return e?e[1].replace(Mk,"'"):t}function Ok({name:t,sessionCount:e,lastActivity:n,sessions:s,selectedId:r,onSelectSession:i,initialExpanded:o=!1}){const[a,l]=S.useState(o);return S.useEffect(()=>{r&&s.some(d=>{var h;return d.id===r||((h=d.agentSessions)==null?void 0:h.some(f=>f.id===r))})&&l(!0)},[r,s]),c.jsxs("div",{className:"border-b border-gray-700",children:[c.jsx("button",{onClick:()=>l(!a),className:"sticky top-0 z-10 w-full text-left p-4 bg-gray-900 hover:bg-gray-800 transition-colors flex items-center justify-between",children:c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("svg",{className:`w-4 h-4 transition-transform ${a?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),c.jsx("span",{className:"font-semibold text-sm truncate",children:t})]}),c.jsxs("div",{className:"text-xs text-gray-400 mt-1 ml-6",children:[e," session",e!==1?"s":""," · Last activity"," ",ht(new Date(n),"PPp")]})]})}),a&&c.jsx("div",{className:"bg-gray-900/50",children:s.map(u=>c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>i(u.id),className:`w-full text-left px-4 py-3 pl-8 hover:bg-gray-700/50 transition-colors border-l-2 ${r===u.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[u.title&&c.jsx("div",{className:"text-sm font-medium text-gray-200 mb-1 truncate",children:u.title}),c.jsx("div",{className:"text-xs text-gray-400",children:ht(new Date(u.timestamp),"PPpp")}),c.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[u.messageCount," message",u.messageCount!==1?"s":"",u.agentSessions&&u.agentSessions.length>0&&c.jsxs("span",{className:"ml-2",children:["· ",u.agentSessions.length," task",u.agentSessions.length!==1?"s":""]})]})]}),u.agentSessions&&u.agentSessions.length>0&&c.jsx("div",{className:"bg-gray-900/70",children:u.agentSessions.map(d=>c.jsxs("button",{onClick:()=>i(d.id),className:`w-full text-left px-4 py-2 pl-14 hover:bg-gray-700/50 transition-colors border-l-2 ${r===d.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:"TASK"}),d.title&&c.jsx("span",{className:"text-sm font-medium text-gray-300 truncate",children:d.title})]}),c.jsx("div",{className:"text-xs text-gray-400",children:ht(new Date(d.timestamp),"PPpp")}),c.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[d.messageCount," message",d.messageCount!==1?"s":""]})]},d.id))})]},u.id))})]})}function Dk({projects:t,selectedId:e,onSelect:n}){const s=r=>e?r.sessions.some(i=>{var o;return i.id===e||((o=i.agentSessions)==null?void 0:o.some(a=>a.id===e))}):!1;return c.jsx("div",{children:t.map(r=>c.jsx(Ok,{id:r.id,name:r.name,sessionCount:r.sessionCount,lastActivity:r.lastActivity,sessions:r.sessions,selectedId:e,onSelectSession:n,initialExpanded:s(r)},r.id))})}function Lk({messages:t,activeId:e,onNavigate:n}){const[s,r]=S.useState([]),i=S.useRef(null),o=S.useRef(null);S.useEffect(()=>{const l=t.map((u,d)=>{var x;const h=`message-${d}`;let f="";const p=[];if((x=u.message)!=null&&x.content&&Array.isArray(u.message.content)){const m=u.message.content.find(b=>b.type==="text");m&&(f=m.text.slice(0,50)+(m.text.length>50?"...":"")),u.message.content.forEach(b=>{b.type==="tool_use"?p.push({name:b.name,type:"tool_use"}):b.type==="tool_result"&&p.push({name:"Tool Result",type:"tool_result"})})}return{id:h,type:u.type||"system",text:f,toolUses:p,timestamp:u.timestamp}});r(l)},[t]),S.useEffect(()=>{if(i.current&&o.current){const l=o.current,u=i.current,d=l.getBoundingClientRect(),h=u.getBoundingClientRect();(h.top<d.top||h.bottom>d.bottom)&&u.scrollIntoView({behavior:"smooth",block:"nearest"})}},[e]);const a=l=>{n(l,!0)};return c.jsxs("div",{className:"w-full h-full flex flex-col border-l border-gray-700 bg-gray-800",children:[c.jsxs("div",{className:"p-4 border-b border-gray-700 bg-gray-800 flex-shrink-0",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Table of Contents"}),c.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[s.length," messages"]})]}),c.jsx("nav",{ref:o,className:"p-2 flex-1 overflow-y-auto",children:s.map((l,u)=>c.jsx("div",{className:"mb-1",children:c.jsxs("button",{ref:e===l.id?i:null,onClick:()=>a(l.id),className:`w-full text-left px-3 py-2 rounded text-xs transition-colors ${e===l.id?"bg-blue-900/50 text-blue-200 border-l-2 border-blue-400":"text-gray-400 hover:bg-gray-700 hover:text-gray-200"}`,style:{scrollMarginTop:"16px",scrollMarginBottom:"16px"},children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:`px-1.5 py-0.5 text-[10px] rounded ${l.type==="user"?"bg-blue-900/50 text-blue-300":l.type==="assistant"?"bg-green-900/50 text-green-300":"bg-gray-700 text-gray-400"}`,children:l.type}),c.jsxs("span",{className:"text-gray-500",children:["#",u+1]})]}),l.text&&c.jsx("div",{className:"text-gray-300 line-clamp-2 leading-tight",children:l.text}),l.toolUses.length>0&&c.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:l.toolUses.map((d,h)=>c.jsxs("span",{className:`px-1.5 py-0.5 text-[10px] rounded font-mono ${d.type==="tool_result"?"bg-green-900/30 text-green-400":"bg-yellow-900/30 text-yellow-400"}`,children:[d.type==="tool_result"?"✓":"🔧"," ",d.name]},h))})]})},l.id))})]})}const Sc=256,Rf=640,Fk=896,Ik=Fk+Sc;function Ak({sessionId:t,sessionInfo:e,isProjectDashboard:n=!1}){var A,z,X;const s=yo(),[r,i]=S.useState(null),[o,a]=S.useState(!0),[l,u]=S.useState(null),d=S.useRef(new Map),h=S.useRef(!1),f=S.useRef(null),p=S.useRef(null),x=S.useRef(null),m=S.useRef(null),b=S.useRef(!1),g=S.useRef(0),y=S.useRef(0),v=S.useRef(null),w=S.useRef(null),j=S.useRef(null),P=S.useRef(null),k=S.useRef(null),N=S.useRef(null),R=S.useRef(null),C=S.useRef(null),M=S.useRef(0),{data:L,isLoading:V,error:ke}=xl({queryKey:["session",t],queryFn:async()=>{const O=await fetch(`/api/sessions/${t}`);if(!O.ok)throw new Error("Failed to fetch session");return O.json()}});S.useEffect(()=>{g.current=0,y.current=0,v.current!==null&&(cancelAnimationFrame(v.current),v.current=null),M.current=0,i(null),f.current=null,b.current=!1;const O=C.current;O&&(O.scrollTop=0)},[t]);const te=O=>{const Q=j.current;if(!Q)return;const H=14+O*8,Z=1.25+O*.25,$=O,ve=O,sn=Math.max(0,1-$);Q.style.padding=`${H}px 24px`,P.current&&(P.current.style.fontSize=`${Z}rem`),k.current&&(k.current.style.opacity=`${$}`,k.current.style.height=$>0?"auto":"0"),N.current&&(N.current.style.opacity=`${ve}`,N.current.style.height=ve>0?"auto":"0",N.current.style.marginTop=ve>0?"1rem":"0"),R.current&&(R.current.style.opacity=`${sn}`,R.current.style.pointerEvents=sn>0?"auto":"none",R.current.style.position=sn>0?"static":"absolute")};S.useEffect(()=>{const O=l;if(!O)return;const Q=()=>{var ze;const Z=g.current,$=y.current,ve=$+(Z-$)*.2,sn=O.scrollHeight-(ve+O.clientHeight),wo=sn<=5,xt=ve<M.current;let Ye=b.current;Ye?sn>40&&(Ye=!1):wo&&(Ye=!0),b.current=Ye;const ds=Math.max(0,1-(xt?0:Ye?80:ve)/80);te(ds),y.current=ve,M.current=ve,Math.abs(Z-ve)>.5?v.current=requestAnimationFrame(Q):(y.current=Z,M.current=Z,v.current=null,Ye&&((ze=x.current)==null||ze.call(x)))},H=()=>{g.current=O.scrollTop,v.current===null&&(v.current=requestAnimationFrame(Q))};return O.addEventListener("scroll",H),()=>{O.removeEventListener("scroll",H),v.current!==null&&(cancelAnimationFrame(v.current),v.current=null)}},[t,l]),S.useEffect(()=>{if(!w.current)return;const O=w.current.parentElement??w.current,Q=$=>{a($>=Ik)},H=new ResizeObserver($=>{for(const ve of $)Q(ve.contentRect.width)}),Z=O.getBoundingClientRect().width;return Q(Z),H.observe(O),()=>{H.disconnect()}},[]),S.useEffect(()=>{var wo;if(!((wo=L==null?void 0:L.session)!=null&&wo.messages))return;const O=C.current;if(!O)return;const Q=new Set;let H=null;const Z=()=>{if(h.current)return;const xt=[];d.current.forEach((Ke,ce)=>{const De=Ke.getBoundingClientRect();xt.push({id:ce,element:Ke,rect:De})}),xt.sort((Ke,ce)=>Ke.rect.top-ce.rect.top);const Ye=O.getBoundingClientRect(),Vt=Ye.top,ds=Ye.bottom;let ze=null;for(const Ke of xt){const ce=Ke.rect.top>=Vt&&Ke.rect.bottom<=ds,De=Ke.rect.bottom>Vt&&Ke.rect.top<ds;if(ce){ze=Ke.id;break}else De&&!ze&&(ze=Ke.id)}ze&&ze!==f.current&&i(ze)},$=()=>{const xt=m.current;if(h.current&&xt){const ce=d.current.get(xt);if(ce){const De=O.getBoundingClientRect(),ko=ce.getBoundingClientRect();if(!(ko.top>=De.top&&ko.top<=De.top+5))return}h.current=!1,m.current=null}if(b.current){const ce=L.session.messages.length-1,De=ce>=0?`message-${ce}`:null;De&&De!==f.current&&i(De);return}if(Q.size===0){Z();return}const Ye=O.getBoundingClientRect(),Vt=Ye.top,ds=Ye.bottom;let ze=null;const Ke=Array.from(Q).map(ce=>{const De=d.current.get(ce);return De?{id:ce,rect:De.getBoundingClientRect()}:null}).filter(ce=>!!ce);if(Ke.length===0){Z();return}Ke.sort((ce,De)=>ce.rect.top-De.rect.top);for(const ce of Ke){const De=ce.rect.top>=Vt&&ce.rect.bottom<=ds,ko=ce.rect.bottom>Vt&&ce.rect.top<ds;if(De){ze=ce.id;break}else ko&&!ze&&(ze=ce.id)}ze&&ze!==f.current&&i(ze)},ve=()=>{H!==null&&cancelAnimationFrame(H),H=requestAnimationFrame(()=>{H=null,$()})};x.current=$;const sn=new IntersectionObserver(xt=>{for(const Ye of xt){const Vt=Ye.target.dataset.messageId;Vt&&(Ye.isIntersecting?Q.add(Vt):Q.delete(Vt))}ve()},{root:O,threshold:[0,.1,.5,1]});return d.current.forEach(xt=>sn.observe(xt)),ve(),()=>{sn.disconnect(),x.current=null,H!==null&&cancelAnimationFrame(H)}},[(A=L==null?void 0:L.session)==null?void 0:A.messages,l]),S.useEffect(()=>{f.current=r},[r]),S.useEffect(()=>{te(1)},[(z=L==null?void 0:L.session)==null?void 0:z.id]);const B=S.useCallback(O=>{C.current=O,u(Q=>Q===O?Q:O)},[]),ae=(O,Q=!1)=>{if(i(O),Q){h.current=!0,m.current=O,p.current&&(clearTimeout(p.current),p.current=null);const H=d.current.get(O);H&&H.scrollIntoView({behavior:"smooth",block:"start"}),p.current=setTimeout(()=>{var Z;h.current=!1,m.current=null,p.current=null,(Z=x.current)==null||Z.call(x)},1500)}};if(S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]),V&&!L&&!e)return c.jsxs("div",{className:"h-full flex min-w-0",children:[c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Rf}px`},children:[c.jsx("div",{className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 p-6",children:c.jsxs("div",{className:"animate-pulse",children:[c.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-3"}),c.jsx("div",{className:"h-5 bg-gray-700 rounded w-1/3 mb-4"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-32"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-24"})]})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:c.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(O=>c.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),c.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},O))})})]}),o&&c.jsx("div",{style:{width:`${Sc}px`,flexShrink:0},className:"border-l border-gray-700 bg-gray-800/30 p-4",children:c.jsxs("div",{className:"animate-pulse space-y-3",children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-3/4"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4"})]})})]});if(ke)return c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-red-400",children:["Error: ",ke.message]})});const E=(L==null?void 0:L.session)||e;return c.jsxs("div",{ref:w,className:"h-full flex min-w-0",children:[c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Rf}px`},children:[c.jsxs("div",{ref:j,className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 transition-all duration-200",style:{padding:"22px 24px"},children:[c.jsxs("div",{className:"flex items-center gap-2",children:[(E==null?void 0:E.isAgent)&&c.jsx("span",{className:"px-2 py-1 text-xs bg-purple-900/50 text-purple-300 rounded font-semibold",children:"TASK"}),c.jsx("h2",{ref:P,className:"font-bold truncate flex-1 transition-all duration-200",style:{fontSize:"1.5rem"},children:(E==null?void 0:E.title)||"Untitled Session"}),c.jsx("button",{ref:R,onClick:()=>(E==null?void 0:E.projectId)&&s(`/projects/${E.projectId}`),className:"px-2 py-1 text-xs bg-gray-700 text-gray-300 rounded transition-all duration-200 hover:bg-gray-600 hover:text-white",style:{opacity:0},children:(E==null?void 0:E.projectName)||(E==null?void 0:E.projectId)}),c.jsx("button",{onClick:()=>!n&&(E==null?void 0:E.projectId)&&s(`/projects/${E.projectId}`),disabled:n,className:`flex items-center justify-center p-2 rounded-lg transition-colors flex-shrink-0 ${n?"bg-gray-700 text-gray-500 cursor-not-allowed opacity-50":"bg-gray-700 text-gray-300 hover:bg-gray-600 hover:text-white"}`,title:n?"Already on Project Dashboard":"Project Dashboard",children:c.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})})]}),c.jsx("div",{ref:k,onClick:()=>(E==null?void 0:E.projectId)&&s(`/projects/${E.projectId}`),className:"text-xl text-gray-300 transition-all duration-200 hover:text-white hover:underline cursor-pointer",style:{opacity:1,height:"auto",overflow:"hidden",marginTop:"-2px"},children:(E==null?void 0:E.projectName)||(E==null?void 0:E.projectId)}),c.jsxs("div",{ref:N,className:"flex items-center gap-3 text-sm text-gray-400 transition-all duration-200",style:{opacity:1,height:"auto",overflow:"hidden",marginTop:"1rem"},children:[c.jsx("span",{children:(E==null?void 0:E.timestamp)&&ht(new Date(E.timestamp),"PPpp")}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:[(E==null?void 0:E.messageCount)||0," message",(E==null?void 0:E.messageCount)!==1?"s":""]}),(E==null?void 0:E.agentSessions)&&E.agentSessions.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"•"}),c.jsxs("span",{children:[E.agentSessions.length," task",E.agentSessions.length!==1?"s":""]})]})]})]}),c.jsx("div",{ref:B,className:"flex-1 overflow-y-auto p-6",children:V&&!(E!=null&&E.messages)?c.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(O=>c.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),c.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},O))}):c.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:(X=E==null?void 0:E.messages)==null?void 0:X.map((O,Q)=>{var Z;const H=`message-${Q}`;return c.jsxs("div",{ref:$=>{$?d.current.set(H,$):d.current.delete(H)},"data-message-id":H,className:"border-l-2 border-gray-700 pl-4",style:{scrollMarginTop:"24px"},children:[c.jsx("div",{className:"flex items-start justify-between mb-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:`px-2 py-1 text-xs rounded ${O.type==="user"?"bg-blue-900 text-blue-200":O.type==="assistant"?"bg-green-900 text-green-200":"bg-gray-700 text-gray-300"}`,children:O.type||"system"}),c.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["#",Q+1]}),O.timestamp&&c.jsx("span",{className:"text-xs text-gray-500",children:ht(new Date(O.timestamp),"HH:mm:ss")})]})}),c.jsx("div",{className:"bg-gray-800 rounded-lg p-4 text-sm",children:(Z=O.message)!=null&&Z.content&&Array.isArray(O.message.content)?c.jsx("div",{className:"space-y-2",children:O.message.content.map(($,ve)=>c.jsxs("div",{children:[$.type==="text"&&c.jsx("p",{className:"whitespace-pre-wrap",children:$.text}),$.type==="tool_use"&&c.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{className:"text-yellow-400 font-mono text-xs",children:["🔧 ",$.name]}),$.name==="Task"&&$.agentId&&c.jsx(Id,{to:`/sessions/agent-${$.agentId}`,className:"px-2 py-1 text-xs bg-purple-700 hover:bg-purple-600 text-purple-100 rounded transition-colors",children:"View Task →"})]}),c.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify($.input,null,2)})]}),$.type==="tool_result"&&c.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[c.jsx("div",{className:"text-green-400 font-mono text-xs mb-2",children:"✓ Tool Result"}),c.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:typeof $.content=="string"?$.content:JSON.stringify($.content,null,2)})]})]},ve))}):c.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify(O,null,2)})})]},Q)})})})]}),o&&(E==null?void 0:E.messages)&&E.messages.length>0&&c.jsx("div",{style:{width:`${Sc}px`,flexShrink:0},children:c.jsx(Lk,{messages:E.messages,activeId:r,onNavigate:ae})})]})}/*!
52
- * @kurkle/color v0.3.4
53
- * https://github.com/kurkle/color#readme
54
- * (c) 2024 Jukka Kurkela
55
- * Released under the MIT License
56
- */function vo(t){return t+.5|0}const Hn=(t,e,n)=>Math.max(Math.min(t,n),e);function gi(t){return Hn(vo(t*2.55),0,255)}function ts(t){return Hn(vo(t*255),0,255)}function dn(t){return Hn(vo(t/2.55)/100,0,1)}function Of(t){return Hn(vo(t*100),0,100)}const vt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Cc=[..."0123456789ABCDEF"],zk=t=>Cc[t&15],Bk=t=>Cc[(t&240)>>4]+Cc[t&15],Ho=t=>(t&240)>>4===(t&15),Wk=t=>Ho(t.r)&&Ho(t.g)&&Ho(t.b)&&Ho(t.a);function $k(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&vt[t[1]]*17,g:255&vt[t[2]]*17,b:255&vt[t[3]]*17,a:e===5?vt[t[4]]*17:255}:(e===7||e===9)&&(n={r:vt[t[1]]<<4|vt[t[2]],g:vt[t[3]]<<4|vt[t[4]],b:vt[t[5]]<<4|vt[t[6]],a:e===9?vt[t[7]]<<4|vt[t[8]]:255})),n}const Hk=(t,e)=>t<255?e(t):"";function Uk(t){var e=Wk(t)?zk:Bk;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Hk(t.a,e):void 0}const Vk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Y0(t,e,n){const s=e*Math.min(n,1-n),r=(i,o=(i+t/30)%12)=>n-s*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function Qk(t,e,n){const s=(r,i=(r+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[s(5),s(3),s(1)]}function Yk(t,e,n){const s=Y0(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)s[r]*=1-e-n,s[r]+=e;return s}function Kk(t,e,n,s,r){return t===r?(e-n)/s+(e<n?6:0):e===r?(n-t)/s+2:(t-e)/s+4}function Ad(t){const n=t.r/255,s=t.g/255,r=t.b/255,i=Math.max(n,s,r),o=Math.min(n,s,r),a=(i+o)/2;let l,u,d;return i!==o&&(d=i-o,u=a>.5?d/(2-i-o):d/(i+o),l=Kk(n,s,r,d,i),l=l*60+.5),[l|0,u||0,a]}function zd(t,e,n,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,s)).map(ts)}function Bd(t,e,n){return zd(Y0,t,e,n)}function Xk(t,e,n){return zd(Yk,t,e,n)}function qk(t,e,n){return zd(Qk,t,e,n)}function K0(t){return(t%360+360)%360}function Gk(t){const e=Vk.exec(t);let n=255,s;if(!e)return;e[5]!==s&&(n=e[6]?gi(+e[5]):ts(+e[5]));const r=K0(+e[2]),i=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?s=Xk(r,i,o):e[1]==="hsv"?s=qk(r,i,o):s=Bd(r,i,o),{r:s[0],g:s[1],b:s[2],a:n}}function Jk(t,e){var n=Ad(t);n[0]=K0(n[0]+e),n=Bd(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Zk(t){if(!t)return;const e=Ad(t),n=e[0],s=Of(e[1]),r=Of(e[2]);return t.a<255?`hsla(${n}, ${s}%, ${r}%, ${dn(t.a)})`:`hsl(${n}, ${s}%, ${r}%)`}const Df={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Lf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function e_(){const t={},e=Object.keys(Lf),n=Object.keys(Df);let s,r,i,o,a;for(s=0;s<e.length;s++){for(o=a=e[s],r=0;r<n.length;r++)i=n[r],a=a.replace(i,Df[i]);i=parseInt(Lf[o],16),t[a]=[i>>16&255,i>>8&255,i&255]}return t}let Uo;function t_(t){Uo||(Uo=e_(),Uo.transparent=[0,0,0,0]);const e=Uo[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const n_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function s_(t){const e=n_.exec(t);let n=255,s,r,i;if(e){if(e[7]!==s){const o=+e[7];n=e[8]?gi(o):Hn(o*255,0,255)}return s=+e[1],r=+e[3],i=+e[5],s=255&(e[2]?gi(s):Hn(s,0,255)),r=255&(e[4]?gi(r):Hn(r,0,255)),i=255&(e[6]?gi(i):Hn(i,0,255)),{r:s,g:r,b:i,a:n}}}function r_(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${dn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const nu=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Xs=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function i_(t,e,n){const s=Xs(dn(t.r)),r=Xs(dn(t.g)),i=Xs(dn(t.b));return{r:ts(nu(s+n*(Xs(dn(e.r))-s))),g:ts(nu(r+n*(Xs(dn(e.g))-r))),b:ts(nu(i+n*(Xs(dn(e.b))-i))),a:t.a+n*(e.a-t.a)}}function Vo(t,e,n){if(t){let s=Ad(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*n,e===0?360:1)),s=Bd(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function X0(t,e){return t&&Object.assign(e||{},t)}function Ff(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=ts(t[3]))):(e=X0(t,{r:0,g:0,b:0,a:1}),e.a=ts(e.a)),e}function o_(t){return t.charAt(0)==="r"?s_(t):Gk(t)}class Zi{constructor(e){if(e instanceof Zi)return e;const n=typeof e;let s;n==="object"?s=Ff(e):n==="string"&&(s=$k(e)||t_(e)||o_(e)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var e=X0(this._rgb);return e&&(e.a=dn(e.a)),e}set rgb(e){this._rgb=Ff(e)}rgbString(){return this._valid?r_(this._rgb):void 0}hexString(){return this._valid?Uk(this._rgb):void 0}hslString(){return this._valid?Zk(this._rgb):void 0}mix(e,n){if(e){const s=this.rgb,r=e.rgb;let i;const o=n===i?.5:n,a=2*o-1,l=s.a-r.a,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-u,s.r=255&u*s.r+i*r.r+.5,s.g=255&u*s.g+i*r.g+.5,s.b=255&u*s.b+i*r.b+.5,s.a=o*s.a+(1-o)*r.a,this.rgb=s}return this}interpolate(e,n){return e&&(this._rgb=i_(this._rgb,e._rgb,n)),this}clone(){return new Zi(this.rgb)}alpha(e){return this._rgb.a=ts(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=vo(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Vo(this._rgb,2,e),this}darken(e){return Vo(this._rgb,2,-e),this}saturate(e){return Vo(this._rgb,1,e),this}desaturate(e){return Vo(this._rgb,1,-e),this}rotate(e){return Jk(this._rgb,e),this}}/*!
57
- * Chart.js v4.5.1
58
- * https://www.chartjs.org
59
- * (c) 2025 Chart.js Contributors
60
- * Released under the MIT License
61
- */function rn(){}const a_=(()=>{let t=0;return()=>t++})();function oe(t){return t==null}function Pe(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function J(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Mt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Yt(t,e){return Mt(t)?t:e}function ee(t,e){return typeof t>"u"?e:t}const l_=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function he(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function re(t,e,n,s){let r,i,o;if(Pe(t))for(i=t.length,r=0;r<i;r++)e.call(n,t[r],r);else if(J(t))for(o=Object.keys(t),i=o.length,r=0;r<i;r++)e.call(n,t[o[r]],o[r])}function Qa(t,e){let n,s,r,i;if(!t||!e||t.length!==e.length)return!1;for(n=0,s=t.length;n<s;++n)if(r=t[n],i=e[n],r.datasetIndex!==i.datasetIndex||r.index!==i.index)return!1;return!0}function Ya(t){if(Pe(t))return t.map(Ya);if(J(t)){const e=Object.create(null),n=Object.keys(t),s=n.length;let r=0;for(;r<s;++r)e[n[r]]=Ya(t[n[r]]);return e}return t}function q0(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function u_(t,e,n,s){if(!q0(t))return;const r=e[t],i=n[t];J(r)&&J(i)?eo(r,i,s):e[t]=Ya(i)}function eo(t,e,n){const s=Pe(e)?e:[e],r=s.length;if(!J(t))return t;n=n||{};const i=n.merger||u_;let o;for(let a=0;a<r;++a){if(o=s[a],!J(o))continue;const l=Object.keys(o);for(let u=0,d=l.length;u<d;++u)i(l[u],t,o,n)}return t}function Ni(t,e){return eo(t,e,{merger:c_})}function c_(t,e,n){if(!q0(t))return;const s=e[t],r=n[t];J(s)&&J(r)?Ni(s,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ya(r))}const If={"":t=>t,x:t=>t.x,y:t=>t.y};function d_(t){const e=t.split("."),n=[];let s="";for(const r of e)s+=r,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function h_(t){const e=d_(t);return n=>{for(const s of e){if(s==="")break;n=n&&n[s]}return n}}function Ir(t,e){return(If[e]||(If[e]=h_(e)))(t)}function Wd(t){return t.charAt(0).toUpperCase()+t.slice(1)}const to=t=>typeof t<"u",os=t=>typeof t=="function",Af=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function f_(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Ve=Math.PI,ns=2*Ve,Ka=Number.POSITIVE_INFINITY,p_=Ve/180,At=Ve/2,hs=Ve/4,zf=Ve*2/3,G0=Math.log10,ss=Math.sign;function ga(t,e,n){return Math.abs(t-e)<n}function Bf(t){const e=Math.round(t);t=ga(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(G0(t))),s=t/n;return(s<=1?1:s<=2?2:s<=5?5:10)*n}function g_(t){const e=[],n=Math.sqrt(t);let s;for(s=1;s<n;s++)t%s===0&&(e.push(s),e.push(t/s));return n===(n|0)&&e.push(n),e.sort((r,i)=>r-i).pop(),e}function m_(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Xa(t){return!m_(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function y_(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function x_(t,e,n){let s,r,i;for(s=0,r=t.length;s<r;s++)i=t[s][n],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function Ss(t){return t*(Ve/180)}function v_(t){return t*(180/Ve)}function Wf(t){if(!Mt(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function b_(t,e){const n=e.x-t.x,s=e.y-t.y,r=Math.sqrt(n*n+s*s);let i=Math.atan2(s,n);return i<-.5*Ve&&(i+=ns),{angle:i,distance:r}}function w_(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fs(t){return(t%ns+ns)%ns}function k_(t,e,n,s){const r=fs(t),i=fs(e),o=fs(n),a=fs(i-r),l=fs(o-r),u=fs(r-i),d=fs(r-o);return r===i||r===o||s||a>l&&u<d}function zt(t,e,n){return Math.max(e,Math.min(n,t))}function __(t){return zt(t,-32768,32767)}function lr(t,e,n,s=1e-6){return t>=Math.min(e,n)-s&&t<=Math.max(e,n)+s}function $d(t,e,n){n=n||(o=>t[o]<e);let s=t.length-1,r=0,i;for(;s-r>1;)i=r+s>>1,n(i)?r=i:s=i;return{lo:r,hi:s}}const jc=(t,e,n,s)=>$d(t,n,s?r=>{const i=t[r][e];return i<n||i===n&&t[r+1][e]===n}:r=>t[r][e]<n),S_=(t,e,n)=>$d(t,n,s=>t[s][e]>=n);function C_(t,e,n){let s=0,r=t.length;for(;s<r&&t[s]<e;)s++;for(;r>s&&t[r-1]>n;)r--;return s>0||r<t.length?t.slice(s,r):t}const J0=["push","pop","shift","splice","unshift"];function j_(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),J0.forEach(n=>{const s="_onData"+Wd(n),r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...i){const o=r.apply(this,i);return t._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...i)}),o}})})}function $f(t,e){const n=t._chartjs;if(!n)return;const s=n.listeners,r=s.indexOf(e);r!==-1&&s.splice(r,1),!(s.length>0)&&(J0.forEach(i=>{delete t[i]}),delete t._chartjs)}function Z0(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const ey=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function ty(t,e){let n=[],s=!1;return function(...r){n=r,s||(s=!0,ey.call(window,()=>{s=!1,t.apply(e,n)}))}}function N_(t,e){let n;return function(...s){return e?(clearTimeout(n),n=setTimeout(t,e,s)):t.apply(this,s),e}}const Hd=t=>t==="start"?"left":t==="end"?"right":"center",$e=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,E_=(t,e,n,s)=>t===(s?"left":"right")?n:t==="center"?(e+n)/2:e,Qo=t=>t===0||t===1,Hf=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*ns/n)),Uf=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*ns/n)+1,Ei={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*At)+1,easeOutSine:t=>Math.sin(t*At),easeInOutSine:t=>-.5*(Math.cos(Ve*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Qo(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Qo(t)?t:Hf(t,.075,.3),easeOutElastic:t=>Qo(t)?t:Uf(t,.075,.3),easeInOutElastic(t){return Qo(t)?t:t<.5?.5*Hf(t*2,.1125,.45):.5+.5*Uf(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Ei.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Ei.easeInBounce(t*2)*.5:Ei.easeOutBounce(t*2-1)*.5+.5};function ny(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Vf(t){return ny(t)?t:new Zi(t)}function su(t){return ny(t)?t:new Zi(t).saturate(.5).darken(.1).hexString()}const P_=["x","y","borderWidth","radius","tension"],M_=["color","borderColor","backgroundColor"];function T_(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:M_},numbers:{type:"number",properties:P_}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function R_(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Qf=new Map;function O_(t,e){e=e||{};const n=t+JSON.stringify(e);let s=Qf.get(n);return s||(s=new Intl.NumberFormat(t,e),Qf.set(n,s)),s}function sy(t,e,n){return O_(e,n).format(t)}const D_={values(t){return Pe(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const s=this.chart.options.locale;let r,i=t;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),i=L_(t,n)}const o=G0(Math.abs(i)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),sy(t,s,l)}};function L_(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var ry={formatters:D_};function F_(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ry.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Us=Object.create(null),Nc=Object.create(null);function Pi(t,e){if(!e)return t;const n=e.split(".");for(let s=0,r=n.length;s<r;++s){const i=n[s];t=t[i]||(t[i]=Object.create(null))}return t}function ru(t,e,n){return typeof e=="string"?eo(Pi(t,e),n):eo(Pi(t,""),e)}class I_{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,r)=>su(r.backgroundColor),this.hoverBorderColor=(s,r)=>su(r.borderColor),this.hoverColor=(s,r)=>su(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return ru(this,e,n)}get(e){return Pi(this,e)}describe(e,n){return ru(Nc,e,n)}override(e,n){return ru(Us,e,n)}route(e,n,s,r){const i=Pi(this,e),o=Pi(this,s),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=o[r];return J(l)?Object.assign({},u,l):ee(l,u)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var Se=new I_({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[T_,R_,F_]);function A_(t){return!t||oe(t.size)||oe(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Yf(t,e,n,s,r){let i=e[r];return i||(i=e[r]=t.measureText(r).width,n.push(r)),i>s&&(s=i),s}function ps(t,e,n){const s=t.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((e-r)*s)/s+r}function Kf(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Xf(t,e,n,s){iy(t,e,n,s,null)}function iy(t,e,n,s,r){let i,o,a,l,u,d,h,f;const p=e.pointStyle,x=e.rotation,m=e.radius;let b=(x||0)*p_;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(n,s),t.rotate(b),t.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),t.restore();return}if(!(isNaN(m)||m<=0)){switch(t.beginPath(),p){default:r?t.ellipse(n,s,r/2,m,0,0,ns):t.arc(n,s,m,0,ns),t.closePath();break;case"triangle":d=r?r/2:m,t.moveTo(n+Math.sin(b)*d,s-Math.cos(b)*m),b+=zf,t.lineTo(n+Math.sin(b)*d,s-Math.cos(b)*m),b+=zf,t.lineTo(n+Math.sin(b)*d,s-Math.cos(b)*m),t.closePath();break;case"rectRounded":u=m*.516,l=m-u,o=Math.cos(b+hs)*l,h=Math.cos(b+hs)*(r?r/2-u:l),a=Math.sin(b+hs)*l,f=Math.sin(b+hs)*(r?r/2-u:l),t.arc(n-h,s-a,u,b-Ve,b-At),t.arc(n+f,s-o,u,b-At,b),t.arc(n+h,s+a,u,b,b+At),t.arc(n-f,s+o,u,b+At,b+Ve),t.closePath();break;case"rect":if(!x){l=Math.SQRT1_2*m,d=r?r/2:l,t.rect(n-d,s-l,2*d,2*l);break}b+=hs;case"rectRot":h=Math.cos(b)*(r?r/2:m),o=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(r?r/2:m),t.moveTo(n-h,s-a),t.lineTo(n+f,s-o),t.lineTo(n+h,s+a),t.lineTo(n-f,s+o),t.closePath();break;case"crossRot":b+=hs;case"cross":h=Math.cos(b)*(r?r/2:m),o=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(r?r/2:m),t.moveTo(n-h,s-a),t.lineTo(n+h,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o);break;case"star":h=Math.cos(b)*(r?r/2:m),o=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(r?r/2:m),t.moveTo(n-h,s-a),t.lineTo(n+h,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o),b+=hs,h=Math.cos(b)*(r?r/2:m),o=Math.cos(b)*m,a=Math.sin(b)*m,f=Math.sin(b)*(r?r/2:m),t.moveTo(n-h,s-a),t.lineTo(n+h,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o);break;case"line":o=r?r/2:Math.cos(b)*m,a=Math.sin(b)*m,t.moveTo(n-o,s-a),t.lineTo(n+o,s+a);break;case"dash":t.moveTo(n,s),t.lineTo(n+Math.cos(b)*(r?r/2:m),s+Math.sin(b)*m);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function oy(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Ud(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Vd(t){t.restore()}function z_(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),oe(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function B_(t,e,n,s,r){if(r.strikethrough||r.underline){const i=t.measureText(s),o=e-i.actualBoundingBoxLeft,a=e+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,u=n+i.actualBoundingBoxDescent,d=r.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,d),t.lineTo(a,d),t.stroke()}}function W_(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function no(t,e,n,s,r,i={}){const o=Pe(e)?e:[e],a=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(t.save(),t.font=r.string,z_(t,i),l=0;l<o.length;++l)u=o[l],i.backdrop&&W_(t,i.backdrop),a&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),oe(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(u,n,s,i.maxWidth)),t.fillText(u,n,s,i.maxWidth),B_(t,n,s,u,i),s+=Number(r.lineHeight);t.restore()}function qa(t,e){const{x:n,y:s,w:r,h:i,radius:o}=e;t.arc(n+o.topLeft,s+o.topLeft,o.topLeft,1.5*Ve,Ve,!0),t.lineTo(n,s+i-o.bottomLeft),t.arc(n+o.bottomLeft,s+i-o.bottomLeft,o.bottomLeft,Ve,At,!0),t.lineTo(n+r-o.bottomRight,s+i),t.arc(n+r-o.bottomRight,s+i-o.bottomRight,o.bottomRight,At,0,!0),t.lineTo(n+r,s+o.topRight),t.arc(n+r-o.topRight,s+o.topRight,o.topRight,0,-At,!0),t.lineTo(n+o.topLeft,s)}const $_=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,H_=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function U_(t,e){const n=(""+t).match($_);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const V_=t=>+t||0;function ay(t,e){const n={},s=J(e),r=s?Object.keys(e):e,i=J(t)?s?o=>ee(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of r)n[o]=V_(i(o));return n}function ly(t){return ay(t,{top:"y",right:"x",bottom:"y",left:"x"})}function gr(t){return ay(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Tt(t){const e=ly(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ue(t,e){t=t||{},e=e||Se.font;let n=ee(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let s=ee(t.style,e.style);s&&!(""+s).match(H_)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const r={family:ee(t.family,e.family),lineHeight:U_(ee(t.lineHeight,e.lineHeight),n),size:n,style:s,weight:ee(t.weight,e.weight),string:""};return r.string=A_(r),r}function Yo(t,e,n,s){let r,i,o;for(r=0,i=t.length;r<i;++r)if(o=t[r],o!==void 0&&o!==void 0)return o}function Q_(t,e,n){const{min:s,max:r}=t,i=l_(e,(r-s)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(s,-Math.abs(i)),max:o(r,i)}}function Vr(t,e){return Object.assign(Object.create(t),e)}function Qd(t,e=[""],n,s,r=()=>t[0]){const i=n||t;typeof s>"u"&&(s=hy("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:r,override:a=>Qd([a,...t],e,i,s)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return cy(a,l,()=>eS(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Gf(a).includes(l)},ownKeys(a){return Gf(a)},set(a,l,u){const d=a._storage||(a._storage=r());return a[l]=d[l]=u,delete a._keys,!0}})}function Ar(t,e,n,s){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:uy(t,s),setContext:i=>Ar(t,i,n,s),override:i=>Ar(t.override(i),e,n,s)};return new Proxy(r,{deleteProperty(i,o){return delete i[o],delete t[o],!0},get(i,o,a){return cy(i,o,()=>K_(i,o,a))},getOwnPropertyDescriptor(i,o){return i._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(i,o,a){return t[o]=a,delete i[o],!0}})}function uy(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:s=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:s,isScriptable:os(n)?n:()=>n,isIndexable:os(s)?s:()=>s}}const Y_=(t,e)=>t?t+Wd(e):e,Yd=(t,e)=>J(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function cy(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const s=n();return t[e]=s,s}function K_(t,e,n){const{_proxy:s,_context:r,_subProxy:i,_descriptors:o}=t;let a=s[e];return os(a)&&o.isScriptable(e)&&(a=X_(e,a,t,n)),Pe(a)&&a.length&&(a=q_(e,a,t,o.isIndexable)),Yd(e,a)&&(a=Ar(a,r,i&&i[e],o)),a}function X_(t,e,n,s){const{_proxy:r,_context:i,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(i,o||s);return a.delete(t),Yd(t,l)&&(l=Kd(r._scopes,r,t,l)),l}function q_(t,e,n,s){const{_proxy:r,_context:i,_subProxy:o,_descriptors:a}=n;if(typeof i.index<"u"&&s(t))return e[i.index%e.length];if(J(e[0])){const l=e,u=r._scopes.filter(d=>d!==l);e=[];for(const d of l){const h=Kd(u,r,t,d);e.push(Ar(h,i,o&&o[t],a))}}return e}function dy(t,e,n){return os(t)?t(e,n):t}const G_=(t,e)=>t===!0?e:typeof t=="string"?Ir(e,t):void 0;function J_(t,e,n,s,r){for(const i of e){const o=G_(n,i);if(o){t.add(o);const a=dy(o._fallback,n,r);if(typeof a<"u"&&a!==n&&a!==s)return a}else if(o===!1&&typeof s<"u"&&n!==s)return null}return!1}function Kd(t,e,n,s){const r=e._rootScopes,i=dy(e._fallback,n,s),o=[...t,...r],a=new Set;a.add(s);let l=qf(a,o,n,i||n,s);return l===null||typeof i<"u"&&i!==n&&(l=qf(a,o,i,l,s),l===null)?!1:Qd(Array.from(a),[""],r,i,()=>Z_(e,n,s))}function qf(t,e,n,s,r){for(;n;)n=J_(t,e,n,s,r);return n}function Z_(t,e,n){const s=t._getTarget();e in s||(s[e]={});const r=s[e];return Pe(r)&&J(n)?n:r||{}}function eS(t,e,n,s){let r;for(const i of e)if(r=hy(Y_(i,t),n),typeof r<"u")return Yd(t,r)?Kd(n,s,t,r):r}function hy(t,e){for(const n of e){if(!n)continue;const s=n[t];if(typeof s<"u")return s}}function Gf(t){let e=t._keys;return e||(e=t._keys=tS(t._scopes)),e}function tS(t){const e=new Set;for(const n of t)for(const s of Object.keys(n).filter(r=>!r.startsWith("_")))e.add(s);return Array.from(e)}function Xd(){return typeof window<"u"&&typeof document<"u"}function qd(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ga(t,e,n){let s;return typeof t=="string"?(s=parseInt(t,10),t.indexOf("%")!==-1&&(s=s/100*e.parentNode[n])):s=t,s}const kl=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function nS(t,e){return kl(t).getPropertyValue(e)}const sS=["top","right","bottom","left"];function Fs(t,e,n){const s={};n=n?"-"+n:"";for(let r=0;r<4;r++){const i=sS[r];s[i]=parseFloat(t[e+"-"+i+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const rS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function iS(t,e){const n=t.touches,s=n&&n.length?n[0]:t,{offsetX:r,offsetY:i}=s;let o=!1,a,l;if(rS(r,i,t.target))a=r,l=i;else{const u=e.getBoundingClientRect();a=s.clientX-u.left,l=s.clientY-u.top,o=!0}return{x:a,y:l,box:o}}function vs(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:s}=e,r=kl(n),i=r.boxSizing==="border-box",o=Fs(r,"padding"),a=Fs(r,"border","width"),{x:l,y:u,box:d}=iS(t,n),h=o.left+(d&&a.left),f=o.top+(d&&a.top);let{width:p,height:x}=e;return i&&(p-=o.width+a.width,x-=o.height+a.height),{x:Math.round((l-h)/p*n.width/s),y:Math.round((u-f)/x*n.height/s)}}function oS(t,e,n){let s,r;if(e===void 0||n===void 0){const i=t&&qd(t);if(!i)e=t.clientWidth,n=t.clientHeight;else{const o=i.getBoundingClientRect(),a=kl(i),l=Fs(a,"border","width"),u=Fs(a,"padding");e=o.width-u.width-l.width,n=o.height-u.height-l.height,s=Ga(a.maxWidth,i,"clientWidth"),r=Ga(a.maxHeight,i,"clientHeight")}}return{width:e,height:n,maxWidth:s||Ka,maxHeight:r||Ka}}const Un=t=>Math.round(t*10)/10;function aS(t,e,n,s){const r=kl(t),i=Fs(r,"margin"),o=Ga(r.maxWidth,t,"clientWidth")||Ka,a=Ga(r.maxHeight,t,"clientHeight")||Ka,l=oS(t,e,n);let{width:u,height:d}=l;if(r.boxSizing==="content-box"){const f=Fs(r,"border","width"),p=Fs(r,"padding");u-=p.width+f.width,d-=p.height+f.height}return u=Math.max(0,u-i.width),d=Math.max(0,s?u/s:d-i.height),u=Un(Math.min(u,o,l.maxWidth)),d=Un(Math.min(d,a,l.maxHeight)),u&&!d&&(d=Un(u/2)),(e!==void 0||n!==void 0)&&s&&l.height&&d>l.height&&(d=l.height,u=Un(Math.floor(d*s))),{width:u,height:d}}function Jf(t,e,n){const s=e||1,r=Un(t.height*s),i=Un(t.width*s);t.height=Un(t.height),t.width=Un(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==s||o.height!==r||o.width!==i?(t.currentDevicePixelRatio=s,o.height=r,o.width=i,t.ctx.setTransform(s,0,0,s,0,0),!0):!1}const lS=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Xd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Zf(t,e){const n=nS(t,e),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const uS=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},cS=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function mr(t,e,n){return t?uS(e,n):cS()}function fy(t,e){let n,s;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=s)}function py(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ko(t,e,n){return t.options.clip?t[n]:e[n]}function dS(t,e){const{xScale:n,yScale:s}=t;return n&&s?{left:Ko(n,e,"left"),right:Ko(n,e,"right"),top:Ko(s,e,"top"),bottom:Ko(s,e,"bottom")}:e}function hS(t,e){const n=e._clip;if(n.disabled)return!1;const s=dS(e,t.chartArea);return{left:n.left===!1?0:s.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:s.right+(n.right===!0?0:n.right),top:n.top===!1?0:s.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:s.bottom+(n.bottom===!0?0:n.bottom)}}/*!
62
- * Chart.js v4.5.1
63
- * https://www.chartjs.org
64
- * (c) 2025 Chart.js Contributors
65
- * Released under the MIT License
66
- */class fS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,s,r){const i=n.listeners[r],o=n.duration;i.forEach(a=>a({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(s-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=ey.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((s,r)=>{if(!s.running||!s.items.length)return;const i=s.items;let o=i.length-1,a=!1,l;for(;o>=0;--o)l=i[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(e),a=!0):(i[o]=i[i.length-1],i.pop());a&&(r.draw(),this._notify(r,s,e,"progress")),i.length||(s.running=!1,this._notify(r,s,e,"complete"),s.initial=!1),n+=i.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let s=n.get(e);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,s)),s}listen(e,n,s){this._getAnims(e).listeners[n].push(s)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,r)=>Math.max(s,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const s=n.items;let r=s.length-1;for(;r>=0;--r)s[r].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var an=new fS;const ep="transparent",pS={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const s=Vf(t||ep),r=s.valid&&Vf(e||ep);return r&&r.valid?r.mix(s,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class gS{constructor(e,n,s,r){const i=n[s];r=Yo([e.to,r,i,e.from]);const o=Yo([e.from,i,r]);this._active=!0,this._fn=e.fn||pS[e.type||typeof o],this._easing=Ei[e.easing]||Ei.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=s,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(e,n,s){if(this._active){this._notify(!1);const r=this._target[this._prop],i=s-this._start,o=this._duration-i;this._start=s,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Yo([e.to,n,r,e.from]),this._from=Yo([e.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,s=this._duration,r=this._prop,i=this._from,o=this._loop,a=this._to;let l;if(this._active=i!==a&&(o||n<s),!this._active){this._target[r]=a,this._notify(!0);return}if(n<0){this._target[r]=i;return}l=n/s%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(i,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,s)=>{e.push({res:n,rej:s})})}_notify(e){const n=e?"res":"rej",s=this._promises||[];for(let r=0;r<s.length;r++)s[r][n]()}}class gy{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!J(e))return;const n=Object.keys(Se.animation),s=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const i=e[r];if(!J(i))return;const o={};for(const a of n)o[a]=i[a];(Pe(i.properties)&&i.properties||[r]).forEach(a=>{(a===r||!s.has(a))&&s.set(a,o)})})}_animateOptions(e,n){const s=n.options,r=yS(e,s);if(!r)return[];const i=this._createAnimations(r,s);return s.$shared&&mS(e.options.$animations,s).then(()=>{e.options=s},()=>{}),i}_createAnimations(e,n){const s=this._properties,r=[],i=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(e,n));continue}const d=n[u];let h=i[u];const f=s.get(u);if(h)if(f&&h.active()){h.update(f,d,a);continue}else h.cancel();if(!f||!f.duration){e[u]=d;continue}i[u]=h=new gS(f,e,u,d),r.push(h)}return r}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const s=this._createAnimations(e,n);if(s.length)return an.add(this._chart,s),!0}}function mS(t,e){const n=[],s=Object.keys(e);for(let r=0;r<s.length;r++){const i=t[s[r]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function yS(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function tp(t,e){const n=t&&t.options||{},s=n.reverse,r=n.min===void 0?e:0,i=n.max===void 0?e:0;return{start:s?i:r,end:s?r:i}}function xS(t,e,n){if(n===!1)return!1;const s=tp(t,n),r=tp(e,n);return{top:r.end,right:s.end,bottom:r.start,left:s.start}}function vS(t){let e,n,s,r;return J(t)?(e=t.top,n=t.right,s=t.bottom,r=t.left):e=n=s=r=t,{top:e,right:n,bottom:s,left:r,disabled:t===!1}}function my(t,e){const n=[],s=t._getSortedDatasetMetas(e);let r,i;for(r=0,i=s.length;r<i;++r)n.push(s[r].index);return n}function np(t,e,n,s={}){const r=t.keys,i=s.mode==="single";let o,a,l,u;if(e===null)return;let d=!1;for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===n){if(d=!0,s.all)continue;break}u=t.values[l],Mt(u)&&(i||e===0||ss(e)===ss(u))&&(e+=u)}return!d&&!s.all?0:e}function bS(t,e){const{iScale:n,vScale:s}=e,r=n.axis==="x"?"x":"y",i=s.axis==="x"?"x":"y",o=Object.keys(t),a=new Array(o.length);let l,u,d;for(l=0,u=o.length;l<u;++l)d=o[l],a[l]={[r]:d,[i]:t[d]};return a}function iu(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function wS(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function kS(t){const{min:e,max:n,minDefined:s,maxDefined:r}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function _S(t,e,n){const s=t[e]||(t[e]={});return s[n]||(s[n]={})}function sp(t,e,n,s){for(const r of e.getMatchingVisibleMetas(s).reverse()){const i=t[r.index];if(n&&i>0||!n&&i<0)return r.index}return null}function rp(t,e){const{chart:n,_cachedMeta:s}=t,r=n._stacks||(n._stacks={}),{iScale:i,vScale:o,index:a}=s,l=i.axis,u=o.axis,d=wS(i,o,s),h=e.length;let f;for(let p=0;p<h;++p){const x=e[p],{[l]:m,[u]:b}=x,g=x._stacks||(x._stacks={});f=g[u]=_S(r,d,m),f[a]=b,f._top=sp(f,o,!0,s.type),f._bottom=sp(f,o,!1,s.type);const y=f._visualValues||(f._visualValues={});y[a]=b}}function ou(t,e){const n=t.scales;return Object.keys(n).filter(s=>n[s].axis===e).shift()}function SS(t,e){return Vr(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function CS(t,e,n){return Vr(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function ri(t,e){const n=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const r of e){const i=r._stacks;if(!i||i[s]===void 0||i[s][n]===void 0)return;delete i[s][n],i[s]._visualValues!==void 0&&i[s]._visualValues[n]!==void 0&&delete i[s]._visualValues[n]}}}const au=t=>t==="reset"||t==="none",ip=(t,e)=>e?t:Object.assign({},t),jS=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:my(n,!0),values:null};class Mi{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=iu(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&ri(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,s=this.getDataset(),r=(h,f,p,x)=>h==="x"?f:h==="r"?x:p,i=n.xAxisID=ee(s.xAxisID,ou(e,"x")),o=n.yAxisID=ee(s.yAxisID,ou(e,"y")),a=n.rAxisID=ee(s.rAxisID,ou(e,"r")),l=n.indexAxis,u=n.iAxisID=r(l,i,o,a),d=n.vAxisID=r(l,o,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&$f(this._data,this),e._stacked&&ri(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),s=this._data;if(J(n)){const r=this._cachedMeta;this._data=bS(n,r)}else if(s!==n){if(s){$f(s,this);const r=this._cachedMeta;ri(r),r._parsed=[]}n&&Object.isExtensible(n)&&j_(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,s=this.getDataset();let r=!1;this._dataCheck();const i=n._stacked;n._stacked=iu(n.vScale,n),n.stack!==s.stack&&(r=!0,ri(n),n.stack=s.stack),this._resyncElements(e),(r||i!==n._stacked)&&(rp(this,n._parsed),n._stacked=iu(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),s=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:s,_data:r}=this,{iScale:i,_stacked:o}=s,a=i.axis;let l=e===0&&n===r.length?!0:s._sorted,u=e>0&&s._parsed[e-1],d,h,f;if(this._parsing===!1)s._parsed=r,s._sorted=!0,f=r;else{Pe(r[e])?f=this.parseArrayData(s,r,e,n):J(r[e])?f=this.parseObjectData(s,r,e,n):f=this.parsePrimitiveData(s,r,e,n);const p=()=>h[a]===null||u&&h[a]<u[a];for(d=0;d<n;++d)s._parsed[d+e]=h=f[d],l&&(p()&&(l=!1),u=h);s._sorted=l}o&&rp(this,f)}parsePrimitiveData(e,n,s,r){const{iScale:i,vScale:o}=e,a=i.axis,l=o.axis,u=i.getLabels(),d=i===o,h=new Array(r);let f,p,x;for(f=0,p=r;f<p;++f)x=f+s,h[f]={[a]:d||i.parse(u[x],x),[l]:o.parse(n[x],x)};return h}parseArrayData(e,n,s,r){const{xScale:i,yScale:o}=e,a=new Array(r);let l,u,d,h;for(l=0,u=r;l<u;++l)d=l+s,h=n[d],a[l]={x:i.parse(h[0],d),y:o.parse(h[1],d)};return a}parseObjectData(e,n,s,r){const{xScale:i,yScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(r);let d,h,f,p;for(d=0,h=r;d<h;++d)f=d+s,p=n[f],u[d]={x:i.parse(Ir(p,a),f),y:o.parse(Ir(p,l),f)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,s){const r=this.chart,i=this._cachedMeta,o=n[e.axis],a={keys:my(r,!0),values:n._stacks[e.axis]._visualValues};return np(a,o,i.index,{mode:s})}updateRangeFromParsed(e,n,s,r){const i=s[n.axis];let o=i===null?NaN:i;const a=r&&s._stacks[n.axis];r&&a&&(r.values=a,o=np(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const s=this._cachedMeta,r=s._parsed,i=s._sorted&&e===s.iScale,o=r.length,a=this._getOtherScale(e),l=jS(n,s,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=kS(a);let f,p;function x(){p=r[f];const m=p[a.axis];return!Mt(p[e.axis])||d>m||h<m}for(f=0;f<o&&!(!x()&&(this.updateRangeFromParsed(u,e,p,l),i));++f);if(i){for(f=o-1;f>=0;--f)if(!x()){this.updateRangeFromParsed(u,e,p,l);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,s=[];let r,i,o;for(r=0,i=n.length;r<i;++r)o=n[r][e.axis],Mt(o)&&s.push(o);return s}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,s=n.iScale,r=n.vScale,i=this.getParsed(e);return{label:s?""+s.getLabelForValue(i[s.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=vS(ee(this.options.clip,xS(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,s=this._cachedMeta,r=s.data||[],i=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||r.length-a,u=this.options.drawActiveElementsOnTop;let d;for(s.dataset&&s.dataset.draw(e,i,a,l),d=a;d<a+l;++d){const h=r[d];h.hidden||(h.active&&u?o.push(h):h.draw(e,i))}for(d=0;d<o.length;++d)o[d].draw(e,i)}getStyle(e,n){const s=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(e||0,s)}getContext(e,n,s){const r=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];i=o.$context||(o.$context=CS(this.getContext(),e,o)),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=SS(this.chart.getContext(),this.index)),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=s,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",s){const r=n==="active",i=this._cachedDataOpts,o=e+"-"+n,a=i[o],l=this.enableOptionSharing&&to(s);if(a)return ip(a,l);const u=this.chart.config,d=u.datasetElementScopeKeys(this._type,e),h=r?[`${e}Hover`,"hover",e,""]:[e,""],f=u.getOptionScopes(this.getDataset(),d),p=Object.keys(Se.elements[e]),x=()=>this.getContext(s,r,n),m=u.resolveNamedOptions(f,p,x,h);return m.$shared&&(m.$shared=l,i[o]=Object.freeze(ip(m,l))),m}_resolveAnimations(e,n,s){const r=this.chart,i=this._cachedDataOpts,o=`animation-${n}`,a=i[o];if(a)return a;let l;if(r.options.animation!==!1){const d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(f,this.getContext(e,s,n))}const u=new gy(r,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||au(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const s=this.resolveDataElementOptions(e,n),r=this._sharedOptions,i=this.getSharedOptions(s),o=this.includeOptions(n,i)||i!==r;return this.updateSharedOptions(i,n,s),{sharedOptions:i,includeOptions:o}}updateElement(e,n,s,r){au(r)?Object.assign(e,s):this._resolveAnimations(n,r).update(e,s)}updateSharedOptions(e,n,s){e&&!au(n)&&this._resolveAnimations(void 0,n).update(e,s)}_setStyle(e,n,s,r){e.active=r;const i=this.getStyle(n,r);this._resolveAnimations(n,s,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,n,s){this._setStyle(e,s,"active",!1)}setHoverStyle(e,n,s){this._setStyle(e,s,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,s=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const r=s.length,i=n.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,n,s=!0){const r=this._cachedMeta,i=r.data,o=e+n;let a;const l=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[a-n]};for(l(i),a=e;a<o;++a)i[a]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(e,n),s&&this.updateElements(i,e,n,"reset")}updateElements(e,n,s,r){}_removeElements(e,n){const s=this._cachedMeta;if(this._parsing){const r=s._parsed.splice(e,n);s._stacked&&ri(s,r)}s.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,s,r]=e;this[n](s,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const s=arguments.length-2;s&&this._sync(["_insertElements",e,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}q(Mi,"defaults",{}),q(Mi,"datasetElementType",null),q(Mi,"dataElementType",null);function NS(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let s=[];for(let r=0,i=n.length;r<i;r++)s=s.concat(n[r].controller.getAllParsedValues(t));t._cache.$bar=Z0(s.sort((r,i)=>r-i))}return t._cache.$bar}function ES(t){const e=t.iScale,n=NS(e,t.type);let s=e._length,r,i,o,a;const l=()=>{o===32767||o===-32768||(to(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(r=0,i=n.length;r<i;++r)o=e.getPixelForValue(n[r]),l();for(a=void 0,r=0,i=e.ticks.length;r<i;++r)o=e.getPixelForTick(r),l();return s}function PS(t,e,n,s){const r=n.barThickness;let i,o;return oe(r)?(i=e.min*n.categoryPercentage,o=n.barPercentage):(i=r*s,o=1),{chunk:i/s,ratio:o,start:e.pixels[t]-i/2}}function MS(t,e,n,s){const r=e.pixels,i=r[t];let o=t>0?r[t-1]:null,a=t<r.length-1?r[t+1]:null;const l=n.categoryPercentage;o===null&&(o=i-(a===null?e.end-e.start:a-i)),a===null&&(a=i+i-o);const u=i-(i-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/s,ratio:n.barPercentage,start:u}}function TS(t,e,n,s){const r=n.parse(t[0],s),i=n.parse(t[1],s),o=Math.min(r,i),a=Math.max(r,i);let l=o,u=a;Math.abs(o)>Math.abs(a)&&(l=a,u=o),e[n.axis]=u,e._custom={barStart:l,barEnd:u,start:r,end:i,min:o,max:a}}function yy(t,e,n,s){return Pe(t)?TS(t,e,n,s):e[n.axis]=n.parse(t,s),e}function op(t,e,n,s){const r=t.iScale,i=t.vScale,o=r.getLabels(),a=r===i,l=[];let u,d,h,f;for(u=n,d=n+s;u<d;++u)f=e[u],h={},h[r.axis]=a||r.parse(o[u],u),l.push(yy(f,h,i,u));return l}function lu(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function RS(t,e,n){return t!==0?ss(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function OS(t){let e,n,s,r,i;return t.horizontal?(e=t.base>t.x,n="left",s="right"):(e=t.base<t.y,n="bottom",s="top"),e?(r="end",i="start"):(r="start",i="end"),{start:n,end:s,reverse:e,top:r,bottom:i}}function DS(t,e,n,s){let r=e.borderSkipped;const i={};if(!r){t.borderSkipped=i;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:u,bottom:d}=OS(t);r==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===s?r=u:(n._bottom||0)===s?r=d:(i[ap(d,o,a,l)]=!0,r=u)),i[ap(r,o,a,l)]=!0,t.borderSkipped=i}function ap(t,e,n,s){return s?(t=LS(t,e,n),t=lp(t,n,e)):t=lp(t,e,n),t}function LS(t,e,n){return t===e?n:t===n?e:t}function lp(t,e,n){return t==="start"?e:t==="end"?n:t}function FS(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class ma extends Mi{parsePrimitiveData(e,n,s,r){return op(e,n,s,r)}parseArrayData(e,n,s,r){return op(e,n,s,r)}parseObjectData(e,n,s,r){const{iScale:i,vScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=i.axis==="x"?a:l,d=o.axis==="x"?a:l,h=[];let f,p,x,m;for(f=s,p=s+r;f<p;++f)m=n[f],x={},x[i.axis]=i.parse(Ir(m,u),f),h.push(yy(Ir(m,d),x,o,f));return h}updateRangeFromParsed(e,n,s,r){super.updateRangeFromParsed(e,n,s,r);const i=s._custom;i&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:s,vScale:r}=n,i=this.getParsed(e),o=i._custom,a=lu(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+s.getLabelForValue(i[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,s,r){const i=r==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,r);for(let p=n;p<n+s;p++){const x=this.getParsed(p),m=i||oe(x[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),g=(x._stacks||{})[a.axis],y={horizontal:u,base:m.base,enableBorderRadius:!g||lu(x._custom)||o===g._top||o===g._bottom,x:u?m.head:b.center,y:u?b.center:m.head,height:u?b.size:Math.abs(m.size),width:u?Math.abs(m.size):b.size};f&&(y.options=h||this.resolveDataElementOptions(p,e[p].active?"active":r));const v=y.options||e[p].options;DS(y,v,g,o),FS(y,v,d.ratio),this.updateElement(e[p],p,y,r)}}_getStacks(e,n){const{iScale:s}=this._cachedMeta,r=s.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),i=s.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[s.axis],u=d=>{const h=d._parsed.find(p=>p[s.axis]===l),f=h&&h[d.vScale.axis];if(oe(f)||isNaN(f))return!0};for(const d of r)if(!(n!==void 0&&u(d))&&((i===!1||o.indexOf(d.stack)===-1||i===void 0&&d.stack===void 0)&&o.push(d.stack),d.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(s=>e[s].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)e[ee(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,s){const r=this._getStacks(e,s),i=n!==void 0?r.indexOf(n):-1;return i===-1?r.length-1:i}_getRuler(){const e=this.options,n=this._cachedMeta,s=n.iScale,r=[];let i,o;for(i=0,o=n.data.length;i<o;++i)r.push(s.getPixelForValue(this.getParsed(i)[s.axis],i));const a=e.barThickness;return{min:a||ES(n),pixels:r,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:s,index:r},options:{base:i,minBarLength:o}}=this,a=i||0,l=this.getParsed(e),u=l._custom,d=lu(u);let h=l[n.axis],f=0,p=s?this.applyStack(n,l,s):h,x,m;p!==h&&(f=p-h,p=h),d&&(h=u.barStart,p=u.barEnd-u.barStart,h!==0&&ss(h)!==ss(u.barEnd)&&(f=0),f+=h);const b=!oe(i)&&!d?i:f;let g=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?x=n.getPixelForValue(f+p):x=g,m=x-g,Math.abs(m)<o){m=RS(m,n,a)*o,h===a&&(g-=m/2);const y=n.getPixelForDecimal(0),v=n.getPixelForDecimal(1),w=Math.min(y,v),j=Math.max(y,v);g=Math.max(Math.min(g,j),w),x=g+m,s&&!d&&(l._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(g))}if(g===n.getPixelForValue(a)){const y=ss(m)*n.getLineWidthForValue(a)/2;g+=y,m-=y}return{size:m,base:g,head:x,center:x+m/2}}_calculateBarIndexPixels(e,n){const s=n.scale,r=this.options,i=r.skipNull,o=ee(r.maxBarThickness,1/0);let a,l;const u=this._getAxisCount();if(n.grouped){const d=i?this._getStackCount(e):n.stackCount,h=r.barThickness==="flex"?MS(e,n,r,d*u):PS(e,n,r,d*u),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(ee(f,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+p;a=h.start+h.chunk*x+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(e)[s.axis],e),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,s=e.data,r=s.length;let i=0;for(;i<r;++i)this.getParsed(i)[n.axis]!==null&&!s[i].hidden&&s[i].draw(this._ctx)}}q(ma,"id","bar"),q(ma,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),q(ma,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function gs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gd{constructor(e){q(this,"options");this.options=e||{}}static override(e){Object.assign(Gd.prototype,e)}init(){}formats(){return gs()}parse(){return gs()}format(){return gs()}add(){return gs()}diff(){return gs()}startOf(){return gs()}endOf(){return gs()}}var IS={_date:Gd};function AS(t,e,n,s){const{controller:r,data:i,_sorted:o}=t,a=r._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&i.length){const u=a._reversePixels?S_:jc;if(s){if(r._sharedOptions){const d=i[0],h=typeof d.getRange=="function"&&d.getRange(e);if(h){const f=u(i,e,n-h),p=u(i,e,n+h);return{lo:f.lo,hi:p.hi}}}}else{const d=u(i,e,n);if(l){const{vScale:h}=r._cachedMeta,{_parsed:f}=t,p=f.slice(0,d.lo+1).reverse().findIndex(m=>!oe(m[h.axis]));d.lo-=Math.max(0,p);const x=f.slice(d.hi).findIndex(m=>!oe(m[h.axis]));d.hi+=Math.max(0,x)}return d}}return{lo:0,hi:i.length-1}}function _l(t,e,n,s,r){const i=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=i.length;a<l;++a){const{index:u,data:d}=i[a],{lo:h,hi:f}=AS(i[a],e,o,r);for(let p=h;p<=f;++p){const x=d[p];x.skip||s(x,u,p)}}}function zS(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(s,r){const i=e?Math.abs(s.x-r.x):0,o=n?Math.abs(s.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}function uu(t,e,n,s,r){const i=[];return!r&&!t.isPointInArea(e)||_l(t,n,e,function(a,l,u){!r&&!oy(a,t.chartArea,0)||a.inRange(e.x,e.y,s)&&i.push({element:a,datasetIndex:l,index:u})},!0),i}function BS(t,e,n,s){let r=[];function i(o,a,l){const{startAngle:u,endAngle:d}=o.getProps(["startAngle","endAngle"],s),{angle:h}=b_(o,{x:e.x,y:e.y});k_(h,u,d)&&r.push({element:o,datasetIndex:a,index:l})}return _l(t,n,e,i),r}function WS(t,e,n,s,r,i){let o=[];const a=zS(n);let l=Number.POSITIVE_INFINITY;function u(d,h,f){const p=d.inRange(e.x,e.y,r);if(s&&!p)return;const x=d.getCenterPoint(r);if(!(!!i||t.isPointInArea(x))&&!p)return;const b=a(e,x);b<l?(o=[{element:d,datasetIndex:h,index:f}],l=b):b===l&&o.push({element:d,datasetIndex:h,index:f})}return _l(t,n,e,u),o}function cu(t,e,n,s,r,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!s?BS(t,e,n,r):WS(t,e,n,s,r,i)}function up(t,e,n,s,r){const i=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return _l(t,n,e,(l,u,d)=>{l[o]&&l[o](e[n],r)&&(i.push({element:l,datasetIndex:u,index:d}),a=a||l.inRange(e.x,e.y,r))}),s&&!a?[]:i}var $S={modes:{index(t,e,n,s){const r=vs(e,t),i=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?uu(t,r,i,s,o):cu(t,r,i,!1,s,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const d=a[0].index,h=u.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:u.index,index:d})}),l):[]},dataset(t,e,n,s){const r=vs(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?uu(t,r,i,s,o):cu(t,r,i,!1,s,o);if(a.length>0){const l=a[0].datasetIndex,u=t.getDatasetMeta(l).data;a=[];for(let d=0;d<u.length;++d)a.push({element:u[d],datasetIndex:l,index:d})}return a},point(t,e,n,s){const r=vs(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return uu(t,r,i,s,o)},nearest(t,e,n,s){const r=vs(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return cu(t,r,i,n.intersect,s,o)},x(t,e,n,s){const r=vs(e,t);return up(t,r,"x",n.intersect,s)},y(t,e,n,s){const r=vs(e,t);return up(t,r,"y",n.intersect,s)}}};const xy=["left","top","right","bottom"];function ii(t,e){return t.filter(n=>n.pos===e)}function cp(t,e){return t.filter(n=>xy.indexOf(n.pos)===-1&&n.box.axis===e)}function oi(t,e){return t.sort((n,s)=>{const r=e?s:n,i=e?n:s;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function HS(t){const e=[];let n,s,r,i,o,a;for(n=0,s=(t||[]).length;n<s;++n)r=t[n],{position:i,options:{stack:o,stackWeight:a=1}}=r,e.push({index:n,box:r,pos:i,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&i+o,stackWeight:a});return e}function US(t){const e={};for(const n of t){const{stack:s,pos:r,stackWeight:i}=n;if(!s||!xy.includes(r))continue;const o=e[s]||(e[s]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return e}function VS(t,e){const n=US(t),{vBoxMaxWidth:s,hBoxMaxHeight:r}=e;let i,o,a;for(i=0,o=t.length;i<o;++i){a=t[i];const{fullSize:l}=a.box,u=n[a.stack],d=u&&a.stackWeight/u.weight;a.horizontal?(a.width=d?d*s:l&&e.availableWidth,a.height=r):(a.width=s,a.height=d?d*r:l&&e.availableHeight)}return n}function QS(t){const e=HS(t),n=oi(e.filter(u=>u.box.fullSize),!0),s=oi(ii(e,"left"),!0),r=oi(ii(e,"right")),i=oi(ii(e,"top"),!0),o=oi(ii(e,"bottom")),a=cp(e,"x"),l=cp(e,"y");return{fullSize:n,leftAndTop:s.concat(i),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:ii(e,"chartArea"),vertical:s.concat(r).concat(l),horizontal:i.concat(o).concat(a)}}function dp(t,e,n,s){return Math.max(t[n],e[n])+Math.max(t[s],e[s])}function vy(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function YS(t,e,n,s){const{pos:r,box:i}=n,o=t.maxPadding;if(!J(r)){n.size&&(t[r]-=n.size);const h=s[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?i.height:i.width),n.size=h.size/h.count,t[r]+=n.size}i.getPadding&&vy(o,i.getPadding());const a=Math.max(0,e.outerWidth-dp(o,t,"left","right")),l=Math.max(0,e.outerHeight-dp(o,t,"top","bottom")),u=a!==t.w,d=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:u,other:d}:{same:d,other:u}}function KS(t){const e=t.maxPadding;function n(s){const r=Math.max(e[s]-t[s],0);return t[s]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function XS(t,e){const n=e.maxPadding;function s(r){const i={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{i[o]=Math.max(e[o],n[o])}),i}return s(t?["left","right"]:["top","bottom"])}function mi(t,e,n,s){const r=[];let i,o,a,l,u,d;for(i=0,o=t.length,u=0;i<o;++i){a=t[i],l=a.box,l.update(a.width||e.w,a.height||e.h,XS(a.horizontal,e));const{same:h,other:f}=YS(e,n,a,s);u|=h&&r.length,d=d||f,l.fullSize||r.push(a)}return u&&mi(r,e,n,s)||d}function Xo(t,e,n,s,r){t.top=n,t.left=e,t.right=e+s,t.bottom=n+r,t.width=s,t.height=r}function hp(t,e,n,s){const r=n.padding;let{x:i,y:o}=e;for(const a of t){const l=a.box,u=s[a.stack]||{placed:0,weight:1},d=a.stackWeight/u.weight||1;if(a.horizontal){const h=e.w*d,f=u.size||l.height;to(u.start)&&(o=u.start),l.fullSize?Xo(l,r.left,o,n.outerWidth-r.right-r.left,f):Xo(l,e.left+u.placed,o,h,f),u.start=o,u.placed+=h,o=l.bottom}else{const h=e.h*d,f=u.size||l.width;to(u.start)&&(i=u.start),l.fullSize?Xo(l,i,r.top,f,n.outerHeight-r.bottom-r.top):Xo(l,i,e.top+u.placed,f,h),u.start=i,u.placed+=h,i=l.right}}e.x=i,e.y=o}var Ct={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,s){if(!t)return;const r=Tt(t.options.layout.padding),i=Math.max(e-r.width,0),o=Math.max(n-r.height,0),a=QS(t.boxes),l=a.vertical,u=a.horizontal;re(t.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/d,hBoxMaxHeight:o/2}),f=Object.assign({},r);vy(f,Tt(s));const p=Object.assign({maxPadding:f,w:i,h:o,x:r.left,y:r.top},r),x=VS(l.concat(u),h);mi(a.fullSize,p,h,x),mi(l,p,h,x),mi(u,p,h,x)&&mi(l,p,h,x),KS(p),hp(a.leftAndTop,p,h,x),p.x+=p.w,p.y+=p.h,hp(a.rightAndBottom,p,h,x),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},re(a.chartArea,m=>{const b=m.box;Object.assign(b,t.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class by{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,s){}removeEventListener(e,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,s,r){return n=Math.max(0,n||e.width),s=s||e.height,{width:n,height:Math.max(0,r?Math.floor(n/r):s)}}isAttached(e){return!0}updateConfig(e){}}class qS extends by{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ya="$chartjs",GS={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fp=t=>t===null||t==="";function JS(t,e){const n=t.style,s=t.getAttribute("height"),r=t.getAttribute("width");if(t[ya]={initial:{height:s,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",fp(r)){const i=Zf(t,"width");i!==void 0&&(t.width=i)}if(fp(s))if(t.style.height==="")t.height=t.width/(e||2);else{const i=Zf(t,"height");i!==void 0&&(t.height=i)}return t}const wy=lS?{passive:!0}:!1;function ZS(t,e,n){t&&t.addEventListener(e,n,wy)}function eC(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,wy)}function tC(t,e){const n=GS[t.type]||t.type,{x:s,y:r}=vs(t,e);return{type:n,chart:e,native:t,x:s!==void 0?s:null,y:r!==void 0?r:null}}function Ja(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function nC(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Ja(a.addedNodes,s),o=o&&!Ja(a.removedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function sC(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Ja(a.removedNodes,s),o=o&&!Ja(a.addedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const so=new Map;let pp=0;function ky(){const t=window.devicePixelRatio;t!==pp&&(pp=t,so.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function rC(t,e){so.size||window.addEventListener("resize",ky),so.set(t,e)}function iC(t){so.delete(t),so.size||window.removeEventListener("resize",ky)}function oC(t,e,n){const s=t.canvas,r=s&&qd(s);if(!r)return;const i=ty((a,l)=>{const u=r.clientWidth;n(a,l),u<r.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,d=l.contentRect.height;u===0&&d===0||i(u,d)});return o.observe(r),rC(t,i),o}function du(t,e,n){n&&n.disconnect(),e==="resize"&&iC(t)}function aC(t,e,n){const s=t.canvas,r=ty(i=>{t.ctx!==null&&n(tC(i,t))},t);return ZS(s,e,r),r}class lC extends by{acquireContext(e,n){const s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(JS(e,n),s):null}releaseContext(e){const n=e.canvas;if(!n[ya])return!1;const s=n[ya].initial;["height","width"].forEach(i=>{const o=s[i];oe(o)?n.removeAttribute(i):n.setAttribute(i,o)});const r=s.style||{};return Object.keys(r).forEach(i=>{n.style[i]=r[i]}),n.width=n.width,delete n[ya],!0}addEventListener(e,n,s){this.removeEventListener(e,n);const r=e.$proxies||(e.$proxies={}),o={attach:nC,detach:sC,resize:oC}[n]||aC;r[n]=o(e,n,s)}removeEventListener(e,n){const s=e.$proxies||(e.$proxies={}),r=s[n];if(!r)return;({attach:du,detach:du,resize:du}[n]||eC)(e,n,r),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,s,r){return aS(e,n,s,r)}isAttached(e){const n=e&&qd(e);return!!(n&&n.isConnected)}}function uC(t){return!Xd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?qS:lC}class as{constructor(){q(this,"x");q(this,"y");q(this,"active",!1);q(this,"options");q(this,"$animations")}tooltipPosition(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}hasValue(){return Xa(this.x)&&Xa(this.y)}getProps(e,n){const s=this.$animations;if(!n||!s)return this;const r={};return e.forEach(i=>{r[i]=s[i]&&s[i].active()?s[i]._to:this[i]}),r}}q(as,"defaults",{}),q(as,"defaultRoutes");function cC(t,e){const n=t.options.ticks,s=dC(t),r=Math.min(n.maxTicksLimit||s,s),i=n.major.enabled?fC(e):[],o=i.length,a=i[0],l=i[o-1],u=[];if(o>r)return pC(e,u,i,o/r),u;const d=hC(i,e,r);if(o>0){let h,f;const p=o>1?Math.round((l-a)/(o-1)):null;for(qo(e,u,d,oe(p)?0:a-p,a),h=0,f=o-1;h<f;h++)qo(e,u,d,i[h],i[h+1]);return qo(e,u,d,l,oe(p)?e.length:l+p),u}return qo(e,u,d),u}function dC(t){const e=t.options.offset,n=t._tickSize(),s=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(s,r))}function hC(t,e,n){const s=gC(t),r=e.length/n;if(!s)return Math.max(r,1);const i=g_(s);for(let o=0,a=i.length-1;o<a;o++){const l=i[o];if(l>r)return l}return Math.max(r,1)}function fC(t){const e=[];let n,s;for(n=0,s=t.length;n<s;n++)t[n].major&&e.push(n);return e}function pC(t,e,n,s){let r=0,i=n[0],o;for(s=Math.ceil(s),o=0;o<t.length;o++)o===i&&(e.push(t[o]),r++,i=n[r*s])}function qo(t,e,n,s,r){const i=ee(s,0),o=Math.min(ee(r,t.length),t.length);let a=0,l,u,d;for(n=Math.ceil(n),r&&(l=r-s,n=l/Math.floor(l/n)),d=i;d<0;)a++,d=Math.round(i+a*n);for(u=Math.max(i,0);u<o;u++)u===d&&(e.push(t[u]),a++,d=Math.round(i+a*n))}function gC(t){const e=t.length;let n,s;if(e<2)return!1;for(s=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==s)return!1;return s}const mC=t=>t==="left"?"right":t==="right"?"left":t,gp=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,mp=(t,e)=>Math.min(e||t,t);function yp(t,e){const n=[],s=t.length/e,r=t.length;let i=0;for(;i<r;i+=s)n.push(t[Math.floor(i)]);return n}function yC(t,e,n){const s=t.ticks.length,r=Math.min(e,s-1),i=t._startPixel,o=t._endPixel,a=1e-6;let l=t.getPixelForTick(r),u;if(!(n&&(s===1?u=Math.max(l-i,o-l):e===0?u=(t.getPixelForTick(1)-l)/2:u=(l-t.getPixelForTick(r-1))/2,l+=r<e?u:-u,l<i-a||l>o+a)))return l}function xC(t,e){re(t,n=>{const s=n.gc,r=s.length/2;let i;if(r>e){for(i=0;i<r;++i)delete n.data[s[i]];s.splice(0,r)}})}function ai(t){return t.drawTicks?t.tickLength:0}function xp(t,e){if(!t.display)return 0;const n=Ue(t.font,e),s=Tt(t.padding);return(Pe(t.text)?t.text.length:1)*n.lineHeight+s.height}function vC(t,e){return Vr(t,{scale:e,type:"scale"})}function bC(t,e,n){return Vr(t,{tick:n,index:e,type:"tick"})}function wC(t,e,n){let s=Hd(t);return(n&&e!=="right"||!n&&e==="right")&&(s=mC(s)),s}function kC(t,e,n,s){const{top:r,left:i,bottom:o,right:a,chart:l}=t,{chartArea:u,scales:d}=l;let h=0,f,p,x;const m=o-r,b=a-i;if(t.isHorizontal()){if(p=$e(s,i,a),J(n)){const g=Object.keys(n)[0],y=n[g];x=d[g].getPixelForValue(y)+m-e}else n==="center"?x=(u.bottom+u.top)/2+m-e:x=gp(t,n,e);f=a-i}else{if(J(n)){const g=Object.keys(n)[0],y=n[g];p=d[g].getPixelForValue(y)-b+e}else n==="center"?p=(u.left+u.right)/2-b+e:p=gp(t,n,e);x=$e(s,o,r),h=n==="left"?-At:At}return{titleX:p,titleY:x,maxWidth:f,rotation:h}}class Qr extends as{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:s,_suggestedMax:r}=this;return e=Yt(e,Number.POSITIVE_INFINITY),n=Yt(n,Number.NEGATIVE_INFINITY),s=Yt(s,Number.POSITIVE_INFINITY),r=Yt(r,Number.NEGATIVE_INFINITY),{min:Yt(e,s),max:Yt(n,r),minDefined:Mt(e),maxDefined:Mt(n)}}getMinMax(e){let{min:n,max:s,minDefined:r,maxDefined:i}=this.getUserBounds(),o;if(r&&i)return{min:n,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)o=a[l].controller.getMinMax(this,e),r||(n=Math.min(n,o.min)),i||(s=Math.max(s,o.max));return n=i&&n>s?s:n,s=r&&n>s?n:s,{min:Yt(n,Yt(s,n)),max:Yt(s,Yt(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){he(this.options.beforeUpdate,[this])}update(e,n,s){const{beginAtZero:r,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Q_(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?yp(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=cC(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,s;this.isHorizontal()?(n=this.left,s=this.right):(n=this.top,s=this.bottom,e=!e),this._startPixel=n,this._endPixel=s,this._reversePixels=e,this._length=s-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){he(this.options.afterUpdate,[this])}beforeSetDimensions(){he(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){he(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),he(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){he(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let s,r,i;for(s=0,r=e.length;s<r;s++)i=e[s],i.label=he(n.callback,[i.value,s,e],this)}afterTickToLabelConversion(){he(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){he(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,s=mp(this.ticks.length,e.ticks.maxTicksLimit),r=n.minRotation||0,i=n.maxRotation;let o=r,a,l,u;if(!this._isVisible()||!n.display||r>=i||s<=1||!this.isHorizontal()){this.labelRotation=r;return}const d=this._getLabelSizes(),h=d.widest.width,f=d.highest.height,p=zt(this.chart.width-h,0,this.maxWidth);a=e.offset?this.maxWidth/s:p/(s-1),h+6>a&&(a=p/(s-(e.offset?.5:1)),l=this.maxHeight-ai(e.grid)-n.padding-xp(e.title,this.chart.options.font),u=Math.sqrt(h*h+f*f),o=v_(Math.min(Math.asin(zt((d.highest.height+6)/a,-1,1)),Math.asin(zt(l/u,-1,1))-Math.asin(zt(f/u,-1,1)))),o=Math.max(r,Math.min(i,o))),this.labelRotation=o}afterCalculateLabelRotation(){he(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){he(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:s,title:r,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=xp(r,n.options.font);if(a?(e.width=this.maxWidth,e.height=ai(i)+l):(e.height=this.maxHeight,e.width=ai(i)+l),s.display&&this.ticks.length){const{first:u,last:d,widest:h,highest:f}=this._getLabelSizes(),p=s.padding*2,x=Ss(this.labelRotation),m=Math.cos(x),b=Math.sin(x);if(a){const g=s.mirror?0:b*h.width+m*f.height;e.height=Math.min(this.maxHeight,e.height+g+p)}else{const g=s.mirror?0:m*h.width+b*f.height;e.width=Math.min(this.maxWidth,e.width+g+p)}this._calculatePadding(u,d,b,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,s,r){const{ticks:{align:i,padding:o},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?u?(f=r*e.width,p=s*n.height):(f=s*e.height,p=r*n.width):i==="start"?p=n.width:i==="end"?f=e.width:i!=="inner"&&(f=e.width/2,p=n.width/2),this.paddingLeft=Math.max((f-d+o)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-h+o)*this.width/(this.width-h),0)}else{let d=n.height/2,h=e.height/2;i==="start"?(d=0,h=e.height):i==="end"&&(d=n.height,h=0),this.paddingTop=d+o,this.paddingBottom=h+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){he(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,s;for(n=0,s=e.length;n<s;n++)oe(e[n].label)&&(e.splice(n,1),s--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let s=this.ticks;n<s.length&&(s=yp(s,n)),this._labelSizes=e=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,s){const{ctx:r,_longestTextCache:i}=this,o=[],a=[],l=Math.floor(n/mp(n,s));let u=0,d=0,h,f,p,x,m,b,g,y,v,w,j;for(h=0;h<n;h+=l){if(x=e[h].label,m=this._resolveTickFontOptions(h),r.font=b=m.string,g=i[b]=i[b]||{data:{},gc:[]},y=m.lineHeight,v=w=0,!oe(x)&&!Pe(x))v=Yf(r,g.data,g.gc,v,x),w=y;else if(Pe(x))for(f=0,p=x.length;f<p;++f)j=x[f],!oe(j)&&!Pe(j)&&(v=Yf(r,g.data,g.gc,v,j),w+=y);o.push(v),a.push(w),u=Math.max(v,u),d=Math.max(w,d)}xC(i,n);const P=o.indexOf(u),k=a.indexOf(d),N=R=>({width:o[R]||0,height:a[R]||0});return{first:N(0),last:N(n-1),widest:N(P),highest:N(k),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return __(this._alignToPixels?ps(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const s=n[e];return s.$context||(s.$context=bC(this.getContext(),e,s))}return this.$context||(this.$context=vC(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Ss(this.labelRotation),s=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,a=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return this.isHorizontal()?l*s>a*r?a/s:l/r:l*r<a*s?l/s:a/r}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,s=this.chart,r=this.options,{grid:i,position:o,border:a}=r,l=i.offset,u=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=ai(i),p=[],x=a.setContext(this.getContext()),m=x.display?x.width:0,b=m/2,g=function(B){return ps(s,B,m)};let y,v,w,j,P,k,N,R,C,M,L,V;if(o==="top")y=g(this.bottom),k=this.bottom-f,R=y-b,M=g(e.top)+b,V=e.bottom;else if(o==="bottom")y=g(this.top),M=e.top,V=g(e.bottom)-b,k=y+b,R=this.top+f;else if(o==="left")y=g(this.right),P=this.right-f,N=y-b,C=g(e.left)+b,L=e.right;else if(o==="right")y=g(this.left),C=e.left,L=g(e.right)-b,P=y+b,N=this.left+f;else if(n==="x"){if(o==="center")y=g((e.top+e.bottom)/2+.5);else if(J(o)){const B=Object.keys(o)[0],ae=o[B];y=g(this.chart.scales[B].getPixelForValue(ae))}M=e.top,V=e.bottom,k=y+b,R=k+f}else if(n==="y"){if(o==="center")y=g((e.left+e.right)/2);else if(J(o)){const B=Object.keys(o)[0],ae=o[B];y=g(this.chart.scales[B].getPixelForValue(ae))}P=y-b,N=P-f,C=e.left,L=e.right}const ke=ee(r.ticks.maxTicksLimit,h),te=Math.max(1,Math.ceil(h/ke));for(v=0;v<h;v+=te){const B=this.getContext(v),ae=i.setContext(B),E=a.setContext(B),A=ae.lineWidth,z=ae.color,X=E.dash||[],O=E.dashOffset,Q=ae.tickWidth,H=ae.tickColor,Z=ae.tickBorderDash||[],$=ae.tickBorderDashOffset;w=yC(this,v,l),w!==void 0&&(j=ps(s,w,A),u?P=N=C=L=j:k=R=M=V=j,p.push({tx1:P,ty1:k,tx2:N,ty2:R,x1:C,y1:M,x2:L,y2:V,width:A,color:z,borderDash:X,borderDashOffset:O,tickWidth:Q,tickColor:H,tickBorderDash:Z,tickBorderDashOffset:$}))}return this._ticksLength=h,this._borderValue=y,p}_computeLabelItems(e){const n=this.axis,s=this.options,{position:r,ticks:i}=s,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:d,mirror:h}=i,f=ai(s.grid),p=f+d,x=h?-d:p,m=-Ss(this.labelRotation),b=[];let g,y,v,w,j,P,k,N,R,C,M,L,V="middle";if(r==="top")P=this.bottom-x,k=this._getXAxisLabelAlignment();else if(r==="bottom")P=this.top+x,k=this._getXAxisLabelAlignment();else if(r==="left"){const te=this._getYAxisLabelAlignment(f);k=te.textAlign,j=te.x}else if(r==="right"){const te=this._getYAxisLabelAlignment(f);k=te.textAlign,j=te.x}else if(n==="x"){if(r==="center")P=(e.top+e.bottom)/2+p;else if(J(r)){const te=Object.keys(r)[0],B=r[te];P=this.chart.scales[te].getPixelForValue(B)+p}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")j=(e.left+e.right)/2-p;else if(J(r)){const te=Object.keys(r)[0],B=r[te];j=this.chart.scales[te].getPixelForValue(B)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?V="top":l==="end"&&(V="bottom"));const ke=this._getLabelSizes();for(g=0,y=a.length;g<y;++g){v=a[g],w=v.label;const te=i.setContext(this.getContext(g));N=this.getPixelForTick(g)+i.labelOffset,R=this._resolveTickFontOptions(g),C=R.lineHeight,M=Pe(w)?w.length:1;const B=M/2,ae=te.color,E=te.textStrokeColor,A=te.textStrokeWidth;let z=k;o?(j=N,k==="inner"&&(g===y-1?z=this.options.reverse?"left":"right":g===0?z=this.options.reverse?"right":"left":z="center"),r==="top"?u==="near"||m!==0?L=-M*C+C/2:u==="center"?L=-ke.highest.height/2-B*C+C:L=-ke.highest.height+C/2:u==="near"||m!==0?L=C/2:u==="center"?L=ke.highest.height/2-B*C:L=ke.highest.height-M*C,h&&(L*=-1),m!==0&&!te.showLabelBackdrop&&(j+=C/2*Math.sin(m))):(P=N,L=(1-M)*C/2);let X;if(te.showLabelBackdrop){const O=Tt(te.backdropPadding),Q=ke.heights[g],H=ke.widths[g];let Z=L-O.top,$=0-O.left;switch(V){case"middle":Z-=Q/2;break;case"bottom":Z-=Q;break}switch(k){case"center":$-=H/2;break;case"right":$-=H;break;case"inner":g===y-1?$-=H:g>0&&($-=H/2);break}X={left:$,top:Z,width:H+O.width,height:Q+O.height,color:te.backdropColor}}b.push({label:w,font:R,textOffset:L,options:{rotation:m,color:ae,strokeColor:E,strokeWidth:A,textAlign:z,textBaseline:V,translation:[j,P],backdrop:X}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Ss(this.labelRotation))return e==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:s,mirror:r,padding:i}}=this.options,o=this._getLabelSizes(),a=e+i,l=o.widest.width;let u,d;return n==="left"?r?(d=this.right+i,s==="near"?u="left":s==="center"?(u="center",d+=l/2):(u="right",d+=l)):(d=this.right-a,s==="near"?u="right":s==="center"?(u="center",d-=l/2):(u="left",d=this.left)):n==="right"?r?(d=this.left+i,s==="near"?u="right":s==="center"?(u="center",d-=l/2):(u="left",d-=l)):(d=this.left+a,s==="near"?u="left":s==="center"?(u="center",d+=l/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:s,top:r,width:i,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(s,r,i,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(i=>i.value===e);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const n=this.options.grid,s=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,o;const a=(l,u,d)=>{!d.width||!d.color||(s.save(),s.lineWidth=d.width,s.strokeStyle=d.color,s.setLineDash(d.borderDash||[]),s.lineDashOffset=d.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(u.x,u.y),s.stroke(),s.restore())};if(n.display)for(i=0,o=r.length;i<o;++i){const l=r[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:s,grid:r}}=this,i=s.setContext(this.getContext()),o=s.display?i.width:0;if(!o)return;const a=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,d,h,f;this.isHorizontal()?(u=ps(e,this.left,o)-o/2,d=ps(e,this.right,a)+a/2,h=f=l):(h=ps(e,this.top,o)-o/2,f=ps(e,this.bottom,a)+a/2,u=d=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(u,h),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const s=this.ctx,r=this._computeLabelArea();r&&Ud(s,r);const i=this.getLabelItems(e);for(const o of i){const a=o.options,l=o.font,u=o.label,d=o.textOffset;no(s,u,0,d,l,a)}r&&Vd(s)}drawTitle(){const{ctx:e,options:{position:n,title:s,reverse:r}}=this;if(!s.display)return;const i=Ue(s.font),o=Tt(s.padding),a=s.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||J(n)?(l+=o.bottom,Pe(s.text)&&(l+=i.lineHeight*(s.text.length-1))):l+=o.top;const{titleX:u,titleY:d,maxWidth:h,rotation:f}=kC(this,l,n,a);no(e,s.text,0,0,i,{color:s.color,maxWidth:h,rotation:f,textAlign:wC(a,n,r),textBaseline:"middle",translation:[u,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,s=ee(e.grid&&e.grid.z,-1),r=ee(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Qr.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:s,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];a[s]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Ue(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Go{constructor(e,n,s){this.type=e,this.scope=n,this.override=s,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let s;CC(n)&&(s=this.register(n));const r=this.items,i=e.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in r||(r[i]=e,_C(e,o,s),this.override&&Se.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,s=e.id,r=this.scope;s in n&&delete n[s],r&&s in Se[r]&&(delete Se[r][s],this.override&&delete Us[s])}}function _C(t,e,n){const s=eo(Object.create(null),[n?Se.get(n):{},Se.get(e),t.defaults]);Se.set(e,s),t.defaultRoutes&&SC(e,t.defaultRoutes),t.descriptors&&Se.describe(e,t.descriptors)}function SC(t,e){Object.keys(e).forEach(n=>{const s=n.split("."),r=s.pop(),i=[t].concat(s).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");Se.route(i,r,l,a)})}function CC(t){return"id"in t&&"defaults"in t}class jC{constructor(){this.controllers=new Go(Mi,"datasets",!0),this.elements=new Go(as,"elements"),this.plugins=new Go(Object,"plugins"),this.scales=new Go(Qr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,s){[...n].forEach(r=>{const i=s||this._getRegistryForType(r);s||i.isForType(r)||i===this.plugins&&r.id?this._exec(e,i,r):re(r,o=>{const a=s||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,s){const r=Wd(e);he(s["before"+r],[],s),n[e](s),he(s["after"+r],[],s)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const s=this._typedRegistries[n];if(s.isForType(e))return s}return this.plugins}_get(e,n,s){const r=n.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+s+".");return r}}var qt=new jC;class NC{constructor(){this._init=void 0}notify(e,n,s,r){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const i=r?this._descriptors(e).filter(r):this._descriptors(e),o=this._notify(i,e,n,s);return n==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,n,s,r){r=r||{};for(const i of e){const o=i.plugin,a=o[s],l=[n,r,i.options];if(he(a,l,o)===!1&&r.cancelable)return!1}return!0}invalidate(){oe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const s=e&&e.config,r=ee(s.options&&s.options.plugins,{}),i=EC(s);return r===!1&&!n?[]:MC(e,i,r,n)}_notifyStateChanges(e){const n=this._oldCache||[],s=this._cache,r=(i,o)=>i.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(r(n,s),e,"stop"),this._notify(r(s,n),e,"start")}}function EC(t){const e={},n=[],s=Object.keys(qt.plugins.items);for(let i=0;i<s.length;i++)n.push(qt.getPlugin(s[i]));const r=t.plugins||[];for(let i=0;i<r.length;i++){const o=r[i];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function PC(t,e){return!e&&t===!1?null:t===!0?{}:t}function MC(t,{plugins:e,localIds:n},s,r){const i=[],o=t.getContext();for(const a of e){const l=a.id,u=PC(s[l],r);u!==null&&i.push({plugin:a,options:TC(t.config,{plugin:a,local:n[l]},u,o)})}return i}function TC(t,{plugin:e,local:n},s,r){const i=t.pluginScopeKeys(e),o=t.getOptionScopes(s,i);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ec(t,e){const n=Se.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function RC(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function OC(t,e){return t===e?"_index_":"_value_"}function vp(t){if(t==="x"||t==="y"||t==="r")return t}function DC(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Pc(t,...e){if(vp(t))return t;for(const n of e){const s=n.axis||DC(n.position)||t.length>1&&vp(t[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function bp(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function LC(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(s=>s.xAxisID===t||s.yAxisID===t);if(n.length)return bp(t,"x",n[0])||bp(t,"y",n[0])}return{}}function FC(t,e){const n=Us[t.type]||{scales:{}},s=e.scales||{},r=Ec(t.type,e),i=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!J(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Pc(o,a,LC(o,t),Se.scales[a.type]),u=OC(l,r),d=n.scales||{};i[o]=Ni(Object.create(null),[{axis:l},a,d[l],d[u]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||Ec(a,e),d=(Us[a]||{}).scales||{};Object.keys(d).forEach(h=>{const f=RC(h,l),p=o[f+"AxisID"]||f;i[p]=i[p]||Object.create(null),Ni(i[p],[{axis:f},s[p],d[h]])})}),Object.keys(i).forEach(o=>{const a=i[o];Ni(a,[Se.scales[a.type],Se.scale])}),i}function _y(t){const e=t.options||(t.options={});e.plugins=ee(e.plugins,{}),e.scales=FC(t,e)}function Sy(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function IC(t){return t=t||{},t.data=Sy(t.data),_y(t),t}const wp=new Map,Cy=new Set;function Jo(t,e){let n=wp.get(t);return n||(n=e(),wp.set(t,n),Cy.add(n)),n}const li=(t,e,n)=>{const s=Ir(e,n);s!==void 0&&t.add(s)};class AC{constructor(e){this._config=IC(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Sy(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),_y(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Jo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Jo(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Jo(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,s=this.type;return Jo(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const s=this._scopeCache;let r=s.get(e);return(!r||n)&&(r=new Map,s.set(e,r)),r}getOptionScopes(e,n,s){const{options:r,type:i}=this,o=this._cachedScopes(e,s),a=o.get(n);if(a)return a;const l=new Set;n.forEach(d=>{e&&(l.add(e),d.forEach(h=>li(l,e,h))),d.forEach(h=>li(l,r,h)),d.forEach(h=>li(l,Us[i]||{},h)),d.forEach(h=>li(l,Se,h)),d.forEach(h=>li(l,Nc,h))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),Cy.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,Us[n]||{},Se.datasets[n]||{},{type:n},Se,Nc]}resolveNamedOptions(e,n,s,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=kp(this._resolverCache,e,r);let l=o;if(BC(o,n)){i.$shared=!1,s=os(s)?s():s;const u=this.createResolver(e,s,a);l=Ar(o,s,u)}for(const u of n)i[u]=l[u];return i}createResolver(e,n,s=[""],r){const{resolver:i}=kp(this._resolverCache,e,s);return J(n)?Ar(i,n,void 0,r):i}}function kp(t,e,n){let s=t.get(e);s||(s=new Map,t.set(e,s));const r=n.join();let i=s.get(r);return i||(i={resolver:Qd(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(r,i)),i}const zC=t=>J(t)&&Object.getOwnPropertyNames(t).some(e=>os(t[e]));function BC(t,e){const{isScriptable:n,isIndexable:s}=uy(t);for(const r of e){const i=n(r),o=s(r),a=(o||i)&&t[r];if(i&&(os(a)||zC(a))||o&&Pe(a))return!0}return!1}var WC="4.5.1";const $C=["top","bottom","left","right","chartArea"];function _p(t,e){return t==="top"||t==="bottom"||$C.indexOf(t)===-1&&e==="x"}function Sp(t,e){return function(n,s){return n[t]===s[t]?n[e]-s[e]:n[t]-s[t]}}function Cp(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),he(n&&n.onComplete,[t],e)}function HC(t){const e=t.chart,n=e.options.animation;he(n&&n.onProgress,[t],e)}function jy(t){return Xd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const xa={},jp=t=>{const e=jy(t);return Object.values(xa).filter(n=>n.canvas===e).pop()};function UC(t,e,n){const s=Object.keys(t);for(const r of s){const i=+r;if(i>=e){const o=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=o)}}}function VC(t,e,n,s){return!n||t.type==="mouseout"?null:s?e:t}var Nn;let bo=(Nn=class{static register(...e){qt.add(...e),Np()}static unregister(...e){qt.remove(...e),Np()}constructor(e,n){const s=this.config=new AC(n),r=jy(e),i=jp(r);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||uC(r)),this.platform.updateConfig(s);const a=this.platform.acquireContext(r,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,d=l&&l.width;if(this.id=a_(),this.ctx=a,this.canvas=l,this.width=d,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new NC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=N_(h=>this.update(h),o.resizeDelay||0),this._dataChanges=[],xa[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}an.listen(this,"complete",Cp),an.listen(this,"progress",HC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:s,height:r,_aspectRatio:i}=this;return oe(e)?n&&i?i:r?s/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return qt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Jf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kf(this.canvas,this.ctx),this}stop(){return an.stop(this),this}resize(e,n){an.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const s=this.options,r=this.canvas,i=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,e,n,i),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Jf(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),he(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};re(n,(s,r)=>{s.id=r})}buildOrUpdateScales(){const e=this.options,n=e.scales,s=this.scales,r=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{});let i=[];n&&(i=i.concat(Object.keys(n).map(o=>{const a=n[o],l=Pc(o,a),u=l==="r",d=l==="x";return{options:a,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),re(i,o=>{const a=o.options,l=a.id,u=Pc(l,a),d=ee(a.type,o.dtype);(a.position===void 0||_p(a.position,u)!==_p(o.dposition))&&(a.position=o.dposition),r[l]=!0;let h=null;if(l in s&&s[l].type===d)h=s[l];else{const f=qt.getScale(d);h=new f({id:l,type:d,ctx:this.ctx,chart:this}),s[h.id]=h}h.init(a,e)}),re(r,(o,a)=>{o||delete s[a]}),re(s,o=>{Ct.configure(this,o,o.options),Ct.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,s=e.length;if(e.sort((r,i)=>r.index-i.index),s>n){for(let r=n;r<s;++r)this._destroyDatasetMeta(r);e.splice(n,s-n)}this._sortedMetasets=e.slice(0).sort(Sp("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((s,r)=>{n.filter(i=>i===s._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let s,r;for(this._removeUnreferencedMetasets(),s=0,r=n.length;s<r;s++){const i=n[s];let o=this.getDatasetMeta(s);const a=i.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(s),o=this.getDatasetMeta(s)),o.type=a,o.indexAxis=i.indexAxis||Ec(a,this.options),o.order=i.order||0,o.index=s,o.label=""+i.label,o.visible=this.isDatasetVisible(s),o.controller)o.controller.updateIndex(s),o.controller.linkScales();else{const l=qt.getController(a),{datasetElementType:u,dataElementType:d}=Se.datasets[a];Object.assign(l,{dataElementType:qt.getElement(d),datasetElementType:u&&qt.getElement(u)}),o.controller=new l(this,s),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){re(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,d=this.data.datasets.length;u<d;u++){const{controller:h}=this.getDatasetMeta(u),f=!r&&i.indexOf(h)===-1;h.buildOrUpdateElements(f),o=Math.max(+h.getMaxOverflow(),o)}o=this._minPadding=s.layout.autoPadding?o:0,this._updateLayout(o),r||re(i,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Sp("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){re(this.scales,e=>{Ct.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(e.events);(!Af(n,s)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:s,start:r,count:i}of n){const o=s==="_removeElements"?-i:i;UC(e,r,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,s=i=>new Set(e.filter(o=>o[0]===i).map((o,a)=>a+","+o.splice(1).join(","))),r=s(0);for(let i=1;i<n;i++)if(!Af(r,s(i)))return;return Array.from(r).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ct.update(this,this.width,this.height,e);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],re(this.boxes,r=>{s&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,i)=>{r._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,os(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const s=this.getDatasetMeta(e),r={meta:s,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(s.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(an.has(this)?this.attached&&!an.running(this)&&an.start(this):(this.draw(),Cp({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:s,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,s=[];let r,i;for(r=0,i=n.length;r<i;++r){const o=n[r];(!e||o.visible)&&s.push(o)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,s={meta:e,index:e.index,cancelable:!0},r=hS(this,e);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Ud(n,r),e.controller.draw(),r&&Vd(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return oy(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,s,r){const i=$S.modes[n];return typeof i=="function"?i(this,e,s,r):[]}getDatasetMeta(e){const n=this.data.datasets[e],s=this._metasets;let r=s.filter(i=>i&&i._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},s.push(r)),r}getContext(){return this.$context||(this.$context=Vr(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const s=this.getDatasetMeta(e);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(e,n){const s=this.getDatasetMeta(e);s.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,s){const r=s?"show":"hide",i=this.getDatasetMeta(e),o=i.controller._resolveAnimations(void 0,r);to(n)?(i.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(e,s),o.update(i,{visible:s}),this.update(a=>a.datasetIndex===e?r:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),an.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Kf(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete xa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,s=(i,o)=>{n.addEventListener(this,i,o),e[i]=o},r=(i,o,a)=>{i.offsetX=o,i.offsetY=a,this._eventHandler(i)};re(this.options.events,i=>s(i,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,s=(l,u)=>{n.addEventListener(this,l,u),e[l]=u},r=(l,u)=>{e[l]&&(n.removeEventListener(this,l,u),delete e[l])},i=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const a=()=>{r("attach",a),this.attached=!0,this.resize(),s("resize",i),s("detach",o)};o=()=>{this.attached=!1,r("resize",i),this._stop(),this._resize(0,0),s("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){re(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},re(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,s){const r=s?"set":"remove";let i,o,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+r+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){o=e[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[r+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],s=e.map(({datasetIndex:i,index:o})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[o],index:o}});!Qa(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(e,n,s){return this._plugins.notify(this,e,n,s)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,s){const r=this.options.hover,i=(l,u)=>l.filter(d=>!u.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),o=i(n,e),a=s?e:i(e,n);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,n){const s={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},r=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",s,r)===!1)return;const i=this._handleEvent(e,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,r),(i||s.changed)&&this.render(),this}_handleEvent(e,n,s){const{_active:r=[],options:i}=this,o=n,a=this._getActiveElements(e,r,s,o),l=f_(e),u=VC(e,this._lastEvent,s,l);s&&(this._lastEvent=null,he(i.onHover,[e,a,this],this),l&&he(i.onClick,[e,a,this],this));const d=!Qa(a,r);return(d||n)&&(this._active=a,this._updateHoverStyles(a,r,n)),this._lastEvent=u,d}_getActiveElements(e,n,s,r){if(e.type==="mouseout")return[];if(!s)return n;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}},q(Nn,"defaults",Se),q(Nn,"instances",xa),q(Nn,"overrides",Us),q(Nn,"registry",qt),q(Nn,"version",WC),q(Nn,"getChart",jp),Nn);function Np(){return re(bo.instances,t=>t._plugins.invalidate())}function Ny(t,e){const{x:n,y:s,base:r,width:i,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,u,d,h;return t.horizontal?(h=o/2,a=Math.min(n,r),l=Math.max(n,r),u=s-h,d=s+h):(h=i/2,a=n-h,l=n+h,u=Math.min(s,r),d=Math.max(s,r)),{left:a,top:u,right:l,bottom:d}}function Vn(t,e,n,s){return t?0:zt(e,n,s)}function QC(t,e,n){const s=t.options.borderWidth,r=t.borderSkipped,i=ly(s);return{t:Vn(r.top,i.top,0,n),r:Vn(r.right,i.right,0,e),b:Vn(r.bottom,i.bottom,0,n),l:Vn(r.left,i.left,0,e)}}function YC(t,e,n){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,i=gr(r),o=Math.min(e,n),a=t.borderSkipped,l=s||J(r);return{topLeft:Vn(!l||a.top||a.left,i.topLeft,0,o),topRight:Vn(!l||a.top||a.right,i.topRight,0,o),bottomLeft:Vn(!l||a.bottom||a.left,i.bottomLeft,0,o),bottomRight:Vn(!l||a.bottom||a.right,i.bottomRight,0,o)}}function KC(t){const e=Ny(t),n=e.right-e.left,s=e.bottom-e.top,r=QC(t,n/2,s/2),i=YC(t,n/2,s/2);return{outer:{x:e.left,y:e.top,w:n,h:s,radius:i},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:s-r.t-r.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,i.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(r.b,r.r))}}}}function hu(t,e,n,s){const r=e===null,i=n===null,a=t&&!(r&&i)&&Ny(t,s);return a&&(r||lr(e,a.left,a.right))&&(i||lr(n,a.top,a.bottom))}function XC(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function qC(t,e){t.rect(e.x,e.y,e.w,e.h)}function fu(t,e,n={}){const s=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,i=(t.x+t.w!==n.x+n.w?e:0)-s,o=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+s,y:t.y+r,w:t.w+i,h:t.h+o,radius:t.radius}}class Ti extends as{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:s,backgroundColor:r}}=this,{inner:i,outer:o}=KC(this),a=XC(o.radius)?qa:qC;e.save(),(o.w!==i.w||o.h!==i.h)&&(e.beginPath(),a(e,fu(o,n,i)),e.clip(),a(e,fu(i,-n,o)),e.fillStyle=s,e.fill("evenodd")),e.beginPath(),a(e,fu(i,n)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,n,s){return hu(this,e,n,s)}inXRange(e,n){return hu(this,e,null,n)}inYRange(e,n){return hu(this,null,e,n)}getCenterPoint(e){const{x:n,y:s,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(n+r)/2:n,y:i?s:(s+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}q(Ti,"id","bar"),q(Ti,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),q(Ti,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Ep=(t,e)=>{let{boxHeight:n=e,boxWidth:s=e}=t;return t.usePointStyle&&(n=Math.min(n,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:n,itemHeight:Math.max(e,n)}},GC=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Pp extends as{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,s){this.maxWidth=e,this.maxHeight=n,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=he(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(s=>e.filter(s,this.chart.data))),e.sort&&(n=n.sort((s,r)=>e.sort(s,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const s=e.labels,r=Ue(s.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ep(s,i);let u,d;n.font=r.string,this.isHorizontal()?(u=this.maxWidth,d=this._fitRows(o,i,a,l)+10):(d=this.maxHeight,u=this._fitCols(o,r,a,l)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(d,e.maxHeight||this.maxHeight)}_fitRows(e,n,s,r){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],d=r+a;let h=e;i.textAlign="left",i.textBaseline="middle";let f=-1,p=-d;return this.legendItems.forEach((x,m)=>{const b=s+n/2+i.measureText(x.text).width;(m===0||u[u.length-1]+b+2*a>o)&&(h+=d,u[u.length-(m>0?0:1)]=0,p+=d,f++),l[m]={left:0,top:p,row:f,width:b,height:r},u[u.length-1]+=b+a}),h}_fitCols(e,n,s,r){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],d=o-e;let h=a,f=0,p=0,x=0,m=0;return this.legendItems.forEach((b,g)=>{const{itemWidth:y,itemHeight:v}=JC(s,n,i,b,r);g>0&&p+v+2*a>d&&(h+=f+a,u.push({width:f,height:p}),x+=f+a,m++,f=p=0),l[g]={left:x,top:p,col:m,width:y,height:v},f=Math.max(f,y),p+=v+a}),h+=f,u.push({width:f,height:p}),h}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:s,labels:{padding:r},rtl:i}}=this,o=mr(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=$e(s,this.left+r,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=$e(s,this.left+r,this.right-this.lineWidths[a])),u.top+=this.top+e+r,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+r}else{let a=0,l=$e(s,this.top+e+r,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=$e(s,this.top+e+r,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+r,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Ud(e,this),this._draw(),Vd(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:s,ctx:r}=this,{align:i,labels:o}=e,a=Se.color,l=mr(e.rtl,this.left,this.width),u=Ue(o.font),{padding:d}=o,h=u.size,f=h/2;let p;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:x,boxHeight:m,itemHeight:b}=Ep(o,h),g=function(P,k,N){if(isNaN(x)||x<=0||isNaN(m)||m<0)return;r.save();const R=ee(N.lineWidth,1);if(r.fillStyle=ee(N.fillStyle,a),r.lineCap=ee(N.lineCap,"butt"),r.lineDashOffset=ee(N.lineDashOffset,0),r.lineJoin=ee(N.lineJoin,"miter"),r.lineWidth=R,r.strokeStyle=ee(N.strokeStyle,a),r.setLineDash(ee(N.lineDash,[])),o.usePointStyle){const C={radius:m*Math.SQRT2/2,pointStyle:N.pointStyle,rotation:N.rotation,borderWidth:R},M=l.xPlus(P,x/2),L=k+f;iy(r,C,M,L,o.pointStyleWidth&&x)}else{const C=k+Math.max((h-m)/2,0),M=l.leftForLtr(P,x),L=gr(N.borderRadius);r.beginPath(),Object.values(L).some(V=>V!==0)?qa(r,{x:M,y:C,w:x,h:m,radius:L}):r.rect(M,C,x,m),r.fill(),R!==0&&r.stroke()}r.restore()},y=function(P,k,N){no(r,N.text,P,k+b/2,u,{strikethrough:N.hidden,textAlign:l.textAlign(N.textAlign)})},v=this.isHorizontal(),w=this._computeTitleHeight();v?p={x:$e(i,this.left+d,this.right-s[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:$e(i,this.top+w+d,this.bottom-n[0].height),line:0},fy(this.ctx,e.textDirection);const j=b+d;this.legendItems.forEach((P,k)=>{r.strokeStyle=P.fontColor,r.fillStyle=P.fontColor;const N=r.measureText(P.text).width,R=l.textAlign(P.textAlign||(P.textAlign=o.textAlign)),C=x+f+N;let M=p.x,L=p.y;l.setWidth(this.width),v?k>0&&M+C+d>this.right&&(L=p.y+=j,p.line++,M=p.x=$e(i,this.left+d,this.right-s[p.line])):k>0&&L+j>this.bottom&&(M=p.x=M+n[p.line].width+d,p.line++,L=p.y=$e(i,this.top+w+d,this.bottom-n[p.line].height));const V=l.x(M);if(g(V,L,P),M=E_(R,M+x+f,v?M+C:this.right,e.rtl),y(l.x(M),L,P),v)p.x+=C+d;else if(typeof P.text!="string"){const ke=u.lineHeight;p.y+=Ey(P,ke)+d}else p.y+=j}),py(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,s=Ue(n.font),r=Tt(n.padding);if(!n.display)return;const i=mr(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=s.size/2,u=r.top+l;let d,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+u,h=$e(e.align,h,this.right-f);else{const x=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);d=u+$e(e.align,this.top,this.bottom-x-e.labels.padding-this._computeTitleHeight())}const p=$e(a,h,h+f);o.textAlign=i.textAlign(Hd(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=s.string,no(o,n.text,p,d,s)}_computeTitleHeight(){const e=this.options.title,n=Ue(e.font),s=Tt(e.padding);return e.display?n.lineHeight+s.height:0}_getLegendItemAt(e,n){let s,r,i;if(lr(e,this.left,this.right)&&lr(n,this.top,this.bottom)){for(i=this.legendHitBoxes,s=0;s<i.length;++s)if(r=i[s],lr(e,r.left,r.left+r.width)&&lr(n,r.top,r.top+r.height))return this.legendItems[s]}return null}handleEvent(e){const n=this.options;if(!t2(e.type,n))return;const s=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,i=GC(r,s);r&&!i&&he(n.onLeave,[e,r,this],this),this._hoveredItem=s,s&&!i&&he(n.onHover,[e,s,this],this)}else s&&he(n.onClick,[e,s,this],this)}}function JC(t,e,n,s,r){const i=ZC(s,t,e,n),o=e2(r,s,e.lineHeight);return{itemWidth:i,itemHeight:o}}function ZC(t,e,n,s){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((i,o)=>i.length>o.length?i:o)),e+n.size/2+s.measureText(r).width}function e2(t,e,n){let s=t;return typeof e.text!="string"&&(s=Ey(e,n)),s}function Ey(t,e){const n=t.text?t.text.length:0;return e*n}function t2(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Py={id:"legend",_element:Pp,start(t,e,n){const s=t.legend=new Pp({ctx:t.ctx,options:n,chart:t});Ct.configure(t,s,n),Ct.addBox(t,s)},stop(t){Ct.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const s=t.legend;Ct.configure(t,s,n),s.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const s=e.datasetIndex,r=n.chart;r.isDatasetVisible(s)?(r.hide(s),e.hidden=!0):(r.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:r,color:i,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),d=Tt(u.borderWidth);return{text:e[l.index].label,fillStyle:u.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:u.borderColor,pointStyle:s||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:o&&(a||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class My extends as{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const r=Pe(s.text)?s.text.length:1;this._padding=Tt(s.padding);const i=r*Ue(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:s,bottom:r,right:i,options:o}=this,a=o.align;let l=0,u,d,h;return this.isHorizontal()?(d=$e(a,s,i),h=n+e,u=i-s):(o.position==="left"?(d=s+e,h=$e(a,r,n),l=Ve*-.5):(d=i-e,h=$e(a,n,r),l=Ve*.5),u=r-n),{titleX:d,titleY:h,maxWidth:u,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const s=Ue(n.font),i=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(i);no(e,n.text,0,0,s,{color:n.color,maxWidth:l,rotation:u,textAlign:Hd(n.align),textBaseline:"middle",translation:[o,a]})}}function n2(t,e){const n=new My({ctx:t.ctx,options:e,chart:t});Ct.configure(t,n,e),Ct.addBox(t,n),t.titleBlock=n}var Ty={id:"title",_element:My,start(t,e,n){n2(t,n)},stop(t){const e=t.titleBlock;Ct.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const s=t.titleBlock;Ct.configure(t,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const yi={average(t){if(!t.length)return!1;let e,n,s=new Set,r=0,i=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),r+=l.y,++i}}return i===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:r/i}},nearest(t,e){if(!t.length)return!1;let n=e.x,s=e.y,r=Number.POSITIVE_INFINITY,i,o,a;for(i=0,o=t.length;i<o;++i){const l=t[i].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),d=w_(e,u);d<r&&(r=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,s=l.y}return{x:n,y:s}}};function Kt(t,e){return e&&(Pe(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ln(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
67
- `)>-1?t.split(`
68
- `):t}function s2(t,e){const{element:n,datasetIndex:s,index:r}=e,i=t.getDatasetMeta(s).controller,{label:o,value:a}=i.getLabelAndValue(r);return{chart:t,label:o,parsed:i.getParsed(r),raw:t.data.datasets[s].data[r],formattedValue:a,dataset:i.getDataset(),dataIndex:r,datasetIndex:s,element:n}}function Mp(t,e){const n=t.chart.ctx,{body:s,footer:r,title:i}=t,{boxWidth:o,boxHeight:a}=e,l=Ue(e.bodyFont),u=Ue(e.titleFont),d=Ue(e.footerFont),h=i.length,f=r.length,p=s.length,x=Tt(e.padding);let m=x.height,b=0,g=s.reduce((w,j)=>w+j.before.length+j.lines.length+j.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,h&&(m+=h*u.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),g){const w=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=p*w+(g-p)*l.lineHeight+(g-1)*e.bodySpacing}f&&(m+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let y=0;const v=function(w){b=Math.max(b,n.measureText(w).width+y)};return n.save(),n.font=u.string,re(t.title,v),n.font=l.string,re(t.beforeBody.concat(t.afterBody),v),y=e.displayColors?o+2+e.boxPadding:0,re(s,w=>{re(w.before,v),re(w.lines,v),re(w.after,v)}),y=0,n.font=d.string,re(t.footer,v),n.restore(),b+=x.width,{width:b,height:m}}function r2(t,e){const{y:n,height:s}=e;return n<s/2?"top":n>t.height-s/2?"bottom":"center"}function i2(t,e,n,s){const{x:r,width:i}=s,o=n.caretSize+n.caretPadding;if(t==="left"&&r+i+o>e.width||t==="right"&&r-i-o<0)return!0}function o2(t,e,n,s){const{x:r,width:i}=n,{width:o,chartArea:{left:a,right:l}}=t;let u="center";return s==="center"?u=r<=(a+l)/2?"left":"right":r<=i/2?u="left":r>=o-i/2&&(u="right"),i2(u,t,e,n)&&(u="center"),u}function Tp(t,e,n){const s=n.yAlign||e.yAlign||r2(t,n);return{xAlign:n.xAlign||e.xAlign||o2(t,e,n,s),yAlign:s}}function a2(t,e){let{x:n,width:s}=t;return e==="right"?n-=s:e==="center"&&(n-=s/2),n}function l2(t,e,n){let{y:s,height:r}=t;return e==="top"?s+=n:e==="bottom"?s-=r+n:s-=r/2,s}function Rp(t,e,n,s){const{caretSize:r,caretPadding:i,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,u=r+i,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=gr(o);let x=a2(e,a);const m=l2(e,l,u);return l==="center"?a==="left"?x+=u:a==="right"&&(x-=u):a==="left"?x-=Math.max(d,f)+r:a==="right"&&(x+=Math.max(h,p)+r),{x:zt(x,0,s.width-e.width),y:zt(m,0,s.height-e.height)}}function Zo(t,e,n){const s=Tt(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-s.right:t.x+s.left}function Op(t){return Kt([],ln(t))}function u2(t,e,n){return Vr(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Dp(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Ry={beforeTitle:rn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,s=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return n[e.dataIndex]}return""},afterTitle:rn,beforeBody:rn,beforeLabel:rn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return oe(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:rn,afterBody:rn,beforeFooter:rn,footer:rn,afterFooter:rn};function tt(t,e,n,s){const r=t[e].call(n,s);return typeof r>"u"?Ry[e].call(n,s):r}class Mc extends as{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,s=this.options.setContext(this.getContext()),r=s.enabled&&n.options.animation&&s.animations,i=new gy(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=u2(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:s}=n,r=tt(s,"beforeTitle",this,e),i=tt(s,"title",this,e),o=tt(s,"afterTitle",this,e);let a=[];return a=Kt(a,ln(r)),a=Kt(a,ln(i)),a=Kt(a,ln(o)),a}getBeforeBody(e,n){return Op(tt(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:s}=n,r=[];return re(e,i=>{const o={before:[],lines:[],after:[]},a=Dp(s,i);Kt(o.before,ln(tt(a,"beforeLabel",this,i))),Kt(o.lines,tt(a,"label",this,i)),Kt(o.after,ln(tt(a,"afterLabel",this,i))),r.push(o)}),r}getAfterBody(e,n){return Op(tt(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:s}=n,r=tt(s,"beforeFooter",this,e),i=tt(s,"footer",this,e),o=tt(s,"afterFooter",this,e);let a=[];return a=Kt(a,ln(r)),a=Kt(a,ln(i)),a=Kt(a,ln(o)),a}_createItems(e){const n=this._active,s=this.chart.data,r=[],i=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(s2(this.chart,n[l]));return e.filter&&(a=a.filter((d,h,f)=>e.filter(d,h,f,s))),e.itemSort&&(a=a.sort((d,h)=>e.itemSort(d,h,s))),re(a,d=>{const h=Dp(e.callbacks,d);r.push(tt(h,"labelColor",this,d)),i.push(tt(h,"labelPointStyle",this,d)),o.push(tt(h,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const s=this.options.setContext(this.getContext()),r=this._active;let i,o=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{const a=yi[s.position].call(this,r,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);const l=this._size=Mp(this,s),u=Object.assign({},a,l),d=Tp(this.chart,s,u),h=Rp(s,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,i={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,s,r){const i=this.getCaretPosition(e,s,r);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,s){const{xAlign:r,yAlign:i}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:h}=gr(a),{x:f,y:p}=e,{width:x,height:m}=n;let b,g,y,v,w,j;return i==="center"?(w=p+m/2,r==="left"?(b=f,g=b-o,v=w+o,j=w-o):(b=f+x,g=b+o,v=w-o,j=w+o),y=b):(r==="left"?g=f+Math.max(l,d)+o:r==="right"?g=f+x-Math.max(u,h)-o:g=this.caretX,i==="top"?(v=p,w=v-o,b=g-o,y=g+o):(v=p+m,w=v+o,b=g+o,y=g-o),j=v),{x1:b,x2:g,x3:y,y1:v,y2:w,y3:j}}drawTitle(e,n,s){const r=this.title,i=r.length;let o,a,l;if(i){const u=mr(s.rtl,this.x,this.width);for(e.x=Zo(this,s.titleAlign,s),n.textAlign=u.textAlign(s.titleAlign),n.textBaseline="middle",o=Ue(s.titleFont),a=s.titleSpacing,n.fillStyle=s.titleColor,n.font=o.string,l=0;l<i;++l)n.fillText(r[l],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,l+1===i&&(e.y+=s.titleMarginBottom-a)}}_drawColorBox(e,n,s,r,i){const o=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:u}=i,d=Ue(i.bodyFont),h=Zo(this,"left",i),f=r.x(h),p=l<d.lineHeight?(d.lineHeight-l)/2:0,x=n.y+p;if(i.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=r.leftForLtr(f,u)+u/2,g=x+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Xf(e,m,b,g),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Xf(e,m,b,g)}else{e.lineWidth=J(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const m=r.leftForLtr(f,u),b=r.leftForLtr(r.xPlus(f,1),u-2),g=gr(o.borderRadius);Object.values(g).some(y=>y!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,qa(e,{x:m,y:x,w:u,h:l,radius:g}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),qa(e,{x:b,y:x+1,w:u-2,h:l-2,radius:g}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(m,x,u,l),e.strokeRect(m,x,u,l),e.fillStyle=o.backgroundColor,e.fillRect(b,x+1,u-2,l-2))}e.fillStyle=this.labelTextColors[s]}drawBody(e,n,s){const{body:r}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:d}=s,h=Ue(s.bodyFont);let f=h.lineHeight,p=0;const x=mr(s.rtl,this.x,this.width),m=function(N){n.fillText(N,x.x(e.x+p),e.y+f/2),e.y+=f+i},b=x.textAlign(o);let g,y,v,w,j,P,k;for(n.textAlign=o,n.textBaseline="middle",n.font=h.string,e.x=Zo(this,b,s),n.fillStyle=s.bodyColor,re(this.beforeBody,m),p=a&&b!=="right"?o==="center"?u/2+d:u+2+d:0,w=0,P=r.length;w<P;++w){for(g=r[w],y=this.labelTextColors[w],n.fillStyle=y,re(g.before,m),v=g.lines,a&&v.length&&(this._drawColorBox(n,e,w,x,s),f=Math.max(h.lineHeight,l)),j=0,k=v.length;j<k;++j)m(v[j]),f=h.lineHeight;re(g.after,m)}p=0,f=h.lineHeight,re(this.afterBody,m),e.y-=i}drawFooter(e,n,s){const r=this.footer,i=r.length;let o,a;if(i){const l=mr(s.rtl,this.x,this.width);for(e.x=Zo(this,s.footerAlign,s),e.y+=s.footerMarginTop,n.textAlign=l.textAlign(s.footerAlign),n.textBaseline="middle",o=Ue(s.footerFont),n.fillStyle=s.footerColor,n.font=o.string,a=0;a<i;++a)n.fillText(r[a],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+s.footerSpacing}}drawBackground(e,n,s,r){const{xAlign:i,yAlign:o}=this,{x:a,y:l}=e,{width:u,height:d}=s,{topLeft:h,topRight:f,bottomLeft:p,bottomRight:x}=gr(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(a+h,l),o==="top"&&this.drawCaret(e,n,s,r),n.lineTo(a+u-f,l),n.quadraticCurveTo(a+u,l,a+u,l+f),o==="center"&&i==="right"&&this.drawCaret(e,n,s,r),n.lineTo(a+u,l+d-x),n.quadraticCurveTo(a+u,l+d,a+u-x,l+d),o==="bottom"&&this.drawCaret(e,n,s,r),n.lineTo(a+p,l+d),n.quadraticCurveTo(a,l+d,a,l+d-p),o==="center"&&i==="left"&&this.drawCaret(e,n,s,r),n.lineTo(a,l+h),n.quadraticCurveTo(a,l,a+h,l),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,s=this.$animations,r=s&&s.x,i=s&&s.y;if(r||i){const o=yi[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Mp(this,e),l=Object.assign({},o,this._size),u=Tp(n,e,l),d=Rp(e,l,u,n);(r._to!==d.x||i._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},i={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=Tt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=s,this.drawBackground(i,e,r,n),fy(e,n.textDirection),i.y+=o.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),py(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const s=this._active,r=e.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),i=!Qa(s,r),o=this._positionChanged(r,n);(i||o)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,i=this._active||[],o=this._getActiveElements(e,i,n,s),a=this._positionChanged(o,e),l=n||!Qa(o,i)||a;return l&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,s,r){const i=this.options;if(e.type==="mouseout")return[];if(!r)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,i.mode,i,s);return i.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:s,caretY:r,options:i}=this,o=yi[i.position].call(this,e,n);return o!==!1&&(s!==o.x||r!==o.y)}}q(Mc,"positioners",yi);var Oy={id:"tooltip",_element:Mc,positioners:yi,afterInit(t,e,n){n&&(t.tooltip=new Mc({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ry},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const c2=(t,e,n,s)=>(typeof e=="string"?(n=t.push(e)-1,s.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function d2(t,e,n,s){const r=t.indexOf(e);if(r===-1)return c2(t,e,n,s);const i=t.lastIndexOf(e);return r!==i?n:r}const h2=(t,e)=>t===null?null:zt(Math.round(t),0,e);function Lp(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Za extends Qr{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const s=this.getLabels();for(const{index:r,label:i}of n)s[r]===i&&s.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(oe(e))return null;const s=this.getLabels();return n=isFinite(n)&&s[n]===e?n:d2(s,e,ee(n,e),this._addedLabels),h2(n,s.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(s=0),n||(r=this.getLabels().length-1)),this.min=s,this.max=r}buildTicks(){const e=this.min,n=this.max,s=this.options.offset,r=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let o=e;o<=n;o++)r.push({value:o});return r}getLabelForValue(e){return Lp.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}q(Za,"id","category"),q(Za,"defaults",{ticks:{callback:Lp}});function f2(t,e){const n=[],{bounds:r,step:i,min:o,max:a,precision:l,count:u,maxTicks:d,maxDigits:h,includeBounds:f}=t,p=i||1,x=d-1,{min:m,max:b}=e,g=!oe(o),y=!oe(a),v=!oe(u),w=(b-m)/(h+1);let j=Bf((b-m)/x/p)*p,P,k,N,R;if(j<1e-14&&!g&&!y)return[{value:m},{value:b}];R=Math.ceil(b/j)-Math.floor(m/j),R>x&&(j=Bf(R*j/x/p)*p),oe(l)||(P=Math.pow(10,l),j=Math.ceil(j*P)/P),r==="ticks"?(k=Math.floor(m/j)*j,N=Math.ceil(b/j)*j):(k=m,N=b),g&&y&&i&&y_((a-o)/i,j/1e3)?(R=Math.round(Math.min((a-o)/j,d)),j=(a-o)/R,k=o,N=a):v?(k=g?o:k,N=y?a:N,R=u-1,j=(N-k)/R):(R=(N-k)/j,ga(R,Math.round(R),j/1e3)?R=Math.round(R):R=Math.ceil(R));const C=Math.max(Wf(j),Wf(k));P=Math.pow(10,oe(l)?C:l),k=Math.round(k*P)/P,N=Math.round(N*P)/P;let M=0;for(g&&(f&&k!==o?(n.push({value:o}),k<o&&M++,ga(Math.round((k+M*j)*P)/P,o,Fp(o,w,t))&&M++):k<o&&M++);M<R;++M){const L=Math.round((k+M*j)*P)/P;if(y&&L>a)break;n.push({value:L})}return y&&f&&N!==a?n.length&&ga(n[n.length-1].value,a,Fp(a,w,t))?n[n.length-1].value=a:n.push({value:a}):(!y||N===a)&&n.push({value:N}),n}function Fp(t,e,{horizontal:n,minRotation:s}){const r=Ss(s),i=(n?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/i,o)}class p2 extends Qr{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return oe(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds();let{min:r,max:i}=this;const o=l=>r=n?r:l,a=l=>i=s?i:l;if(e){const l=ss(r),u=ss(i);l<0&&u<0?a(0):l>0&&u>0&&o(0)}if(r===i){let l=i===0?1:Math.abs(i*.05);a(i+l),e||o(r-l)}this.min=r,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:s}=e,r;return s?(r=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let s=this.getTickLimit();s=Math.max(2,s);const r={maxTicks:s,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,o=f2(r,i);return e.bounds==="ticks"&&x_(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,s=this.max;if(super.configure(),this.options.offset&&e.length){const r=(s-n)/Math.max(e.length-1,1)/2;n-=r,s+=r}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(e){return sy(e,this.chart.options.locale,this.options.ticks.format)}}class el extends p2{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Mt(e)?e:0,this.max=Mt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,s=Ss(this.options.ticks.minRotation),r=(e?Math.sin(s):Math.cos(s))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}q(el,"id","linear"),q(el,"defaults",{ticks:{callback:ry.formatters.numeric}});const Sl={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},it=Object.keys(Sl);function Ip(t,e){return t-e}function Ap(t,e){if(oe(e))return null;const n=t._adapter,{parser:s,round:r,isoWeekday:i}=t._parseOpts;let o=e;return typeof s=="function"&&(o=s(o)),Mt(o)||(o=typeof s=="string"?n.parse(o,s):n.parse(o)),o===null?null:(r&&(o=r==="week"&&(Xa(i)||i===!0)?n.startOf(o,"isoWeek",i):n.startOf(o,r)),+o)}function zp(t,e,n,s){const r=it.length;for(let i=it.indexOf(t);i<r-1;++i){const o=Sl[it[i]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(a*o.size))<=s)return it[i]}return it[r-1]}function g2(t,e,n,s,r){for(let i=it.length-1;i>=it.indexOf(n);i--){const o=it[i];if(Sl[o].common&&t._adapter.diff(r,s,o)>=e-1)return o}return it[n?it.indexOf(n):0]}function m2(t){for(let e=it.indexOf(t)+1,n=it.length;e<n;++e)if(Sl[it[e]].common)return it[e]}function Bp(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:s,hi:r}=$d(n,e),i=n[s]>=e?n[s]:n[r];t[i]=!0}}function y2(t,e,n,s){const r=t._adapter,i=+r.startOf(e[0].value,s),o=e[e.length-1].value;let a,l;for(a=i;a<=o;a=+r.add(a,1,s))l=n[a],l>=0&&(e[l].major=!0);return e}function Wp(t,e,n){const s=[],r={},i=e.length;let o,a;for(o=0;o<i;++o)a=e[o],r[a]=o,s.push({value:a,major:!1});return i===0||!n?s:y2(t,s,r,n)}class tl extends Qr{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const s=e.time||(e.time={}),r=this._adapter=new IS._date(e.adapters.date);r.init(n),Ni(s.displayFormats,r.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Ap(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,s=e.time.unit||"day";let{min:r,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(r=Math.min(r,u.min)),!a&&!isNaN(u.max)&&(i=Math.max(i,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=Mt(r)&&!isNaN(r)?r:+n.startOf(Date.now(),s),i=Mt(i)&&!isNaN(i)?i:+n.endOf(Date.now(),s)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],s=e[e.length-1]),{min:n,max:s}}buildTicks(){const e=this.options,n=e.time,s=e.ticks,r=s.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const i=this.min,o=this.max,a=C_(r,i,o);return this._unit=n.unit||(s.autoSkip?zp(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):g2(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:m2(this._unit),this.initOffsets(r),e.reverse&&a.reverse(),Wp(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,s=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?n=1-r:n=(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?s=i:s=(i-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=zt(n,0,o),s=zt(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const e=this._adapter,n=this.min,s=this.max,r=this.options,i=r.time,o=i.unit||zp(i.minUnit,n,s,this._getLabelCapacity(n)),a=ee(r.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,u=Xa(l)||l===!0,d={};let h=n,f,p;if(u&&(h=+e.startOf(h,"isoWeek",l)),h=+e.startOf(h,u?"day":o),e.diff(s,n,o)>1e5*a)throw new Error(n+" and "+s+" are too far apart with stepSize of "+a+" "+o);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(f=h,p=0;f<s;f=+e.add(f,a,o),p++)Bp(d,f,x);return(f===s||r.bounds==="ticks"||p===1)&&Bp(d,f,x),Object.keys(d).sort(Ip).map(m=>+m)}getLabelForValue(e){const n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(e,s.tooltipFormat):n.format(e,s.displayFormats.datetime)}format(e,n){const r=this.options.time.displayFormats,i=this._unit,o=n||r[i];return this._adapter.format(e,o)}_tickFormatFunction(e,n,s,r){const i=this.options,o=i.ticks.callback;if(o)return he(o,[e,n,s],this);const a=i.time.displayFormats,l=this._unit,u=this._majorUnit,d=l&&a[l],h=u&&a[u],f=s[n],p=u&&h&&f&&f.major;return this._adapter.format(e,r||(p?h:d))}generateTickLabels(e){let n,s,r;for(n=0,s=e.length;n<s;++n)r=e[n],r.label=this._tickFormatFunction(r.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,s=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+s)*n.factor)}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+s*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,s=this.ctx.measureText(e).width,r=Ss(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(r),o=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:s*i+a*o,h:s*o+a*i}}_getLabelCapacity(e){const n=this.options.time,s=n.displayFormats,r=s[n.unit]||s.millisecond,i=this._tickFormatFunction(e,0,Wp(this,[e],this._majorUnit),r),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,s;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,s=r.length;n<s;++n)e=e.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,s;if(e.length)return e;const r=this.getLabels();for(n=0,s=r.length;n<s;++n)e.push(Ap(this,r[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Z0(e.sort(Ip))}}q(tl,"id","time"),q(tl,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ea(t,e,n){let s=0,r=t.length-1,i,o,a,l;n?(e>=t[s].pos&&e<=t[r].pos&&({lo:s,hi:r}=jc(t,"pos",e)),{pos:i,time:a}=t[s],{pos:o,time:l}=t[r]):(e>=t[s].time&&e<=t[r].time&&({lo:s,hi:r}=jc(t,"time",e)),{time:i,pos:a}=t[s],{time:o,pos:l}=t[r]);const u=o-i;return u?a+(l-a)*(e-i)/u:a}class $p extends tl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=ea(n,this.min),this._tableRange=ea(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:s}=this,r=[],i=[];let o,a,l,u,d;for(o=0,a=e.length;o<a;++o)u=e[o],u>=n&&u<=s&&r.push(u);if(r.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(o=0,a=r.length;o<a;++o)d=r[o+1],l=r[o-1],u=r[o],Math.round((d+l)/2)!==u&&i.push({time:u,pos:o/(a-1)});return i}_generate(){const e=this.min,n=this.max;let s=super.getDataTimestamps();return(!s.includes(e)||!s.length)&&s.splice(0,0,e),(!s.includes(n)||s.length===1)&&s.push(n),s.sort((r,i)=>r-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?e=this.normalize(n.concat(s)):e=n.length?n:s,e=this._cache.all=e,e}getDecimalForValue(e){return(ea(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return ea(this._table,s*this._tableRange+this._minPos,!0)}}q($p,"id","timeseries"),q($p,"defaults",tl.defaults);const Dy="label";function Hp(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function x2(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Ly(t,e){t.labels=e}function Fy(t,e,n=Dy){const s=[];t.datasets=e.map(r=>{const i=t.datasets.find(o=>o[n]===r[n]);return!i||!r.data||s.includes(i)?{...r}:(s.push(i),Object.assign(i,r),i)})}function v2(t,e=Dy){const n={labels:[],datasets:[]};return Ly(n,t.labels),Fy(n,t.datasets,e),n}function b2(t,e){const{height:n=150,width:s=300,redraw:r=!1,datasetIdKey:i,type:o,data:a,options:l,plugins:u=[],fallbackContent:d,updateMode:h,...f}=t,p=S.useRef(null),x=S.useRef(null),m=()=>{p.current&&(x.current=new bo(p.current,{type:o,data:v2(a,i),options:l&&{...l},plugins:u}),Hp(e,x.current))},b=()=>{Hp(e,null),x.current&&(x.current.destroy(),x.current=null)};return S.useEffect(()=>{!r&&x.current&&l&&x2(x.current,l)},[r,l]),S.useEffect(()=>{!r&&x.current&&Ly(x.current.config.data,a.labels)},[r,a.labels]),S.useEffect(()=>{!r&&x.current&&a.datasets&&Fy(x.current.config.data,a.datasets,i)},[r,a.datasets]),S.useEffect(()=>{x.current&&(r?(b(),setTimeout(m)):x.current.update(h))},[r,l,a.labels,a.datasets,h]),S.useEffect(()=>{x.current&&(b(),setTimeout(m))},[o]),S.useEffect(()=>(m(),()=>b()),[]),c.jsx("canvas",{ref:p,role:"img",height:n,width:s,...f,children:d})}const w2=S.forwardRef(b2);function k2(t,e){return bo.register(e),S.forwardRef((n,s)=>c.jsx(w2,{...n,ref:s,type:t}))}const yr=k2("bar",ma);function _2(t,e="12px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s?(s.font=e,s.measureText(t).width):0}function Ce({label:t,percentage:e,color:n,title:s}){const r=S.useRef(null),[i,o]=S.useState(!1),[a,l]=S.useState(!1);return S.useEffect(()=>{const u=()=>{if(r.current){const h=r.current.offsetWidth,f=_2(t,'bold 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif');o(h>=f+8)}};u(),window.addEventListener("resize",u);const d=new ResizeObserver(u);return r.current&&d.observe(r.current),()=>{window.removeEventListener("resize",u),d.disconnect()}},[t,e]),c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:r,className:`${n} flex items-center justify-center text-xs font-semibold transition-all`,style:{width:`${e}%`,minWidth:"2px"},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:i&&c.jsx("span",{className:"text-white",children:t})}),a&&r.current&&c.jsxs("div",{className:"fixed px-3 py-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg border border-gray-700 whitespace-nowrap z-50 pointer-events-none",style:{left:`${r.current.getBoundingClientRect().left+r.current.getBoundingClientRect().width/2}px`,top:`${r.current.getBoundingClientRect().top-10}px`,transform:"translate(-50%, -100%)"},children:[s,c.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px",children:c.jsx("div",{className:"border-4 border-transparent border-t-gray-900"})})]})]})}function je({title:t,value:e,subtitle:n,color:s="blue"}){const r={blue:"bg-blue-500/10 border-blue-500/20",green:"bg-green-500/10 border-green-500/20",purple:"bg-purple-500/10 border-purple-500/20",orange:"bg-orange-500/10 border-orange-500/20",pink:"bg-pink-500/10 border-pink-500/20",cyan:"bg-cyan-500/10 border-cyan-500/20"};return c.jsxs("div",{className:`p-6 rounded-lg border ${r[s]||r.blue}`,children:[c.jsx("div",{className:"text-sm text-gray-400 mb-1",children:t}),c.jsx("div",{className:"text-3xl font-bold mb-1",children:e}),n&&c.jsx("div",{className:"text-xs text-gray-500",children:n})]})}function D(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(2)}K`:t.toLocaleString()}function le(t){return`$${t.toFixed(2)}`}bo.register(Za,el,Ti,Ty,Oy,Py);function S2(){const[t,e]=S.useState("7"),{data:n,isLoading:s,error:r}=xl({queryKey:["usage-statistics",t],queryFn:async()=>{const l=await fetch(`/api/statistics/overall?days=${t}`);if(!l.ok)throw new Error("Failed to fetch usage statistics");return l.json()}}),i=()=>c.jsxs("div",{className:"p-6 rounded-lg border bg-gray-800/50 border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-1/2 mb-3"}),c.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-2"}),c.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3"})]}),o=()=>c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-6 bg-gray-700 rounded w-1/3 mb-6"}),c.jsx("div",{className:"h-64 bg-gray-700 rounded"})]}),a=()=>{if(r)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsxs("div",{className:"text-red-400",children:["Error loading statistics: ",r.message]})});if(!n)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsx("div",{className:"text-gray-400",children:"No data available"})});const{overview:l,daily:u,byProject:d,byModel:h,cache:f,cost:p,productivity:x,trends:m}=n,b=[...u.map(k=>k.tokenUsage.totalTokens)].sort((k,N)=>k-N),g=Math.floor(b.length*.95),y=Math.max(b[g]||1,1),v=u.map(k=>k.tokenUsage.totalTokens),w=v.length>0?Math.min(...v):0,j=v.length>0?Math.max(...v):0,P=v.length>0?v.reduce((k,N)=>k+N,0)/v.length:0;return c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-gray-400 mb-6",children:[ht(new Date(l.dateRange.start),"MMM d, yyyy")," - ",ht(new Date(l.dateRange.end),"MMM d, yyyy")]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(je,{title:"Total Tokens",value:D(l.tokenUsage.totalTokens),subtitle:`${l.sessionCount} sessions`,color:"blue"}),c.jsx(je,{title:"Total Cost",value:le(p.totalCost),subtitle:"Estimated",color:"green"}),c.jsx(je,{title:"Cache Hit Rate",value:`${f.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${le(f.estimatedSavings)}`,color:"purple"}),c.jsx(je,{title:"Messages",value:D(l.messageCount),subtitle:`${l.sessionCount} sessions`,color:"orange"})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Token Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Token Distribution"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[D(l.tokenUsage.totalTokens)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Ce,{label:"Input",percentage:l.tokenUsage.inputTokens/l.tokenUsage.totalTokens*100,color:"bg-blue-500",title:`Input: ${D(l.tokenUsage.inputTokens)}`}),c.jsx(Ce,{label:"Output",percentage:l.tokenUsage.outputTokens/l.tokenUsage.totalTokens*100,color:"bg-green-500",title:`Output: ${D(l.tokenUsage.outputTokens)}`}),c.jsx(Ce,{label:"Cache Create",percentage:l.tokenUsage.cacheCreationTokens/l.tokenUsage.totalTokens*100,color:"bg-purple-500",title:`Cache Create: ${D(l.tokenUsage.cacheCreationTokens)}`}),c.jsx(Ce,{label:"Cache Read",percentage:l.tokenUsage.cacheReadTokens/l.tokenUsage.totalTokens*100,color:"bg-cyan-500",title:`Cache Read: ${D(l.tokenUsage.cacheReadTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",D(l.tokenUsage.inputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",D(l.tokenUsage.outputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",D(l.tokenUsage.cacheCreationTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",D(l.tokenUsage.cacheReadTokens),")"]})]})]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cache Creation Breakdown"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[D(f.totalCacheCreation)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Ce,{label:"5-minute",percentage:f.totalCacheCreation>0?f.ephemeral5mTokens/f.totalCacheCreation*100:0,color:"bg-yellow-500",title:`5-minute: ${D(f.ephemeral5mTokens)}`}),c.jsx(Ce,{label:"1-hour",percentage:f.totalCacheCreation>0?f.ephemeral1hTokens/f.totalCacheCreation*100:0,color:"bg-orange-500",title:`1-hour: ${D(f.ephemeral1hTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded"}),c.jsxs("span",{children:["5-minute (",D(f.ephemeral5mTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-orange-500 rounded"}),c.jsxs("span",{children:["1-hour (",D(f.ephemeral1hTokens),")"]})]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cost Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Cost Distribution"}),c.jsx("span",{className:"text-sm text-white font-semibold",children:le(p.totalCost)})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Ce,{label:"Input",percentage:p.inputCost/p.totalCost*100,color:"bg-blue-500",title:`Input: ${le(p.inputCost)}`}),c.jsx(Ce,{label:"Output",percentage:p.outputCost/p.totalCost*100,color:"bg-green-500",title:`Output: ${le(p.outputCost)}`}),c.jsx(Ce,{label:"Cache Create",percentage:p.cacheCreationCost/p.totalCost*100,color:"bg-purple-500",title:`Cache Create: ${le(p.cacheCreationCost)}`}),c.jsx(Ce,{label:"Cache Read",percentage:p.cacheReadCost/p.totalCost*100,color:"bg-cyan-500",title:`Cache Read: ${le(p.cacheReadCost)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",le(p.inputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",le(p.outputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",le(p.cacheCreationCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",le(p.cacheReadCost),")"]})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Estimated savings from cache"}),c.jsx("div",{className:"text-2xl font-bold text-green-400",children:le(f.estimatedSavings)})]}),c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Cache Hit Rate"}),c.jsxs("div",{className:"text-2xl font-bold text-purple-400",children:[f.cacheHitRate.toFixed(1),"%"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Daily Token Usage"}),u.length===0?c.jsx("div",{className:"h-64 flex items-center justify-center text-gray-500",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{children:"No daily data available"}),c.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Total sessions: ",l.sessionCount]}),c.jsxs("p",{className:"text-sm text-gray-600",children:["Daily entries: ",u.length]})]})}):c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(yr,{data:{labels:u.map(k=>ht(new Date(k.date),"MMM d")),datasets:[{label:"Input",data:u.map(k=>k.tokenUsage.inputTokens),backgroundColor:"rgb(59, 130, 246)",borderColor:"rgb(59, 130, 246)",borderWidth:0},{label:"Cache Create",data:u.map(k=>k.tokenUsage.cacheCreationTokens),backgroundColor:"rgb(168, 85, 247)",borderColor:"rgb(168, 85, 247)",borderWidth:0},{label:"Cache Read",data:u.map(k=>k.tokenUsage.cacheReadTokens),backgroundColor:"rgb(6, 182, 212)",borderColor:"rgb(6, 182, 212)",borderWidth:0},{label:"Output",data:u.map(k=>k.tokenUsage.outputTokens),backgroundColor:"rgb(34, 197, 94)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:0,autoSkip:!0,maxTicksLimit:15}},y:{stacked:!0,max:y,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",callback:function(k){return typeof k=="number"?D(k):k}}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:k=>{if(k.length>0){const N=k[0].dataIndex;return ht(new Date(u[N].date),"MMM d, yyyy")}return""},label:k=>{const N=k.dataset.label||"",R=k.parsed.y!==null?D(k.parsed.y):"0";return`${N}: ${R}`},footer:k=>{if(k.length>0){const N=k[0].dataIndex,R=D(u[N].tokenUsage.totalTokens),C=u[N].sessionCount;return`Total: ${R}
69
- ${C} sessions`}return""}}}}},height:300})}),c.jsxs("div",{className:"flex gap-4 mt-4 text-xs justify-center",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsx("span",{children:"Input"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsx("span",{children:"Cache Create"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsx("span",{children:"Cache Read"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsx("span",{children:"Output"})]})]}),u.length>0&&c.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6 pt-6 border-t border-gray-700",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Min Daily"}),c.jsx("div",{className:"font-mono text-sm text-gray-300",children:D(w)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Avg Daily"}),c.jsx("div",{className:"font-mono text-sm text-blue-400",children:D(P)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Max Daily"}),c.jsx("div",{className:"font-mono text-sm text-green-400",children:D(j)})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Project"}),c.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:d.slice(0,10).map((k,N)=>{const R=d.reduce((M,L)=>M+L.tokenUsage.totalTokens,0),C=k.tokenUsage.totalTokens/R*100;return c.jsxs("div",{className:"bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[c.jsxs("div",{className:"flex justify-between items-baseline mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:k.name}),c.jsxs("div",{className:"text-xs text-gray-500",children:[k.sessionCount," sessions"]})]}),c.jsxs("div",{className:"text-right flex-shrink-0 ml-4",children:[c.jsx("div",{className:"font-mono text-sm",children:D(k.tokenUsage.totalTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[C.toFixed(1),"%"]})]})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs",children:[c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-gray-500",children:"Input"}),c.jsx("div",{className:"text-blue-400 font-mono",children:D(k.tokenUsage.inputTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Create"}),c.jsx("div",{className:"text-purple-400 font-mono",children:D(k.tokenUsage.cacheCreationTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Read"}),c.jsx("div",{className:"text-cyan-400 font-mono",children:D(k.tokenUsage.cacheReadTokens)})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-gray-500",children:"Output"}),c.jsx("div",{className:"text-green-400 font-mono",children:D(k.tokenUsage.outputTokens)})]})]})]},N)})})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Model"}),c.jsx("div",{className:"space-y-4",children:h.map((k,N)=>{const R=h.reduce((M,L)=>M+L.tokenUsage.totalTokens,0),C=k.tokenUsage.totalTokens/R*100;return c.jsxs("div",{className:"border-b border-gray-700 pb-4 last:border-b-0 last:pb-0",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:k.model}),c.jsxs("div",{className:"text-xs text-gray-500",children:[k.messageCount," messages"]})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"font-mono text-sm",children:D(k.tokenUsage.totalTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[C.toFixed(1),"%"]})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:"h-2 rounded-full bg-gradient-to-r from-blue-500 to-green-500",style:{width:`${C}%`}})}),c.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs mt-2",children:[c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-gray-500",children:"Input"}),c.jsx("div",{className:"text-blue-400 font-mono",children:D(k.tokenUsage.inputTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Create"}),c.jsx("div",{className:"text-purple-400 font-mono",children:D(k.tokenUsage.cacheCreationTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Read"}),c.jsx("div",{className:"text-cyan-400 font-mono",children:D(k.tokenUsage.cacheReadTokens)})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-gray-500",children:"Output"}),c.jsx("div",{className:"text-green-400 font-mono",children:D(k.tokenUsage.outputTokens)})]})]})]},N)})})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Productivity Metrics"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[c.jsx(je,{title:"Total Tool Calls",value:D(x.totalToolCalls),subtitle:`Across ${l.sessionCount} sessions`,color:"blue"}),c.jsx(je,{title:"Agent Sessions",value:D(x.agentSessions),subtitle:`${x.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),c.jsx(je,{title:"Avg Tools per Session",value:(x.totalToolCalls/x.totalSessions).toFixed(1),subtitle:"Tool calls per session",color:"cyan"})]}),c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Tool Usage & Success Rates"}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 auto-rows-fr",children:x.toolUsage.map((k,N)=>c.jsxs("div",{className:"@container bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:k.toolName}),c.jsxs("div",{className:"text-xs text-gray-500",children:[c.jsxs("span",{className:"hidden @[300px]:inline",children:[k.successfulUses," successful / ",k.totalUses," total calls"]}),c.jsxs("span",{className:"@[300px]:hidden",children:[k.successfulUses," / ",k.totalUses," calls"]})]})]}),c.jsxs("div",{className:"text-right ml-2",children:[c.jsxs("div",{className:`font-mono text-sm ${k.successRate>=90?"text-green-400":k.successRate>=70?"text-yellow-400":"text-red-400"}`,children:[k.successRate.toFixed(1),"%"]}),c.jsx("div",{className:"text-xs text-gray-500",children:"success"})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full ${k.successRate>=90?"bg-green-500":k.successRate>=70?"bg-yellow-500":"bg-red-500"}`,style:{width:`${Math.min(k.successRate,100)}%`}})})]},N))})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cache Efficiency Analysis"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsx(je,{title:"Total Cache Created",value:D(f.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),c.jsx(je,{title:"Total Cache Read",value:D(f.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),c.jsx(je,{title:"Cache Hit Rate",value:`${f.cacheHitRate.toFixed(2)}%`,subtitle:`${le(f.estimatedSavings)} saved`,color:"green"})]}),c.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"5-minute Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:D(f.ephemeral5mTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[f.totalCacheCreation>0?(f.ephemeral5mTokens/f.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]}),c.jsxs("div",{className:"p-4 bg-orange-500/10 border border-orange-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"1-hour Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:D(f.ephemeral1hTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[f.totalCacheCreation>0?(f.ephemeral1hTokens/f.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Activity Trends"}),c.jsxs("div",{className:"mb-8",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Hour of Day"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(yr,{data:{labels:m.byHour.map(k=>`${k.hour.toString().padStart(2,"0")}:00`),datasets:[{label:"Messages",data:m.byHour.map(k=>k.messageCount),backgroundColor:"rgba(59, 130, 246, 0.8)",borderColor:"rgb(59, 130, 246)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:45,minRotation:45}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:k=>{const N=m.byHour[k.dataIndex];return[`Messages: ${N.messageCount}`,`Sessions: ${N.sessionCount}`,`Tokens: ${D(N.tokenUsage.totalTokens)}`]}}}}},height:250})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Day of Week"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(yr,{data:{labels:m.byWeekday.map(k=>k.weekdayName),datasets:[{label:"Messages",data:m.byWeekday.map(k=>k.messageCount),backgroundColor:"rgba(34, 197, 94, 0.8)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:k=>{const N=m.byWeekday[k.dataIndex];return[`Messages: ${N.messageCount}`,`Sessions: ${N.sessionCount}`,`Tokens: ${D(N.tokenUsage.totalTokens)}`]}}}}},height:250})})]})]})]})};return c.jsx("div",{className:"h-screen overflow-y-auto bg-gray-900 text-white p-8",children:c.jsxs("div",{className:"max-w-7xl mx-auto",children:[c.jsx("div",{className:"mb-2",children:c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-4xl font-bold",children:"Dashboard"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:()=>e("7"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t==="7"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 7 Days"}),c.jsx("button",{onClick:()=>e("30"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t==="30"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 30 Days"}),c.jsx("button",{onClick:()=>e("all"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t==="all"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"All Time"})]})]})}),s?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-64 mb-8 animate-pulse"}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(i,{}),c.jsx(i,{}),c.jsx(i,{}),c.jsx(i,{})]}),c.jsx(o,{}),c.jsx("div",{className:"mt-8",children:c.jsx(o,{})}),c.jsx("div",{className:"mt-8",children:c.jsx(o,{})})]}):a()]})})}bo.register(Za,el,Ti,Ty,Oy,Py);function C2({projectInfo:t}){var h;const{projectId:e}=L0(),n=yo(),[s,r]=S.useState("7"),{data:i,isLoading:o,error:a}=xl({queryKey:["project-statistics",e,s],queryFn:async()=>{const f=await fetch(`/api/statistics/projects/${e}?days=${s}`);if(!f.ok)throw f.status===404?new Error("Project not found"):new Error("Failed to fetch project statistics");return f.json()},enabled:!!e}),l=()=>c.jsxs("div",{className:"p-6 rounded-lg border bg-gray-800/50 border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-1/2 mb-3"}),c.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-2"}),c.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3"})]}),u=()=>c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-6 bg-gray-700 rounded w-1/3 mb-6"}),c.jsx("div",{className:"h-64 bg-gray-700 rounded"})]}),d=()=>{if(a)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsxs("div",{className:"text-center",children:[c.jsxs("div",{className:"text-red-400 mb-4",children:["Error loading statistics: ",a.message]}),c.jsx("button",{onClick:()=>n("/dashboard"),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Back to Dashboard"})]})});if(!i)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsx("div",{className:"text-gray-400",children:"No data available"})});const{overview:f,daily:p,byModel:x,cache:m,cost:b,productivity:g,trends:y}=i;i.byProject[0];const v=[...p.map(C=>C.tokenUsage.totalTokens)].sort((C,M)=>C-M),w=Math.floor(v.length*.95),j=Math.max(v[w]||1,1),P=p.map(C=>C.tokenUsage.totalTokens),k=P.length>0?Math.min(...P):0,N=P.length>0?Math.max(...P):0,R=P.length>0?P.reduce((C,M)=>C+M,0)/P.length:0;return c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-gray-400 mb-6",children:[ht(new Date(f.dateRange.start),"MMM d, yyyy")," - ",ht(new Date(f.dateRange.end),"MMM d, yyyy")]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(je,{title:"Total Tokens",value:D(f.tokenUsage.totalTokens),subtitle:`${f.sessionCount} sessions`,color:"blue"}),c.jsx(je,{title:"Total Cost",value:le(b.totalCost),subtitle:"Estimated",color:"green"}),c.jsx(je,{title:"Cache Hit Rate",value:`${m.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${le(m.estimatedSavings)}`,color:"purple"}),c.jsx(je,{title:"Messages",value:D(f.messageCount),subtitle:`${f.sessionCount} sessions`,color:"orange"})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Token Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Token Distribution"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[D(f.tokenUsage.totalTokens)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Ce,{label:"Input",percentage:f.tokenUsage.inputTokens/f.tokenUsage.totalTokens*100,color:"bg-blue-500",title:`Input: ${D(f.tokenUsage.inputTokens)}`}),c.jsx(Ce,{label:"Output",percentage:f.tokenUsage.outputTokens/f.tokenUsage.totalTokens*100,color:"bg-green-500",title:`Output: ${D(f.tokenUsage.outputTokens)}`}),c.jsx(Ce,{label:"Cache Create",percentage:f.tokenUsage.cacheCreationTokens/f.tokenUsage.totalTokens*100,color:"bg-purple-500",title:`Cache Create: ${D(f.tokenUsage.cacheCreationTokens)}`}),c.jsx(Ce,{label:"Cache Read",percentage:f.tokenUsage.cacheReadTokens/f.tokenUsage.totalTokens*100,color:"bg-cyan-500",title:`Cache Read: ${D(f.tokenUsage.cacheReadTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",D(f.tokenUsage.inputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",D(f.tokenUsage.outputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",D(f.tokenUsage.cacheCreationTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",D(f.tokenUsage.cacheReadTokens),")"]})]})]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cache Creation Breakdown"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[D(m.totalCacheCreation)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Ce,{label:"5-minute",percentage:m.totalCacheCreation>0?m.ephemeral5mTokens/m.totalCacheCreation*100:0,color:"bg-yellow-500",title:`5-minute: ${D(m.ephemeral5mTokens)}`}),c.jsx(Ce,{label:"1-hour",percentage:m.totalCacheCreation>0?m.ephemeral1hTokens/m.totalCacheCreation*100:0,color:"bg-orange-500",title:`1-hour: ${D(m.ephemeral1hTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded"}),c.jsxs("span",{children:["5-minute (",D(m.ephemeral5mTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-orange-500 rounded"}),c.jsxs("span",{children:["1-hour (",D(m.ephemeral1hTokens),")"]})]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cost Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Cost Distribution"}),c.jsx("span",{className:"text-sm text-white font-semibold",children:le(b.totalCost)})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Ce,{label:"Input",percentage:b.inputCost/b.totalCost*100,color:"bg-blue-500",title:`Input: ${le(b.inputCost)}`}),c.jsx(Ce,{label:"Output",percentage:b.outputCost/b.totalCost*100,color:"bg-green-500",title:`Output: ${le(b.outputCost)}`}),c.jsx(Ce,{label:"Cache Create",percentage:b.cacheCreationCost/b.totalCost*100,color:"bg-purple-500",title:`Cache Create: ${le(b.cacheCreationCost)}`}),c.jsx(Ce,{label:"Cache Read",percentage:b.cacheReadCost/b.totalCost*100,color:"bg-cyan-500",title:`Cache Read: ${le(b.cacheReadCost)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",le(b.inputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",le(b.outputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",le(b.cacheCreationCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",le(b.cacheReadCost),")"]})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Estimated savings from cache"}),c.jsx("div",{className:"text-2xl font-bold text-green-400",children:le(m.estimatedSavings)})]}),c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Cache Hit Rate"}),c.jsxs("div",{className:"text-2xl font-bold text-purple-400",children:[m.cacheHitRate.toFixed(1),"%"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Daily Token Usage"}),p.length===0?c.jsx("div",{className:"h-64 flex items-center justify-center text-gray-500",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{children:"No daily data available"}),c.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Total sessions: ",f.sessionCount]}),c.jsxs("p",{className:"text-sm text-gray-600",children:["Daily entries: ",p.length]})]})}):c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(yr,{data:{labels:p.map(C=>ht(new Date(C.date),"MMM d")),datasets:[{label:"Input",data:p.map(C=>C.tokenUsage.inputTokens),backgroundColor:"rgb(59, 130, 246)",borderColor:"rgb(59, 130, 246)",borderWidth:0},{label:"Cache Create",data:p.map(C=>C.tokenUsage.cacheCreationTokens),backgroundColor:"rgb(168, 85, 247)",borderColor:"rgb(168, 85, 247)",borderWidth:0},{label:"Cache Read",data:p.map(C=>C.tokenUsage.cacheReadTokens),backgroundColor:"rgb(6, 182, 212)",borderColor:"rgb(6, 182, 212)",borderWidth:0},{label:"Output",data:p.map(C=>C.tokenUsage.outputTokens),backgroundColor:"rgb(34, 197, 94)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:0,autoSkip:!0,maxTicksLimit:15}},y:{stacked:!0,max:j,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",callback:function(C){return typeof C=="number"?D(C):C}}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:C=>{if(C.length>0){const M=C[0].dataIndex;return ht(new Date(p[M].date),"MMM d, yyyy")}return""},label:C=>{const M=C.dataset.label||"",L=C.parsed.y!==null?D(C.parsed.y):"0";return`${M}: ${L}`},footer:C=>{if(C.length>0){const M=C[0].dataIndex,L=D(p[M].tokenUsage.totalTokens),V=p[M].sessionCount;return`Total: ${L}
70
- ${V} sessions`}return""}}}}},height:300})}),c.jsxs("div",{className:"flex gap-4 mt-4 text-xs justify-center",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsx("span",{children:"Input"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsx("span",{children:"Cache Create"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsx("span",{children:"Cache Read"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsx("span",{children:"Output"})]})]}),p.length>0&&c.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6 pt-6 border-t border-gray-700",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Min Daily"}),c.jsx("div",{className:"font-mono text-sm text-gray-300",children:D(k)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Avg Daily"}),c.jsx("div",{className:"font-mono text-sm text-blue-400",children:D(R)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Max Daily"}),c.jsx("div",{className:"font-mono text-sm text-green-400",children:D(N)})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Model"}),c.jsx("div",{className:"space-y-4",children:x.map((C,M)=>{const L=x.reduce((ke,te)=>ke+te.tokenUsage.totalTokens,0),V=C.tokenUsage.totalTokens/L*100;return c.jsxs("div",{className:"border-b border-gray-700 pb-4 last:border-b-0 last:pb-0",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:C.model}),c.jsxs("div",{className:"text-xs text-gray-500",children:[C.messageCount," messages"]})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"font-mono text-sm",children:D(C.tokenUsage.totalTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[V.toFixed(1),"%"]})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:"h-2 rounded-full bg-gradient-to-r from-blue-500 to-green-500",style:{width:`${V}%`}})}),c.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs mt-2",children:[c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-gray-500",children:"Input"}),c.jsx("div",{className:"text-blue-400 font-mono",children:D(C.tokenUsage.inputTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Create"}),c.jsx("div",{className:"text-purple-400 font-mono",children:D(C.tokenUsage.cacheCreationTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Read"}),c.jsx("div",{className:"text-cyan-400 font-mono",children:D(C.tokenUsage.cacheReadTokens)})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-gray-500",children:"Output"}),c.jsx("div",{className:"text-green-400 font-mono",children:D(C.tokenUsage.outputTokens)})]})]})]},M)})})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Productivity Metrics"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[c.jsx(je,{title:"Total Tool Calls",value:D(g.totalToolCalls),subtitle:`Across ${f.sessionCount} sessions`,color:"blue"}),c.jsx(je,{title:"Agent Sessions",value:D(g.agentSessions),subtitle:`${g.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),c.jsx(je,{title:"Avg Tools per Session",value:(g.totalToolCalls/g.totalSessions).toFixed(1),subtitle:"Tool calls per session",color:"cyan"})]}),c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Tool Usage & Success Rates"}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 auto-rows-fr",children:g.toolUsage.map((C,M)=>c.jsxs("div",{className:"@container bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:C.toolName}),c.jsxs("div",{className:"text-xs text-gray-500",children:[c.jsxs("span",{className:"hidden @[300px]:inline",children:[C.successfulUses," successful / ",C.totalUses," total calls"]}),c.jsxs("span",{className:"@[300px]:hidden",children:[C.successfulUses," / ",C.totalUses," calls"]})]})]}),c.jsxs("div",{className:"text-right ml-2",children:[c.jsxs("div",{className:`font-mono text-sm ${C.successRate>=90?"text-green-400":C.successRate>=70?"text-yellow-400":"text-red-400"}`,children:[C.successRate.toFixed(1),"%"]}),c.jsx("div",{className:"text-xs text-gray-500",children:"success"})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full ${C.successRate>=90?"bg-green-500":C.successRate>=70?"bg-yellow-500":"bg-red-500"}`,style:{width:`${Math.min(C.successRate,100)}%`}})})]},M))})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cache Efficiency Analysis"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsx(je,{title:"Total Cache Created",value:D(m.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),c.jsx(je,{title:"Total Cache Read",value:D(m.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),c.jsx(je,{title:"Cache Hit Rate",value:`${m.cacheHitRate.toFixed(2)}%`,subtitle:`${le(m.estimatedSavings)} saved`,color:"green"})]}),c.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"5-minute Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:D(m.ephemeral5mTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[m.totalCacheCreation>0?(m.ephemeral5mTokens/m.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]}),c.jsxs("div",{className:"p-4 bg-orange-500/10 border border-orange-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"1-hour Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:D(m.ephemeral1hTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[m.totalCacheCreation>0?(m.ephemeral1hTokens/m.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Activity Trends"}),c.jsxs("div",{className:"mb-8",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Hour of Day"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(yr,{data:{labels:y.byHour.map(C=>`${C.hour.toString().padStart(2,"0")}:00`),datasets:[{label:"Messages",data:y.byHour.map(C=>C.messageCount),backgroundColor:"rgba(59, 130, 246, 0.8)",borderColor:"rgb(59, 130, 246)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:45,minRotation:45}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:C=>{const M=y.byHour[C.dataIndex];return[`Messages: ${M.messageCount}`,`Sessions: ${M.sessionCount}`,`Tokens: ${D(M.tokenUsage.totalTokens)}`]}}}}},height:250})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Day of Week"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(yr,{data:{labels:y.byWeekday.map(C=>C.weekdayName),datasets:[{label:"Messages",data:y.byWeekday.map(C=>C.messageCount),backgroundColor:"rgba(34, 197, 94, 0.8)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:C=>{const M=y.byWeekday[C.dataIndex];return[`Messages: ${M.messageCount}`,`Sessions: ${M.sessionCount}`,`Tokens: ${D(M.tokenUsage.totalTokens)}`]}}}}},height:250})})]})]})]})};return c.jsx("div",{className:"h-screen overflow-y-auto bg-gray-900 text-white p-8",children:c.jsxs("div",{className:"max-w-7xl mx-auto",children:[c.jsx("div",{className:"mb-2",children:c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o&&!t?c.jsx("div",{className:"h-10 bg-gray-700 rounded w-64 animate-pulse"}):c.jsx("h1",{className:"text-4xl font-bold",children:((h=i==null?void 0:i.byProject[0])==null?void 0:h.name)||(t==null?void 0:t.name)||e}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:()=>r("7"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s==="7"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 7 Days"}),c.jsx("button",{onClick:()=>r("30"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s==="30"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 30 Days"}),c.jsx("button",{onClick:()=>r("all"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s==="all"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"All Time"})]})]})}),o?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-64 mb-8 animate-pulse"}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(l,{}),c.jsx(l,{}),c.jsx(l,{}),c.jsx(l,{})]}),c.jsx(u,{}),c.jsx("div",{className:"mt-8",children:c.jsx(u,{})}),c.jsx("div",{className:"mt-8",children:c.jsx(u,{})})]}):d()]})})}const Iy=new Ib,Up="claude-session-viewer-sidebar-width",j2=320,N2=200,E2=600;function pu(){const t=yo(),e=Sn(),n=L0(),s=n.sessionId||null,r=n.projectId||null,i=e.pathname==="/dashboard",o=e.pathname.startsWith("/projects/")&&!e.pathname.includes("/sessions"),[a,l]=S.useState(()=>{const B=localStorage.getItem(Up);return B?parseInt(B,10):j2}),[u,d]=S.useState(!1),[h,f]=S.useState(0),[p,x]=S.useState(!1),m=S.useRef(null),b=S.useRef(null),g=S.useRef(0),{data:y,isLoading:v,error:w,refetch:j}=xl({queryKey:["sessions"],queryFn:async()=>{const B=await fetch("/api/sessions");if(!B.ok)throw new Error("Failed to fetch sessions");return B.json()}}),P=B=>{t(`/sessions/${B}`)},k=s?y==null?void 0:y.projects.flatMap(B=>B.sessions).flatMap(B=>[B,...B.agentSessions||[]]).find(B=>B.id===s):null,N=r?y==null?void 0:y.projects.find(B=>B.id===r):null;S.useEffect(()=>{const B=b.current;if(!B)return;const ae=()=>{const E=B.scrollTop,A=E<g.current;f(E),x(A),g.current=E};return B.addEventListener("scroll",ae),()=>B.removeEventListener("scroll",ae)},[]),S.useEffect(()=>{const B=E=>{if(!u)return;const A=E.clientX;A>=N2&&A<=E2&&(l(A),localStorage.setItem(Up,A.toString()))},ae=()=>{d(!1),document.body.style.cursor="",document.body.style.userSelect=""};return u&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",B),document.addEventListener("mouseup",ae)),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",ae)}},[u]),S.useEffect(()=>{const ae=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;let E=null,A=!1,z=null,X=0,O=!0;const Q=()=>{E=new WebSocket(ae),A=!1,E.onopen=()=>{if(A){E==null||E.close();return}X=0},E.onmessage=H=>{const Z=JSON.parse(H.data);(Z.type==="file-added"||Z.type==="file-changed"||Z.type==="file-deleted")&&(j(),s&&Iy.invalidateQueries({queryKey:["session",s]}))},E.onerror=H=>{console.error("WebSocket error:",H)},E.onclose=()=>{if(!O)return;const H=Math.min(1e3*2**X,1e4);X+=1,z=setTimeout(Q,H)}};return Q(),()=>{O=!1,z&&clearTimeout(z),E&&E.readyState===WebSocket.CONNECTING?A=!0:E==null||E.close()}},[j,s]);const C=Math.max(0,1-(p?0:h)/80),M=12+C*12,L=1.125+C*.375,V=C,ke=8+C*6,te=8+C*20;return c.jsxs("div",{className:"flex h-screen bg-gray-900 text-white",children:[c.jsxs("div",{className:"relative flex flex-col",style:{width:`${a}px`},children:[c.jsxs("div",{ref:m,className:"border-r border-gray-700 h-full flex flex-col",children:[c.jsxs("div",{className:"border-b border-gray-700 flex-shrink-0 transition-all duration-200 relative",style:{padding:`${M}px`,paddingRight:`${ke+44}px`},children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold transition-all duration-200",style:{fontSize:`${L}rem`},children:"Claude Sessions"}),c.jsx("p",{className:"text-sm text-gray-400 mt-1 transition-opacity duration-200",style:{opacity:V,height:V>0?"auto":0,overflow:"hidden"},children:v?"Loading...":`${(y==null?void 0:y.projects.length)||0} project${(y==null?void 0:y.projects.length)!==1?"s":""}`})]}),c.jsx("button",{onClick:()=>!i&&t("/dashboard"),disabled:i,className:`absolute flex items-center justify-center p-2 rounded-lg transition-all duration-200 ${i?"bg-gray-700 text-gray-500 cursor-not-allowed opacity-50":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-white"}`,style:{top:`${te}px`,right:`${ke}px`},title:i?"Already on Dashboard":"Dashboard",children:c.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})})]}),c.jsx("div",{ref:b,className:"flex-1 overflow-y-auto",children:w?c.jsxs("div",{className:"p-4 text-red-400 text-sm",children:["Error loading sessions: ",w.message]}):c.jsx(Dk,{projects:(y==null?void 0:y.projects)||[],selectedId:s,onSelect:P})})]}),c.jsx("div",{className:"absolute top-0 right-0 w-4 h-full cursor-col-resize group z-10",onMouseDown:B=>{B.preventDefault(),d(!0)},style:{touchAction:"none"},children:c.jsx("div",{className:`w-1 h-full ml-auto transition-colors ${u?"bg-blue-500":"bg-transparent group-hover:bg-blue-500"}`})})]}),c.jsx("div",{className:"flex-1 min-w-0",children:i?c.jsx(S2,{}):o?c.jsx(C2,{projectInfo:N}):s?c.jsx(Ak,{sessionId:s,sessionInfo:k}):c.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:c.jsxs("div",{className:"text-center",children:[c.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),c.jsx("h3",{className:"mt-2 text-sm font-medium",children:"No session selected"}),c.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Select a session from the sidebar to view details"})]})})})]})}function P2(){return c.jsx(zb,{client:Iy,children:c.jsx(x1,{children:c.jsxs(Kw,{children:[c.jsx(pi,{path:"/",element:c.jsx(Qw,{to:"/dashboard",replace:!0})}),c.jsx(pi,{path:"/dashboard",element:c.jsx(pu,{})}),c.jsx(pi,{path:"/projects/:projectId",element:c.jsx(pu,{})}),c.jsx(pi,{path:"/sessions/:sessionId",element:c.jsx(pu,{})})]})})})}gu.createRoot(document.getElementById("root")).render(c.jsx(nx.StrictMode,{children:c.jsx(P2,{})}));