claude-session-viewer 0.3.6 → 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.
@@ -0,0 +1,213 @@
1
+ var By=Object.defineProperty;var th=t=>{throw TypeError(t)};var Hy=(t,e,n)=>e in t?By(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var G=(t,e,n)=>Hy(t,typeof e!="symbol"?e+"":e,n),El=(t,e,n)=>e.has(t)||th("Cannot "+n);var S=(t,e,n)=>(El(t,e,"read from private field"),n?n.call(t):e.get(t)),B=(t,e,n)=>e.has(t)?th("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),I=(t,e,n,s)=>(El(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),X=(t,e,n)=>(El(t,e,"access private method"),n);var jo=(t,e,n,s)=>({set _(r){I(t,e,r,n)},get _(){return S(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 Wy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rm={exports:{}},il={},im={exports:{}},Y={};/**
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 po=Symbol.for("react.element"),Uy=Symbol.for("react.portal"),Vy=Symbol.for("react.fragment"),Qy=Symbol.for("react.strict_mode"),Yy=Symbol.for("react.profiler"),Ky=Symbol.for("react.provider"),Xy=Symbol.for("react.context"),qy=Symbol.for("react.forward_ref"),Gy=Symbol.for("react.suspense"),Jy=Symbol.for("react.memo"),Zy=Symbol.for("react.lazy"),nh=Symbol.iterator;function ex(t){return t===null||typeof t!="object"?null:(t=nh&&t[nh]||t["@@iterator"],typeof t=="function"?t:null)}var om={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},am=Object.assign,lm={};function Wr(t,e,n){this.props=t,this.context=e,this.refs=lm,this.updater=n||om}Wr.prototype.isReactComponent={};Wr.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")};Wr.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function um(){}um.prototype=Wr.prototype;function Lc(t,e,n){this.props=t,this.context=e,this.refs=lm,this.updater=n||om}var Fc=Lc.prototype=new um;Fc.constructor=Lc;am(Fc,Wr.prototype);Fc.isPureReactComponent=!0;var sh=Array.isArray,cm=Object.prototype.hasOwnProperty,Ic={current:null},dm={key:!0,ref:!0,__self:!0,__source:!0};function hm(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)cm.call(e,s)&&!dm.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:po,type:t,key:i,ref:o,props:r,_owner:Ic.current}}function tx(t,e){return{$$typeof:po,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Ac(t){return typeof t=="object"&&t!==null&&t.$$typeof===po}function nx(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var rh=/\/+/g;function Pl(t,e){return typeof t=="object"&&t!==null&&t.key!=null?nx(""+t.key):e.toString(36)}function ra(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 po:case Uy:o=!0}}if(o)return o=t,r=r(o),t=s===""?"."+Pl(o,0):s,sh(r)?(n="",t!=null&&(n=t.replace(rh,"$&/")+"/"),ra(r,e,n,"",function(u){return u})):r!=null&&(Ac(r)&&(r=tx(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(rh,"$&/")+"/")+t)),e.push(r)),1;if(o=0,s=s===""?".":s+":",sh(t))for(var a=0;a<t.length;a++){i=t[a];var l=s+Pl(i,a);o+=ra(i,e,n,l,r)}else if(l=ex(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=s+Pl(i,a++),o+=ra(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 No(t,e,n){if(t==null)return t;var s=[],r=0;return ra(t,s,"","",function(i){return e.call(n,i,r++)}),s}function sx(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 st={current:null},ia={transition:null},rx={ReactCurrentDispatcher:st,ReactCurrentBatchConfig:ia,ReactCurrentOwner:Ic};function fm(){throw Error("act(...) is not supported in production builds of React.")}Y.Children={map:No,forEach:function(t,e,n){No(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return No(t,function(){e++}),e},toArray:function(t){return No(t,function(e){return e})||[]},only:function(t){if(!Ac(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Y.Component=Wr;Y.Fragment=Vy;Y.Profiler=Yy;Y.PureComponent=Lc;Y.StrictMode=Qy;Y.Suspense=Gy;Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rx;Y.act=fm;Y.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=am({},t.props),r=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=Ic.current),e.key!==void 0&&(r=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)cm.call(e,l)&&!dm.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:po,type:t.type,key:r,ref:i,props:s,_owner:o}};Y.createContext=function(t){return t={$$typeof:Xy,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Ky,_context:t},t.Consumer=t};Y.createElement=hm;Y.createFactory=function(t){var e=hm.bind(null,t);return e.type=t,e};Y.createRef=function(){return{current:null}};Y.forwardRef=function(t){return{$$typeof:qy,render:t}};Y.isValidElement=Ac;Y.lazy=function(t){return{$$typeof:Zy,_payload:{_status:-1,_result:t},_init:sx}};Y.memo=function(t,e){return{$$typeof:Jy,type:t,compare:e===void 0?null:e}};Y.startTransition=function(t){var e=ia.transition;ia.transition={};try{t()}finally{ia.transition=e}};Y.unstable_act=fm;Y.useCallback=function(t,e){return st.current.useCallback(t,e)};Y.useContext=function(t){return st.current.useContext(t)};Y.useDebugValue=function(){};Y.useDeferredValue=function(t){return st.current.useDeferredValue(t)};Y.useEffect=function(t,e){return st.current.useEffect(t,e)};Y.useId=function(){return st.current.useId()};Y.useImperativeHandle=function(t,e,n){return st.current.useImperativeHandle(t,e,n)};Y.useInsertionEffect=function(t,e){return st.current.useInsertionEffect(t,e)};Y.useLayoutEffect=function(t,e){return st.current.useLayoutEffect(t,e)};Y.useMemo=function(t,e){return st.current.useMemo(t,e)};Y.useReducer=function(t,e,n){return st.current.useReducer(t,e,n)};Y.useRef=function(t){return st.current.useRef(t)};Y.useState=function(t){return st.current.useState(t)};Y.useSyncExternalStore=function(t,e,n){return st.current.useSyncExternalStore(t,e,n)};Y.useTransition=function(){return st.current.useTransition()};Y.version="18.3.1";im.exports=Y;var _=im.exports;const ix=Wy(_);/**
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 ox=_,ax=Symbol.for("react.element"),lx=Symbol.for("react.fragment"),ux=Object.prototype.hasOwnProperty,cx=ox.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dx={key:!0,ref:!0,__self:!0,__source:!0};function pm(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)ux.call(e,s)&&!dx.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:ax,type:t,key:i,ref:o,props:r,_owner:cx.current}}il.Fragment=lx;il.jsx=pm;il.jsxs=pm;rm.exports=il;var c=rm.exports,xu={},mm={exports:{}},bt={},gm={exports:{}},ym={};/**
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(L,O){var $=L.length;L.push(O);e:for(;0<$;){var P=$-1>>>1,Q=L[P];if(0<r(Q,O))L[P]=O,L[$]=Q,$=P;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var O=L[0],$=L.pop();if($!==O){L[0]=$;e:for(var P=0,Q=L.length,Fe=Q>>>1;P<Fe;){var we=2*(P+1)-1,F=L[we],H=we+1,K=L[H];if(0>r(F,$))H<Q&&0>r(K,F)?(L[P]=K,L[H]=$,P=H):(L[P]=F,L[we]=$,P=we);else if(H<Q&&0>r(K,$))L[P]=K,L[H]=$,P=H;else break e}}return O}function r(L,O){var $=L.sortIndex-O.sortIndex;return $!==0?$:L.id-O.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,y=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=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(L){for(var O=n(u);O!==null;){if(O.callback===null)s(u);else if(O.startTime<=L)s(u),O.sortIndex=O.expirationTime,e(l,O);else break;O=n(u)}}function w(L){if(m=!1,v(L),!y)if(n(l)!==null)y=!0,ie(j);else{var O=n(u);O!==null&&be(w,O.startTime-L)}}function j(L,O){y=!1,m&&(m=!1,g(N),N=-1),p=!0;var $=f;try{for(v(O),h=n(l);h!==null&&(!(h.expirationTime>O)||L&&!T());){var P=h.callback;if(typeof P=="function"){h.callback=null,f=h.priorityLevel;var Q=P(h.expirationTime<=O);O=t.unstable_now(),typeof Q=="function"?h.callback=Q:h===n(l)&&s(l),v(O)}else s(l);h=n(l)}if(h!==null)var Fe=!0;else{var we=n(u);we!==null&&be(w,we.startTime-O),Fe=!1}return Fe}finally{h=null,f=$,p=!1}}var E=!1,k=null,N=-1,R=5,C=-1;function T(){return!(t.unstable_now()-C<R)}function z(){if(k!==null){var L=t.unstable_now();C=L;var O=!0;try{O=k(!0,L)}finally{O?V():(E=!1,k=null)}}else E=!1}var V;if(typeof x=="function")V=function(){x(z)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,W=ve.port2;ve.port1.onmessage=z,V=function(){W.postMessage(null)}}else V=function(){b(z,0)};function ie(L){k=L,E||(E=!0,V())}function be(L,O){N=b(function(){L(t.unstable_now())},O)}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(L){L.callback=null},t.unstable_continueExecution=function(){y||p||(y=!0,ie(j))},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(L){switch(f){case 1:case 2:case 3:var O=3;break;default:O=f}var $=f;f=O;try{return L()}finally{f=$}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(L,O){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var $=f;f=L;try{return O()}finally{f=$}},t.unstable_scheduleCallback=function(L,O,$){var P=t.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?P+$:P):$=P,L){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=$+Q,L={id:d++,callback:O,priorityLevel:L,startTime:$,expirationTime:Q,sortIndex:-1},$>P?(L.sortIndex=$,e(u,L),n(l)===null&&L===n(u)&&(m?(g(N),N=-1):m=!0,be(w,$-P))):(L.sortIndex=Q,e(l,L),y||p||(y=!0,ie(j))),L},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(L){var O=f;return function(){var $=f;f=O;try{return L.apply(this,arguments)}finally{f=$}}}})(ym);gm.exports=ym;var hx=gm.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 fx=_,vt=hx;function M(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 xm=new Set,Fi={};function Xs(t,e){Dr(t,e),Dr(t+"Capture",e)}function Dr(t,e){for(Fi[t]=e,t=0;t<e.length;t++)xm.add(e[t])}var kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vu=Object.prototype.hasOwnProperty,px=/^[: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]*$/,ih={},oh={};function mx(t){return vu.call(oh,t)?!0:vu.call(ih,t)?!1:px.test(t)?oh[t]=!0:(ih[t]=!0,!1)}function gx(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 yx(t,e,n,s){if(e===null||typeof e>"u"||gx(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 rt(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 Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Be[t]=new rt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Be[e]=new rt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Be[t]=new rt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Be[t]=new rt(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){Be[t]=new rt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Be[t]=new rt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Be[t]=new rt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Be[t]=new rt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Be[t]=new rt(t,5,!1,t.toLowerCase(),null,!1,!1)});var zc=/[\-:]([a-z])/g;function $c(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(zc,$c);Be[e]=new rt(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(zc,$c);Be[e]=new rt(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(zc,$c);Be[e]=new rt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Be[t]=new rt(t,1,!1,t.toLowerCase(),null,!1,!1)});Be.xlinkHref=new rt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Be[t]=new rt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Bc(t,e,n,s){var r=Be.hasOwnProperty(e)?Be[e]:null;(r!==null?r.type!==0:s||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(yx(e,n,r,s)&&(n=null),s||r===null?mx(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 Nn=fx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Eo=Symbol.for("react.element"),er=Symbol.for("react.portal"),tr=Symbol.for("react.fragment"),Hc=Symbol.for("react.strict_mode"),bu=Symbol.for("react.profiler"),vm=Symbol.for("react.provider"),bm=Symbol.for("react.context"),Wc=Symbol.for("react.forward_ref"),wu=Symbol.for("react.suspense"),ku=Symbol.for("react.suspense_list"),Uc=Symbol.for("react.memo"),On=Symbol.for("react.lazy"),wm=Symbol.for("react.offscreen"),ah=Symbol.iterator;function Gr(t){return t===null||typeof t!="object"?null:(t=ah&&t[ah]||t["@@iterator"],typeof t=="function"?t:null)}var xe=Object.assign,Tl;function fi(t){if(Tl===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Tl=e&&e[1]||""}return`
34
+ `+Tl+t}var Ml=!1;function Rl(t,e){if(!t||Ml)return"";Ml=!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{Ml=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?fi(t):""}function xx(t){switch(t.tag){case 5:return fi(t.type);case 16:return fi("Lazy");case 13:return fi("Suspense");case 19:return fi("SuspenseList");case 0:case 2:case 15:return t=Rl(t.type,!1),t;case 11:return t=Rl(t.type.render,!1),t;case 1:return t=Rl(t.type,!0),t;default:return""}}function _u(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 tr:return"Fragment";case er:return"Portal";case bu:return"Profiler";case Hc:return"StrictMode";case wu:return"Suspense";case ku:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case bm:return(t.displayName||"Context")+".Consumer";case vm:return(t._context.displayName||"Context")+".Provider";case Wc:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Uc:return e=t.displayName||null,e!==null?e:_u(t.type)||"Memo";case On:e=t._payload,t=t._init;try{return _u(t(e))}catch{}}return null}function vx(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 _u(e);case 8:return e===Hc?"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 ls(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function km(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function bx(t){var e=km(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 Po(t){t._valueTracker||(t._valueTracker=bx(t))}function _m(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),s="";return t&&(s=km(t)?t.checked?"true":"false":t.value),t=s,t!==n?(e.setValue(t),!0):!1}function ka(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 Su(t,e){var n=e.checked;return xe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function lh(t,e){var n=e.defaultValue==null?"":e.defaultValue,s=e.checked!=null?e.checked:e.defaultChecked;n=ls(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 Sm(t,e){e=e.checked,e!=null&&Bc(t,"checked",e,!1)}function Cu(t,e){Sm(t,e);var n=ls(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")?ju(t,e.type,n):e.hasOwnProperty("defaultValue")&&ju(t,e.type,ls(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function uh(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 ju(t,e,n){(e!=="number"||ka(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var pi=Array.isArray;function fr(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=""+ls(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 Nu(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(M(91));return xe({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ch(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(M(92));if(pi(n)){if(1<n.length)throw Error(M(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:ls(n)}}function Cm(t,e){var n=ls(e.value),s=ls(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 dh(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function jm(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 Eu(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?jm(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var To,Nm=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(To=To||document.createElement("div"),To.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=To.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ii(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ki={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},wx=["Webkit","ms","Moz","O"];Object.keys(ki).forEach(function(t){wx.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ki[e]=ki[t]})});function Em(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ki.hasOwnProperty(t)&&ki[t]?(""+e).trim():e+"px"}function Pm(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Em(n,e[n],s);n==="float"&&(n="cssFloat"),s?t.setProperty(n,r):t[n]=r}}var kx=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 Pu(t,e){if(e){if(kx[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(M(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(M(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(M(61))}if(e.style!=null&&typeof e.style!="object")throw Error(M(62))}}function Tu(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 Mu=null;function Vc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ru=null,pr=null,mr=null;function hh(t){if(t=yo(t)){if(typeof Ru!="function")throw Error(M(280));var e=t.stateNode;e&&(e=cl(e),Ru(t.stateNode,t.type,e))}}function Tm(t){pr?mr?mr.push(t):mr=[t]:pr=t}function Mm(){if(pr){var t=pr,e=mr;if(mr=pr=null,hh(t),e)for(t=0;t<e.length;t++)hh(e[t])}}function Rm(t,e){return t(e)}function Om(){}var Ol=!1;function Dm(t,e,n){if(Ol)return t(e,n);Ol=!0;try{return Rm(t,e,n)}finally{Ol=!1,(pr!==null||mr!==null)&&(Om(),Mm())}}function Ai(t,e){var n=t.stateNode;if(n===null)return null;var s=cl(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(M(231,e,typeof n));return n}var Ou=!1;if(kn)try{var Jr={};Object.defineProperty(Jr,"passive",{get:function(){Ou=!0}}),window.addEventListener("test",Jr,Jr),window.removeEventListener("test",Jr,Jr)}catch{Ou=!1}function _x(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 _i=!1,_a=null,Sa=!1,Du=null,Sx={onError:function(t){_i=!0,_a=t}};function Cx(t,e,n,s,r,i,o,a,l){_i=!1,_a=null,_x.apply(Sx,arguments)}function jx(t,e,n,s,r,i,o,a,l){if(Cx.apply(this,arguments),_i){if(_i){var u=_a;_i=!1,_a=null}else throw Error(M(198));Sa||(Sa=!0,Du=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 Lm(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 fh(t){if(qs(t)!==t)throw Error(M(188))}function Nx(t){var e=t.alternate;if(!e){if(e=qs(t),e===null)throw Error(M(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 fh(r),t;if(i===s)return fh(r),e;i=i.sibling}throw Error(M(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(M(189))}}if(n.alternate!==s)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?t:e}function Fm(t){return t=Nx(t),t!==null?Im(t):null}function Im(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Im(t);if(e!==null)return e;t=t.sibling}return null}var Am=vt.unstable_scheduleCallback,ph=vt.unstable_cancelCallback,Ex=vt.unstable_shouldYield,Px=vt.unstable_requestPaint,Ce=vt.unstable_now,Tx=vt.unstable_getCurrentPriorityLevel,Qc=vt.unstable_ImmediatePriority,zm=vt.unstable_UserBlockingPriority,Ca=vt.unstable_NormalPriority,Mx=vt.unstable_LowPriority,$m=vt.unstable_IdlePriority,ol=null,an=null;function Rx(t){if(an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(ol,t,void 0,(t.current.flags&128)===128)}catch{}}var Vt=Math.clz32?Math.clz32:Lx,Ox=Math.log,Dx=Math.LN2;function Lx(t){return t>>>=0,t===0?32:31-(Ox(t)/Dx|0)|0}var Mo=64,Ro=4194304;function mi(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 ja(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=mi(a):(i&=o,i!==0&&(s=mi(i)))}else o=n&~r,o!==0?s=mi(o):i!==0&&(s=mi(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-Vt(e),r=1<<n,s|=t[n],e&=~r;return s}function Fx(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 Ix(t,e){for(var n=t.suspendedLanes,s=t.pingedLanes,r=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Vt(i),a=1<<o,l=r[o];l===-1?(!(a&n)||a&s)&&(r[o]=Fx(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function Lu(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Bm(){var t=Mo;return Mo<<=1,!(Mo&4194240)&&(Mo=64),t}function Dl(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function mo(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Vt(e),t[e]=n}function Ax(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-Vt(n),i=1<<r;e[r]=0,s[r]=-1,t[r]=-1,n&=~i}}function Yc(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var s=31-Vt(n),r=1<<s;r&e|t[s]&e&&(t[s]|=e),n&=~r}}var re=0;function Hm(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Wm,Kc,Um,Vm,Qm,Fu=!1,Oo=[],qn=null,Gn=null,Jn=null,zi=new Map,$i=new Map,Ln=[],zx="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 mh(t,e){switch(t){case"focusin":case"focusout":qn=null;break;case"dragenter":case"dragleave":Gn=null;break;case"mouseover":case"mouseout":Jn=null;break;case"pointerover":case"pointerout":zi.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":$i.delete(e.pointerId)}}function Zr(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=yo(e),e!==null&&Kc(e)),t):(t.eventSystemFlags|=s,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function $x(t,e,n,s,r){switch(e){case"focusin":return qn=Zr(qn,t,e,n,s,r),!0;case"dragenter":return Gn=Zr(Gn,t,e,n,s,r),!0;case"mouseover":return Jn=Zr(Jn,t,e,n,s,r),!0;case"pointerover":var i=r.pointerId;return zi.set(i,Zr(zi.get(i)||null,t,e,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,$i.set(i,Zr($i.get(i)||null,t,e,n,s,r)),!0}return!1}function Ym(t){var e=Ss(t.target);if(e!==null){var n=qs(e);if(n!==null){if(e=n.tag,e===13){if(e=Lm(n),e!==null){t.blockedOn=e,Qm(t.priority,function(){Um(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 oa(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Iu(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var s=new n.constructor(n.type,n);Mu=s,n.target.dispatchEvent(s),Mu=null}else return e=yo(n),e!==null&&Kc(e),t.blockedOn=n,!1;e.shift()}return!0}function gh(t,e,n){oa(t)&&n.delete(e)}function Bx(){Fu=!1,qn!==null&&oa(qn)&&(qn=null),Gn!==null&&oa(Gn)&&(Gn=null),Jn!==null&&oa(Jn)&&(Jn=null),zi.forEach(gh),$i.forEach(gh)}function ei(t,e){t.blockedOn===e&&(t.blockedOn=null,Fu||(Fu=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,Bx)))}function Bi(t){function e(r){return ei(r,t)}if(0<Oo.length){ei(Oo[0],t);for(var n=1;n<Oo.length;n++){var s=Oo[n];s.blockedOn===t&&(s.blockedOn=null)}}for(qn!==null&&ei(qn,t),Gn!==null&&ei(Gn,t),Jn!==null&&ei(Jn,t),zi.forEach(e),$i.forEach(e),n=0;n<Ln.length;n++)s=Ln[n],s.blockedOn===t&&(s.blockedOn=null);for(;0<Ln.length&&(n=Ln[0],n.blockedOn===null);)Ym(n),n.blockedOn===null&&Ln.shift()}var gr=Nn.ReactCurrentBatchConfig,Na=!0;function Hx(t,e,n,s){var r=re,i=gr.transition;gr.transition=null;try{re=1,Xc(t,e,n,s)}finally{re=r,gr.transition=i}}function Wx(t,e,n,s){var r=re,i=gr.transition;gr.transition=null;try{re=4,Xc(t,e,n,s)}finally{re=r,gr.transition=i}}function Xc(t,e,n,s){if(Na){var r=Iu(t,e,n,s);if(r===null)Ul(t,e,s,Ea,n),mh(t,s);else if($x(r,t,e,n,s))s.stopPropagation();else if(mh(t,s),e&4&&-1<zx.indexOf(t)){for(;r!==null;){var i=yo(r);if(i!==null&&Wm(i),i=Iu(t,e,n,s),i===null&&Ul(t,e,s,Ea,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Ul(t,e,s,null,n)}}var Ea=null;function Iu(t,e,n,s){if(Ea=null,t=Vc(s),t=Ss(t),t!==null)if(e=qs(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Lm(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 Ea=t,null}function Km(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(Tx()){case Qc:return 1;case zm:return 4;case Ca:case Mx:return 16;case $m:return 536870912;default:return 16}default:return 16}}var Vn=null,qc=null,aa=null;function Xm(){if(aa)return aa;var t,e=qc,n=e.length,s,r="value"in Vn?Vn.value:Vn.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 aa=r.slice(t,1<s?1-s:void 0)}function la(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 Do(){return!0}function yh(){return!1}function wt(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)?Do:yh,this.isPropagationStopped=yh,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=Do)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Do)},persist:function(){},isPersistent:Do}),e}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gc=wt(Ur),go=xe({},Ur,{view:0,detail:0}),Ux=wt(go),Ll,Fl,ti,al=xe({},go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jc,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!==ti&&(ti&&t.type==="mousemove"?(Ll=t.screenX-ti.screenX,Fl=t.screenY-ti.screenY):Fl=Ll=0,ti=t),Ll)},movementY:function(t){return"movementY"in t?t.movementY:Fl}}),xh=wt(al),Vx=xe({},al,{dataTransfer:0}),Qx=wt(Vx),Yx=xe({},go,{relatedTarget:0}),Il=wt(Yx),Kx=xe({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),Xx=wt(Kx),qx=xe({},Ur,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Gx=wt(qx),Jx=xe({},Ur,{data:0}),vh=wt(Jx),Zx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ev={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"},tv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nv(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=tv[t])?!!e[t]:!1}function Jc(){return nv}var sv=xe({},go,{key:function(t){if(t.key){var e=Zx[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=la(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?ev[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jc,charCode:function(t){return t.type==="keypress"?la(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?la(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),rv=wt(sv),iv=xe({},al,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bh=wt(iv),ov=xe({},go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jc}),av=wt(ov),lv=xe({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),uv=wt(lv),cv=xe({},al,{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}),dv=wt(cv),hv=[9,13,27,32],Zc=kn&&"CompositionEvent"in window,Si=null;kn&&"documentMode"in document&&(Si=document.documentMode);var fv=kn&&"TextEvent"in window&&!Si,qm=kn&&(!Zc||Si&&8<Si&&11>=Si),wh=" ",kh=!1;function Gm(t,e){switch(t){case"keyup":return hv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var nr=!1;function pv(t,e){switch(t){case"compositionend":return Jm(e);case"keypress":return e.which!==32?null:(kh=!0,wh);case"textInput":return t=e.data,t===wh&&kh?null:t;default:return null}}function mv(t,e){if(nr)return t==="compositionend"||!Zc&&Gm(t,e)?(t=Xm(),aa=qc=Vn=null,nr=!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 qm&&e.locale!=="ko"?null:e.data;default:return null}}var gv={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 _h(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!gv[t.type]:e==="textarea"}function Zm(t,e,n,s){Tm(s),e=Pa(e,"onChange"),0<e.length&&(n=new Gc("onChange","change",null,n,s),t.push({event:n,listeners:e}))}var Ci=null,Hi=null;function yv(t){cg(t,0)}function ll(t){var e=ir(t);if(_m(e))return t}function xv(t,e){if(t==="change")return e}var eg=!1;if(kn){var Al;if(kn){var zl="oninput"in document;if(!zl){var Sh=document.createElement("div");Sh.setAttribute("oninput","return;"),zl=typeof Sh.oninput=="function"}Al=zl}else Al=!1;eg=Al&&(!document.documentMode||9<document.documentMode)}function Ch(){Ci&&(Ci.detachEvent("onpropertychange",tg),Hi=Ci=null)}function tg(t){if(t.propertyName==="value"&&ll(Hi)){var e=[];Zm(e,Hi,t,Vc(t)),Dm(yv,e)}}function vv(t,e,n){t==="focusin"?(Ch(),Ci=e,Hi=n,Ci.attachEvent("onpropertychange",tg)):t==="focusout"&&Ch()}function bv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ll(Hi)}function wv(t,e){if(t==="click")return ll(e)}function kv(t,e){if(t==="input"||t==="change")return ll(e)}function _v(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Yt=typeof Object.is=="function"?Object.is:_v;function Wi(t,e){if(Yt(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(!vu.call(e,r)||!Yt(t[r],e[r]))return!1}return!0}function jh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Nh(t,e){var n=jh(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=jh(n)}}function ng(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?ng(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function sg(){for(var t=window,e=ka();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ka(t.document)}return e}function ed(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 Sv(t){var e=sg(),n=t.focusedElem,s=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&ng(n.ownerDocument.documentElement,n)){if(s!==null&&ed(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=Nh(n,i);var o=Nh(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 Cv=kn&&"documentMode"in document&&11>=document.documentMode,sr=null,Au=null,ji=null,zu=!1;function Eh(t,e,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zu||sr==null||sr!==ka(s)||(s=sr,"selectionStart"in s&&ed(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}),ji&&Wi(ji,s)||(ji=s,s=Pa(Au,"onSelect"),0<s.length&&(e=new Gc("onSelect","select",null,e,n),t.push({event:e,listeners:s}),e.target=sr)))}function Lo(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var rr={animationend:Lo("Animation","AnimationEnd"),animationiteration:Lo("Animation","AnimationIteration"),animationstart:Lo("Animation","AnimationStart"),transitionend:Lo("Transition","TransitionEnd")},$l={},rg={};kn&&(rg=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function ul(t){if($l[t])return $l[t];if(!rr[t])return t;var e=rr[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in rg)return $l[t]=e[n];return t}var ig=ul("animationend"),og=ul("animationiteration"),ag=ul("animationstart"),lg=ul("transitionend"),ug=new Map,Ph="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 hs(t,e){ug.set(t,e),Xs(e,[t])}for(var Bl=0;Bl<Ph.length;Bl++){var Hl=Ph[Bl],jv=Hl.toLowerCase(),Nv=Hl[0].toUpperCase()+Hl.slice(1);hs(jv,"on"+Nv)}hs(ig,"onAnimationEnd");hs(og,"onAnimationIteration");hs(ag,"onAnimationStart");hs("dblclick","onDoubleClick");hs("focusin","onFocus");hs("focusout","onBlur");hs(lg,"onTransitionEnd");Dr("onMouseEnter",["mouseout","mouseover"]);Dr("onMouseLeave",["mouseout","mouseover"]);Dr("onPointerEnter",["pointerout","pointerover"]);Dr("onPointerLeave",["pointerout","pointerover"]);Xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Xs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gi="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(" "),Ev=new Set("cancel close invalid load scroll toggle".split(" ").concat(gi));function Th(t,e,n){var s=t.type||"unknown-event";t.currentTarget=n,jx(s,e,void 0,t),t.currentTarget=null}function cg(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;Th(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;Th(r,a,u),i=l}}}if(Sa)throw t=Du,Sa=!1,Du=null,t}function de(t,e){var n=e[Uu];n===void 0&&(n=e[Uu]=new Set);var s=t+"__bubble";n.has(s)||(dg(e,t,2,!1),n.add(s))}function Wl(t,e,n){var s=0;e&&(s|=4),dg(n,t,s,e)}var Fo="_reactListening"+Math.random().toString(36).slice(2);function Ui(t){if(!t[Fo]){t[Fo]=!0,xm.forEach(function(n){n!=="selectionchange"&&(Ev.has(n)||Wl(n,!1,t),Wl(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Fo]||(e[Fo]=!0,Wl("selectionchange",!1,e))}}function dg(t,e,n,s){switch(Km(e)){case 1:var r=Hx;break;case 4:r=Wx;break;default:r=Xc}n=r.bind(null,e,n,t),r=void 0,!Ou||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 Ul(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=Ss(a),o===null)return;if(l=o.tag,l===5||l===6){s=i=o;continue e}a=a.parentNode}}s=s.return}Dm(function(){var u=i,d=Vc(n),h=[];e:{var f=ug.get(t);if(f!==void 0){var p=Gc,y=t;switch(t){case"keypress":if(la(n)===0)break e;case"keydown":case"keyup":p=rv;break;case"focusin":y="focus",p=Il;break;case"focusout":y="blur",p=Il;break;case"beforeblur":case"afterblur":p=Il;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=xh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Qx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=av;break;case ig:case og:case ag:p=Xx;break;case lg:p=uv;break;case"scroll":p=Ux;break;case"wheel":p=dv;break;case"copy":case"cut":case"paste":p=Gx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=bh}var m=(e&4)!==0,b=!m&&t==="scroll",g=m?f!==null?f+"Capture":null:f;m=[];for(var x=u,v;x!==null;){v=x;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,g!==null&&(w=Ai(x,g),w!=null&&m.push(Vi(x,w,v)))),b)break;x=x.return}0<m.length&&(f=new p(f,y,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!==Mu&&(y=n.relatedTarget||n.fromElement)&&(Ss(y)||y[_n]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=u,y=y?Ss(y):null,y!==null&&(b=qs(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(p=null,y=u),p!==y)){if(m=xh,w="onMouseLeave",g="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(m=bh,w="onPointerLeave",g="onPointerEnter",x="pointer"),b=p==null?f:ir(p),v=y==null?f:ir(y),f=new m(w,x+"leave",p,n,d),f.target=b,f.relatedTarget=v,w=null,Ss(d)===u&&(m=new m(g,x+"enter",y,n,d),m.target=v,m.relatedTarget=b,w=m),b=w,p&&y)t:{for(m=p,g=y,x=0,v=m;v;v=Gs(v))x++;for(v=0,w=g;w;w=Gs(w))v++;for(;0<x-v;)m=Gs(m),x--;for(;0<v-x;)g=Gs(g),v--;for(;x--;){if(m===g||g!==null&&m===g.alternate)break t;m=Gs(m),g=Gs(g)}m=null}else m=null;p!==null&&Mh(h,f,p,m,!1),y!==null&&b!==null&&Mh(h,b,y,m,!0)}}e:{if(f=u?ir(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=xv;else if(_h(f))if(eg)j=kv;else{j=bv;var E=vv}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=wv);if(j&&(j=j(t,u))){Zm(h,j,n,d);break e}E&&E(t,f,u),t==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&ju(f,"number",f.value)}switch(E=u?ir(u):window,t){case"focusin":(_h(E)||E.contentEditable==="true")&&(sr=E,Au=u,ji=null);break;case"focusout":ji=Au=sr=null;break;case"mousedown":zu=!0;break;case"contextmenu":case"mouseup":case"dragend":zu=!1,Eh(h,n,d);break;case"selectionchange":if(Cv)break;case"keydown":case"keyup":Eh(h,n,d)}var k;if(Zc)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 nr?Gm(t,n)&&(N="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(qm&&n.locale!=="ko"&&(nr||N!=="onCompositionStart"?N==="onCompositionEnd"&&nr&&(k=Xm()):(Vn=d,qc="value"in Vn?Vn.value:Vn.textContent,nr=!0)),E=Pa(u,N),0<E.length&&(N=new vh(N,t,null,n,d),h.push({event:N,listeners:E}),k?N.data=k:(k=Jm(n),k!==null&&(N.data=k)))),(k=fv?pv(t,n):mv(t,n))&&(u=Pa(u,"onBeforeInput"),0<u.length&&(d=new vh("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=k))}cg(h,e)})}function Vi(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Pa(t,e){for(var n=e+"Capture",s=[];t!==null;){var r=t,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Ai(t,n),i!=null&&s.unshift(Vi(t,i,r)),i=Ai(t,e),i!=null&&s.push(Vi(t,i,r))),t=t.return}return s}function Gs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Mh(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=Ai(n,i),l!=null&&o.unshift(Vi(n,l,a))):r||(l=Ai(n,i),l!=null&&o.push(Vi(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var Pv=/\r\n?/g,Tv=/\u0000|\uFFFD/g;function Rh(t){return(typeof t=="string"?t:""+t).replace(Pv,`
38
+ `).replace(Tv,"")}function Io(t,e,n){if(e=Rh(e),Rh(t)!==e&&n)throw Error(M(425))}function Ta(){}var $u=null,Bu=null;function Hu(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 Wu=typeof setTimeout=="function"?setTimeout:void 0,Mv=typeof clearTimeout=="function"?clearTimeout:void 0,Oh=typeof Promise=="function"?Promise:void 0,Rv=typeof queueMicrotask=="function"?queueMicrotask:typeof Oh<"u"?function(t){return Oh.resolve(null).then(t).catch(Ov)}:Wu;function Ov(t){setTimeout(function(){throw t})}function Vl(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),Bi(e);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Bi(e)}function Zn(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 Dh(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 Vr=Math.random().toString(36).slice(2),on="__reactFiber$"+Vr,Qi="__reactProps$"+Vr,_n="__reactContainer$"+Vr,Uu="__reactEvents$"+Vr,Dv="__reactListeners$"+Vr,Lv="__reactHandles$"+Vr;function Ss(t){var e=t[on];if(e)return e;for(var n=t.parentNode;n;){if(e=n[_n]||n[on]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Dh(t);t!==null;){if(n=t[on])return n;t=Dh(t)}return e}t=n,n=t.parentNode}return null}function yo(t){return t=t[on]||t[_n],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ir(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(M(33))}function cl(t){return t[Qi]||null}var Vu=[],or=-1;function fs(t){return{current:t}}function fe(t){0>or||(t.current=Vu[or],Vu[or]=null,or--)}function ue(t,e){or++,Vu[or]=t.current,t.current=e}var us={},Xe=fs(us),ft=fs(!1),Bs=us;function Lr(t,e){var n=t.type.contextTypes;if(!n)return us;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 pt(t){return t=t.childContextTypes,t!=null}function Ma(){fe(ft),fe(Xe)}function Lh(t,e,n){if(Xe.current!==us)throw Error(M(168));ue(Xe,e),ue(ft,n)}function hg(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(M(108,vx(t)||"Unknown",r));return xe({},n,s)}function Ra(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||us,Bs=Xe.current,ue(Xe,t),ue(ft,ft.current),!0}function Fh(t,e,n){var s=t.stateNode;if(!s)throw Error(M(169));n?(t=hg(t,e,Bs),s.__reactInternalMemoizedMergedChildContext=t,fe(ft),fe(Xe),ue(Xe,t)):fe(ft),ue(ft,n)}var pn=null,dl=!1,Ql=!1;function fg(t){pn===null?pn=[t]:pn.push(t)}function Fv(t){dl=!0,fg(t)}function ps(){if(!Ql&&pn!==null){Ql=!0;var t=0,e=re;try{var n=pn;for(re=1;t<n.length;t++){var s=n[t];do s=s(!0);while(s!==null)}pn=null,dl=!1}catch(r){throw pn!==null&&(pn=pn.slice(t+1)),Am(Qc,ps),r}finally{re=e,Ql=!1}}return null}var ar=[],lr=0,Oa=null,Da=0,Nt=[],Et=0,Hs=null,xn=1,vn="";function bs(t,e){ar[lr++]=Da,ar[lr++]=Oa,Oa=t,Da=e}function pg(t,e,n){Nt[Et++]=xn,Nt[Et++]=vn,Nt[Et++]=Hs,Hs=t;var s=xn;t=vn;var r=32-Vt(s)-1;s&=~(1<<r),n+=1;var i=32-Vt(e)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,xn=1<<32-Vt(e)+r|n<<r|s,vn=i+t}else xn=1<<i|n<<r|s,vn=t}function td(t){t.return!==null&&(bs(t,1),pg(t,1,0))}function nd(t){for(;t===Oa;)Oa=ar[--lr],ar[lr]=null,Da=ar[--lr],ar[lr]=null;for(;t===Hs;)Hs=Nt[--Et],Nt[Et]=null,vn=Nt[--Et],Nt[Et]=null,xn=Nt[--Et],Nt[Et]=null}var xt=null,yt=null,pe=!1,Ht=null;function mg(t,e){var n=Pt(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 Ih(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,xt=t,yt=Zn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,xt=t,yt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Hs!==null?{id:xn,overflow:vn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Pt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,xt=t,yt=null,!0):!1;default:return!1}}function Qu(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Yu(t){if(pe){var e=yt;if(e){var n=e;if(!Ih(t,e)){if(Qu(t))throw Error(M(418));e=Zn(n.nextSibling);var s=xt;e&&Ih(t,e)?mg(s,n):(t.flags=t.flags&-4097|2,pe=!1,xt=t)}}else{if(Qu(t))throw Error(M(418));t.flags=t.flags&-4097|2,pe=!1,xt=t}}}function Ah(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;xt=t}function Ao(t){if(t!==xt)return!1;if(!pe)return Ah(t),pe=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Hu(t.type,t.memoizedProps)),e&&(e=yt)){if(Qu(t))throw gg(),Error(M(418));for(;e;)mg(t,e),e=Zn(e.nextSibling)}if(Ah(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){yt=Zn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}yt=null}}else yt=xt?Zn(t.stateNode.nextSibling):null;return!0}function gg(){for(var t=yt;t;)t=Zn(t.nextSibling)}function Fr(){yt=xt=null,pe=!1}function sd(t){Ht===null?Ht=[t]:Ht.push(t)}var Iv=Nn.ReactCurrentBatchConfig;function ni(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(M(309));var s=n.stateNode}if(!s)throw Error(M(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(M(284));if(!n._owner)throw Error(M(290,t))}return t}function zo(t,e){throw t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function zh(t){var e=t._init;return e(t._payload)}function yg(t){function e(g,x){if(t){var v=g.deletions;v===null?(g.deletions=[x],g.flags|=16):v.push(x)}}function n(g,x){if(!t)return null;for(;x!==null;)e(g,x),x=x.sibling;return null}function s(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function r(g,x){return g=ss(g,x),g.index=0,g.sibling=null,g}function i(g,x,v){return g.index=v,t?(v=g.alternate,v!==null?(v=v.index,v<x?(g.flags|=2,x):v):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return t&&g.alternate===null&&(g.flags|=2),g}function a(g,x,v,w){return x===null||x.tag!==6?(x=Zl(v,g.mode,w),x.return=g,x):(x=r(x,v),x.return=g,x)}function l(g,x,v,w){var j=v.type;return j===tr?d(g,x,v.props.children,w,v.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===On&&zh(j)===x.type)?(w=r(x,v.props),w.ref=ni(g,x,v),w.return=g,w):(w=ma(v.type,v.key,v.props,null,g.mode,w),w.ref=ni(g,x,v),w.return=g,w)}function u(g,x,v,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==v.containerInfo||x.stateNode.implementation!==v.implementation?(x=eu(v,g.mode,w),x.return=g,x):(x=r(x,v.children||[]),x.return=g,x)}function d(g,x,v,w,j){return x===null||x.tag!==7?(x=zs(v,g.mode,w,j),x.return=g,x):(x=r(x,v),x.return=g,x)}function h(g,x,v){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Zl(""+x,g.mode,v),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Eo:return v=ma(x.type,x.key,x.props,null,g.mode,v),v.ref=ni(g,null,x),v.return=g,v;case er:return x=eu(x,g.mode,v),x.return=g,x;case On:var w=x._init;return h(g,w(x._payload),v)}if(pi(x)||Gr(x))return x=zs(x,g.mode,v,null),x.return=g,x;zo(g,x)}return null}function f(g,x,v,w){var j=x!==null?x.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return j!==null?null:a(g,x,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Eo:return v.key===j?l(g,x,v,w):null;case er:return v.key===j?u(g,x,v,w):null;case On:return j=v._init,f(g,x,j(v._payload),w)}if(pi(v)||Gr(v))return j!==null?null:d(g,x,v,w,null);zo(g,v)}return null}function p(g,x,v,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(v)||null,a(x,g,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Eo:return g=g.get(w.key===null?v:w.key)||null,l(x,g,w,j);case er:return g=g.get(w.key===null?v:w.key)||null,u(x,g,w,j);case On:var E=w._init;return p(g,x,v,E(w._payload),j)}if(pi(w)||Gr(w))return g=g.get(v)||null,d(x,g,w,j,null);zo(x,w)}return null}function y(g,x,v,w){for(var j=null,E=null,k=x,N=x=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),x=i(C,x,N),E===null?j=C:E.sibling=C,E=C,k=R}if(N===v.length)return n(g,k),pe&&bs(g,N),j;if(k===null){for(;N<v.length;N++)k=h(g,v[N],w),k!==null&&(x=i(k,x,N),E===null?j=k:E.sibling=k,E=k);return pe&&bs(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),x=i(R,x,N),E===null?j=R:E.sibling=R,E=R);return t&&k.forEach(function(T){return e(g,T)}),pe&&bs(g,N),j}function m(g,x,v,w){var j=Gr(v);if(typeof j!="function")throw Error(M(150));if(v=j.call(v),v==null)throw Error(M(151));for(var E=j=null,k=x,N=x=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 T=f(g,k,C.value,w);if(T===null){k===null&&(k=R);break}t&&k&&T.alternate===null&&e(g,k),x=i(T,x,N),E===null?j=T:E.sibling=T,E=T,k=R}if(C.done)return n(g,k),pe&&bs(g,N),j;if(k===null){for(;!C.done;N++,C=v.next())C=h(g,C.value,w),C!==null&&(x=i(C,x,N),E===null?j=C:E.sibling=C,E=C);return pe&&bs(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),x=i(C,x,N),E===null?j=C:E.sibling=C,E=C);return t&&k.forEach(function(z){return e(g,z)}),pe&&bs(g,N),j}function b(g,x,v,w){if(typeof v=="object"&&v!==null&&v.type===tr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Eo:e:{for(var j=v.key,E=x;E!==null;){if(E.key===j){if(j=v.type,j===tr){if(E.tag===7){n(g,E.sibling),x=r(E,v.props.children),x.return=g,g=x;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===On&&zh(j)===E.type){n(g,E.sibling),x=r(E,v.props),x.ref=ni(g,E,v),x.return=g,g=x;break e}n(g,E);break}else e(g,E);E=E.sibling}v.type===tr?(x=zs(v.props.children,g.mode,w,v.key),x.return=g,g=x):(w=ma(v.type,v.key,v.props,null,g.mode,w),w.ref=ni(g,x,v),w.return=g,g=w)}return o(g);case er:e:{for(E=v.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(g,x.sibling),x=r(x,v.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else e(g,x);x=x.sibling}x=eu(v,g.mode,w),x.return=g,g=x}return o(g);case On:return E=v._init,b(g,x,E(v._payload),w)}if(pi(v))return y(g,x,v,w);if(Gr(v))return m(g,x,v,w);zo(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(g,x.sibling),x=r(x,v),x.return=g,g=x):(n(g,x),x=Zl(v,g.mode,w),x.return=g,g=x),o(g)):n(g,x)}return b}var Ir=yg(!0),xg=yg(!1),La=fs(null),Fa=null,ur=null,rd=null;function id(){rd=ur=Fa=null}function od(t){var e=La.current;fe(La),t._currentValue=e}function Ku(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 yr(t,e){Fa=t,rd=ur=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ht=!0),t.firstContext=null)}function Rt(t){var e=t._currentValue;if(rd!==t)if(t={context:t,memoizedValue:e,next:null},ur===null){if(Fa===null)throw Error(M(308));ur=t,Fa.dependencies={lanes:0,firstContext:t}}else ur=ur.next=t;return e}var Cs=null;function ad(t){Cs===null?Cs=[t]:Cs.push(t)}function vg(t,e,n,s){var r=e.interleaved;return r===null?(n.next=n,ad(e)):(n.next=r.next,r.next=n),e.interleaved=n,Sn(t,s)}function Sn(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 Dn=!1;function ld(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bg(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 bn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function es(t,e,n){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,J&2){var r=s.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),s.pending=e,Sn(t,n)}return r=s.interleaved,r===null?(e.next=e,ad(s)):(e.next=r.next,r.next=e),s.interleaved=e,Sn(t,n)}function ua(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,Yc(t,n)}}function $h(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 Ia(t,e,n,s){var r=t.updateQueue;Dn=!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 y=t,m=a;switch(f=e,p=n,m.tag){case 1:if(y=m.payload,typeof y=="function"){h=y.call(p,h,f);break e}h=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=m.payload,f=typeof y=="function"?y.call(p,h,f):y,f==null)break e;h=xe({},h,f);break e;case 2:Dn=!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);Us|=o,t.lanes=o,t.memoizedState=h}}function Bh(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(M(191,r));r.call(s)}}}var xo={},ln=fs(xo),Yi=fs(xo),Ki=fs(xo);function js(t){if(t===xo)throw Error(M(174));return t}function ud(t,e){switch(ue(Ki,e),ue(Yi,t),ue(ln,xo),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Eu(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Eu(e,t)}fe(ln),ue(ln,e)}function Ar(){fe(ln),fe(Yi),fe(Ki)}function wg(t){js(Ki.current);var e=js(ln.current),n=Eu(e,t.type);e!==n&&(ue(Yi,t),ue(ln,n))}function cd(t){Yi.current===t&&(fe(ln),fe(Yi))}var ge=fs(0);function Aa(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 Yl=[];function dd(){for(var t=0;t<Yl.length;t++)Yl[t]._workInProgressVersionPrimary=null;Yl.length=0}var ca=Nn.ReactCurrentDispatcher,Kl=Nn.ReactCurrentBatchConfig,Ws=0,ye=null,Te=null,De=null,za=!1,Ni=!1,Xi=0,Av=0;function We(){throw Error(M(321))}function hd(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Yt(t[n],e[n]))return!1;return!0}function fd(t,e,n,s,r,i){if(Ws=i,ye=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ca.current=t===null||t.memoizedState===null?Hv:Wv,t=n(s,r),Ni){i=0;do{if(Ni=!1,Xi=0,25<=i)throw Error(M(301));i+=1,De=Te=null,e.updateQueue=null,ca.current=Uv,t=n(s,r)}while(Ni)}if(ca.current=$a,e=Te!==null&&Te.next!==null,Ws=0,De=Te=ye=null,za=!1,e)throw Error(M(300));return t}function pd(){var t=Xi!==0;return Xi=0,t}function en(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?ye.memoizedState=De=t:De=De.next=t,De}function Ot(){if(Te===null){var t=ye.alternate;t=t!==null?t.memoizedState:null}else t=Te.next;var e=De===null?ye.memoizedState:De.next;if(e!==null)De=e,Te=t;else{if(t===null)throw Error(M(310));Te=t,t={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},De===null?ye.memoizedState=De=t:De=De.next=t}return De}function qi(t,e){return typeof e=="function"?e(t):e}function Xl(t){var e=Ot(),n=e.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=t;var s=Te,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((Ws&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,Us|=d}u=u.next}while(u!==null&&u!==i);l===null?o=s:l.next=a,Yt(s,e.memoizedState)||(ht=!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,Us|=i,r=r.next;while(r!==t)}else r===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function ql(t){var e=Ot(),n=e.queue;if(n===null)throw Error(M(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);Yt(i,e.memoizedState)||(ht=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,s]}function kg(){}function _g(t,e){var n=ye,s=Ot(),r=e(),i=!Yt(s.memoizedState,r);if(i&&(s.memoizedState=r,ht=!0),s=s.queue,md(jg.bind(null,n,s,t),[t]),s.getSnapshot!==e||i||De!==null&&De.memoizedState.tag&1){if(n.flags|=2048,Gi(9,Cg.bind(null,n,s,r,e),void 0,null),Le===null)throw Error(M(349));Ws&30||Sg(n,e,r)}return r}function Sg(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 Cg(t,e,n,s){e.value=n,e.getSnapshot=s,Ng(e)&&Eg(t)}function jg(t,e,n){return n(function(){Ng(e)&&Eg(t)})}function Ng(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Yt(t,n)}catch{return!0}}function Eg(t){var e=Sn(t,1);e!==null&&Qt(e,t,1,-1)}function Hh(t){var e=en();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=Bv.bind(null,ye,t),[e.memoizedState,t]}function Gi(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 Pg(){return Ot().memoizedState}function da(t,e,n,s){var r=en();ye.flags|=t,r.memoizedState=Gi(1|e,n,void 0,s===void 0?null:s)}function hl(t,e,n,s){var r=Ot();s=s===void 0?null:s;var i=void 0;if(Te!==null){var o=Te.memoizedState;if(i=o.destroy,s!==null&&hd(s,o.deps)){r.memoizedState=Gi(e,n,i,s);return}}ye.flags|=t,r.memoizedState=Gi(1|e,n,i,s)}function Wh(t,e){return da(8390656,8,t,e)}function md(t,e){return hl(2048,8,t,e)}function Tg(t,e){return hl(4,2,t,e)}function Mg(t,e){return hl(4,4,t,e)}function Rg(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 Og(t,e,n){return n=n!=null?n.concat([t]):null,hl(4,4,Rg.bind(null,e,t),n)}function gd(){}function Dg(t,e){var n=Ot();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&hd(e,s[1])?s[0]:(n.memoizedState=[t,e],t)}function Lg(t,e){var n=Ot();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&hd(e,s[1])?s[0]:(t=t(),n.memoizedState=[t,e],t)}function Fg(t,e,n){return Ws&21?(Yt(n,e)||(n=Bm(),ye.lanes|=n,Us|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ht=!0),t.memoizedState=n)}function zv(t,e){var n=re;re=n!==0&&4>n?n:4,t(!0);var s=Kl.transition;Kl.transition={};try{t(!1),e()}finally{re=n,Kl.transition=s}}function Ig(){return Ot().memoizedState}function $v(t,e,n){var s=ns(t);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Ag(t))zg(e,n);else if(n=vg(t,e,n,s),n!==null){var r=nt();Qt(n,t,s,r),$g(n,e,s)}}function Bv(t,e,n){var s=ns(t),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ag(t))zg(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,Yt(a,o)){var l=e.interleaved;l===null?(r.next=r,ad(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}n=vg(t,e,r,s),n!==null&&(r=nt(),Qt(n,t,s,r),$g(n,e,s))}}function Ag(t){var e=t.alternate;return t===ye||e!==null&&e===ye}function zg(t,e){Ni=za=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function $g(t,e,n){if(n&4194240){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,Yc(t,n)}}var $a={readContext:Rt,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},Hv={readContext:Rt,useCallback:function(t,e){return en().memoizedState=[t,e===void 0?null:e],t},useContext:Rt,useEffect:Wh,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,da(4194308,4,Rg.bind(null,e,t),n)},useLayoutEffect:function(t,e){return da(4194308,4,t,e)},useInsertionEffect:function(t,e){return da(4,2,t,e)},useMemo:function(t,e){var n=en();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var s=en();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=$v.bind(null,ye,t),[s.memoizedState,t]},useRef:function(t){var e=en();return t={current:t},e.memoizedState=t},useState:Hh,useDebugValue:gd,useDeferredValue:function(t){return en().memoizedState=t},useTransition:function(){var t=Hh(!1),e=t[0];return t=zv.bind(null,t[1]),en().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var s=ye,r=en();if(pe){if(n===void 0)throw Error(M(407));n=n()}else{if(n=e(),Le===null)throw Error(M(349));Ws&30||Sg(s,e,n)}r.memoizedState=n;var i={value:n,getSnapshot:e};return r.queue=i,Wh(jg.bind(null,s,i,t),[t]),s.flags|=2048,Gi(9,Cg.bind(null,s,i,n,e),void 0,null),n},useId:function(){var t=en(),e=Le.identifierPrefix;if(pe){var n=vn,s=xn;n=(s&~(1<<32-Vt(s)-1)).toString(32)+n,e=":"+e+"R"+n,n=Xi++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=Av++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Wv={readContext:Rt,useCallback:Dg,useContext:Rt,useEffect:md,useImperativeHandle:Og,useInsertionEffect:Tg,useLayoutEffect:Mg,useMemo:Lg,useReducer:Xl,useRef:Pg,useState:function(){return Xl(qi)},useDebugValue:gd,useDeferredValue:function(t){var e=Ot();return Fg(e,Te.memoizedState,t)},useTransition:function(){var t=Xl(qi)[0],e=Ot().memoizedState;return[t,e]},useMutableSource:kg,useSyncExternalStore:_g,useId:Ig,unstable_isNewReconciler:!1},Uv={readContext:Rt,useCallback:Dg,useContext:Rt,useEffect:md,useImperativeHandle:Og,useInsertionEffect:Tg,useLayoutEffect:Mg,useMemo:Lg,useReducer:ql,useRef:Pg,useState:function(){return ql(qi)},useDebugValue:gd,useDeferredValue:function(t){var e=Ot();return Te===null?e.memoizedState=t:Fg(e,Te.memoizedState,t)},useTransition:function(){var t=ql(qi)[0],e=Ot().memoizedState;return[t,e]},useMutableSource:kg,useSyncExternalStore:_g,useId:Ig,unstable_isNewReconciler:!1};function At(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 Xu(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 fl={isMounted:function(t){return(t=t._reactInternals)?qs(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var s=nt(),r=ns(t),i=bn(s,r);i.payload=e,n!=null&&(i.callback=n),e=es(t,i,r),e!==null&&(Qt(e,t,r,s),ua(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var s=nt(),r=ns(t),i=bn(s,r);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=es(t,i,r),e!==null&&(Qt(e,t,r,s),ua(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=nt(),s=ns(t),r=bn(n,s);r.tag=2,e!=null&&(r.callback=e),e=es(t,r,s),e!==null&&(Qt(e,t,s,n),ua(e,t,s))}};function Uh(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?!Wi(n,s)||!Wi(r,i):!0}function Bg(t,e,n){var s=!1,r=us,i=e.contextType;return typeof i=="object"&&i!==null?i=Rt(i):(r=pt(e)?Bs:Xe.current,s=e.contextTypes,i=(s=s!=null)?Lr(t,r):us),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=fl,t.stateNode=e,e._reactInternals=t,s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=i),e}function Vh(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&&fl.enqueueReplaceState(e,e.state,null)}function qu(t,e,n,s){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},ld(t);var i=e.contextType;typeof i=="object"&&i!==null?r.context=Rt(i):(i=pt(e)?Bs:Xe.current,r.context=Lr(t,i)),r.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Xu(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&&fl.enqueueReplaceState(r,r.state,null),Ia(t,n,r,s),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308)}function zr(t,e){try{var n="",s=e;do n+=xx(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 Gl(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Gu(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Vv=typeof WeakMap=="function"?WeakMap:Map;function Hg(t,e,n){n=bn(-1,n),n.tag=3,n.payload={element:null};var s=e.value;return n.callback=function(){Ha||(Ha=!0,ac=s),Gu(t,e)},n}function Wg(t,e,n){n=bn(-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(){Gu(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Gu(t,e),typeof s!="function"&&(ts===null?ts=new Set([this]):ts.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Qh(t,e,n){var s=t.pingCache;if(s===null){s=t.pingCache=new Vv;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=ib.bind(null,t,e,n),e.then(t,t))}function Yh(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 Kh(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=bn(-1,1),e.tag=2,es(n,e,1))),n.lanes|=1),t)}var Qv=Nn.ReactCurrentOwner,ht=!1;function et(t,e,n,s){e.child=t===null?xg(e,null,n,s):Ir(e,t.child,n,s)}function Xh(t,e,n,s,r){n=n.render;var i=e.ref;return yr(e,r),s=fd(t,e,n,s,i,r),n=pd(),t!==null&&!ht?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Cn(t,e,r)):(pe&&n&&td(e),e.flags|=1,et(t,e,s,r),e.child)}function qh(t,e,n,s,r){if(t===null){var i=n.type;return typeof i=="function"&&!Sd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,Ug(t,e,i,s,r)):(t=ma(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:Wi,n(o,s)&&t.ref===e.ref)return Cn(t,e,r)}return e.flags|=1,t=ss(i,s),t.ref=e.ref,t.return=e,e.child=t}function Ug(t,e,n,s,r){if(t!==null){var i=t.memoizedProps;if(Wi(i,s)&&t.ref===e.ref)if(ht=!1,e.pendingProps=s=i,(t.lanes&r)!==0)t.flags&131072&&(ht=!0);else return e.lanes=t.lanes,Cn(t,e,r)}return Ju(t,e,n,s,r)}function Vg(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(dr,gt),gt|=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(dr,gt),gt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,ue(dr,gt),gt|=s}else i!==null?(s=i.baseLanes|n,e.memoizedState=null):s=n,ue(dr,gt),gt|=s;return et(t,e,r,n),e.child}function Qg(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ju(t,e,n,s,r){var i=pt(n)?Bs:Xe.current;return i=Lr(e,i),yr(e,r),n=fd(t,e,n,s,i,r),s=pd(),t!==null&&!ht?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,Cn(t,e,r)):(pe&&s&&td(e),e.flags|=1,et(t,e,n,r),e.child)}function Gh(t,e,n,s,r){if(pt(n)){var i=!0;Ra(e)}else i=!1;if(yr(e,r),e.stateNode===null)ha(t,e),Bg(e,n,s),qu(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=Rt(u):(u=pt(n)?Bs:Xe.current,u=Lr(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)&&Vh(e,o,s,u),Dn=!1;var f=e.memoizedState;o.state=f,Ia(e,s,o,r),l=e.memoizedState,a!==s||f!==l||ft.current||Dn?(typeof d=="function"&&(Xu(e,n,d,s),l=e.memoizedState),(a=Dn||Uh(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,bg(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:At(e.type,a),o.props=u,h=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Rt(l):(l=pt(n)?Bs:Xe.current,l=Lr(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)&&Vh(e,o,s,l),Dn=!1,f=e.memoizedState,o.state=f,Ia(e,s,o,r);var y=e.memoizedState;a!==h||f!==y||ft.current||Dn?(typeof p=="function"&&(Xu(e,n,p,s),y=e.memoizedState),(u=Dn||Uh(e,n,u,s,f,y,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,y,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=y),o.props=s,o.state=y,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 Zu(t,e,n,s,i,r)}function Zu(t,e,n,s,r,i){Qg(t,e);var o=(e.flags&128)!==0;if(!s&&!o)return r&&Fh(e,n,!1),Cn(t,e,i);s=e.stateNode,Qv.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return e.flags|=1,t!==null&&o?(e.child=Ir(e,t.child,null,i),e.child=Ir(e,null,a,i)):et(t,e,a,i),e.memoizedState=s.state,r&&Fh(e,n,!0),e.child}function Yg(t){var e=t.stateNode;e.pendingContext?Lh(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Lh(t,e.context,!1),ud(t,e.containerInfo)}function Jh(t,e,n,s,r){return Fr(),sd(r),e.flags|=256,et(t,e,n,s),e.child}var ec={dehydrated:null,treeContext:null,retryLane:0};function tc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Kg(t,e,n){var s=e.pendingProps,r=ge.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(ge,r&1),t===null)return Yu(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=gl(o,s,0,null),t=zs(t,s,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=tc(n),e.memoizedState=ec,t):yd(e,o));if(r=t.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Yv(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=ss(r,l),s.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=ss(a,i):(i=zs(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?tc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=ec,s}return i=t.child,t=i.sibling,s=ss(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 yd(t,e){return e=gl({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function $o(t,e,n,s){return s!==null&&sd(s),Ir(e,t.child,null,n),t=yd(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Yv(t,e,n,s,r,i,o){if(n)return e.flags&256?(e.flags&=-257,s=Gl(Error(M(422))),$o(t,e,o,s)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=s.fallback,r=e.mode,s=gl({mode:"visible",children:s.children},r,0,null),i=zs(i,r,o,null),i.flags|=2,s.return=e,i.return=e,s.sibling=i,e.child=s,e.mode&1&&Ir(e,t.child,null,o),e.child.memoizedState=tc(o),e.memoizedState=ec,i);if(!(e.mode&1))return $o(t,e,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var a=s.dgst;return s=a,i=Error(M(419)),s=Gl(i,s,void 0),$o(t,e,o,s)}if(a=(o&t.childLanes)!==0,ht||a){if(s=Le,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,Sn(t,r),Qt(s,t,r,-1))}return _d(),s=Gl(Error(M(421))),$o(t,e,o,s)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=ob.bind(null,t),r._reactRetry=e,null):(t=i.treeContext,yt=Zn(r.nextSibling),xt=e,pe=!0,Ht=null,t!==null&&(Nt[Et++]=xn,Nt[Et++]=vn,Nt[Et++]=Hs,xn=t.id,vn=t.overflow,Hs=e),e=yd(e,s.children),e.flags|=4096,e)}function Zh(t,e,n){t.lanes|=e;var s=t.alternate;s!==null&&(s.lanes|=e),Ku(t.return,e,n)}function Jl(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 Xg(t,e,n){var s=e.pendingProps,r=s.revealOrder,i=s.tail;if(et(t,e,s.children,n),s=ge.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&&Zh(t,n,e);else if(t.tag===19)Zh(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(ge,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&&Aa(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Jl(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&&Aa(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Jl(e,!0,n,null,i);break;case"together":Jl(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ha(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Cn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Us|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,n=ss(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ss(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Kv(t,e,n){switch(e.tag){case 3:Yg(e),Fr();break;case 5:wg(e);break;case 1:pt(e.type)&&Ra(e);break;case 4:ud(e,e.stateNode.containerInfo);break;case 10:var s=e.type._context,r=e.memoizedProps.value;ue(La,s._currentValue),s._currentValue=r;break;case 13:if(s=e.memoizedState,s!==null)return s.dehydrated!==null?(ue(ge,ge.current&1),e.flags|=128,null):n&e.child.childLanes?Kg(t,e,n):(ue(ge,ge.current&1),t=Cn(t,e,n),t!==null?t.sibling:null);ue(ge,ge.current&1);break;case 19:if(s=(n&e.childLanes)!==0,t.flags&128){if(s)return Xg(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ue(ge,ge.current),s)break;return null;case 22:case 23:return e.lanes=0,Vg(t,e,n)}return Cn(t,e,n)}var qg,nc,Gg,Jg;qg=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}};nc=function(){};Gg=function(t,e,n,s){var r=t.memoizedProps;if(r!==s){t=e.stateNode,js(ln.current);var i=null;switch(n){case"input":r=Su(t,r),s=Su(t,s),i=[];break;case"select":r=xe({},r,{value:void 0}),s=xe({},s,{value:void 0}),i=[];break;case"textarea":r=Nu(t,r),s=Nu(t,s),i=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(t.onclick=Ta)}Pu(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"&&(Fi.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"&&(Fi.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)}};Jg=function(t,e,n,s){n!==s&&(e.flags|=4)};function si(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 Ue(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 Xv(t,e,n){var s=e.pendingProps;switch(nd(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(e),null;case 1:return pt(e.type)&&Ma(),Ue(e),null;case 3:return s=e.stateNode,Ar(),fe(ft),fe(Xe),dd(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Ao(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ht!==null&&(cc(Ht),Ht=null))),nc(t,e),Ue(e),null;case 5:cd(e);var r=js(Ki.current);if(n=e.type,t!==null&&e.stateNode!=null)Gg(t,e,n,s,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!s){if(e.stateNode===null)throw Error(M(166));return Ue(e),null}if(t=js(ln.current),Ao(e)){s=e.stateNode,n=e.type;var i=e.memoizedProps;switch(s[on]=e,s[Qi]=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<gi.length;r++)de(gi[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":lh(s,i),de("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},de("invalid",s);break;case"textarea":ch(s,i),de("invalid",s)}Pu(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&&Io(s.textContent,a,t),r=["children",a]):typeof a=="number"&&s.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Io(s.textContent,a,t),r=["children",""+a]):Fi.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&de("scroll",s)}switch(n){case"input":Po(s),uh(s,i,!0);break;case"textarea":Po(s),dh(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=Ta)}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=jm(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[on]=e,t[Qi]=s,qg(t,e,!1,!1),e.stateNode=t;e:{switch(o=Tu(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<gi.length;r++)de(gi[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":lh(t,s),r=Su(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":ch(t,s),r=Nu(t,s),de("invalid",t);break;default:r=s}Pu(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Pm(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Nm(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ii(t,l):typeof l=="number"&&Ii(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&de("scroll",t):l!=null&&Bc(t,i,l,o))}switch(n){case"input":Po(t),uh(t,s,!1);break;case"textarea":Po(t),dh(t);break;case"option":s.value!=null&&t.setAttribute("value",""+ls(s.value));break;case"select":t.multiple=!!s.multiple,i=s.value,i!=null?fr(t,!!s.multiple,i,!1):s.defaultValue!=null&&fr(t,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(t.onclick=Ta)}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 Ue(e),null;case 6:if(t&&e.stateNode!=null)Jg(t,e,t.memoizedProps,s);else{if(typeof s!="string"&&e.stateNode===null)throw Error(M(166));if(n=js(Ki.current),js(ln.current),Ao(e)){if(s=e.stateNode,n=e.memoizedProps,s[on]=e,(i=s.nodeValue!==n)&&(t=xt,t!==null))switch(t.tag){case 3:Io(s.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Io(s.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[on]=e,e.stateNode=s}return Ue(e),null;case 13:if(fe(ge),s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(pe&&yt!==null&&e.mode&1&&!(e.flags&128))gg(),Fr(),e.flags|=98560,i=!1;else if(i=Ao(e),s!==null&&s.dehydrated!==null){if(t===null){if(!i)throw Error(M(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(M(317));i[on]=e}else Fr(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ue(e),i=!1}else Ht!==null&&(cc(Ht),Ht=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||ge.current&1?Re===0&&(Re=3):_d())),e.updateQueue!==null&&(e.flags|=4),Ue(e),null);case 4:return Ar(),nc(t,e),t===null&&Ui(e.stateNode.containerInfo),Ue(e),null;case 10:return od(e.type._context),Ue(e),null;case 17:return pt(e.type)&&Ma(),Ue(e),null;case 19:if(fe(ge),i=e.memoizedState,i===null)return Ue(e),null;if(s=(e.flags&128)!==0,o=i.rendering,o===null)if(s)si(i,!1);else{if(Re!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Aa(t),o!==null){for(e.flags|=128,si(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(ge,ge.current&1|2),e.child}t=t.sibling}i.tail!==null&&Ce()>$r&&(e.flags|=128,s=!0,si(i,!1),e.lanes=4194304)}else{if(!s)if(t=Aa(o),t!==null){if(e.flags|=128,s=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),si(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!pe)return Ue(e),null}else 2*Ce()-i.renderingStartTime>$r&&n!==1073741824&&(e.flags|=128,s=!0,si(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=Ce(),e.sibling=null,n=ge.current,ue(ge,s?n&1|2:n&1),e):(Ue(e),null);case 22:case 23:return kd(),s=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==s&&(e.flags|=8192),s&&e.mode&1?gt&1073741824&&(Ue(e),e.subtreeFlags&6&&(e.flags|=8192)):Ue(e),null;case 24:return null;case 25:return null}throw Error(M(156,e.tag))}function qv(t,e){switch(nd(e),e.tag){case 1:return pt(e.type)&&Ma(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ar(),fe(ft),fe(Xe),dd(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return cd(e),null;case 13:if(fe(ge),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));Fr()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return fe(ge),null;case 4:return Ar(),null;case 10:return od(e.type._context),null;case 22:case 23:return kd(),null;case 24:return null;default:return null}}var Bo=!1,Qe=!1,Gv=typeof WeakSet=="function"?WeakSet:Set,A=null;function cr(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Se(t,e,s)}else n.current=null}function sc(t,e,n){try{n()}catch(s){Se(t,e,s)}}var ef=!1;function Jv(t,e){if($u=Na,t=sg(),ed(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(Bu={focusedElem:t,selectionRange:n},Na=!1,A=e;A!==null;)if(e=A,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,A=t;else for(;A!==null;){e=A;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var m=y.memoizedProps,b=y.memoizedState,g=e.stateNode,x=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:At(e.type,m),b);g.__reactInternalSnapshotBeforeUpdate=x}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(M(163))}}catch(w){Se(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,A=t;break}A=e.return}return y=ef,ef=!1,y}function Ei(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&&sc(e,n,i)}r=r.next}while(r!==s)}}function pl(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 rc(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 Zg(t){var e=t.alternate;e!==null&&(t.alternate=null,Zg(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[on],delete e[Qi],delete e[Uu],delete e[Dv],delete e[Lv])),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 e0(t){return t.tag===5||t.tag===3||t.tag===4}function tf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||e0(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 ic(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=Ta));else if(s!==4&&(t=t.child,t!==null))for(ic(t,e,n),t=t.sibling;t!==null;)ic(t,e,n),t=t.sibling}function oc(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(oc(t,e,n),t=t.sibling;t!==null;)oc(t,e,n),t=t.sibling}var Ae=null,Bt=!1;function Pn(t,e,n){for(n=n.child;n!==null;)t0(t,e,n),n=n.sibling}function t0(t,e,n){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(ol,n)}catch{}switch(n.tag){case 5:Qe||cr(n,e);case 6:var s=Ae,r=Bt;Ae=null,Pn(t,e,n),Ae=s,Bt=r,Ae!==null&&(Bt?(t=Ae,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ae.removeChild(n.stateNode));break;case 18:Ae!==null&&(Bt?(t=Ae,n=n.stateNode,t.nodeType===8?Vl(t.parentNode,n):t.nodeType===1&&Vl(t,n),Bi(t)):Vl(Ae,n.stateNode));break;case 4:s=Ae,r=Bt,Ae=n.stateNode.containerInfo,Bt=!0,Pn(t,e,n),Ae=s,Bt=r;break;case 0:case 11:case 14:case 15:if(!Qe&&(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)&&sc(n,e,o),r=r.next}while(r!==s)}Pn(t,e,n);break;case 1:if(!Qe&&(cr(n,e),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(a){Se(n,e,a)}Pn(t,e,n);break;case 21:Pn(t,e,n);break;case 22:n.mode&1?(Qe=(s=Qe)||n.memoizedState!==null,Pn(t,e,n),Qe=s):Pn(t,e,n);break;default:Pn(t,e,n)}}function nf(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Gv),e.forEach(function(s){var r=ab.bind(null,t,s);n.has(s)||(n.add(s),s.then(r,r))})}}function It(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:Ae=a.stateNode,Bt=!1;break e;case 3:Ae=a.stateNode.containerInfo,Bt=!0;break e;case 4:Ae=a.stateNode.containerInfo,Bt=!0;break e}a=a.return}if(Ae===null)throw Error(M(160));t0(i,o,r),Ae=null,Bt=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){Se(r,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)n0(e,t),e=e.sibling}function n0(t,e){var n=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(It(e,t),Gt(t),s&4){try{Ei(3,t,t.return),pl(3,t)}catch(m){Se(t,t.return,m)}try{Ei(5,t,t.return)}catch(m){Se(t,t.return,m)}}break;case 1:It(e,t),Gt(t),s&512&&n!==null&&cr(n,n.return);break;case 5:if(It(e,t),Gt(t),s&512&&n!==null&&cr(n,n.return),t.flags&32){var r=t.stateNode;try{Ii(r,"")}catch(m){Se(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&&Sm(r,i),Tu(a,o);var u=Tu(a,i);for(o=0;o<l.length;o+=2){var d=l[o],h=l[o+1];d==="style"?Pm(r,h):d==="dangerouslySetInnerHTML"?Nm(r,h):d==="children"?Ii(r,h):Bc(r,d,h,u)}switch(a){case"input":Cu(r,i);break;case"textarea":Cm(r,i);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?fr(r,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?fr(r,!!i.multiple,i.defaultValue,!0):fr(r,!!i.multiple,i.multiple?[]:"",!1))}r[Qi]=i}catch(m){Se(t,t.return,m)}}break;case 6:if(It(e,t),Gt(t),s&4){if(t.stateNode===null)throw Error(M(162));r=t.stateNode,i=t.memoizedProps;try{r.nodeValue=i}catch(m){Se(t,t.return,m)}}break;case 3:if(It(e,t),Gt(t),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Bi(e.containerInfo)}catch(m){Se(t,t.return,m)}break;case 4:It(e,t),Gt(t);break;case 13:It(e,t),Gt(t),r=t.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(bd=Ce())),s&4&&nf(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(Qe=(u=Qe)||d,It(e,t),Qe=u):It(e,t),Gt(t),s&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(A=t,d=t.child;d!==null;){for(h=A=d;A!==null;){switch(f=A,p=f.child,f.tag){case 0:case 11:case 14:case 15:Ei(4,f,f.return);break;case 1:cr(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){s=f,n=f.return;try{e=s,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(m){Se(s,n,m)}}break;case 5:cr(f,f.return);break;case 22:if(f.memoizedState!==null){rf(h);continue}}p!==null?(p.return=f,A=p):rf(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=Em("display",o))}catch(m){Se(t,t.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){Se(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:It(e,t),Gt(t),s&4&&nf(t);break;case 21:break;default:It(e,t),Gt(t)}}function Gt(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(e0(n)){var s=n;break e}n=n.return}throw Error(M(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Ii(r,""),s.flags&=-33);var i=tf(t);oc(t,i,r);break;case 3:case 4:var o=s.stateNode.containerInfo,a=tf(t);ic(t,a,o);break;default:throw Error(M(161))}}catch(l){Se(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Zv(t,e,n){A=t,s0(t)}function s0(t,e,n){for(var s=(t.mode&1)!==0;A!==null;){var r=A,i=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||Bo;if(!o){var a=r.alternate,l=a!==null&&a.memoizedState!==null||Qe;a=Bo;var u=Qe;if(Bo=o,(Qe=l)&&!u)for(A=r;A!==null;)o=A,l=o.child,o.tag===22&&o.memoizedState!==null?of(r):l!==null?(l.return=o,A=l):of(r);for(;i!==null;)A=i,s0(i),i=i.sibling;A=r,Bo=a,Qe=u}sf(t)}else r.subtreeFlags&8772&&i!==null?(i.return=r,A=i):sf(t)}}function sf(t){for(;A!==null;){var e=A;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Qe||pl(5,e);break;case 1:var s=e.stateNode;if(e.flags&4&&!Qe)if(n===null)s.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:At(e.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Bh(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}Bh(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&&Bi(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}Qe||e.flags&512&&rc(e)}catch(f){Se(e,e.return,f)}}if(e===t){A=null;break}if(n=e.sibling,n!==null){n.return=e.return,A=n;break}A=e.return}}function rf(t){for(;A!==null;){var e=A;if(e===t){A=null;break}var n=e.sibling;if(n!==null){n.return=e.return,A=n;break}A=e.return}}function of(t){for(;A!==null;){var e=A;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{pl(4,e)}catch(l){Se(e,n,l)}break;case 1:var s=e.stateNode;if(typeof s.componentDidMount=="function"){var r=e.return;try{s.componentDidMount()}catch(l){Se(e,r,l)}}var i=e.return;try{rc(e)}catch(l){Se(e,i,l)}break;case 5:var o=e.return;try{rc(e)}catch(l){Se(e,o,l)}}}catch(l){Se(e,e.return,l)}if(e===t){A=null;break}var a=e.sibling;if(a!==null){a.return=e.return,A=a;break}A=e.return}}var eb=Math.ceil,Ba=Nn.ReactCurrentDispatcher,xd=Nn.ReactCurrentOwner,Mt=Nn.ReactCurrentBatchConfig,J=0,Le=null,Pe=null,$e=0,gt=0,dr=fs(0),Re=0,Ji=null,Us=0,ml=0,vd=0,Pi=null,ct=null,bd=0,$r=1/0,fn=null,Ha=!1,ac=null,ts=null,Ho=!1,Qn=null,Wa=0,Ti=0,lc=null,fa=-1,pa=0;function nt(){return J&6?Ce():fa!==-1?fa:fa=Ce()}function ns(t){return t.mode&1?J&2&&$e!==0?$e&-$e:Iv.transition!==null?(pa===0&&(pa=Bm()),pa):(t=re,t!==0||(t=window.event,t=t===void 0?16:Km(t.type)),t):1}function Qt(t,e,n,s){if(50<Ti)throw Ti=0,lc=null,Error(M(185));mo(t,n,s),(!(J&2)||t!==Le)&&(t===Le&&(!(J&2)&&(ml|=n),Re===4&&Fn(t,$e)),mt(t,s),n===1&&J===0&&!(e.mode&1)&&($r=Ce()+500,dl&&ps()))}function mt(t,e){var n=t.callbackNode;Ix(t,e);var s=ja(t,t===Le?$e:0);if(s===0)n!==null&&ph(n),t.callbackNode=null,t.callbackPriority=0;else if(e=s&-s,t.callbackPriority!==e){if(n!=null&&ph(n),e===1)t.tag===0?Fv(af.bind(null,t)):fg(af.bind(null,t)),Rv(function(){!(J&6)&&ps()}),n=null;else{switch(Hm(s)){case 1:n=Qc;break;case 4:n=zm;break;case 16:n=Ca;break;case 536870912:n=$m;break;default:n=Ca}n=d0(n,r0.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function r0(t,e){if(fa=-1,pa=0,J&6)throw Error(M(327));var n=t.callbackNode;if(xr()&&t.callbackNode!==n)return null;var s=ja(t,t===Le?$e:0);if(s===0)return null;if(s&30||s&t.expiredLanes||e)e=Ua(t,s);else{e=s;var r=J;J|=2;var i=o0();(Le!==t||$e!==e)&&(fn=null,$r=Ce()+500,As(t,e));do try{sb();break}catch(a){i0(t,a)}while(!0);id(),Ba.current=i,J=r,Pe!==null?e=0:(Le=null,$e=0,e=Re)}if(e!==0){if(e===2&&(r=Lu(t),r!==0&&(s=r,e=uc(t,r))),e===1)throw n=Ji,As(t,0),Fn(t,s),mt(t,Ce()),n;if(e===6)Fn(t,s);else{if(r=t.current.alternate,!(s&30)&&!tb(r)&&(e=Ua(t,s),e===2&&(i=Lu(t),i!==0&&(s=i,e=uc(t,i))),e===1))throw n=Ji,As(t,0),Fn(t,s),mt(t,Ce()),n;switch(t.finishedWork=r,t.finishedLanes=s,e){case 0:case 1:throw Error(M(345));case 2:ws(t,ct,fn);break;case 3:if(Fn(t,s),(s&130023424)===s&&(e=bd+500-Ce(),10<e)){if(ja(t,0)!==0)break;if(r=t.suspendedLanes,(r&s)!==s){nt(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=Wu(ws.bind(null,t,ct,fn),e);break}ws(t,ct,fn);break;case 4:if(Fn(t,s),(s&4194240)===s)break;for(e=t.eventTimes,r=-1;0<s;){var o=31-Vt(s);i=1<<o,o=e[o],o>r&&(r=o),s&=~i}if(s=r,s=Ce()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*eb(s/1960))-s,10<s){t.timeoutHandle=Wu(ws.bind(null,t,ct,fn),s);break}ws(t,ct,fn);break;case 5:ws(t,ct,fn);break;default:throw Error(M(329))}}}return mt(t,Ce()),t.callbackNode===n?r0.bind(null,t):null}function uc(t,e){var n=Pi;return t.current.memoizedState.isDehydrated&&(As(t,e).flags|=256),t=Ua(t,e),t!==2&&(e=ct,ct=n,e!==null&&cc(e)),t}function cc(t){ct===null?ct=t:ct.push.apply(ct,t)}function tb(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(!Yt(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 Fn(t,e){for(e&=~vd,e&=~ml,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Vt(e),s=1<<n;t[n]=-1,e&=~s}}function af(t){if(J&6)throw Error(M(327));xr();var e=ja(t,0);if(!(e&1))return mt(t,Ce()),null;var n=Ua(t,e);if(t.tag!==0&&n===2){var s=Lu(t);s!==0&&(e=s,n=uc(t,s))}if(n===1)throw n=Ji,As(t,0),Fn(t,e),mt(t,Ce()),n;if(n===6)throw Error(M(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ws(t,ct,fn),mt(t,Ce()),null}function wd(t,e){var n=J;J|=1;try{return t(e)}finally{J=n,J===0&&($r=Ce()+500,dl&&ps())}}function Vs(t){Qn!==null&&Qn.tag===0&&!(J&6)&&xr();var e=J;J|=1;var n=Mt.transition,s=re;try{if(Mt.transition=null,re=1,t)return t()}finally{re=s,Mt.transition=n,J=e,!(J&6)&&ps()}}function kd(){gt=dr.current,fe(dr)}function As(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Mv(n)),Pe!==null)for(n=Pe.return;n!==null;){var s=n;switch(nd(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Ma();break;case 3:Ar(),fe(ft),fe(Xe),dd();break;case 5:cd(s);break;case 4:Ar();break;case 13:fe(ge);break;case 19:fe(ge);break;case 10:od(s.type._context);break;case 22:case 23:kd()}n=n.return}if(Le=t,Pe=t=ss(t.current,null),$e=gt=e,Re=0,Ji=null,vd=ml=Us=0,ct=Pi=null,Cs!==null){for(e=0;e<Cs.length;e++)if(n=Cs[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}Cs=null}return t}function i0(t,e){do{var n=Pe;try{if(id(),ca.current=$a,za){for(var s=ye.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}za=!1}if(Ws=0,De=Te=ye=null,Ni=!1,Xi=0,xd.current=null,n===null||n.return===null){Re=1,Ji=e,Pe=null;break}e:{var i=t,o=n.return,a=n,l=e;if(e=$e,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=Yh(o);if(p!==null){p.flags&=-257,Kh(p,o,a,i,e),p.mode&1&&Qh(i,u,e),e=p,l=u;var y=e.updateQueue;if(y===null){var m=new Set;m.add(l),e.updateQueue=m}else y.add(l);break e}else{if(!(e&1)){Qh(i,u,e),_d();break e}l=Error(M(426))}}else if(pe&&a.mode&1){var b=Yh(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Kh(b,o,a,i,e),sd(zr(l,a));break e}}i=l=zr(l,a),Re!==4&&(Re=2),Pi===null?Pi=[i]:Pi.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var g=Hg(i,l,e);$h(i,g);break e;case 1:a=l;var x=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ts===null||!ts.has(v)))){i.flags|=65536,e&=-e,i.lanes|=e;var w=Wg(i,a,e);$h(i,w);break e}}i=i.return}while(i!==null)}l0(n)}catch(j){e=j,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(!0)}function o0(){var t=Ba.current;return Ba.current=$a,t===null?$a:t}function _d(){(Re===0||Re===3||Re===2)&&(Re=4),Le===null||!(Us&268435455)&&!(ml&268435455)||Fn(Le,$e)}function Ua(t,e){var n=J;J|=2;var s=o0();(Le!==t||$e!==e)&&(fn=null,As(t,e));do try{nb();break}catch(r){i0(t,r)}while(!0);if(id(),J=n,Ba.current=s,Pe!==null)throw Error(M(261));return Le=null,$e=0,Re}function nb(){for(;Pe!==null;)a0(Pe)}function sb(){for(;Pe!==null&&!Ex();)a0(Pe)}function a0(t){var e=c0(t.alternate,t,gt);t.memoizedProps=t.pendingProps,e===null?l0(t):Pe=e,xd.current=null}function l0(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=qv(n,e),n!==null){n.flags&=32767,Pe=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Re=6,Pe=null;return}}else if(n=Xv(n,e,gt),n!==null){Pe=n;return}if(e=e.sibling,e!==null){Pe=e;return}Pe=e=t}while(e!==null);Re===0&&(Re=5)}function ws(t,e,n){var s=re,r=Mt.transition;try{Mt.transition=null,re=1,rb(t,e,n,s)}finally{Mt.transition=r,re=s}return null}function rb(t,e,n,s){do xr();while(Qn!==null);if(J&6)throw Error(M(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(M(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(Ax(t,i),t===Le&&(Pe=Le=null,$e=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ho||(Ho=!0,d0(Ca,function(){return xr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Mt.transition,Mt.transition=null;var o=re;re=1;var a=J;J|=4,xd.current=null,Jv(t,n),n0(n,t),Sv(Bu),Na=!!$u,Bu=$u=null,t.current=n,Zv(n),Px(),J=a,re=o,Mt.transition=i}else t.current=n;if(Ho&&(Ho=!1,Qn=t,Wa=r),i=t.pendingLanes,i===0&&(ts=null),Rx(n.stateNode),mt(t,Ce()),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(Ha)throw Ha=!1,t=ac,ac=null,t;return Wa&1&&t.tag!==0&&xr(),i=t.pendingLanes,i&1?t===lc?Ti++:(Ti=0,lc=t):Ti=0,ps(),null}function xr(){if(Qn!==null){var t=Hm(Wa),e=Mt.transition,n=re;try{if(Mt.transition=null,re=16>t?16:t,Qn===null)var s=!1;else{if(t=Qn,Qn=null,Wa=0,J&6)throw Error(M(331));var r=J;for(J|=4,A=t.current;A!==null;){var i=A,o=i.child;if(A.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(A=u;A!==null;){var d=A;switch(d.tag){case 0:case 11:case 15:Ei(8,d,i)}var h=d.child;if(h!==null)h.return=d,A=h;else for(;A!==null;){d=A;var f=d.sibling,p=d.return;if(Zg(d),d===u){A=null;break}if(f!==null){f.return=p,A=f;break}A=p}}}var y=i.alternate;if(y!==null){var m=y.child;if(m!==null){y.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(m!==null)}}A=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,A=o;else e:for(;A!==null;){if(i=A,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ei(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,A=g;break e}A=i.return}}var x=t.current;for(A=x;A!==null;){o=A;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,A=v;else e:for(o=x;A!==null;){if(a=A,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:pl(9,a)}}catch(j){Se(a,a.return,j)}if(a===o){A=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,A=w;break e}A=a.return}}if(J=r,ps(),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(ol,t)}catch{}s=!0}return s}finally{re=n,Mt.transition=e}}return!1}function lf(t,e,n){e=zr(n,e),e=Hg(t,e,1),t=es(t,e,1),e=nt(),t!==null&&(mo(t,1,e),mt(t,e))}function Se(t,e,n){if(t.tag===3)lf(t,t,n);else for(;e!==null;){if(e.tag===3){lf(e,t,n);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ts===null||!ts.has(s))){t=zr(n,t),t=Wg(e,t,1),e=es(e,t,1),t=nt(),e!==null&&(mo(e,1,t),mt(e,t));break}}e=e.return}}function ib(t,e,n){var s=t.pingCache;s!==null&&s.delete(e),e=nt(),t.pingedLanes|=t.suspendedLanes&n,Le===t&&($e&n)===n&&(Re===4||Re===3&&($e&130023424)===$e&&500>Ce()-bd?As(t,0):vd|=n),mt(t,e)}function u0(t,e){e===0&&(t.mode&1?(e=Ro,Ro<<=1,!(Ro&130023424)&&(Ro=4194304)):e=1);var n=nt();t=Sn(t,e),t!==null&&(mo(t,e,n),mt(t,n))}function ob(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),u0(t,n)}function ab(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(M(314))}s!==null&&s.delete(e),u0(t,n)}var c0;c0=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ft.current)ht=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ht=!1,Kv(t,e,n);ht=!!(t.flags&131072)}else ht=!1,pe&&e.flags&1048576&&pg(e,Da,e.index);switch(e.lanes=0,e.tag){case 2:var s=e.type;ha(t,e),t=e.pendingProps;var r=Lr(e,Xe.current);yr(e,n),r=fd(null,e,s,t,r,n);var i=pd();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,pt(s)?(i=!0,Ra(e)):i=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,ld(e),r.updater=fl,e.stateNode=r,r._reactInternals=e,qu(e,s,t,n),e=Zu(null,e,s,!0,i,n)):(e.tag=0,pe&&i&&td(e),et(null,e,r,n),e=e.child),e;case 16:s=e.elementType;e:{switch(ha(t,e),t=e.pendingProps,r=s._init,s=r(s._payload),e.type=s,r=e.tag=ub(s),t=At(s,t),r){case 0:e=Ju(null,e,s,t,n);break e;case 1:e=Gh(null,e,s,t,n);break e;case 11:e=Xh(null,e,s,t,n);break e;case 14:e=qh(null,e,s,At(s.type,t),n);break e}throw Error(M(306,s,""))}return e;case 0:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:At(s,r),Ju(t,e,s,r,n);case 1:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:At(s,r),Gh(t,e,s,r,n);case 3:e:{if(Yg(e),t===null)throw Error(M(387));s=e.pendingProps,i=e.memoizedState,r=i.element,bg(t,e),Ia(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=zr(Error(M(423)),e),e=Jh(t,e,s,n,r);break e}else if(s!==r){r=zr(Error(M(424)),e),e=Jh(t,e,s,n,r);break e}else for(yt=Zn(e.stateNode.containerInfo.firstChild),xt=e,pe=!0,Ht=null,n=xg(e,null,s,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fr(),s===r){e=Cn(t,e,n);break e}et(t,e,s,n)}e=e.child}return e;case 5:return wg(e),t===null&&Yu(e),s=e.type,r=e.pendingProps,i=t!==null?t.memoizedProps:null,o=r.children,Hu(s,r)?o=null:i!==null&&Hu(s,i)&&(e.flags|=32),Qg(t,e),et(t,e,o,n),e.child;case 6:return t===null&&Yu(e),null;case 13:return Kg(t,e,n);case 4:return ud(e,e.stateNode.containerInfo),s=e.pendingProps,t===null?e.child=Ir(e,null,s,n):et(t,e,s,n),e.child;case 11:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:At(s,r),Xh(t,e,s,r,n);case 7:return et(t,e,e.pendingProps,n),e.child;case 8:return et(t,e,e.pendingProps.children,n),e.child;case 12:return et(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(La,s._currentValue),s._currentValue=o,i!==null)if(Yt(i.value,o)){if(i.children===r.children&&!ft.current){e=Cn(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=bn(-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),Ku(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(M(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Ku(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}et(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,s=e.pendingProps.children,yr(e,n),r=Rt(r),s=s(r),e.flags|=1,et(t,e,s,n),e.child;case 14:return s=e.type,r=At(s,e.pendingProps),r=At(s.type,r),qh(t,e,s,r,n);case 15:return Ug(t,e,e.type,e.pendingProps,n);case 17:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:At(s,r),ha(t,e),e.tag=1,pt(s)?(t=!0,Ra(e)):t=!1,yr(e,n),Bg(e,s,r),qu(e,s,r,n),Zu(null,e,s,!0,t,n);case 19:return Xg(t,e,n);case 22:return Vg(t,e,n)}throw Error(M(156,e.tag))};function d0(t,e){return Am(t,e)}function lb(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 Pt(t,e,n,s){return new lb(t,e,n,s)}function Sd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ub(t){if(typeof t=="function")return Sd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Wc)return 11;if(t===Uc)return 14}return 2}function ss(t,e){var n=t.alternate;return n===null?(n=Pt(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 ma(t,e,n,s,r,i){var o=2;if(s=t,typeof t=="function")Sd(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case tr:return zs(n.children,r,i,e);case Hc:o=8,r|=8;break;case bu:return t=Pt(12,n,e,r|2),t.elementType=bu,t.lanes=i,t;case wu:return t=Pt(13,n,e,r),t.elementType=wu,t.lanes=i,t;case ku:return t=Pt(19,n,e,r),t.elementType=ku,t.lanes=i,t;case wm:return gl(n,r,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case vm:o=10;break e;case bm:o=9;break e;case Wc:o=11;break e;case Uc:o=14;break e;case On:o=16,s=null;break e}throw Error(M(130,t==null?t:typeof t,""))}return e=Pt(o,n,e,r),e.elementType=t,e.type=s,e.lanes=i,e}function zs(t,e,n,s){return t=Pt(7,t,s,e),t.lanes=n,t}function gl(t,e,n,s){return t=Pt(22,t,s,e),t.elementType=wm,t.lanes=n,t.stateNode={isHidden:!1},t}function Zl(t,e,n){return t=Pt(6,t,null,e),t.lanes=n,t}function eu(t,e,n){return e=Pt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function cb(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=Dl(0),this.expirationTimes=Dl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dl(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Cd(t,e,n,s,r,i,o,a,l){return t=new cb(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Pt(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ld(i),t}function db(t,e,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:er,key:s==null?null:""+s,children:t,containerInfo:e,implementation:n}}function h0(t){if(!t)return us;t=t._reactInternals;e:{if(qs(t)!==t||t.tag!==1)throw Error(M(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(pt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(M(171))}if(t.tag===1){var n=t.type;if(pt(n))return hg(t,n,e)}return e}function f0(t,e,n,s,r,i,o,a,l){return t=Cd(n,s,!0,t,r,i,o,a,l),t.context=h0(null),n=t.current,s=nt(),r=ns(n),i=bn(s,r),i.callback=e??null,es(n,i,r),t.current.lanes=r,mo(t,r,s),mt(t,s),t}function yl(t,e,n,s){var r=e.current,i=nt(),o=ns(r);return n=h0(n),e.context===null?e.context=n:e.pendingContext=n,e=bn(i,o),e.payload={element:t},s=s===void 0?null:s,s!==null&&(e.callback=s),t=es(r,e,o),t!==null&&(Qt(t,r,o,i),ua(t,r,o)),o}function Va(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 uf(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function jd(t,e){uf(t,e),(t=t.alternate)&&uf(t,e)}function hb(){return null}var p0=typeof reportError=="function"?reportError:function(t){console.error(t)};function Nd(t){this._internalRoot=t}xl.prototype.render=Nd.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));yl(t,e,null,null)};xl.prototype.unmount=Nd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Vs(function(){yl(null,t,null,null)}),e[_n]=null}};function xl(t){this._internalRoot=t}xl.prototype.unstable_scheduleHydration=function(t){if(t){var e=Vm();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Ln.length&&e!==0&&e<Ln[n].priority;n++);Ln.splice(n,0,t),n===0&&Ym(t)}};function Ed(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function vl(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function cf(){}function fb(t,e,n,s,r){if(r){if(typeof s=="function"){var i=s;s=function(){var u=Va(o);i.call(u)}}var o=f0(e,s,t,0,null,!1,!1,"",cf);return t._reactRootContainer=o,t[_n]=o.current,Ui(t.nodeType===8?t.parentNode:t),Vs(),o}for(;r=t.lastChild;)t.removeChild(r);if(typeof s=="function"){var a=s;s=function(){var u=Va(l);a.call(u)}}var l=Cd(t,0,!1,null,null,!1,!1,"",cf);return t._reactRootContainer=l,t[_n]=l.current,Ui(t.nodeType===8?t.parentNode:t),Vs(function(){yl(e,l,n,s)}),l}function bl(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=Va(o);a.call(l)}}yl(e,o,t,r)}else o=fb(n,e,t,r,s);return Va(o)}Wm=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=mi(e.pendingLanes);n!==0&&(Yc(e,n|1),mt(e,Ce()),!(J&6)&&($r=Ce()+500,ps()))}break;case 13:Vs(function(){var s=Sn(t,1);if(s!==null){var r=nt();Qt(s,t,1,r)}}),jd(t,1)}};Kc=function(t){if(t.tag===13){var e=Sn(t,134217728);if(e!==null){var n=nt();Qt(e,t,134217728,n)}jd(t,134217728)}};Um=function(t){if(t.tag===13){var e=ns(t),n=Sn(t,e);if(n!==null){var s=nt();Qt(n,t,e,s)}jd(t,e)}};Vm=function(){return re};Qm=function(t,e){var n=re;try{return re=t,e()}finally{re=n}};Ru=function(t,e,n){switch(e){case"input":if(Cu(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=cl(s);if(!r)throw Error(M(90));_m(s),Cu(s,r)}}}break;case"textarea":Cm(t,n);break;case"select":e=n.value,e!=null&&fr(t,!!n.multiple,e,!1)}};Rm=wd;Om=Vs;var pb={usingClientEntryPoint:!1,Events:[yo,ir,cl,Tm,Mm,wd]},ri={findFiberByHostInstance:Ss,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mb={bundleType:ri.bundleType,version:ri.version,rendererPackageName:ri.rendererPackageName,rendererConfig:ri.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Nn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Fm(t),t===null?null:t.stateNode},findFiberByHostInstance:ri.findFiberByHostInstance||hb,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 Wo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wo.isDisabled&&Wo.supportsFiber)try{ol=Wo.inject(mb),an=Wo}catch{}}bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pb;bt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ed(e))throw Error(M(200));return db(t,e,null,n)};bt.createRoot=function(t,e){if(!Ed(t))throw Error(M(299));var n=!1,s="",r=p0;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(s=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=Cd(t,1,!1,null,null,n,!1,s,r),t[_n]=e.current,Ui(t.nodeType===8?t.parentNode:t),new Nd(e)};bt.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(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=Fm(e),t=t===null?null:t.stateNode,t};bt.flushSync=function(t){return Vs(t)};bt.hydrate=function(t,e,n){if(!vl(e))throw Error(M(200));return bl(null,t,e,!0,n)};bt.hydrateRoot=function(t,e,n){if(!Ed(t))throw Error(M(405));var s=n!=null&&n.hydratedSources||null,r=!1,i="",o=p0;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=f0(e,null,t,1,n??null,r,!1,i,o),t[_n]=e.current,Ui(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 xl(e)};bt.render=function(t,e,n){if(!vl(e))throw Error(M(200));return bl(null,t,e,!1,n)};bt.unmountComponentAtNode=function(t){if(!vl(t))throw Error(M(40));return t._reactRootContainer?(Vs(function(){bl(null,null,t,!1,function(){t._reactRootContainer=null,t[_n]=null})}),!0):!1};bt.unstable_batchedUpdates=wd;bt.unstable_renderSubtreeIntoContainer=function(t,e,n,s){if(!vl(n))throw Error(M(200));if(t==null||t._reactInternals===void 0)throw Error(M(38));return bl(t,e,n,!1,s)};bt.version="18.3.1-next-f1338f8080-20240426";function m0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m0)}catch(t){console.error(t)}}m0(),mm.exports=bt;var gb=mm.exports,df=gb;xu.createRoot=df.createRoot,xu.hydrateRoot=df.hydrateRoot;var vo=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(){}},yb={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},In,Dc,Kp,xb=(Kp=class{constructor(){B(this,In,yb);B(this,Dc,!1)}setTimeoutProvider(t){I(this,In,t)}setTimeout(t,e){return S(this,In).setTimeout(t,e)}clearTimeout(t){S(this,In).clearTimeout(t)}setInterval(t,e){return S(this,In).setInterval(t,e)}clearInterval(t){S(this,In).clearInterval(t)}},In=new WeakMap,Dc=new WeakMap,Kp),Ns=new xb;function vb(t){setTimeout(t,0)}var Qs=typeof window>"u"||"Deno"in globalThis;function ut(){}function bb(t,e){return typeof t=="function"?t(e):t}function dc(t){return typeof t=="number"&&t>=0&&t!==1/0}function g0(t,e){return Math.max(t+(e||0)-Date.now(),0)}function rs(t,e){return typeof t=="function"?t(e):t}function jt(t,e){return typeof t=="function"?t(e):t}function hf(t,e){const{type:n="all",exact:s,fetchStatus:r,predicate:i,queryKey:o,stale:a}=t;if(o){if(s){if(e.queryHash!==Pd(o,e.options))return!1}else if(!eo(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 ff(t,e){const{exact:n,status:s,predicate:r,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Zi(e.options.mutationKey)!==Zi(i))return!1}else if(!eo(e.options.mutationKey,i))return!1}return!(s&&e.state.status!==s||r&&!r(e))}function Pd(t,e){return((e==null?void 0:e.queryKeyHashFn)||Zi)(t)}function Zi(t){return JSON.stringify(t,(e,n)=>fc(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function eo(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>eo(t[n],e[n])):!1}var wb=Object.prototype.hasOwnProperty;function y0(t,e){if(t===e)return t;const n=pf(t)&&pf(e);if(!n&&!(fc(t)&&fc(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:wb.call(t,d))&&l++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){a[d]=f;continue}const p=y0(h,f);a[d]=p,p===h&&l++}return r===o&&l===r?t:a}function hc(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 pf(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function fc(t){if(!mf(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!mf(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function mf(t){return Object.prototype.toString.call(t)==="[object Object]"}function kb(t){return new Promise(e=>{Ns.setTimeout(e,t)})}function pc(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?y0(t,e):e}function _b(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function Sb(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var Td=Symbol();function x0(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Td?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function v0(t,e){return typeof t=="function"?t(...e):!!t}function Cb(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 Ps,An,kr,Xp,jb=(Xp=class extends vo{constructor(){super();B(this,Ps);B(this,An);B(this,kr);I(this,kr,e=>{if(!Qs&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,An)||this.setEventListener(S(this,kr))}onUnsubscribe(){var e;this.hasListeners()||((e=S(this,An))==null||e.call(this),I(this,An,void 0))}setEventListener(e){var n;I(this,kr,e),(n=S(this,An))==null||n.call(this),I(this,An,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){S(this,Ps)!==e&&(I(this,Ps,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof S(this,Ps)=="boolean"?S(this,Ps):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ps=new WeakMap,An=new WeakMap,kr=new WeakMap,Xp),Md=new jb;function mc(){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 Nb=vb;function Eb(){let t=[],e=0,n=a=>{a()},s=a=>{a()},r=Nb;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 ze=Eb(),_r,zn,Sr,qp,Pb=(qp=class extends vo{constructor(){super();B(this,_r,!0);B(this,zn);B(this,Sr);I(this,Sr,e=>{if(!Qs&&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(){S(this,zn)||this.setEventListener(S(this,Sr))}onUnsubscribe(){var e;this.hasListeners()||((e=S(this,zn))==null||e.call(this),I(this,zn,void 0))}setEventListener(e){var n;I(this,Sr,e),(n=S(this,zn))==null||n.call(this),I(this,zn,e(this.setOnline.bind(this)))}setOnline(e){S(this,_r)!==e&&(I(this,_r,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return S(this,_r)}},_r=new WeakMap,zn=new WeakMap,Sr=new WeakMap,qp),Qa=new Pb;function Tb(t){return Math.min(1e3*2**t,3e4)}function b0(t){return(t??"online")==="online"?Qa.isOnline():!0}var gc=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function w0(t){let e=!1,n=0,s;const r=mc(),i=()=>r.status!=="pending",o=m=>{var b;if(!i()){const g=new gc(m);f(g),(b=t.onCancel)==null||b.call(t,g)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Md.isFocused()&&(t.networkMode==="always"||Qa.isOnline())&&t.canRun(),d=()=>b0(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)}),y=()=>{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 E;if(i())return;const x=t.retry??(Qs?0:3),v=t.retryDelay??Tb,w=typeof v=="function"?v(n,g):v,j=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,g);if(e||!j){f(g);return}n++,(E=t.onFail)==null||E.call(t,n,g),kb(w).then(()=>u()?void 0:p()).then(()=>{e?f(g):y()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(s==null||s(),r),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():p().then(y),r)}}var Ts,Gp,k0=(Gp=class{constructor(){B(this,Ts)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dc(this.gcTime)&&I(this,Ts,Ns.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Qs?1/0:5*60*1e3))}clearGcTimeout(){S(this,Ts)&&(Ns.clearTimeout(S(this,Ts)),I(this,Ts,void 0))}},Ts=new WeakMap,Gp),Ms,Cr,Ct,Rs,Oe,lo,Os,zt,cn,Jp,Mb=(Jp=class extends k0{constructor(e){super();B(this,zt);B(this,Ms);B(this,Cr);B(this,Ct);B(this,Rs);B(this,Oe);B(this,lo);B(this,Os);I(this,Os,!1),I(this,lo,e.defaultOptions),this.setOptions(e.options),this.observers=[],I(this,Rs,e.client),I(this,Ct,S(this,Rs).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,I(this,Ms,yf(this.options)),this.state=e.state??S(this,Ms),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=S(this,Oe))==null?void 0:e.promise}setOptions(e){if(this.options={...S(this,lo),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=yf(this.options);n.data!==void 0&&(this.setState(gf(n.data,n.dataUpdatedAt)),I(this,Ms,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Ct).remove(this)}setData(e,n){const s=pc(this.state.data,e,this.options);return X(this,zt,cn).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e,n){X(this,zt,cn).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var s,r;const n=(s=S(this,Oe))==null?void 0:s.promise;return(r=S(this,Oe))==null||r.cancel(e),n?n.then(ut).catch(ut):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,Ms))}isActive(){return this.observers.some(e=>jt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Td||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>rs(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:!g0(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=S(this,Oe))==null||n.continue()}onOnline(){var n;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=S(this,Oe))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),S(this,Ct).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(S(this,Oe)&&(S(this,Os)?S(this,Oe).cancel({revert:!0}):S(this,Oe).cancelRetry()),this.scheduleGc()),S(this,Ct).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,zt,cn).call(this,{type:"invalidate"})}async fetch(e,n){var l,u,d,h,f,p,y,m,b,g,x,v;if(this.state.fetchStatus!=="idle"&&((l=S(this,Oe))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,Oe))return S(this,Oe).continueRetry(),S(this,Oe).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:()=>(I(this,Os,!0),s.signal)})},i=()=>{const w=x0(this.options,n),E=(()=>{const k={client:S(this,Rs),queryKey:this.queryKey,meta:this.meta};return r(k),k})();return I(this,Os,!1),this.options.persister?this.options.persister(w,E,this):w(E)},a=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,Rs),state:this.state,fetchFn:i};return r(w),w})();(u=this.options.behavior)==null||u.onFetch(a,this),I(this,Cr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&X(this,zt,cn).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),I(this,Oe,w0({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:w=>{w instanceof gc&&w.revert&&this.setState({...S(this,Cr),fetchStatus:"idle"}),s.abort()},onFail:(w,j)=>{X(this,zt,cn).call(this,{type:"failed",failureCount:w,error:j})},onPause:()=>{X(this,zt,cn).call(this,{type:"pause"})},onContinue:()=>{X(this,zt,cn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await S(this,Oe).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(p=(f=S(this,Ct).config).onSuccess)==null||p.call(f,w,this),(m=(y=S(this,Ct).config).onSettled)==null||m.call(y,w,this.state.error,this),w}catch(w){if(w instanceof gc){if(w.silent)return S(this,Oe).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw X(this,zt,cn).call(this,{type:"error",error:w}),(g=(b=S(this,Ct).config).onError)==null||g.call(b,w,this),(v=(x=S(this,Ct).config).onSettled)==null||v.call(x,this.state.data,w,this),w}finally{this.scheduleGc()}}},Ms=new WeakMap,Cr=new WeakMap,Ct=new WeakMap,Rs=new WeakMap,Oe=new WeakMap,lo=new WeakMap,Os=new WeakMap,zt=new WeakSet,cn=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,..._0(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...gf(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return I(this,Cr,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),ze.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),S(this,Ct).notify({query:this,type:"updated",action:e})})},Jp);function _0(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:b0(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function gf(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yf(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 lt,q,uo,Je,Ds,jr,gn,$n,co,Nr,Er,Ls,Fs,Bn,Pr,te,yi,yc,xc,vc,bc,wc,kc,_c,S0,Zp,Rb=(Zp=class extends vo{constructor(e,n){super();B(this,te);B(this,lt);B(this,q);B(this,uo);B(this,Je);B(this,Ds);B(this,jr);B(this,gn);B(this,$n);B(this,co);B(this,Nr);B(this,Er);B(this,Ls);B(this,Fs);B(this,Bn);B(this,Pr,new Set);this.options=n,I(this,lt,e),I(this,$n,null),I(this,gn,mc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,q).addObserver(this),xf(S(this,q),this.options)?X(this,te,yi).call(this):this.updateResult(),X(this,te,bc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sc(S(this,q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sc(S(this,q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,te,wc).call(this),X(this,te,kc).call(this),S(this,q).removeObserver(this)}setOptions(e){const n=this.options,s=S(this,q);if(this.options=S(this,lt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof jt(this.options.enabled,S(this,q))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");X(this,te,_c).call(this),S(this,q).setOptions(this.options),n._defaulted&&!hc(this.options,n)&&S(this,lt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,q),observer:this});const r=this.hasListeners();r&&vf(S(this,q),s,this.options,n)&&X(this,te,yi).call(this),this.updateResult(),r&&(S(this,q)!==s||jt(this.options.enabled,S(this,q))!==jt(n.enabled,S(this,q))||rs(this.options.staleTime,S(this,q))!==rs(n.staleTime,S(this,q)))&&X(this,te,yc).call(this);const i=X(this,te,xc).call(this);r&&(S(this,q)!==s||jt(this.options.enabled,S(this,q))!==jt(n.enabled,S(this,q))||i!==S(this,Bn))&&X(this,te,vc).call(this,i)}getOptimisticResult(e){const n=S(this,lt).getQueryCache().build(S(this,lt),e),s=this.createResult(n,e);return Db(this,s)&&(I(this,Je,s),I(this,jr,this.options),I(this,Ds,S(this,q).state)),s}getCurrentResult(){return S(this,Je)}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&&S(this,gn).status==="pending"&&S(this,gn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){S(this,Pr).add(e)}getCurrentQuery(){return S(this,q)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=S(this,lt).defaultQueryOptions(e),s=S(this,lt).getQueryCache().build(S(this,lt),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return X(this,te,yi).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,Je)))}createResult(e,n){var R;const s=S(this,q),r=this.options,i=S(this,Je),o=S(this,Ds),a=S(this,jr),u=e!==s?e.state:S(this,uo),{state:d}=e;let h={...d},f=!1,p;if(n._optimisticResults){const C=this.hasListeners(),T=!C&&xf(e,n),z=C&&vf(e,s,n,r);(T||z)&&(h={...h,..._0(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,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=S(this,Er))==null?void 0:R.state.data,S(this,Er)):n.placeholderData,C!==void 0&&(b="success",p=pc(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===S(this,co))p=S(this,Nr);else try{I(this,co,n.select),p=n.select(p),p=pc(i==null?void 0:i.data,p,n),I(this,Nr,p),I(this,$n,null)}catch(C){I(this,$n,C)}S(this,$n)&&(y=S(this,$n),p=S(this,Nr),m=Date.now(),b="error");const x=h.fetchStatus==="fetching",v=b==="pending",w=b==="error",j=v&&x,E=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:y,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:x,isRefetching:x&&!v,isLoadingError:w&&!E,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&E,isStale:Rd(e,n),refetch:this.refetch,promise:S(this,gn),isEnabled:jt(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)},T=()=>{const V=I(this,gn,N.promise=mc());C(V)},z=S(this,gn);switch(z.status){case"pending":e.queryHash===s.queryHash&&C(z);break;case"fulfilled":(N.status==="error"||N.data!==z.value)&&T();break;case"rejected":(N.status!=="error"||N.error!==z.reason)&&T();break}}return N}updateResult(){const e=S(this,Je),n=this.createResult(S(this,q),this.options);if(I(this,Ds,S(this,q).state),I(this,jr,this.options),S(this,Ds).data!==void 0&&I(this,Er,S(this,q)),hc(n,e))return;I(this,Je,n);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!S(this,Pr).size)return!0;const o=new Set(i??S(this,Pr));return this.options.throwOnError&&o.add("error"),Object.keys(S(this,Je)).some(a=>{const l=a;return S(this,Je)[l]!==e[l]&&o.has(l)})};X(this,te,S0).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,te,bc).call(this)}},lt=new WeakMap,q=new WeakMap,uo=new WeakMap,Je=new WeakMap,Ds=new WeakMap,jr=new WeakMap,gn=new WeakMap,$n=new WeakMap,co=new WeakMap,Nr=new WeakMap,Er=new WeakMap,Ls=new WeakMap,Fs=new WeakMap,Bn=new WeakMap,Pr=new WeakMap,te=new WeakSet,yi=function(e){X(this,te,_c).call(this);let n=S(this,q).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ut)),n},yc=function(){X(this,te,wc).call(this);const e=rs(this.options.staleTime,S(this,q));if(Qs||S(this,Je).isStale||!dc(e))return;const s=g0(S(this,Je).dataUpdatedAt,e)+1;I(this,Ls,Ns.setTimeout(()=>{S(this,Je).isStale||this.updateResult()},s))},xc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,q)):this.options.refetchInterval)??!1},vc=function(e){X(this,te,kc).call(this),I(this,Bn,e),!(Qs||jt(this.options.enabled,S(this,q))===!1||!dc(S(this,Bn))||S(this,Bn)===0)&&I(this,Fs,Ns.setInterval(()=>{(this.options.refetchIntervalInBackground||Md.isFocused())&&X(this,te,yi).call(this)},S(this,Bn)))},bc=function(){X(this,te,yc).call(this),X(this,te,vc).call(this,X(this,te,xc).call(this))},wc=function(){S(this,Ls)&&(Ns.clearTimeout(S(this,Ls)),I(this,Ls,void 0))},kc=function(){S(this,Fs)&&(Ns.clearInterval(S(this,Fs)),I(this,Fs,void 0))},_c=function(){const e=S(this,lt).getQueryCache().build(S(this,lt),this.options);if(e===S(this,q))return;const n=S(this,q);I(this,q,e),I(this,uo,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},S0=function(e){ze.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(S(this,Je))}),S(this,lt).getQueryCache().notify({query:S(this,q),type:"observerResultsUpdated"})})},Zp);function Ob(t,e){return jt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function xf(t,e){return Ob(t,e)||t.state.data!==void 0&&Sc(t,e,e.refetchOnMount)}function Sc(t,e,n){if(jt(e.enabled,t)!==!1&&rs(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&Rd(t,e)}return!1}function vf(t,e,n,s){return(t!==e||jt(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Rd(t,n)}function Rd(t,e){return jt(e.enabled,t)!==!1&&t.isStaleByTime(rs(e.staleTime,t))}function Db(t,e){return!hc(t.getCurrentResult(),e)}function bf(t){return{onFetch:(e,n)=>{var d,h,f,p,y;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=((y=e.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const b=v=>{Cb(v,()=>e.signal,()=>m=!0)},g=x0(e.options,e.fetchOptions),x=async(v,w,j)=>{if(m)return Promise.reject();if(w==null&&v.pages.length)return Promise.resolve(v);const k=(()=>{const T={client:e.client,queryKey:e.queryKey,pageParam:w,direction:j?"backward":"forward",meta:e.options.meta};return b(T),T})(),N=await g(k),{maxPages:R}=e.options,C=j?Sb:_b;return{pages:C(v.pages,N,R),pageParams:C(v.pageParams,w,R)}};if(r&&i.length){const v=r==="backward",w=v?Lb:wf,j={pages:i,pageParams:o},E=w(s,j);a=await x(j,E,v)}else{const v=t??i.length;do{const w=l===0?o[0]??s.initialPageParam:wf(s,a);if(l>0&&w==null)break;a=await x(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 wf(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 Lb(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 ho,nn,Ze,Is,sn,Rn,em,Fb=(em=class extends k0{constructor(e){super();B(this,sn);B(this,ho);B(this,nn);B(this,Ze);B(this,Is);I(this,ho,e.client),this.mutationId=e.mutationId,I(this,Ze,e.mutationCache),I(this,nn,[]),this.state=e.state||Ib(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){S(this,nn).includes(e)||(S(this,nn).push(e),this.clearGcTimeout(),S(this,Ze).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){I(this,nn,S(this,nn).filter(n=>n!==e)),this.scheduleGc(),S(this,Ze).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){S(this,nn).length||(this.state.status==="pending"?this.scheduleGc():S(this,Ze).remove(this))}continue(){var e;return((e=S(this,Is))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,d,h,f,p,y,m,b,g,x,v,w,j,E,k,N,R;const n=()=>{X(this,sn,Rn).call(this,{type:"continue"})},s={client:S(this,ho),meta:this.options.meta,mutationKey:this.options.mutationKey};I(this,Is,w0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(C,T)=>{X(this,sn,Rn).call(this,{type:"failed",failureCount:C,error:T})},onPause:()=>{X(this,sn,Rn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,Ze).canRun(this)}));const r=this.state.status==="pending",i=!S(this,Is).canStart();try{if(r)n();else{X(this,sn,Rn).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=S(this,Ze).config).onMutate)==null?void 0:a.call(o,e,this,s));const T=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,s));T!==this.state.context&&X(this,sn,Rn).call(this,{type:"pending",context:T,variables:e,isPaused:i})}const C=await S(this,Is).start();return await((h=(d=S(this,Ze).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=(y=S(this,Ze).config).onSettled)==null?void 0:m.call(y,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)),X(this,sn,Rn).call(this,{type:"success",data:C}),C}catch(C){try{await((v=(x=S(this,Ze).config).onError)==null?void 0:v.call(x,C,e,this.state.context,this,s))}catch(T){Promise.reject(T)}try{await((j=(w=this.options).onError)==null?void 0:j.call(w,C,e,this.state.context,s))}catch(T){Promise.reject(T)}try{await((k=(E=S(this,Ze).config).onSettled)==null?void 0:k.call(E,void 0,C,this.state.variables,this.state.context,this,s))}catch(T){Promise.reject(T)}try{await((R=(N=this.options).onSettled)==null?void 0:R.call(N,void 0,C,e,this.state.context,s))}catch(T){Promise.reject(T)}throw X(this,sn,Rn).call(this,{type:"error",error:C}),C}finally{S(this,Ze).runNext(this)}}},ho=new WeakMap,nn=new WeakMap,Ze=new WeakMap,Is=new WeakMap,sn=new WeakSet,Rn=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),ze.batch(()=>{S(this,nn).forEach(s=>{s.onMutationUpdate(e)}),S(this,Ze).notify({mutation:this,type:"updated",action:e})})},em);function Ib(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yn,$t,fo,tm,Ab=(tm=class extends vo{constructor(e={}){super();B(this,yn);B(this,$t);B(this,fo);this.config=e,I(this,yn,new Set),I(this,$t,new Map),I(this,fo,0)}build(e,n,s){const r=new Fb({client:e,mutationCache:this,mutationId:++jo(this,fo)._,options:e.defaultMutationOptions(n),state:s});return this.add(r),r}add(e){S(this,yn).add(e);const n=Uo(e);if(typeof n=="string"){const s=S(this,$t).get(n);s?s.push(e):S(this,$t).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(S(this,yn).delete(e)){const n=Uo(e);if(typeof n=="string"){const s=S(this,$t).get(n);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&S(this,$t).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Uo(e);if(typeof n=="string"){const s=S(this,$t).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=Uo(e);if(typeof n=="string"){const r=(s=S(this,$t).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(){ze.batch(()=>{S(this,yn).forEach(e=>{this.notify({type:"removed",mutation:e})}),S(this,yn).clear(),S(this,$t).clear()})}getAll(){return Array.from(S(this,yn))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>ff(n,s))}findAll(e={}){return this.getAll().filter(n=>ff(e,n))}notify(e){ze.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return ze.batch(()=>Promise.all(e.map(n=>n.continue().catch(ut))))}},yn=new WeakMap,$t=new WeakMap,fo=new WeakMap,tm);function Uo(t){var e;return(e=t.options.scope)==null?void 0:e.id}var rn,nm,zb=(nm=class extends vo{constructor(e={}){super();B(this,rn);this.config=e,I(this,rn,new Map)}build(e,n,s){const r=n.queryKey,i=n.queryHash??Pd(r,n);let o=this.get(i);return o||(o=new Mb({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){S(this,rn).has(e.queryHash)||(S(this,rn).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=S(this,rn).get(e.queryHash);n&&(e.destroy(),n===e&&S(this,rn).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ze.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return S(this,rn).get(e)}getAll(){return[...S(this,rn).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>hf(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>hf(e,s)):n}notify(e){ze.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){ze.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ze.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rn=new WeakMap,nm),_e,Hn,Wn,Tr,Mr,Un,Rr,Or,sm,$b=(sm=class{constructor(t={}){B(this,_e);B(this,Hn);B(this,Wn);B(this,Tr);B(this,Mr);B(this,Un);B(this,Rr);B(this,Or);I(this,_e,t.queryCache||new zb),I(this,Hn,t.mutationCache||new Ab),I(this,Wn,t.defaultOptions||{}),I(this,Tr,new Map),I(this,Mr,new Map),I(this,Un,0)}mount(){jo(this,Un)._++,S(this,Un)===1&&(I(this,Rr,Md.subscribe(async t=>{t&&(await this.resumePausedMutations(),S(this,_e).onFocus())})),I(this,Or,Qa.subscribe(async t=>{t&&(await this.resumePausedMutations(),S(this,_e).onOnline())})))}unmount(){var t,e;jo(this,Un)._--,S(this,Un)===0&&((t=S(this,Rr))==null||t.call(this),I(this,Rr,void 0),(e=S(this,Or))==null||e.call(this),I(this,Or,void 0))}isFetching(t){return S(this,_e).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return S(this,Hn).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=S(this,_e).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=S(this,_e).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(rs(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return S(this,_e).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=S(this,_e).get(s.queryHash),i=r==null?void 0:r.state.data,o=bb(e,i);if(o!==void 0)return S(this,_e).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return ze.batch(()=>S(this,_e).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=S(this,_e).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=S(this,_e);ze.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=S(this,_e);return ze.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},s=ze.batch(()=>S(this,_e).findAll(t).map(r=>r.cancel(n)));return Promise.all(s).then(ut).catch(ut)}invalidateQueries(t,e={}){return ze.batch(()=>(S(this,_e).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=ze.batch(()=>S(this,_e).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(ut)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(ut)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=S(this,_e).build(this,e);return n.isStaleByTime(rs(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ut).catch(ut)}fetchInfiniteQuery(t){return t.behavior=bf(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ut).catch(ut)}ensureInfiniteQueryData(t){return t.behavior=bf(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Qa.isOnline()?S(this,Hn).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,_e)}getMutationCache(){return S(this,Hn)}getDefaultOptions(){return S(this,Wn)}setDefaultOptions(t){I(this,Wn,t)}setQueryDefaults(t,e){S(this,Tr).set(Zi(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...S(this,Tr).values()],n={};return e.forEach(s=>{eo(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){S(this,Mr).set(Zi(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...S(this,Mr).values()],n={};return e.forEach(s=>{eo(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...S(this,Wn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Pd(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===Td&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...S(this,Wn).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){S(this,_e).clear(),S(this,Hn).clear()}},_e=new WeakMap,Hn=new WeakMap,Wn=new WeakMap,Tr=new WeakMap,Mr=new WeakMap,Un=new WeakMap,Rr=new WeakMap,Or=new WeakMap,sm),C0=_.createContext(void 0),Bb=t=>{const e=_.useContext(C0);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Hb=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(C0.Provider,{value:t,children:e})),j0=_.createContext(!1),Wb=()=>_.useContext(j0);j0.Provider;function Ub(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Vb=_.createContext(Ub()),Qb=()=>_.useContext(Vb),Yb=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?v0(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},Kb=t=>{_.useEffect(()=>{t.clearReset()},[t])},Xb=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(r&&t.data===void 0||v0(n,[t.error,s])),qb=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))}},Gb=(t,e)=>t.isLoading&&t.isFetching&&!e,Jb=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,kf=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Zb(t,e,n){var f,p,y,m;const s=Wb(),r=Qb(),i=Bb(),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",qb(o),Yb(o,r,a),Kb(r);const l=!i.getQueryCache().get(o.queryHash),[u]=_.useState(()=>new e(i,o)),d=u.getOptimisticResult(o),h=!s&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const g=h?u.subscribe(ze.batchCalls(b)):ut;return u.updateResult(),g},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),_.useEffect(()=>{u.setOptions(o)},[o,u]),Jb(o,d))throw kf(o,u,r);if(Xb({result:d,errorResetBoundary:r,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw d.error;if((m=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||m.call(y,o,d),o.experimental_prefetchInRender&&!Qs&&Gb(d,s)){const b=l?kf(o,u,r):a==null?void 0:a.promise;b==null||b.catch(ut).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?d:u.trackResult(d)}function wl(t,e){return Zb(t,Rb)}/**
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 _f="popstate";function ew(t={}){function e(s,r){let{pathname:i,search:o,hash:a}=s.location;return Cc("",{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:to(r)}return nw(e,n,null,t)}function me(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Dt(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function tw(){return Math.random().toString(36).substring(2,10)}function Sf(t,e){return{usr:t.state,key:t.key,idx:e}}function Cc(t,e,n=null,s){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Qr(e):e,state:n,key:e&&e.key||s||tw()}}function to({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 Qr(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 nw(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 x=Cc(m.location,b,g);u=d()+1;let v=Sf(x,u),w=m.createHref(x);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 x=Cc(m.location,b,g);u=d();let v=Sf(x,u),w=m.createHref(x);o.replaceState(v,"",w),i&&l&&l({action:a,location:m.location,delta:0})}function y(b){return sw(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(_f,h),l=b,()=>{r.removeEventListener(_f,h),l=null}},createHref(b){return e(r,b)},createURL:y,encodeLocation(b){let g=y(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:p,go(b){return o.go(b)}};return m}function sw(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),me(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:to(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function N0(t,e,n="/"){return rw(t,e,n,!1)}function rw(t,e,n,s){let r=typeof e=="string"?Qr(e):e,i=jn(r.pathname||"/",n);if(i==null)return null;let o=E0(t);iw(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=gw(i);a=pw(o[l],u,s)}return a}function E0(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;me(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=wn([s,d.relativePath]),f=n.concat(d);o.children&&o.children.length>0&&(me(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),E0(o.children,e,f,h,l)),!(o.path==null&&!o.index)&&e.push({path:h,score:hw(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 P0(o.path))i(o,a,!0,u)}),e}function P0(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=P0(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 iw(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:fw(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var ow=/^:[\w-]+$/,aw=3,lw=2,uw=1,cw=10,dw=-2,Cf=t=>t==="*";function hw(t,e){let n=t.split("/"),s=n.length;return n.some(Cf)&&(s+=dw),e&&(s+=lw),n.filter(r=>!Cf(r)).reduce((r,i)=>r+(ow.test(i)?aw:i===""?uw:cw),s)}function fw(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 pw(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=Ya({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!h&&u&&n&&!s[s.length-1].route.index&&(h=Ya({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(r,h.params),o.push({params:r,pathname:wn([i,h.pathname]),pathnameBase:bw(wn([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=wn([i,h.pathnameBase]))}return o}function Ya(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=mw(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 y=a[f]||"";o=i.slice(0,i.length-y.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 mw(t,e=!1,n=!0){Dt(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 gw(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Dt(!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 jn(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 T0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yw=t=>T0.test(t);function xw(t,e="/"){let{pathname:n,search:s="",hash:r=""}=typeof t=="string"?Qr(t):t,i;if(n)if(yw(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Dt(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${n}`)}n.startsWith("/")?i=jf(n.substring(1),"/"):i=jf(n,e)}else i=e;return{pathname:i,search:ww(s),hash:kw(r)}}function jf(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 tu(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 vw(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Od(t){let e=vw(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function Dd(t,e,n,s=!1){let r;typeof t=="string"?r=Qr(t):(r={...t},me(!r.pathname||!r.pathname.includes("?"),tu("?","pathname","search",r)),me(!r.pathname||!r.pathname.includes("#"),tu("#","pathname","hash",r)),me(!r.search||!r.search.includes("#"),tu("#","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=xw(r,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}var wn=t=>t.join("/").replace(/\/\/+/g,"/"),bw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),ww=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,kw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,_w=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 Sw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Cw(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var M0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function R0(t,e){let n=t;if(typeof n!="string"||!T0.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(M0)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),a=jn(o.pathname,e);o.origin===i.origin&&a!=null?n=a+o.search+o.hash:r=!0}catch{Dt(!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 O0=["POST","PUT","PATCH","DELETE"];new Set(O0);var jw=["GET",...O0];new Set(jw);var Yr=_.createContext(null);Yr.displayName="DataRouter";var kl=_.createContext(null);kl.displayName="DataRouterState";var Nw=_.createContext(!1),D0=_.createContext({isTransitioning:!1});D0.displayName="ViewTransition";var Ew=_.createContext(new Map);Ew.displayName="Fetchers";var Pw=_.createContext(null);Pw.displayName="Await";var kt=_.createContext(null);kt.displayName="Navigation";var bo=_.createContext(null);bo.displayName="Location";var Kt=_.createContext({outlet:null,matches:[],isDataRoute:!1});Kt.displayName="Route";var Ld=_.createContext(null);Ld.displayName="RouteError";var L0="REACT_ROUTER_ERROR",Tw="REDIRECT",Mw="ROUTE_ERROR_RESPONSE";function Rw(t){if(t.startsWith(`${L0}:${Tw}:{`))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 Ow(t){if(t.startsWith(`${L0}:${Mw}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new _w(e.status,e.statusText,e.data)}catch{}}function Dw(t,{relative:e}={}){me(Kr(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=_.useContext(kt),{hash:r,pathname:i,search:o}=ko(t,{relative:e}),a=i;return n!=="/"&&(a=i==="/"?n:wn([n,i])),s.createHref({pathname:a,search:o,hash:r})}function Kr(){return _.useContext(bo)!=null}function En(){return me(Kr(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(bo).location}var F0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function I0(t){_.useContext(kt).static||_.useLayoutEffect(t)}function wo(){let{isDataRoute:t}=_.useContext(Kt);return t?Yw():Lw()}function Lw(){me(Kr(),"useNavigate() may be used only in the context of a <Router> component.");let t=_.useContext(Yr),{basename:e,navigator:n}=_.useContext(kt),{matches:s}=_.useContext(Kt),{pathname:r}=En(),i=JSON.stringify(Od(s)),o=_.useRef(!1);return I0(()=>{o.current=!0}),_.useCallback((l,u={})=>{if(Dt(o.current,F0),!o.current)return;if(typeof l=="number"){n.go(l);return}let d=Dd(l,JSON.parse(i),r,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:wn([e,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[e,n,i,r,t])}_.createContext(null);function A0(){let{matches:t}=_.useContext(Kt),e=t[t.length-1];return e?e.params:{}}function ko(t,{relative:e}={}){let{matches:n}=_.useContext(Kt),{pathname:s}=En(),r=JSON.stringify(Od(n));return _.useMemo(()=>Dd(t,JSON.parse(r),s,e==="path"),[t,r,s,e])}function Fw(t,e){return z0(t,e)}function z0(t,e,n,s,r){var x;me(Kr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=_.useContext(kt),{matches:o}=_.useContext(Kt),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||"";B0(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=En(),p;if(e){let v=typeof e=="string"?Qr(e):e;me(d==="/"||((x=v.pathname)==null?void 0:x.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 y=p.pathname||"/",m=y;if(d!=="/"){let v=d.replace(/^\//,"").split("/");m="/"+y.replace(/^\//,"").split("/").slice(v.length).join("/")}let b=N0(t,{pathname:m});Dt(h||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Dt(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=Bw(b&&b.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:wn([d,i.encodeLocation?i.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?d:wn([d,i.encodeLocation?i.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),o,n,s,r);return e&&g?_.createElement(bo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},g):g}function Iw(){let t=Qw(),e=Sw(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=_.createElement(_.Fragment,null,_.createElement("p",null,"💿 Hey developer 👋"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:i},"ErrorBoundary")," or"," ",_.createElement("code",{style:i},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:r},n):null,o)}var Aw=_.createElement(Iw,null),$0=class extends _.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=Ow(t.digest);n&&(t=n)}let e=t!==void 0?_.createElement(Kt.Provider,{value:this.props.routeContext},_.createElement(Ld.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?_.createElement(zw,{error:t},e):e}};$0.contextType=Nw;var nu=new WeakMap;function zw({children:t,error:e}){let{basename:n}=_.useContext(kt);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=Rw(e.digest);if(s){let r=nu.get(e);if(r)throw r;let i=R0(s.location,n);if(M0&&!nu.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 nu.set(e,o),o}return _.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function $w({routeContext:t,match:e,children:n}){let s=_.useContext(Yr);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),_.createElement(Kt.Provider,{value:t},n)}function Bw(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);me(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,y=h.route.loader&&!f.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||y){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:Cw(n.matches),errorInfo:h})}:void 0;return i.reduceRight((d,h,f)=>{let p,y=!1,m=null,b=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,m=h.route.errorElement||Aw,a&&(l<0&&f===0?(B0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,b=null):l===f&&(y=!0,b=h.route.hydrateFallbackElement||null)));let g=e.concat(i.slice(0,f+1)),x=()=>{let v;return p?v=m:y?v=b:h.route.Component?v=_.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=d,_.createElement($w,{match:h,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?_.createElement($0,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:u}):x()},null)}function Fd(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hw(t){let e=_.useContext(Yr);return me(e,Fd(t)),e}function Ww(t){let e=_.useContext(kl);return me(e,Fd(t)),e}function Uw(t){let e=_.useContext(Kt);return me(e,Fd(t)),e}function Id(t){let e=Uw(t),n=e.matches[e.matches.length-1];return me(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Vw(){return Id("useRouteId")}function Qw(){var s;let t=_.useContext(Ld),e=Ww("useRouteError"),n=Id("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function Yw(){let{router:t}=Hw("useNavigate"),e=Id("useNavigate"),n=_.useRef(!1);return I0(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{Dt(n.current,F0),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...i}))},[t,e])}var Nf={};function B0(t,e,n){!e&&!Nf[t]&&(Nf[t]=!0,Dt(!1,n))}_.memo(Kw);function Kw({routes:t,future:e,state:n,onError:s}){return z0(t,void 0,n,s,e)}function Xw({to:t,replace:e,state:n,relative:s}){me(Kr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=_.useContext(kt);Dt(!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}=_.useContext(Kt),{pathname:o}=En(),a=wo(),l=Dd(t,Od(i),o,s==="path"),u=JSON.stringify(l);return _.useEffect(()=>{a(JSON.parse(u),{replace:e,state:n,relative:s})},[a,u,s,e,n]),null}function xi(t){me(!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 qw({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:r,static:i=!1,unstable_useTransitions:o}){me(!Kr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=_.useMemo(()=>({basename:a,navigator:r,static:i,unstable_useTransitions:o,future:{}}),[a,r,i,o]);typeof n=="string"&&(n=Qr(n));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:p="default"}=n,y=_.useMemo(()=>{let m=jn(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 Dt(y!=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.`),y==null?null:_.createElement(kt.Provider,{value:l},_.createElement(bo.Provider,{children:e,value:y}))}function Gw({children:t,location:e}){return Fw(jc(t),e)}function jc(t,e=[]){let n=[];return _.Children.forEach(t,(s,r)=>{if(!_.isValidElement(s))return;let i=[...e,r];if(s.type===_.Fragment){n.push.apply(n,jc(s.props.children,i));return}me(s.type===xi,`[${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>`),me(!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=jc(s.props.children,i)),n.push(o)}),n}var ga="get",ya="application/x-www-form-urlencoded";function _l(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Jw(t){return _l(t)&&t.tagName.toLowerCase()==="button"}function Zw(t){return _l(t)&&t.tagName.toLowerCase()==="form"}function e1(t){return _l(t)&&t.tagName.toLowerCase()==="input"}function t1(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function n1(t,e){return t.button===0&&(!e||e==="_self")&&!t1(t)}var Vo=null;function s1(){if(Vo===null)try{new FormData(document.createElement("form"),0),Vo=!1}catch{Vo=!0}return Vo}var r1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function su(t){return t!=null&&!r1.has(t)?(Dt(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ya}"`),null):t}function i1(t,e){let n,s,r,i,o;if(Zw(t)){let a=t.getAttribute("action");s=a?jn(a,e):null,n=t.getAttribute("method")||ga,r=su(t.getAttribute("enctype"))||ya,i=new FormData(t)}else if(Jw(t)||e1(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?jn(l,e):null,n=t.getAttribute("formmethod")||a.getAttribute("method")||ga,r=su(t.getAttribute("formenctype"))||su(a.getAttribute("enctype"))||ya,i=new FormData(a,t),!s1()){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(_l(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ga,s=null,r=ya,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 Ad(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function o1(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&&jn(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${n}`,s}async function a1(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 l1(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 u1(t,e,n){let s=await Promise.all(t.map(async r=>{let i=e.routes[r.route.id];if(i){let o=await a1(i,n);return o.links?o.links():[]}return[]}));return f1(s.flat(1).filter(l1).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Ef(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 c1(t,e,{includeHydrateFallback:n}={}){return d1(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 d1(t){return[...new Set(t)]}function h1(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function f1(t,e){let n=new Set;return new Set(e),t.reduce((s,r)=>{let i=JSON.stringify(h1(r));return n.has(i)||(n.add(i),s.push({key:i,link:r})),s},[])}function H0(){let t=_.useContext(Yr);return Ad(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function p1(){let t=_.useContext(kl);return Ad(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var zd=_.createContext(void 0);zd.displayName="FrameworkContext";function W0(){let t=_.useContext(zd);return Ad(t,"You must render this element inside a <HydratedRouter> element"),t}function m1(t,e){let n=_.useContext(zd),[s,r]=_.useState(!1),[i,o]=_.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=e,f=_.useRef(null);_.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let m=g=>{g.forEach(x=>{o(x.isIntersecting)})},b=new IntersectionObserver(m,{threshold:.5});return f.current&&b.observe(f.current),()=>{b.disconnect()}}},[t]),_.useEffect(()=>{if(s){let m=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(m)}}},[s]);let p=()=>{r(!0)},y=()=>{r(!1),o(!1)};return n?t!=="intent"?[i,f,{}]:[i,f,{onFocus:ii(a,p),onBlur:ii(l,y),onMouseEnter:ii(u,p),onMouseLeave:ii(d,y),onTouchStart:ii(h,p)}]:[!1,f,{}]}function ii(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function g1({page:t,...e}){let{router:n}=H0(),s=_.useMemo(()=>N0(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?_.createElement(x1,{page:t,matches:s,...e}):null}function y1(t){let{manifest:e,routeModules:n}=W0(),[s,r]=_.useState([]);return _.useEffect(()=>{let i=!1;return u1(t,e,n).then(o=>{i||r(o)}),()=>{i=!0}},[t,e,n]),s}function x1({page:t,matches:e,...n}){let s=En(),{manifest:r,routeModules:i}=W0(),{basename:o}=H0(),{loaderData:a,matches:l}=p1(),u=_.useMemo(()=>Ef(t,e,l,r,s,"data"),[t,e,l,r,s]),d=_.useMemo(()=>Ef(t,e,l,r,s,"assets"),[t,e,l,r,s]),h=_.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let y=new Set,m=!1;if(e.forEach(g=>{var v;let x=r.routes[g.route.id];!x||!x.hasLoader||(!u.some(w=>w.route.id===g.route.id)&&g.route.id in a&&((v=i[g.route.id])!=null&&v.shouldRevalidate)||x.hasClientLoader?m=!0:y.add(g.route.id))}),y.size===0)return[];let b=o1(t,o,"data");return m&&y.size>0&&b.searchParams.set("_routes",e.filter(g=>y.has(g.route.id)).map(g=>g.route.id).join(",")),[b.pathname+b.search]},[o,a,s,r,u,e,t,i]),f=_.useMemo(()=>c1(d,r),[d,r]),p=y1(d);return _.createElement(_.Fragment,null,h.map(y=>_.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),f.map(y=>_.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),p.map(({key:y,link:m})=>_.createElement("link",{key:y,nonce:n.nonce,...m})))}function v1(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var b1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{b1&&(window.__reactRouterVersion="7.11.0")}catch{}function w1({basename:t,children:e,unstable_useTransitions:n,window:s}){let r=_.useRef();r.current==null&&(r.current=ew({window:s,v5Compat:!0}));let i=r.current,[o,a]=_.useState({action:i.action,location:i.location}),l=_.useCallback(u=>{n===!1?a(u):_.startTransition(()=>a(u))},[n]);return _.useLayoutEffect(()=>i.listen(l),[i,l]),_.createElement(qw,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:i,unstable_useTransitions:n})}var U0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$d=_.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},y){let{basename:m,unstable_useTransitions:b}=_.useContext(kt),g=typeof u=="string"&&U0.test(u),x=R0(u,m);u=x.to;let v=Dw(u,{relative:r}),[w,j,E]=m1(s,p),k=C1(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=_.createElement("a",{...p,...E,href:x.absoluteURL||v,onClick:x.isExternal||i?e:N,ref:v1(y,j),target:l,"data-discover":!g&&n==="render"?"true":void 0});return w&&!g?_.createElement(_.Fragment,null,R,_.createElement(g1,{page:v})):R});$d.displayName="Link";var k1=_.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=ko(o,{relative:u.relative}),f=En(),p=_.useContext(kl),{navigator:y,basename:m}=_.useContext(kt),b=p!=null&&T1(h)&&a===!0,g=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,x=f.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(x=x.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=jn(v,m)||v);const w=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let j=x===g||!r&&x.startsWith(g)&&x.charAt(w)==="/",E=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)==="/"),k={isActive:j,isPending:E,isTransitioning:b},N=j?e:void 0,R;typeof s=="function"?R=s(k):R=[s,j?"active":null,E?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let C=typeof i=="function"?i(k):i;return _.createElement($d,{...u,"aria-current":N,className:R,ref:d,style:C,to:o,viewTransition:a},typeof l=="function"?l(k):l)});k1.displayName="NavLink";var _1=_.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:r,state:i,method:o=ga,action:a,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},y)=>{let{unstable_useTransitions:m}=_.useContext(kt),b=E1(),g=P1(a,{relative:u}),x=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&U0.test(a),w=j=>{if(l&&l(j),j.defaultPrevented)return;j.preventDefault();let E=j.nativeEvent.submitter,k=(E==null?void 0:E.getAttribute("formmethod"))||o,N=()=>b(E||j.currentTarget,{fetcherKey:e,method:k,navigate:n,replace:r,state:i,relative:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f});m&&n!==!1?_.startTransition(()=>N()):N()};return _.createElement("form",{ref:y,method:x,action:g,onSubmit:s?l:w,...p,"data-discover":!v&&t==="render"?"true":void 0})});_1.displayName="Form";function S1(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function V0(t){let e=_.useContext(Yr);return me(e,S1(t)),e}function C1(t,{target:e,replace:n,state:s,preventScrollReset:r,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a,unstable_useTransitions:l}={}){let u=wo(),d=En(),h=ko(t,{relative:i});return _.useCallback(f=>{if(n1(f,e)){f.preventDefault();let p=n!==void 0?n:to(d)===to(h),y=()=>u(t,{replace:p,state:s,preventScrollReset:r,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a});l?_.startTransition(()=>y()):y()}},[d,u,h,n,s,e,t,r,i,o,a,l])}var j1=0,N1=()=>`__${String(++j1)}__`;function E1(){let{router:t}=V0("useSubmit"),{basename:e}=_.useContext(kt),n=Vw(),s=t.fetch,r=t.navigate;return _.useCallback(async(i,o={})=>{let{action:a,method:l,encType:u,formData:d,body:h}=i1(i,e);if(o.navigate===!1){let f=o.fetcherKey||N1();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 P1(t,{relative:e}={}){let{basename:n}=_.useContext(kt),s=_.useContext(Kt);me(s,"useFormAction must be used inside a RouteContext");let[r]=s.matches.slice(-1),i={...ko(t||".",{relative:e})},o=En();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:wn([n,i.pathname])),to(i)}function T1(t,{relative:e}={}){let n=_.useContext(D0);me(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=V0("useViewTransitionState"),r=ko(t,{relative:e});if(!n.isTransitioning)return!1;let i=jn(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=jn(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Ya(r.pathname,o)!=null||Ya(r.pathname,i)!=null}function Xt(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 Ys(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const Q0=6048e5,M1=864e5;let R1={};function Sl(){return R1}function no(t,e){var a,l,u,d;const n=Sl(),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=Xt(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 Ka(t){return no(t,{weekStartsOn:1})}function Y0(t){const e=Xt(t),n=e.getFullYear(),s=Ys(t,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const r=Ka(s),i=Ys(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Ka(i);return e.getTime()>=r.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function Pf(t){const e=Xt(t);return e.setHours(0,0,0,0),e}function Tf(t){const e=Xt(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 O1(t,e){const n=Pf(t),s=Pf(e),r=+n-Tf(n),i=+s-Tf(s);return Math.round((r-i)/M1)}function D1(t){const e=Y0(t),n=Ys(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Ka(n)}function L1(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function F1(t){if(!L1(t)&&typeof t!="number")return!1;const e=Xt(t);return!isNaN(Number(e))}function I1(t){const e=Xt(t),n=Ys(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const A1={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"}},z1=(t,e,n)=>{let s;const r=A1[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 ru(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const $1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},B1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},W1={date:ru({formats:$1,defaultWidth:"full"}),time:ru({formats:B1,defaultWidth:"full"}),dateTime:ru({formats:H1,defaultWidth:"full"})},U1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},V1=(t,e,n,s)=>U1[t];function oi(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 Q1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Y1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},K1={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"]},X1={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"]},q1={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"}},G1={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"}},J1=(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"},Z1={ordinalNumber:J1,era:oi({values:Q1,defaultWidth:"wide"}),quarter:oi({values:Y1,defaultWidth:"wide",argumentCallback:t=>t-1}),month:oi({values:K1,defaultWidth:"wide"}),day:oi({values:X1,defaultWidth:"wide"}),dayPeriod:oi({values:q1,defaultWidth:"wide",formattingValues:G1,defaultFormattingWidth:"wide"})};function ai(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)?tk(a,h=>h.test(o)):ek(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 ek(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function tk(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function nk(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 sk=/^(\d+)(th|st|nd|rd)?/i,rk=/\d+/i,ik={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},ok={any:[/^b/i,/^(a|c)/i]},ak={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},lk={any:[/1/i,/2/i,/3/i,/4/i]},uk={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},ck={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]},dk={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},hk={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]},fk={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},pk={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}},mk={ordinalNumber:nk({matchPattern:sk,parsePattern:rk,valueCallback:t=>parseInt(t,10)}),era:ai({matchPatterns:ik,defaultMatchWidth:"wide",parsePatterns:ok,defaultParseWidth:"any"}),quarter:ai({matchPatterns:ak,defaultMatchWidth:"wide",parsePatterns:lk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ai({matchPatterns:uk,defaultMatchWidth:"wide",parsePatterns:ck,defaultParseWidth:"any"}),day:ai({matchPatterns:dk,defaultMatchWidth:"wide",parsePatterns:hk,defaultParseWidth:"any"}),dayPeriod:ai({matchPatterns:fk,defaultMatchWidth:"any",parsePatterns:pk,defaultParseWidth:"any"})},gk={code:"en-US",formatDistance:z1,formatLong:W1,formatRelative:V1,localize:Z1,match:mk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yk(t){const e=Xt(t);return O1(e,I1(e))+1}function xk(t){const e=Xt(t),n=+Ka(e)-+D1(e);return Math.round(n/Q0)+1}function K0(t,e){var d,h,f,p;const n=Xt(t),s=n.getFullYear(),r=Sl(),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=Ys(t,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const a=no(o,e),l=Ys(t,0);l.setFullYear(s,0,i),l.setHours(0,0,0,0);const u=no(l,e);return n.getTime()>=a.getTime()?s+1:n.getTime()>=u.getTime()?s:s-1}function vk(t,e){var a,l,u,d;const n=Sl(),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=K0(t,e),i=Ys(t,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),no(i,e)}function bk(t,e){const n=Xt(t),s=+no(n,e)-+vk(n,e);return Math.round(s/Q0)+1}function ne(t,e){const n=t<0?"-":"",s=Math.abs(t).toString().padStart(e,"0");return n+s}const Tn={y(t,e){const n=t.getFullYear(),s=n>0?n:1-n;return ne(e==="yy"?s%100:s,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):ne(n+1,2)},d(t,e){return ne(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 ne(t.getHours()%12||12,e.length)},H(t,e){return ne(t.getHours(),e.length)},m(t,e){return ne(t.getMinutes(),e.length)},s(t,e){return ne(t.getSeconds(),e.length)},S(t,e){const n=e.length,s=t.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return ne(r,e.length)}},Js={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Mf={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 Tn.y(t,e)},Y:function(t,e,n,s){const r=K0(t,s),i=r>0?r:1-r;if(e==="YY"){const o=i%100;return ne(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):ne(i,e.length)},R:function(t,e){const n=Y0(t);return ne(n,e.length)},u:function(t,e){const n=t.getFullYear();return ne(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 ne(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 ne(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 Tn.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 ne(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=bk(t,s);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):ne(r,e.length)},I:function(t,e,n){const s=xk(t);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):ne(s,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Tn.d(t,e)},D:function(t,e,n){const s=yk(t);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ne(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 ne(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 ne(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 ne(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=Js.noon:s===0?r=Js.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=Js.evening:s>=12?r=Js.afternoon:s>=4?r=Js.morning:r=Js.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 Tn.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Tn.H(t,e)},K:function(t,e,n){const s=t.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ne(s,e.length)},k:function(t,e,n){let s=t.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):ne(s,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Tn.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Tn.s(t,e)},S:function(t,e){return Tn.S(t,e)},X:function(t,e,n){const s=t.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Of(s);case"XXXX":case"XX":return ks(s);case"XXXXX":case"XXX":default:return ks(s,":")}},x:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"x":return Of(s);case"xxxx":case"xx":return ks(s);case"xxxxx":case"xxx":default:return ks(s,":")}},O:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Rf(s,":");case"OOOO":default:return"GMT"+ks(s,":")}},z:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Rf(s,":");case"zzzz":default:return"GMT"+ks(s,":")}},t:function(t,e,n){const s=Math.trunc(t.getTime()/1e3);return ne(s,e.length)},T:function(t,e,n){const s=t.getTime();return ne(s,e.length)}};function Rf(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+ne(i,2)}function Of(t,e){return t%60===0?(t>0?"-":"+")+ne(Math.abs(t)/60,2):ks(t,e)}function ks(t,e=""){const n=t>0?"-":"+",s=Math.abs(t),r=ne(Math.trunc(s/60),2),i=ne(s%60,2);return n+r+e+i}const Df=(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"})}},X0=(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"})}},wk=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return Df(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}}",Df(s,e)).replace("{{time}}",X0(r,e))},kk={p:X0,P:wk},_k=/^D+$/,Sk=/^Y+$/,Ck=["D","DD","YY","YYYY"];function jk(t){return _k.test(t)}function Nk(t){return Sk.test(t)}function Ek(t,e,n){const s=Pk(t,e,n);if(console.warn(s),Ck.includes(t))throw new RangeError(s)}function Pk(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 Tk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Rk=/^'([^]*?)'?$/,Ok=/''/g,Dk=/[a-zA-Z]/;function tt(t,e,n){var d,h,f,p;const s=Sl(),r=s.locale??gk,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=Xt(t);if(!F1(a))throw new RangeError("Invalid time value");let l=e.match(Mk).map(y=>{const m=y[0];if(m==="p"||m==="P"){const b=kk[m];return b(y,r.formatLong)}return y}).join("").match(Tk).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const m=y[0];if(m==="'")return{isToken:!1,value:Lk(y)};if(Mf[m])return{isToken:!0,value:y};if(m.match(Dk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:y}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return l.map(y=>{if(!y.isToken)return y.value;const m=y.value;(Nk(m)||jk(m))&&Ek(m,e,String(t));const b=Mf[m[0]];return b(a,m,r.localize,u)}).join("")}function Lk(t){const e=t.match(Rk);return e?e[1].replace(Ok,"'"):t}function Fk({id:t,name:e,sessionCount:n,lastActivity:s,sessions:r,selectedId:i,onSelectSession:o,onNavigateToProject:a,initialExpanded:l=!1}){const[u,d]=_.useState(l),[h,f]=_.useState(l);_.useEffect(()=>{i&&r.some(m=>{var b;return m.id===i||((b=m.agentSessions)==null?void 0:b.some(g=>g.id===i))})&&d(!0)},[i,r]);const p=200;return _.useEffect(()=>{let y;return u?f(!0):y=window.setTimeout(()=>{f(!1)},p),()=>{y!==void 0&&window.clearTimeout(y)}},[u]),c.jsxs("div",{className:"border-b border-gray-700",children:[c.jsxs("div",{className:"sticky top-0 z-10 bg-gray-900 relative",children:[c.jsxs("button",{onClick:()=>d(!u),className:"w-full text-left p-4 hover:bg-gray-800 transition-all duration-200",children:[c.jsxs("div",{className:"flex items-start gap-2 transition-all duration-200",style:{paddingRight:u?"36px":"0",transition:"padding-right 200ms"},children:[c.jsx("svg",{className:`w-4 h-4 flex-shrink-0 transition-transform ${u?"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 break-words",children:e})]}),c.jsxs("div",{className:"text-xs text-gray-400 mt-1 ml-6 break-words",children:[n," session",n!==1?"s":""]})]}),c.jsx("button",{onClick:y=>{y.stopPropagation(),a(t)},className:`absolute top-4 right-2 p-1.5 rounded-lg bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-white transition-all duration-200 z-10 ${u?"opacity-100 scale-100":"opacity-0 scale-90 pointer-events-none"}`,title:"Project Dashboard",tabIndex:u?0:-1,children:c.jsx("svg",{className:"w-4 h-4",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",{className:"transition-all overflow-hidden",style:{maxHeight:u?`${r.length*150}px`:"0",transitionDuration:`${p}ms`},children:c.jsx("div",{className:"bg-gray-900/50 transition-opacity",style:{opacity:h?1:0,transitionDuration:`${p}ms`},children:r.map(y=>c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>o(y.id),className:`w-full text-left px-4 py-3 pl-8 hover:bg-gray-700/50 transition-colors border-l-2 ${i===y.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[y.title&&c.jsx("div",{className:"text-sm font-medium text-gray-200 mb-1 truncate",children:y.title}),c.jsx("div",{className:"text-xs text-gray-400",children:tt(new Date(y.timestamp),"PPpp")}),c.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[y.messageCount," message",y.messageCount!==1?"s":"",y.agentSessions&&y.agentSessions.length>0&&c.jsxs("span",{className:"ml-2",children:["· ",y.agentSessions.length," task",y.agentSessions.length!==1?"s":""]})]})]}),y.agentSessions&&y.agentSessions.length>0&&c.jsx("div",{className:"bg-gray-900/70",children:y.agentSessions.map(m=>c.jsxs("button",{onClick:()=>o(m.id),className:`w-full text-left px-4 py-2 pl-14 hover:bg-gray-700/50 transition-colors border-l-2 ${i===m.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"}),m.title&&c.jsx("span",{className:"text-sm font-medium text-gray-300 truncate",children:m.title})]}),c.jsx("div",{className:"text-xs text-gray-400",children:tt(new Date(m.timestamp),"PPpp")}),c.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[m.messageCount," message",m.messageCount!==1?"s":""]})]},m.id))})]},y.id))})})]})}function Ik({projects:t,selectedId:e,onSelect:n,onNavigateToProject:s}){const r=i=>e?i.sessions.some(o=>{var a;return o.id===e||((a=o.agentSessions)==null?void 0:a.some(l=>l.id===e))}):!1;return c.jsx("div",{children:t.map(i=>c.jsx(Fk,{id:i.id,name:i.name,sessionCount:i.sessionCount,lastActivity:i.lastActivity,sessions:i.sessions,selectedId:e,onSelectSession:n,onNavigateToProject:s,initialExpanded:r(i)},i.id))})}function Ak({messages:t,activeId:e,onNavigate:n}){const[s,r]=_.useState([]),i=_.useRef(null),o=_.useRef(null);_.useEffect(()=>{const l=t.map((u,d)=>{var y;const h=`message-${d}`;let f="";const p=[];if((y=u.message)!=null&&y.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]),_.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 Nc=256,Lf=640,zk=896,$k=zk+Nc;function Bk(t){var s,r,i;const e=o=>o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),n=((s=t.messages)==null?void 0:s.map((o,a)=>{var h,f;let l="";o.type!=="user"&&o.type!=="assistant"?l=`<pre class="tool-content">${e(JSON.stringify(o,null,2))}</pre>`:(h=o.message)!=null&&h.content&&Array.isArray(o.message.content)?o.message.content.forEach(p=>{if(p.type==="text")l+=`<div class="message-text">${e(p.text).replace(/\n/g,"<br>")}</div>`;else if(p.type==="tool_use")l+=`
52
+ <div class="tool-use">
53
+ <div class="tool-header">🔧 Tool: ${e(p.name)}</div>
54
+ <pre class="tool-content">${e(JSON.stringify(p.input,null,2))}</pre>
55
+ </div>
56
+ `;else if(p.type==="tool_result"){const y=typeof p.content=="string"?p.content:JSON.stringify(p.content,null,2);l+=`
57
+ <div class="tool-result">
58
+ <div class="tool-header">✓ Tool Result</div>
59
+ <pre class="tool-content">${e(y)}</pre>
60
+ </div>
61
+ `}}):typeof((f=o.message)==null?void 0:f.content)=="string"&&(l=`<div class="message-text">${e(o.message.content).replace(/\n/g,"<br>")}</div>`);const u=o.type==="user"?"user":o.type==="assistant"?"assistant":"system",d=o.timestamp?tt(new Date(o.timestamp),"HH:mm:ss"):"";return`
62
+ <div class="message ${u}">
63
+ <div class="message-header">
64
+ <span class="message-role">${o.type||"system"}</span>
65
+ <span class="message-number">#${a+1}</span>
66
+ ${d?`<span class="message-time">${d}</span>`:""}
67
+ </div>
68
+ <div class="message-content">
69
+ ${l}
70
+ </div>
71
+ </div>
72
+ `}).join(`
73
+ `))||"";return`<!DOCTYPE html>
74
+ <html lang="en">
75
+ <head>
76
+ <meta charset="UTF-8">
77
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
78
+ <title>${e(t.title||"Claude Session")}</title>
79
+ <style>
80
+ * { margin: 0; padding: 0; box-sizing: border-box; }
81
+ body {
82
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
83
+ line-height: 1.6;
84
+ color: #e5e7eb;
85
+ background: #111827;
86
+ padding: 2rem;
87
+ }
88
+ .container { max-width: 900px; margin: 0 auto; }
89
+ .header {
90
+ border-bottom: 2px solid #374151;
91
+ padding-bottom: 1.5rem;
92
+ margin-bottom: 2rem;
93
+ }
94
+ .header h1 {
95
+ font-size: 2rem;
96
+ margin-bottom: 0.5rem;
97
+ color: #f9fafb;
98
+ }
99
+ .metadata {
100
+ color: #9ca3af;
101
+ font-size: 0.875rem;
102
+ }
103
+ .message {
104
+ border-left: 3px solid #374151;
105
+ padding-left: 1rem;
106
+ margin-bottom: 2rem;
107
+ }
108
+ .message.user { border-left-color: #3b82f6; }
109
+ .message.assistant { border-left-color: #10b981; }
110
+ .message-header {
111
+ display: flex;
112
+ gap: 0.75rem;
113
+ align-items: center;
114
+ margin-bottom: 0.75rem;
115
+ }
116
+ .message-role {
117
+ padding: 0.25rem 0.5rem;
118
+ border-radius: 0.25rem;
119
+ font-size: 0.75rem;
120
+ font-weight: 600;
121
+ text-transform: uppercase;
122
+ }
123
+ .message.user .message-role { background: #1e3a8a; color: #bfdbfe; }
124
+ .message.assistant .message-role { background: #064e3b; color: #a7f3d0; }
125
+ .message.system .message-role { background: #374151; color: #d1d5db; }
126
+ .message-number, .message-time {
127
+ font-size: 0.75rem;
128
+ color: #6b7280;
129
+ font-family: 'Monaco', 'Courier New', monospace;
130
+ }
131
+ .message-content {
132
+ background: #1f2937;
133
+ padding: 1rem;
134
+ border-radius: 0.5rem;
135
+ }
136
+ .message-text {
137
+ color: #e5e7eb;
138
+ margin-bottom: 1rem;
139
+ }
140
+ .message-text:last-child { margin-bottom: 0; }
141
+ .tool-use, .tool-result {
142
+ margin-top: 1rem;
143
+ border: 1px solid #374151;
144
+ border-radius: 0.375rem;
145
+ overflow: hidden;
146
+ }
147
+ .tool-header {
148
+ padding: 0.5rem 0.75rem;
149
+ font-size: 0.75rem;
150
+ font-family: 'Monaco', 'Courier New', monospace;
151
+ font-weight: 600;
152
+ }
153
+ .tool-use .tool-header {
154
+ background: #451a03;
155
+ color: #fcd34d;
156
+ }
157
+ .tool-result .tool-header {
158
+ background: #064e3b;
159
+ color: #6ee7b7;
160
+ }
161
+ .tool-content {
162
+ padding: 0.75rem;
163
+ background: #0f172a;
164
+ color: #9ca3af;
165
+ font-size: 0.75rem;
166
+ overflow-x: auto;
167
+ font-family: 'Monaco', 'Courier New', monospace;
168
+ }
169
+ </style>
170
+ </head>
171
+ <body>
172
+ <div class="container">
173
+ <div class="header">
174
+ <h1>${e(t.title||"Claude Session")}</h1>
175
+ <div class="metadata">
176
+ <div>Project: ${e(t.projectName||t.projectId||"Unknown")}</div>
177
+ ${t.timestamp?`<div>Date: ${tt(new Date(t.timestamp),"PPpp")}</div>`:""}
178
+ <div>${((r=t.messages)==null?void 0:r.length)||0} message${((i=t.messages)==null?void 0:i.length)!==1?"s":""}</div>
179
+ </div>
180
+ </div>
181
+ <div class="messages">
182
+ ${n}
183
+ </div>
184
+ </div>
185
+ </body>
186
+ </html>`}function Hk({sessionId:t,sessionInfo:e}){var Q,Fe,we;const n=wo(),[s,r]=_.useState(null),[i,o]=_.useState(!0),[a,l]=_.useState(null),[u,d]=_.useState(!1),[h,f]=_.useState(null),p=_.useRef(new Map),y=_.useRef(!1),m=_.useRef(null),b=_.useRef(null),g=_.useRef(null),x=_.useRef(null),v=_.useRef(!1),w=_.useRef(0),j=_.useRef(0),E=_.useRef(null),k=_.useRef(null),N=_.useRef(null),R=_.useRef(null),C=_.useRef(null),T=_.useRef(null),z=_.useRef(null),V=_.useRef(null),ve=_.useRef(0),{data:W,isLoading:ie,error:be}=wl({queryKey:["session",t],queryFn:async()=>{const F=await fetch(`/api/sessions/${t}`);if(!F.ok)throw new Error("Failed to fetch session");return F.json()}});_.useEffect(()=>{w.current=0,j.current=0,E.current!==null&&(cancelAnimationFrame(E.current),E.current=null),ve.current=0,r(null),m.current=null,v.current=!1;const F=V.current;F&&(F.scrollTop=0)},[t]);const L=F=>{const H=N.current;if(!H)return;const K=14+F*8,oe=1.25+F*.25,U=F,ke=F,_t=Math.max(0,1-U);H.style.padding=`${K}px 24px`,R.current&&(R.current.style.fontSize=`${oe}rem`),C.current&&(C.current.style.opacity=`${U}`,C.current.style.height=U>0?"auto":"0"),T.current&&(T.current.style.opacity=`${ke}`,T.current.style.height=ke>0?"auto":"0",T.current.style.marginTop=ke>0?"1rem":"0"),z.current&&(z.current.style.opacity=`${_t}`,z.current.style.pointerEvents=_t>0?"auto":"none",z.current.style.position=_t>0?"static":"absolute")};_.useEffect(()=>{const F=a;if(!F)return;const H=()=>{var He;const oe=w.current,U=j.current,ke=U+(oe-U)*.2,_t=F.scrollHeight-(ke+F.clientHeight),it=_t<=5,ot=ke<ve.current;let qe=v.current;qe?_t>40&&(qe=!1):it&&(qe=!0),v.current=qe;const ms=Math.max(0,1-(ot?0:qe?80:ke)/80);L(ms),j.current=ke,ve.current=ke,Math.abs(oe-ke)>.5?E.current=requestAnimationFrame(H):(j.current=oe,ve.current=oe,E.current=null,qe&&((He=g.current)==null||He.call(g)))},K=()=>{w.current=F.scrollTop,E.current===null&&(E.current=requestAnimationFrame(H))};return F.addEventListener("scroll",K),()=>{F.removeEventListener("scroll",K),E.current!==null&&(cancelAnimationFrame(E.current),E.current=null)}},[t,a]),_.useEffect(()=>{if(!k.current)return;const F=k.current.parentElement??k.current,H=U=>{o(U>=$k)},K=new ResizeObserver(U=>{for(const ke of U)H(ke.contentRect.width)}),oe=F.getBoundingClientRect().width;return H(oe),K.observe(F),()=>{K.disconnect()}},[]),_.useEffect(()=>{var it;if(!((it=W==null?void 0:W.session)!=null&&it.messages))return;const F=V.current;if(!F)return;const H=new Set;let K=null;const oe=()=>{if(y.current)return;const ot=[];p.current.forEach((Ge,ce)=>{const Ie=Ge.getBoundingClientRect();ot.push({id:ce,element:Ge,rect:Ie})}),ot.sort((Ge,ce)=>Ge.rect.top-ce.rect.top);const qe=F.getBoundingClientRect(),qt=qe.top,ms=qe.bottom;let He=null;for(const Ge of ot){const ce=Ge.rect.top>=qt&&Ge.rect.bottom<=ms,Ie=Ge.rect.bottom>qt&&Ge.rect.top<ms;if(ce){He=Ge.id;break}else Ie&&!He&&(He=Ge.id)}He&&He!==m.current&&r(He)},U=()=>{const ot=x.current;if(y.current&&ot){const ce=p.current.get(ot);if(ce){const Ie=F.getBoundingClientRect(),Co=ce.getBoundingClientRect();if(!(Co.top>=Ie.top&&Co.top<=Ie.top+5))return}y.current=!1,x.current=null}if(v.current){const ce=W.session.messages.length-1,Ie=ce>=0?`message-${ce}`:null;Ie&&Ie!==m.current&&r(Ie);return}if(H.size===0){oe();return}const qe=F.getBoundingClientRect(),qt=qe.top,ms=qe.bottom;let He=null;const Ge=Array.from(H).map(ce=>{const Ie=p.current.get(ce);return Ie?{id:ce,rect:Ie.getBoundingClientRect()}:null}).filter(ce=>!!ce);if(Ge.length===0){oe();return}Ge.sort((ce,Ie)=>ce.rect.top-Ie.rect.top);for(const ce of Ge){const Ie=ce.rect.top>=qt&&ce.rect.bottom<=ms,Co=ce.rect.bottom>qt&&ce.rect.top<ms;if(Ie){He=ce.id;break}else Co&&!He&&(He=ce.id)}He&&He!==m.current&&r(He)},ke=()=>{K!==null&&cancelAnimationFrame(K),K=requestAnimationFrame(()=>{K=null,U()})};g.current=U;const _t=new IntersectionObserver(ot=>{for(const qe of ot){const qt=qe.target.dataset.messageId;qt&&(qe.isIntersecting?H.add(qt):H.delete(qt))}ke()},{root:F,threshold:[0,.1,.5,1]});return p.current.forEach(ot=>_t.observe(ot)),ke(),()=>{_t.disconnect(),g.current=null,K!==null&&cancelAnimationFrame(K)}},[(Q=W==null?void 0:W.session)==null?void 0:Q.messages,a]),_.useEffect(()=>{m.current=s},[s]),_.useEffect(()=>{L(1)},[(Fe=W==null?void 0:W.session)==null?void 0:Fe.id]);const O=_.useCallback(F=>{V.current=F,l(H=>H===F?H:F)},[]),$=(F,H=!1)=>{if(r(F),H){y.current=!0,x.current=F,b.current&&(clearTimeout(b.current),b.current=null);const K=p.current.get(F);K&&K.scrollIntoView({behavior:"smooth",block:"start"}),b.current=setTimeout(()=>{var oe;y.current=!1,x.current=null,b.current=null,(oe=g.current)==null||oe.call(g)},1500)}};if(_.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),ie&&!W&&!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:`${Lf}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(F=>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"})]})})]},F))})})]}),i&&c.jsx("div",{style:{width:`${Nc}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(be)return c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-red-400",children:["Error: ",be.message]})});const P=(W==null?void 0:W.session)||e;return c.jsxs("div",{ref:k,className:"h-full flex min-w-0",children:[c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Lf}px`},children:[c.jsxs("div",{ref:N,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:[(P==null?void 0:P.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:R,className:"font-bold truncate flex-1 transition-all duration-200",style:{fontSize:"1.5rem"},children:(P==null?void 0:P.title)||"Untitled Session"}),c.jsx("button",{ref:z,onClick:()=>(P==null?void 0:P.projectId)&&n(`/projects/${P.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:(P==null?void 0:P.projectName)||(P==null?void 0:P.projectId)}),c.jsx("button",{onClick:()=>{if(!P)return;const F=Bk(P),H=new Blob([F],{type:"text/html"}),K=URL.createObjectURL(H),oe=document.createElement("a");oe.href=K;const U=P.timestamp?tt(new Date(P.timestamp),"yyyy-MM-dd-HHmmss"):"unknown",ke=(P.title||"claude-session").replace(/[<>:"/\\|?*]/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").substring(0,50);oe.download=`${ke}-${U}.html`,document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(K),d(!0),setTimeout(()=>d(!1),2e3)},className:`flex items-center justify-center p-2 rounded-lg transition-all flex-shrink-0 ${u?"bg-green-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600 hover:text-white"}`,title:u?"Saved!":"Save as HTML",children:u?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:"M5 13l4 4L19 7"})}):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:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})})]}),c.jsx("div",{ref:C,onClick:()=>(P==null?void 0:P.projectId)&&n(`/projects/${P.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:(P==null?void 0:P.projectName)||(P==null?void 0:P.projectId)}),c.jsxs("div",{ref:T,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:(P==null?void 0:P.timestamp)&&tt(new Date(P.timestamp),"PPpp")}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:[(P==null?void 0:P.messageCount)||0," message",(P==null?void 0:P.messageCount)!==1?"s":""]}),(P==null?void 0:P.agentSessions)&&P.agentSessions.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"•"}),c.jsxs("span",{children:[P.agentSessions.length," task",P.agentSessions.length!==1?"s":""]})]})]})]}),c.jsx("div",{ref:O,className:"flex-1 overflow-y-auto p-6",children:ie&&!(P!=null&&P.messages)?c.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(F=>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"})]})})]},F))}):c.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:(we=P==null?void 0:P.messages)==null?void 0:we.map((F,H)=>{var oe;const K=`message-${H}`;return c.jsxs("div",{ref:U=>{U?p.current.set(K,U):p.current.delete(K)},"data-message-id":K,className:"border-l-2 border-gray-700 pl-4",style:{scrollMarginTop:"24px"},children:[c.jsxs("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 ${F.type==="user"?"bg-blue-900 text-blue-200":F.type==="assistant"?"bg-green-900 text-green-200":"bg-gray-700 text-gray-300"}`,children:F.type||"system"}),c.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["#",H+1]}),F.timestamp&&c.jsx("span",{className:"text-xs text-gray-500",children:tt(new Date(F.timestamp),"HH:mm:ss")})]}),c.jsx("button",{onClick:()=>{var ke,_t;let U="";F.type!=="user"&&F.type!=="assistant"?U=JSON.stringify(F,null,2):(ke=F.message)!=null&&ke.content&&Array.isArray(F.message.content)?F.message.content.forEach(it=>{if(it.type==="text")U+=it.text+`
187
+
188
+ `;else if(it.type==="tool_use")U+=`🔧 Tool: ${it.name}
189
+ `,U+=JSON.stringify(it.input,null,2)+`
190
+
191
+ `;else if(it.type==="tool_result"){U+=`✓ Tool Result
192
+ `;const ot=typeof it.content=="string"?it.content:JSON.stringify(it.content,null,2);U+=ot+`
193
+
194
+ `}}):typeof((_t=F.message)==null?void 0:_t.content)=="string"&&(U=F.message.content),U&&(navigator.clipboard.writeText(U.trim()),f(H),setTimeout(()=>f(null),1e3))},className:`p-1.5 rounded transition-colors ${h===H?"bg-green-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600 hover:text-white"}`,title:h===H?"Copied!":"Copy message text",children:h===H?c.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):c.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),c.jsx("div",{className:"bg-gray-800 rounded-lg p-4 text-sm",children:(oe=F.message)!=null&&oe.content&&Array.isArray(F.message.content)?c.jsx("div",{className:"space-y-2",children:F.message.content.map((U,ke)=>c.jsxs("div",{children:[U.type==="text"&&c.jsx("p",{className:"whitespace-pre-wrap",children:U.text}),U.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:["🔧 ",U.name]}),U.name==="Task"&&U.agentId&&c.jsx($d,{to:`/sessions/agent-${U.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(U.input,null,2)})]}),U.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 U.content=="string"?U.content:JSON.stringify(U.content,null,2)})]})]},ke))}):c.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify(F,null,2)})})]},H)})})})]}),i&&(P==null?void 0:P.messages)&&P.messages.length>0&&c.jsx("div",{style:{width:`${Nc}px`,flexShrink:0},children:c.jsx(Ak,{messages:P.messages,activeId:s,onNavigate:$})})]})}/*!
195
+ * @kurkle/color v0.3.4
196
+ * https://github.com/kurkle/color#readme
197
+ * (c) 2024 Jukka Kurkela
198
+ * Released under the MIT License
199
+ */function _o(t){return t+.5|0}const Yn=(t,e,n)=>Math.max(Math.min(t,n),e);function vi(t){return Yn(_o(t*2.55),0,255)}function is(t){return Yn(_o(t*255),0,255)}function mn(t){return Yn(_o(t/2.55)/100,0,1)}function Ff(t){return Yn(_o(t*100),0,100)}const St={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},Ec=[..."0123456789ABCDEF"],Wk=t=>Ec[t&15],Uk=t=>Ec[(t&240)>>4]+Ec[t&15],Qo=t=>(t&240)>>4===(t&15),Vk=t=>Qo(t.r)&&Qo(t.g)&&Qo(t.b)&&Qo(t.a);function Qk(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&St[t[1]]*17,g:255&St[t[2]]*17,b:255&St[t[3]]*17,a:e===5?St[t[4]]*17:255}:(e===7||e===9)&&(n={r:St[t[1]]<<4|St[t[2]],g:St[t[3]]<<4|St[t[4]],b:St[t[5]]<<4|St[t[6]],a:e===9?St[t[7]]<<4|St[t[8]]:255})),n}const Yk=(t,e)=>t<255?e(t):"";function Kk(t){var e=Vk(t)?Wk:Uk;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Yk(t.a,e):void 0}const Xk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function q0(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 Gk(t,e,n){const s=q0(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 Jk(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 Bd(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=Jk(n,s,r,d,i),l=l*60+.5),[l|0,u||0,a]}function Hd(t,e,n,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,s)).map(is)}function Wd(t,e,n){return Hd(q0,t,e,n)}function Zk(t,e,n){return Hd(Gk,t,e,n)}function e_(t,e,n){return Hd(qk,t,e,n)}function G0(t){return(t%360+360)%360}function t_(t){const e=Xk.exec(t);let n=255,s;if(!e)return;e[5]!==s&&(n=e[6]?vi(+e[5]):is(+e[5]));const r=G0(+e[2]),i=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?s=Zk(r,i,o):e[1]==="hsv"?s=e_(r,i,o):s=Wd(r,i,o),{r:s[0],g:s[1],b:s[2],a:n}}function n_(t,e){var n=Bd(t);n[0]=G0(n[0]+e),n=Wd(n),t.r=n[0],t.g=n[1],t.b=n[2]}function s_(t){if(!t)return;const e=Bd(t),n=e[0],s=Ff(e[1]),r=Ff(e[2]);return t.a<255?`hsla(${n}, ${s}%, ${r}%, ${mn(t.a)})`:`hsl(${n}, ${s}%, ${r}%)`}const If={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"},Af={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 r_(){const t={},e=Object.keys(Af),n=Object.keys(If);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,If[i]);i=parseInt(Af[o],16),t[a]=[i>>16&255,i>>8&255,i&255]}return t}let Yo;function i_(t){Yo||(Yo=r_(),Yo.transparent=[0,0,0,0]);const e=Yo[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const o_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function a_(t){const e=o_.exec(t);let n=255,s,r,i;if(e){if(e[7]!==s){const o=+e[7];n=e[8]?vi(o):Yn(o*255,0,255)}return s=+e[1],r=+e[3],i=+e[5],s=255&(e[2]?vi(s):Yn(s,0,255)),r=255&(e[4]?vi(r):Yn(r,0,255)),i=255&(e[6]?vi(i):Yn(i,0,255)),{r:s,g:r,b:i,a:n}}}function l_(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${mn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const iu=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Zs=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function u_(t,e,n){const s=Zs(mn(t.r)),r=Zs(mn(t.g)),i=Zs(mn(t.b));return{r:is(iu(s+n*(Zs(mn(e.r))-s))),g:is(iu(r+n*(Zs(mn(e.g))-r))),b:is(iu(i+n*(Zs(mn(e.b))-i))),a:t.a+n*(e.a-t.a)}}function Ko(t,e,n){if(t){let s=Bd(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*n,e===0?360:1)),s=Wd(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function J0(t,e){return t&&Object.assign(e||{},t)}function zf(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=is(t[3]))):(e=J0(t,{r:0,g:0,b:0,a:1}),e.a=is(e.a)),e}function c_(t){return t.charAt(0)==="r"?a_(t):t_(t)}class so{constructor(e){if(e instanceof so)return e;const n=typeof e;let s;n==="object"?s=zf(e):n==="string"&&(s=Qk(e)||i_(e)||c_(e)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var e=J0(this._rgb);return e&&(e.a=mn(e.a)),e}set rgb(e){this._rgb=zf(e)}rgbString(){return this._valid?l_(this._rgb):void 0}hexString(){return this._valid?Kk(this._rgb):void 0}hslString(){return this._valid?s_(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=u_(this._rgb,e._rgb,n)),this}clone(){return new so(this.rgb)}alpha(e){return this._rgb.a=is(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=_o(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 Ko(this._rgb,2,e),this}darken(e){return Ko(this._rgb,2,-e),this}saturate(e){return Ko(this._rgb,1,e),this}desaturate(e){return Ko(this._rgb,1,-e),this}rotate(e){return n_(this._rgb,e),this}}/*!
200
+ * Chart.js v4.5.1
201
+ * https://www.chartjs.org
202
+ * (c) 2025 Chart.js Contributors
203
+ * Released under the MIT License
204
+ */function un(){}const d_=(()=>{let t=0;return()=>t++})();function ae(t){return t==null}function Me(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 Z(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Lt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Jt(t,e){return Lt(t)?t:e}function ee(t,e){return typeof t>"u"?e:t}const h_=(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 se(t,e,n,s){let r,i,o;if(Me(t))for(i=t.length,r=0;r<i;r++)e.call(n,t[r],r);else if(Z(t))for(o=Object.keys(t),i=o.length,r=0;r<i;r++)e.call(n,t[o[r]],o[r])}function Xa(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 qa(t){if(Me(t))return t.map(qa);if(Z(t)){const e=Object.create(null),n=Object.keys(t),s=n.length;let r=0;for(;r<s;++r)e[n[r]]=qa(t[n[r]]);return e}return t}function Z0(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function f_(t,e,n,s){if(!Z0(t))return;const r=e[t],i=n[t];Z(r)&&Z(i)?ro(r,i,s):e[t]=qa(i)}function ro(t,e,n){const s=Me(e)?e:[e],r=s.length;if(!Z(t))return t;n=n||{};const i=n.merger||f_;let o;for(let a=0;a<r;++a){if(o=s[a],!Z(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 Mi(t,e){return ro(t,e,{merger:p_})}function p_(t,e,n){if(!Z0(t))return;const s=e[t],r=n[t];Z(s)&&Z(r)?Mi(s,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=qa(r))}const $f={"":t=>t,x:t=>t.x,y:t=>t.y};function m_(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 g_(t){const e=m_(t);return n=>{for(const s of e){if(s==="")break;n=n&&n[s]}return n}}function Br(t,e){return($f[e]||($f[e]=g_(e)))(t)}function Ud(t){return t.charAt(0).toUpperCase()+t.slice(1)}const io=t=>typeof t<"u",cs=t=>typeof t=="function",Bf=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function y_(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Ke=Math.PI,os=2*Ke,Ga=Number.POSITIVE_INFINITY,x_=Ke/180,Wt=Ke/2,gs=Ke/4,Hf=Ke*2/3,ey=Math.log10,as=Math.sign;function xa(t,e,n){return Math.abs(t-e)<n}function Wf(t){const e=Math.round(t);t=xa(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(ey(t))),s=t/n;return(s<=1?1:s<=2?2:s<=5?5:10)*n}function v_(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 b_(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ja(t){return!b_(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function w_(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function k_(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 Es(t){return t*(Ke/180)}function __(t){return t*(180/Ke)}function Uf(t){if(!Lt(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function S_(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*Ke&&(i+=os),{angle:i,distance:r}}function C_(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ys(t){return(t%os+os)%os}function j_(t,e,n,s){const r=ys(t),i=ys(e),o=ys(n),a=ys(i-r),l=ys(o-r),u=ys(r-i),d=ys(r-o);return r===i||r===o||s||a>l&&u<d}function Ut(t,e,n){return Math.max(e,Math.min(n,t))}function N_(t){return Ut(t,-32768,32767)}function hr(t,e,n,s=1e-6){return t>=Math.min(e,n)-s&&t<=Math.max(e,n)+s}function Vd(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 Pc=(t,e,n,s)=>Vd(t,n,s?r=>{const i=t[r][e];return i<n||i===n&&t[r+1][e]===n}:r=>t[r][e]<n),E_=(t,e,n)=>Vd(t,n,s=>t[s][e]>=n);function P_(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 ty=["push","pop","shift","splice","unshift"];function T_(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ty.forEach(n=>{const s="_onData"+Ud(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 Vf(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)&&(ty.forEach(i=>{delete t[i]}),delete t._chartjs)}function ny(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const sy=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function ry(t,e){let n=[],s=!1;return function(...r){n=r,s||(s=!0,sy.call(window,()=>{s=!1,t.apply(e,n)}))}}function M_(t,e){let n;return function(...s){return e?(clearTimeout(n),n=setTimeout(t,e,s)):t.apply(this,s),e}}const Qd=t=>t==="start"?"left":t==="end"?"right":"center",Ve=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,R_=(t,e,n,s)=>t===(s?"left":"right")?n:t==="center"?(e+n)/2:e,Xo=t=>t===0||t===1,Qf=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*os/n)),Yf=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*os/n)+1,Ri={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*Wt)+1,easeOutSine:t=>Math.sin(t*Wt),easeInOutSine:t=>-.5*(Math.cos(Ke*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=>Xo(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=>Xo(t)?t:Qf(t,.075,.3),easeOutElastic:t=>Xo(t)?t:Yf(t,.075,.3),easeInOutElastic(t){return Xo(t)?t:t<.5?.5*Qf(t*2,.1125,.45):.5+.5*Yf(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-Ri.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?Ri.easeInBounce(t*2)*.5:Ri.easeOutBounce(t*2-1)*.5+.5};function iy(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Kf(t){return iy(t)?t:new so(t)}function ou(t){return iy(t)?t:new so(t).saturate(.5).darken(.1).hexString()}const O_=["x","y","borderWidth","radius","tension"],D_=["color","borderColor","backgroundColor"];function L_(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:D_},numbers:{type:"number",properties:O_}}),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 F_(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Xf=new Map;function I_(t,e){e=e||{};const n=t+JSON.stringify(e);let s=Xf.get(n);return s||(s=new Intl.NumberFormat(t,e),Xf.set(n,s)),s}function oy(t,e,n){return I_(e,n).format(t)}const A_={values(t){return Me(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=z_(t,n)}const o=ey(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),oy(t,s,l)}};function z_(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 ay={formatters:A_};function $_(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:ay.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 Ks=Object.create(null),Tc=Object.create(null);function Oi(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 au(t,e,n){return typeof e=="string"?ro(Oi(t,e),n):ro(Oi(t,""),e)}class B_{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)=>ou(r.backgroundColor),this.hoverBorderColor=(s,r)=>ou(r.borderColor),this.hoverColor=(s,r)=>ou(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 au(this,e,n)}get(e){return Oi(this,e)}describe(e,n){return au(Tc,e,n)}override(e,n){return au(Ks,e,n)}route(e,n,s,r){const i=Oi(this,e),o=Oi(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 Z(l)?Object.assign({},u,l):ee(l,u)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var je=new B_({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[L_,F_,$_]);function H_(t){return!t||ae(t.size)||ae(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function qf(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 xs(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 Gf(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Jf(t,e,n,s){ly(t,e,n,s,null)}function ly(t,e,n,s,r){let i,o,a,l,u,d,h,f;const p=e.pointStyle,y=e.rotation,m=e.radius;let b=(y||0)*x_;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,os):t.arc(n,s,m,0,os),t.closePath();break;case"triangle":d=r?r/2:m,t.moveTo(n+Math.sin(b)*d,s-Math.cos(b)*m),b+=Hf,t.lineTo(n+Math.sin(b)*d,s-Math.cos(b)*m),b+=Hf,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+gs)*l,h=Math.cos(b+gs)*(r?r/2-u:l),a=Math.sin(b+gs)*l,f=Math.sin(b+gs)*(r?r/2-u:l),t.arc(n-h,s-a,u,b-Ke,b-Wt),t.arc(n+f,s-o,u,b-Wt,b),t.arc(n+h,s+a,u,b,b+Wt),t.arc(n-f,s+o,u,b+Wt,b+Ke),t.closePath();break;case"rect":if(!y){l=Math.SQRT1_2*m,d=r?r/2:l,t.rect(n-d,s-l,2*d,2*l);break}b+=gs;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+=gs;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+=gs,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 uy(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 Yd(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Kd(t){t.restore()}function W_(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),ae(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 U_(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 V_(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function oo(t,e,n,s,r,i={}){const o=Me(e)?e:[e],a=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(t.save(),t.font=r.string,W_(t,i),l=0;l<o.length;++l)u=o[l],i.backdrop&&V_(t,i.backdrop),a&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),ae(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(u,n,s,i.maxWidth)),t.fillText(u,n,s,i.maxWidth),U_(t,n,s,u,i),s+=Number(r.lineHeight);t.restore()}function Za(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*Ke,Ke,!0),t.lineTo(n,s+i-o.bottomLeft),t.arc(n+o.bottomLeft,s+i-o.bottomLeft,o.bottomLeft,Ke,Wt,!0),t.lineTo(n+r-o.bottomRight,s+i),t.arc(n+r-o.bottomRight,s+i-o.bottomRight,o.bottomRight,Wt,0,!0),t.lineTo(n+r,s+o.topRight),t.arc(n+r-o.topRight,s+o.topRight,o.topRight,0,-Wt,!0),t.lineTo(n+o.topLeft,s)}const Q_=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Y_=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function K_(t,e){const n=(""+t).match(Q_);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 X_=t=>+t||0;function cy(t,e){const n={},s=Z(e),r=s?Object.keys(e):e,i=Z(t)?s?o=>ee(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of r)n[o]=X_(i(o));return n}function dy(t){return cy(t,{top:"y",right:"x",bottom:"y",left:"x"})}function vr(t){return cy(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ft(t){const e=dy(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ye(t,e){t=t||{},e=e||je.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(Y_)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const r={family:ee(t.family,e.family),lineHeight:K_(ee(t.lineHeight,e.lineHeight),n),size:n,style:s,weight:ee(t.weight,e.weight),string:""};return r.string=H_(r),r}function qo(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=h_(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 Xr(t,e){return Object.assign(Object.create(t),e)}function Xd(t,e=[""],n,s,r=()=>t[0]){const i=n||t;typeof s>"u"&&(s=my("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:r,override:a=>Xd([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 fy(a,l,()=>rS(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return ep(a).includes(l)},ownKeys(a){return ep(a)},set(a,l,u){const d=a._storage||(a._storage=r());return a[l]=d[l]=u,delete a._keys,!0}})}function Hr(t,e,n,s){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:hy(t,s),setContext:i=>Hr(t,i,n,s),override:i=>Hr(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 fy(i,o,()=>J_(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 hy(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:cs(n)?n:()=>n,isIndexable:cs(s)?s:()=>s}}const G_=(t,e)=>t?t+Ud(e):e,qd=(t,e)=>Z(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function fy(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const s=n();return t[e]=s,s}function J_(t,e,n){const{_proxy:s,_context:r,_subProxy:i,_descriptors:o}=t;let a=s[e];return cs(a)&&o.isScriptable(e)&&(a=Z_(e,a,t,n)),Me(a)&&a.length&&(a=eS(e,a,t,o.isIndexable)),qd(e,a)&&(a=Hr(a,r,i&&i[e],o)),a}function Z_(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),qd(t,l)&&(l=Gd(r._scopes,r,t,l)),l}function eS(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(Z(e[0])){const l=e,u=r._scopes.filter(d=>d!==l);e=[];for(const d of l){const h=Gd(u,r,t,d);e.push(Hr(h,i,o&&o[t],a))}}return e}function py(t,e,n){return cs(t)?t(e,n):t}const tS=(t,e)=>t===!0?e:typeof t=="string"?Br(e,t):void 0;function nS(t,e,n,s,r){for(const i of e){const o=tS(n,i);if(o){t.add(o);const a=py(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 Gd(t,e,n,s){const r=e._rootScopes,i=py(e._fallback,n,s),o=[...t,...r],a=new Set;a.add(s);let l=Zf(a,o,n,i||n,s);return l===null||typeof i<"u"&&i!==n&&(l=Zf(a,o,i,l,s),l===null)?!1:Xd(Array.from(a),[""],r,i,()=>sS(e,n,s))}function Zf(t,e,n,s,r){for(;n;)n=nS(t,e,n,s,r);return n}function sS(t,e,n){const s=t._getTarget();e in s||(s[e]={});const r=s[e];return Me(r)&&Z(n)?n:r||{}}function rS(t,e,n,s){let r;for(const i of e)if(r=my(G_(i,t),n),typeof r<"u")return qd(t,r)?Gd(n,s,t,r):r}function my(t,e){for(const n of e){if(!n)continue;const s=n[t];if(typeof s<"u")return s}}function ep(t){let e=t._keys;return e||(e=t._keys=iS(t._scopes)),e}function iS(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 Jd(){return typeof window<"u"&&typeof document<"u"}function Zd(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function el(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 Cl=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function oS(t,e){return Cl(t).getPropertyValue(e)}const aS=["top","right","bottom","left"];function $s(t,e,n){const s={};n=n?"-"+n:"";for(let r=0;r<4;r++){const i=aS[r];s[i]=parseFloat(t[e+"-"+i+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const lS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function uS(t,e){const n=t.touches,s=n&&n.length?n[0]:t,{offsetX:r,offsetY:i}=s;let o=!1,a,l;if(lS(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 _s(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:s}=e,r=Cl(n),i=r.boxSizing==="border-box",o=$s(r,"padding"),a=$s(r,"border","width"),{x:l,y:u,box:d}=uS(t,n),h=o.left+(d&&a.left),f=o.top+(d&&a.top);let{width:p,height:y}=e;return i&&(p-=o.width+a.width,y-=o.height+a.height),{x:Math.round((l-h)/p*n.width/s),y:Math.round((u-f)/y*n.height/s)}}function cS(t,e,n){let s,r;if(e===void 0||n===void 0){const i=t&&Zd(t);if(!i)e=t.clientWidth,n=t.clientHeight;else{const o=i.getBoundingClientRect(),a=Cl(i),l=$s(a,"border","width"),u=$s(a,"padding");e=o.width-u.width-l.width,n=o.height-u.height-l.height,s=el(a.maxWidth,i,"clientWidth"),r=el(a.maxHeight,i,"clientHeight")}}return{width:e,height:n,maxWidth:s||Ga,maxHeight:r||Ga}}const Kn=t=>Math.round(t*10)/10;function dS(t,e,n,s){const r=Cl(t),i=$s(r,"margin"),o=el(r.maxWidth,t,"clientWidth")||Ga,a=el(r.maxHeight,t,"clientHeight")||Ga,l=cS(t,e,n);let{width:u,height:d}=l;if(r.boxSizing==="content-box"){const f=$s(r,"border","width"),p=$s(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=Kn(Math.min(u,o,l.maxWidth)),d=Kn(Math.min(d,a,l.maxHeight)),u&&!d&&(d=Kn(u/2)),(e!==void 0||n!==void 0)&&s&&l.height&&d>l.height&&(d=l.height,u=Kn(Math.floor(d*s))),{width:u,height:d}}function tp(t,e,n){const s=e||1,r=Kn(t.height*s),i=Kn(t.width*s);t.height=Kn(t.height),t.width=Kn(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 hS=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Jd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function np(t,e){const n=oS(t,e),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const fS=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}}},pS=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function br(t,e,n){return t?fS(e,n):pS()}function gy(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 yy(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Go(t,e,n){return t.options.clip?t[n]:e[n]}function mS(t,e){const{xScale:n,yScale:s}=t;return n&&s?{left:Go(n,e,"left"),right:Go(n,e,"right"),top:Go(s,e,"top"),bottom:Go(s,e,"bottom")}:e}function gS(t,e){const n=e._clip;if(n.disabled)return!1;const s=mS(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)}}/*!
205
+ * Chart.js v4.5.1
206
+ * https://www.chartjs.org
207
+ * (c) 2025 Chart.js Contributors
208
+ * Released under the MIT License
209
+ */class yS{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=sy.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 dn=new yS;const sp="transparent",xS={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const s=Kf(t||sp),r=s.valid&&Kf(e||sp);return r&&r.valid?r.mix(s,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class vS{constructor(e,n,s,r){const i=n[s];r=qo([e.to,r,i,e.from]);const o=qo([e.from,i,r]);this._active=!0,this._fn=e.fn||xS[e.type||typeof o],this._easing=Ri[e.easing]||Ri.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=qo([e.to,n,r,e.from]),this._from=qo([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 xy{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Z(e))return;const n=Object.keys(je.animation),s=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const i=e[r];if(!Z(i))return;const o={};for(const a of n)o[a]=i[a];(Me(i.properties)&&i.properties||[r]).forEach(a=>{(a===r||!s.has(a))&&s.set(a,o)})})}_animateOptions(e,n){const s=n.options,r=wS(e,s);if(!r)return[];const i=this._createAnimations(r,s);return s.$shared&&bS(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 vS(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 dn.add(this._chart,s),!0}}function bS(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 wS(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 rp(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 kS(t,e,n){if(n===!1)return!1;const s=rp(t,n),r=rp(e,n);return{top:r.end,right:s.end,bottom:r.start,left:s.start}}function _S(t){let e,n,s,r;return Z(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 vy(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 ip(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],Lt(u)&&(i||e===0||as(e)===as(u))&&(e+=u)}return!d&&!s.all?0:e}function SS(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 lu(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function CS(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function jS(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 NS(t,e,n){const s=t[e]||(t[e]={});return s[n]||(s[n]={})}function op(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 ap(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=CS(i,o,s),h=e.length;let f;for(let p=0;p<h;++p){const y=e[p],{[l]:m,[u]:b}=y,g=y._stacks||(y._stacks={});f=g[u]=NS(r,d,m),f[a]=b,f._top=op(f,o,!0,s.type),f._bottom=op(f,o,!1,s.type);const x=f._visualValues||(f._visualValues={});x[a]=b}}function uu(t,e){const n=t.scales;return Object.keys(n).filter(s=>n[s].axis===e).shift()}function ES(t,e){return Xr(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function PS(t,e,n){return Xr(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function li(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 cu=t=>t==="reset"||t==="none",lp=(t,e)=>e?t:Object.assign({},t),TS=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:vy(n,!0),values:null};class Di{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=lu(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&&li(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,s=this.getDataset(),r=(h,f,p,y)=>h==="x"?f:h==="r"?y:p,i=n.xAxisID=ee(s.xAxisID,uu(e,"x")),o=n.yAxisID=ee(s.yAxisID,uu(e,"y")),a=n.rAxisID=ee(s.rAxisID,uu(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&&Vf(this._data,this),e._stacked&&li(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),s=this._data;if(Z(n)){const r=this._cachedMeta;this._data=SS(n,r)}else if(s!==n){if(s){Vf(s,this);const r=this._cachedMeta;li(r),r._parsed=[]}n&&Object.isExtensible(n)&&T_(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=lu(n.vScale,n),n.stack!==s.stack&&(r=!0,li(n),n.stack=s.stack),this._resyncElements(e),(r||i!==n._stacked)&&(ap(this,n._parsed),n._stacked=lu(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{Me(r[e])?f=this.parseArrayData(s,r,e,n):Z(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&&ap(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,y;for(f=0,p=r;f<p;++f)y=f+s,h[f]={[a]:d||i.parse(u[y],y),[l]:o.parse(n[y],y)};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(Br(p,a),f),y:o.parse(Br(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:vy(r,!0),values:n._stacks[e.axis]._visualValues};return ip(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=ip(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=TS(n,s,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=jS(a);let f,p;function y(){p=r[f];const m=p[a.axis];return!Lt(p[e.axis])||d>m||h<m}for(f=0;f<o&&!(!y()&&(this.updateRangeFromParsed(u,e,p,l),i));++f);if(i){for(f=o-1;f>=0;--f)if(!y()){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],Lt(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=_S(ee(this.options.clip,kS(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=PS(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=ES(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&&io(s);if(a)return lp(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(je.elements[e]),y=()=>this.getContext(s,r,n),m=u.resolveNamedOptions(f,p,y,h);return m.$shared&&(m.$shared=l,i[o]=Object.freeze(lp(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 xy(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||cu(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){cu(r)?Object.assign(e,s):this._resolveAnimations(n,r).update(e,s)}updateSharedOptions(e,n,s){e&&!cu(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&&li(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])}}G(Di,"defaults",{}),G(Di,"datasetElementType",null),G(Di,"dataElementType",null);function MS(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=ny(s.sort((r,i)=>r-i))}return t._cache.$bar}function RS(t){const e=t.iScale,n=MS(e,t.type);let s=e._length,r,i,o,a;const l=()=>{o===32767||o===-32768||(io(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 OS(t,e,n,s){const r=n.barThickness;let i,o;return ae(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 DS(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 LS(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 by(t,e,n,s){return Me(t)?LS(t,e,n,s):e[n.axis]=n.parse(t,s),e}function up(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(by(f,h,i,u));return l}function du(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function FS(t,e,n){return t!==0?as(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function IS(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 AS(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}=IS(t);r==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===s?r=u:(n._bottom||0)===s?r=d:(i[cp(d,o,a,l)]=!0,r=u)),i[cp(r,o,a,l)]=!0,t.borderSkipped=i}function cp(t,e,n,s){return s?(t=zS(t,e,n),t=dp(t,n,e)):t=dp(t,e,n),t}function zS(t,e,n){return t===e?n:t===n?e:t}function dp(t,e,n){return t==="start"?e:t==="end"?n:t}function $S(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class va extends Di{parsePrimitiveData(e,n,s,r){return up(e,n,s,r)}parseArrayData(e,n,s,r){return up(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,y,m;for(f=s,p=s+r;f<p;++f)m=n[f],y={},y[i.axis]=i.parse(Br(m,u),f),h.push(by(Br(m,d),y,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=du(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 y=this.getParsed(p),m=i||ae(y[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),g=(y._stacks||{})[a.axis],x={horizontal:u,base:m.base,enableBorderRadius:!g||du(y._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&&(x.options=h||this.resolveDataElementOptions(p,e[p].active?"active":r));const v=x.options||e[p].options;AS(x,v,g,o),$S(x,v,d.ratio),this.updateElement(e[p],p,x,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(ae(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||RS(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=du(u);let h=l[n.axis],f=0,p=s?this.applyStack(n,l,s):h,y,m;p!==h&&(f=p-h,p=h),d&&(h=u.barStart,p=u.barEnd-u.barStart,h!==0&&as(h)!==as(u.barEnd)&&(f=0),f+=h);const b=!ae(i)&&!d?i:f;let g=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?y=n.getPixelForValue(f+p):y=g,m=y-g,Math.abs(m)<o){m=FS(m,n,a)*o,h===a&&(g-=m/2);const x=n.getPixelForDecimal(0),v=n.getPixelForDecimal(1),w=Math.min(x,v),j=Math.max(x,v);g=Math.max(Math.min(g,j),w),y=g+m,s&&!d&&(l._stacks[n.axis]._visualValues[r]=n.getValueForPixel(y)-n.getValueForPixel(g))}if(g===n.getPixelForValue(a)){const x=as(m)*n.getLineWidthForValue(a)/2;g+=x,m-=x}return{size:m,base:g,head:y,center:y+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"?DS(e,n,r,d*u):OS(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())),y=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+p;a=h.start+h.chunk*y+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)}}G(va,"id","bar"),G(va,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),G(va,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function vs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class eh{constructor(e){G(this,"options");this.options=e||{}}static override(e){Object.assign(eh.prototype,e)}init(){}formats(){return vs()}parse(){return vs()}format(){return vs()}add(){return vs()}diff(){return vs()}startOf(){return vs()}endOf(){return vs()}}var BS={_date:eh};function HS(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?E_:Pc;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=>!ae(m[h.axis]));d.lo-=Math.max(0,p);const y=f.slice(d.hi).findIndex(m=>!ae(m[h.axis]));d.hi+=Math.max(0,y)}return d}}return{lo:0,hi:i.length-1}}function jl(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}=HS(i[a],e,o,r);for(let p=h;p<=f;++p){const y=d[p];y.skip||s(y,u,p)}}}function WS(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 hu(t,e,n,s,r){const i=[];return!r&&!t.isPointInArea(e)||jl(t,n,e,function(a,l,u){!r&&!uy(a,t.chartArea,0)||a.inRange(e.x,e.y,s)&&i.push({element:a,datasetIndex:l,index:u})},!0),i}function US(t,e,n,s){let r=[];function i(o,a,l){const{startAngle:u,endAngle:d}=o.getProps(["startAngle","endAngle"],s),{angle:h}=S_(o,{x:e.x,y:e.y});j_(h,u,d)&&r.push({element:o,datasetIndex:a,index:l})}return jl(t,n,e,i),r}function VS(t,e,n,s,r,i){let o=[];const a=WS(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 y=d.getCenterPoint(r);if(!(!!i||t.isPointInArea(y))&&!p)return;const b=a(e,y);b<l?(o=[{element:d,datasetIndex:h,index:f}],l=b):b===l&&o.push({element:d,datasetIndex:h,index:f})}return jl(t,n,e,u),o}function fu(t,e,n,s,r,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!s?US(t,e,n,r):VS(t,e,n,s,r,i)}function hp(t,e,n,s,r){const i=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return jl(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 QS={modes:{index(t,e,n,s){const r=_s(e,t),i=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?hu(t,r,i,s,o):fu(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=_s(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?hu(t,r,i,s,o):fu(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=_s(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return hu(t,r,i,s,o)},nearest(t,e,n,s){const r=_s(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return fu(t,r,i,n.intersect,s,o)},x(t,e,n,s){const r=_s(e,t);return hp(t,r,"x",n.intersect,s)},y(t,e,n,s){const r=_s(e,t);return hp(t,r,"y",n.intersect,s)}}};const wy=["left","top","right","bottom"];function ui(t,e){return t.filter(n=>n.pos===e)}function fp(t,e){return t.filter(n=>wy.indexOf(n.pos)===-1&&n.box.axis===e)}function ci(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 YS(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 KS(t){const e={};for(const n of t){const{stack:s,pos:r,stackWeight:i}=n;if(!s||!wy.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 XS(t,e){const n=KS(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=YS(t),n=ci(e.filter(u=>u.box.fullSize),!0),s=ci(ui(e,"left"),!0),r=ci(ui(e,"right")),i=ci(ui(e,"top"),!0),o=ci(ui(e,"bottom")),a=fp(e,"x"),l=fp(e,"y");return{fullSize:n,leftAndTop:s.concat(i),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:ui(e,"chartArea"),vertical:s.concat(r).concat(l),horizontal:i.concat(o).concat(a)}}function pp(t,e,n,s){return Math.max(t[n],e[n])+Math.max(t[s],e[s])}function ky(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 GS(t,e,n,s){const{pos:r,box:i}=n,o=t.maxPadding;if(!Z(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&&ky(o,i.getPadding());const a=Math.max(0,e.outerWidth-pp(o,t,"left","right")),l=Math.max(0,e.outerHeight-pp(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 JS(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 ZS(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 bi(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,ZS(a.horizontal,e));const{same:h,other:f}=GS(e,n,a,s);u|=h&&r.length,d=d||f,l.fullSize||r.push(a)}return u&&bi(r,e,n,s)||d}function Jo(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 mp(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;io(u.start)&&(o=u.start),l.fullSize?Jo(l,r.left,o,n.outerWidth-r.right-r.left,f):Jo(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;io(u.start)&&(i=u.start),l.fullSize?Jo(l,i,r.top,f,n.outerHeight-r.bottom-r.top):Jo(l,i,e.top+u.placed,f,h),u.start=i,u.placed+=h,i=l.right}}e.x=i,e.y=o}var Tt={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=Ft(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;se(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);ky(f,Ft(s));const p=Object.assign({maxPadding:f,w:i,h:o,x:r.left,y:r.top},r),y=XS(l.concat(u),h);bi(a.fullSize,p,h,y),bi(l,p,h,y),bi(u,p,h,y)&&bi(l,p,h,y),JS(p),mp(a.leftAndTop,p,h,y),p.x+=p.w,p.y+=p.h,mp(a.rightAndBottom,p,h,y),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},se(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 _y{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 e2 extends _y{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ba="$chartjs",t2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gp=t=>t===null||t==="";function n2(t,e){const n=t.style,s=t.getAttribute("height"),r=t.getAttribute("width");if(t[ba]={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",gp(r)){const i=np(t,"width");i!==void 0&&(t.width=i)}if(gp(s))if(t.style.height==="")t.height=t.width/(e||2);else{const i=np(t,"height");i!==void 0&&(t.height=i)}return t}const Sy=hS?{passive:!0}:!1;function s2(t,e,n){t&&t.addEventListener(e,n,Sy)}function r2(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,Sy)}function i2(t,e){const n=t2[t.type]||t.type,{x:s,y:r}=_s(t,e);return{type:n,chart:e,native:t,x:s!==void 0?s:null,y:r!==void 0?r:null}}function tl(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function o2(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||tl(a.addedNodes,s),o=o&&!tl(a.removedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function a2(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||tl(a.removedNodes,s),o=o&&!tl(a.addedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const ao=new Map;let yp=0;function Cy(){const t=window.devicePixelRatio;t!==yp&&(yp=t,ao.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function l2(t,e){ao.size||window.addEventListener("resize",Cy),ao.set(t,e)}function u2(t){ao.delete(t),ao.size||window.removeEventListener("resize",Cy)}function c2(t,e,n){const s=t.canvas,r=s&&Zd(s);if(!r)return;const i=ry((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),l2(t,i),o}function pu(t,e,n){n&&n.disconnect(),e==="resize"&&u2(t)}function d2(t,e,n){const s=t.canvas,r=ry(i=>{t.ctx!==null&&n(i2(i,t))},t);return s2(s,e,r),r}class h2 extends _y{acquireContext(e,n){const s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(n2(e,n),s):null}releaseContext(e){const n=e.canvas;if(!n[ba])return!1;const s=n[ba].initial;["height","width"].forEach(i=>{const o=s[i];ae(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[ba],!0}addEventListener(e,n,s){this.removeEventListener(e,n);const r=e.$proxies||(e.$proxies={}),o={attach:o2,detach:a2,resize:c2}[n]||d2;r[n]=o(e,n,s)}removeEventListener(e,n){const s=e.$proxies||(e.$proxies={}),r=s[n];if(!r)return;({attach:pu,detach:pu,resize:pu}[n]||r2)(e,n,r),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,s,r){return dS(e,n,s,r)}isAttached(e){const n=e&&Zd(e);return!!(n&&n.isConnected)}}function f2(t){return!Jd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?e2:h2}class ds{constructor(){G(this,"x");G(this,"y");G(this,"active",!1);G(this,"options");G(this,"$animations")}tooltipPosition(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}hasValue(){return Ja(this.x)&&Ja(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}}G(ds,"defaults",{}),G(ds,"defaultRoutes");function p2(t,e){const n=t.options.ticks,s=m2(t),r=Math.min(n.maxTicksLimit||s,s),i=n.major.enabled?y2(e):[],o=i.length,a=i[0],l=i[o-1],u=[];if(o>r)return x2(e,u,i,o/r),u;const d=g2(i,e,r);if(o>0){let h,f;const p=o>1?Math.round((l-a)/(o-1)):null;for(Zo(e,u,d,ae(p)?0:a-p,a),h=0,f=o-1;h<f;h++)Zo(e,u,d,i[h],i[h+1]);return Zo(e,u,d,l,ae(p)?e.length:l+p),u}return Zo(e,u,d),u}function m2(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 g2(t,e,n){const s=v2(t),r=e.length/n;if(!s)return Math.max(r,1);const i=v_(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 y2(t){const e=[];let n,s;for(n=0,s=t.length;n<s;n++)t[n].major&&e.push(n);return e}function x2(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 Zo(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 v2(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 b2=t=>t==="left"?"right":t==="right"?"left":t,xp=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,vp=(t,e)=>Math.min(e||t,t);function bp(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 w2(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 k2(t,e){se(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 di(t){return t.drawTicks?t.tickLength:0}function wp(t,e){if(!t.display)return 0;const n=Ye(t.font,e),s=Ft(t.padding);return(Me(t.text)?t.text.length:1)*n.lineHeight+s.height}function _2(t,e){return Xr(t,{scale:e,type:"scale"})}function S2(t,e,n){return Xr(t,{tick:n,index:e,type:"tick"})}function C2(t,e,n){let s=Qd(t);return(n&&e!=="right"||!n&&e==="right")&&(s=b2(s)),s}function j2(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,y;const m=o-r,b=a-i;if(t.isHorizontal()){if(p=Ve(s,i,a),Z(n)){const g=Object.keys(n)[0],x=n[g];y=d[g].getPixelForValue(x)+m-e}else n==="center"?y=(u.bottom+u.top)/2+m-e:y=xp(t,n,e);f=a-i}else{if(Z(n)){const g=Object.keys(n)[0],x=n[g];p=d[g].getPixelForValue(x)-b+e}else n==="center"?p=(u.left+u.right)/2-b+e:p=xp(t,n,e);y=Ve(s,o,r),h=n==="left"?-Wt:Wt}return{titleX:p,titleY:y,maxWidth:f,rotation:h}}class qr extends ds{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=Jt(e,Number.POSITIVE_INFINITY),n=Jt(n,Number.NEGATIVE_INFINITY),s=Jt(s,Number.POSITIVE_INFINITY),r=Jt(r,Number.NEGATIVE_INFINITY),{min:Jt(e,s),max:Jt(n,r),minDefined:Lt(e),maxDefined:Lt(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:Jt(n,Jt(s,n)),max:Jt(s,Jt(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?bp(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=p2(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=vp(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=Ut(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-di(e.grid)-n.padding-wp(e.title,this.chart.options.font),u=Math.sqrt(h*h+f*f),o=__(Math.min(Math.asin(Ut((d.highest.height+6)/a,-1,1)),Math.asin(Ut(l/u,-1,1))-Math.asin(Ut(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=wp(r,n.options.font);if(a?(e.width=this.maxWidth,e.height=di(i)+l):(e.height=this.maxHeight,e.width=di(i)+l),s.display&&this.ticks.length){const{first:u,last:d,widest:h,highest:f}=this._getLabelSizes(),p=s.padding*2,y=Es(this.labelRotation),m=Math.cos(y),b=Math.sin(y);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++)ae(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=bp(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/vp(n,s));let u=0,d=0,h,f,p,y,m,b,g,x,v,w,j;for(h=0;h<n;h+=l){if(y=e[h].label,m=this._resolveTickFontOptions(h),r.font=b=m.string,g=i[b]=i[b]||{data:{},gc:[]},x=m.lineHeight,v=w=0,!ae(y)&&!Me(y))v=qf(r,g.data,g.gc,v,y),w=x;else if(Me(y))for(f=0,p=y.length;f<p;++f)j=y[f],!ae(j)&&!Me(j)&&(v=qf(r,g.data,g.gc,v,j),w+=x);o.push(v),a.push(w),u=Math.max(v,u),d=Math.max(w,d)}k2(i,n);const E=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(E),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 N_(this._alignToPixels?xs(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=S2(this.getContext(),e,s))}return this.$context||(this.$context=_2(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Es(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=di(i),p=[],y=a.setContext(this.getContext()),m=y.display?y.width:0,b=m/2,g=function(ie){return xs(s,ie,m)};let x,v,w,j,E,k,N,R,C,T,z,V;if(o==="top")x=g(this.bottom),k=this.bottom-f,R=x-b,T=g(e.top)+b,V=e.bottom;else if(o==="bottom")x=g(this.top),T=e.top,V=g(e.bottom)-b,k=x+b,R=this.top+f;else if(o==="left")x=g(this.right),E=this.right-f,N=x-b,C=g(e.left)+b,z=e.right;else if(o==="right")x=g(this.left),C=e.left,z=g(e.right)-b,E=x+b,N=this.left+f;else if(n==="x"){if(o==="center")x=g((e.top+e.bottom)/2+.5);else if(Z(o)){const ie=Object.keys(o)[0],be=o[ie];x=g(this.chart.scales[ie].getPixelForValue(be))}T=e.top,V=e.bottom,k=x+b,R=k+f}else if(n==="y"){if(o==="center")x=g((e.left+e.right)/2);else if(Z(o)){const ie=Object.keys(o)[0],be=o[ie];x=g(this.chart.scales[ie].getPixelForValue(be))}E=x-b,N=E-f,C=e.left,z=e.right}const ve=ee(r.ticks.maxTicksLimit,h),W=Math.max(1,Math.ceil(h/ve));for(v=0;v<h;v+=W){const ie=this.getContext(v),be=i.setContext(ie),L=a.setContext(ie),O=be.lineWidth,$=be.color,P=L.dash||[],Q=L.dashOffset,Fe=be.tickWidth,we=be.tickColor,F=be.tickBorderDash||[],H=be.tickBorderDashOffset;w=w2(this,v,l),w!==void 0&&(j=xs(s,w,O),u?E=N=C=z=j:k=R=T=V=j,p.push({tx1:E,ty1:k,tx2:N,ty2:R,x1:C,y1:T,x2:z,y2:V,width:O,color:$,borderDash:P,borderDashOffset:Q,tickWidth:Fe,tickColor:we,tickBorderDash:F,tickBorderDashOffset:H}))}return this._ticksLength=h,this._borderValue=x,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=di(s.grid),p=f+d,y=h?-d:p,m=-Es(this.labelRotation),b=[];let g,x,v,w,j,E,k,N,R,C,T,z,V="middle";if(r==="top")E=this.bottom-y,k=this._getXAxisLabelAlignment();else if(r==="bottom")E=this.top+y,k=this._getXAxisLabelAlignment();else if(r==="left"){const W=this._getYAxisLabelAlignment(f);k=W.textAlign,j=W.x}else if(r==="right"){const W=this._getYAxisLabelAlignment(f);k=W.textAlign,j=W.x}else if(n==="x"){if(r==="center")E=(e.top+e.bottom)/2+p;else if(Z(r)){const W=Object.keys(r)[0],ie=r[W];E=this.chart.scales[W].getPixelForValue(ie)+p}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")j=(e.left+e.right)/2-p;else if(Z(r)){const W=Object.keys(r)[0],ie=r[W];j=this.chart.scales[W].getPixelForValue(ie)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?V="top":l==="end"&&(V="bottom"));const ve=this._getLabelSizes();for(g=0,x=a.length;g<x;++g){v=a[g],w=v.label;const W=i.setContext(this.getContext(g));N=this.getPixelForTick(g)+i.labelOffset,R=this._resolveTickFontOptions(g),C=R.lineHeight,T=Me(w)?w.length:1;const ie=T/2,be=W.color,L=W.textStrokeColor,O=W.textStrokeWidth;let $=k;o?(j=N,k==="inner"&&(g===x-1?$=this.options.reverse?"left":"right":g===0?$=this.options.reverse?"right":"left":$="center"),r==="top"?u==="near"||m!==0?z=-T*C+C/2:u==="center"?z=-ve.highest.height/2-ie*C+C:z=-ve.highest.height+C/2:u==="near"||m!==0?z=C/2:u==="center"?z=ve.highest.height/2-ie*C:z=ve.highest.height-T*C,h&&(z*=-1),m!==0&&!W.showLabelBackdrop&&(j+=C/2*Math.sin(m))):(E=N,z=(1-T)*C/2);let P;if(W.showLabelBackdrop){const Q=Ft(W.backdropPadding),Fe=ve.heights[g],we=ve.widths[g];let F=z-Q.top,H=0-Q.left;switch(V){case"middle":F-=Fe/2;break;case"bottom":F-=Fe;break}switch(k){case"center":H-=we/2;break;case"right":H-=we;break;case"inner":g===x-1?H-=we:g>0&&(H-=we/2);break}P={left:H,top:F,width:we+Q.width,height:Fe+Q.height,color:W.backdropColor}}b.push({label:w,font:R,textOffset:z,options:{rotation:m,color:be,strokeColor:L,strokeWidth:O,textAlign:$,textBaseline:V,translation:[j,E],backdrop:P}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Es(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=xs(e,this.left,o)-o/2,d=xs(e,this.right,a)+a/2,h=f=l):(h=xs(e,this.top,o)-o/2,f=xs(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&&Yd(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;oo(s,u,0,d,l,a)}r&&Kd(s)}drawTitle(){const{ctx:e,options:{position:n,title:s,reverse:r}}=this;if(!s.display)return;const i=Ye(s.font),o=Ft(s.padding),a=s.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Z(n)?(l+=o.bottom,Me(s.text)&&(l+=i.lineHeight*(s.text.length-1))):l+=o.top;const{titleX:u,titleY:d,maxWidth:h,rotation:f}=j2(this,l,n,a);oo(e,s.text,0,0,i,{color:s.color,maxWidth:h,rotation:f,textAlign:C2(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 Ye(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ea{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;P2(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,N2(e,o,s),this.override&&je.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 je[r]&&(delete je[r][s],this.override&&delete Ks[s])}}function N2(t,e,n){const s=ro(Object.create(null),[n?je.get(n):{},je.get(e),t.defaults]);je.set(e,s),t.defaultRoutes&&E2(e,t.defaultRoutes),t.descriptors&&je.describe(e,t.descriptors)}function E2(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(".");je.route(i,r,l,a)})}function P2(t){return"id"in t&&"defaults"in t}class T2{constructor(){this.controllers=new ea(Di,"datasets",!0),this.elements=new ea(ds,"elements"),this.plugins=new ea(Object,"plugins"),this.scales=new ea(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):se(r,o=>{const a=s||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,s){const r=Ud(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 tn=new T2;class M2{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(){ae(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=R2(s);return r===!1&&!n?[]:D2(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 R2(t){const e={},n=[],s=Object.keys(tn.plugins.items);for(let i=0;i<s.length;i++)n.push(tn.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 O2(t,e){return!e&&t===!1?null:t===!0?{}:t}function D2(t,{plugins:e,localIds:n},s,r){const i=[],o=t.getContext();for(const a of e){const l=a.id,u=O2(s[l],r);u!==null&&i.push({plugin:a,options:L2(t.config,{plugin:a,local:n[l]},u,o)})}return i}function L2(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 Mc(t,e){const n=je.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function F2(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function I2(t,e){return t===e?"_index_":"_value_"}function kp(t){if(t==="x"||t==="y"||t==="r")return t}function A2(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Rc(t,...e){if(kp(t))return t;for(const n of e){const s=n.axis||A2(n.position)||t.length>1&&kp(t[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function _p(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function z2(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 _p(t,"x",n[0])||_p(t,"y",n[0])}return{}}function $2(t,e){const n=Ks[t.type]||{scales:{}},s=e.scales||{},r=Mc(t.type,e),i=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!Z(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=Rc(o,a,z2(o,t),je.scales[a.type]),u=I2(l,r),d=n.scales||{};i[o]=Mi(Object.create(null),[{axis:l},a,d[l],d[u]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||Mc(a,e),d=(Ks[a]||{}).scales||{};Object.keys(d).forEach(h=>{const f=F2(h,l),p=o[f+"AxisID"]||f;i[p]=i[p]||Object.create(null),Mi(i[p],[{axis:f},s[p],d[h]])})}),Object.keys(i).forEach(o=>{const a=i[o];Mi(a,[je.scales[a.type],je.scale])}),i}function jy(t){const e=t.options||(t.options={});e.plugins=ee(e.plugins,{}),e.scales=$2(t,e)}function Ny(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function B2(t){return t=t||{},t.data=Ny(t.data),jy(t),t}const Sp=new Map,Ey=new Set;function ta(t,e){let n=Sp.get(t);return n||(n=e(),Sp.set(t,n),Ey.add(n)),n}const hi=(t,e,n)=>{const s=Br(e,n);s!==void 0&&t.add(s)};class H2{constructor(e){this._config=B2(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=Ny(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(),jy(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ta(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return ta(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return ta(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,s=this.type;return ta(`${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=>hi(l,e,h))),d.forEach(h=>hi(l,r,h)),d.forEach(h=>hi(l,Ks[i]||{},h)),d.forEach(h=>hi(l,je,h)),d.forEach(h=>hi(l,Tc,h))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),Ey.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,Ks[n]||{},je.datasets[n]||{},{type:n},je,Tc]}resolveNamedOptions(e,n,s,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=Cp(this._resolverCache,e,r);let l=o;if(U2(o,n)){i.$shared=!1,s=cs(s)?s():s;const u=this.createResolver(e,s,a);l=Hr(o,s,u)}for(const u of n)i[u]=l[u];return i}createResolver(e,n,s=[""],r){const{resolver:i}=Cp(this._resolverCache,e,s);return Z(n)?Hr(i,n,void 0,r):i}}function Cp(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:Xd(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(r,i)),i}const W2=t=>Z(t)&&Object.getOwnPropertyNames(t).some(e=>cs(t[e]));function U2(t,e){const{isScriptable:n,isIndexable:s}=hy(t);for(const r of e){const i=n(r),o=s(r),a=(o||i)&&t[r];if(i&&(cs(a)||W2(a))||o&&Me(a))return!0}return!1}var V2="4.5.1";const Q2=["top","bottom","left","right","chartArea"];function jp(t,e){return t==="top"||t==="bottom"||Q2.indexOf(t)===-1&&e==="x"}function Np(t,e){return function(n,s){return n[t]===s[t]?n[e]-s[e]:n[t]-s[t]}}function Ep(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),he(n&&n.onComplete,[t],e)}function Y2(t){const e=t.chart,n=e.options.animation;he(n&&n.onProgress,[t],e)}function Py(t){return Jd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const wa={},Pp=t=>{const e=Py(t);return Object.values(wa).filter(n=>n.canvas===e).pop()};function K2(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 X2(t,e,n,s){return!n||t.type==="mouseout"?null:s?e:t}var Mn;let So=(Mn=class{static register(...e){tn.add(...e),Tp()}static unregister(...e){tn.remove(...e),Tp()}constructor(e,n){const s=this.config=new H2(n),r=Py(e),i=Pp(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||f2(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=d_(),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 M2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=M_(h=>this.update(h),o.resizeDelay||0),this._dataChanges=[],wa[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}dn.listen(this,"complete",Ep),dn.listen(this,"progress",Y2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:s,height:r,_aspectRatio:i}=this;return ae(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 tn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tp(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Gf(this.canvas,this.ctx),this}stop(){return dn.stop(this),this}resize(e,n){dn.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,tp(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||{};se(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=Rc(o,a),u=l==="r",d=l==="x";return{options:a,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),se(i,o=>{const a=o.options,l=a.id,u=Rc(l,a),d=ee(a.type,o.dtype);(a.position===void 0||jp(a.position,u)!==jp(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=tn.getScale(d);h=new f({id:l,type:d,ctx:this.ctx,chart:this}),s[h.id]=h}h.init(a,e)}),se(r,(o,a)=>{o||delete s[a]}),se(s,o=>{Tt.configure(this,o,o.options),Tt.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(Np("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||Mc(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=tn.getController(a),{datasetElementType:u,dataElementType:d}=je.datasets[a];Object.assign(l,{dataElementType:tn.getElement(d),datasetElementType:u&&tn.getElement(u)}),o.controller=new l(this,s),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){se(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||se(i,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Np("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){se(this.scales,e=>{Tt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(e.events);(!Bf(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;K2(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(!Bf(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;Tt.update(this,this.width,this.height,e);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],se(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,cs(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&&(dn.has(this)?this.attached&&!dn.running(this)&&dn.start(this):(this.draw(),Ep({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=gS(this,e);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Yd(n,r),e.controller.draw(),r&&Kd(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return uy(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,s,r){const i=QS.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=Xr(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);io(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(),dn.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(),Gf(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete wa[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)};se(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(){se(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},se(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}});!Xa(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=y_(e),u=X2(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=!Xa(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)}},G(Mn,"defaults",je),G(Mn,"instances",wa),G(Mn,"overrides",Ks),G(Mn,"registry",tn),G(Mn,"version",V2),G(Mn,"getChart",Pp),Mn);function Tp(){return se(So.instances,t=>t._plugins.invalidate())}function Ty(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 Xn(t,e,n,s){return t?0:Ut(e,n,s)}function q2(t,e,n){const s=t.options.borderWidth,r=t.borderSkipped,i=dy(s);return{t:Xn(r.top,i.top,0,n),r:Xn(r.right,i.right,0,e),b:Xn(r.bottom,i.bottom,0,n),l:Xn(r.left,i.left,0,e)}}function G2(t,e,n){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,i=vr(r),o=Math.min(e,n),a=t.borderSkipped,l=s||Z(r);return{topLeft:Xn(!l||a.top||a.left,i.topLeft,0,o),topRight:Xn(!l||a.top||a.right,i.topRight,0,o),bottomLeft:Xn(!l||a.bottom||a.left,i.bottomLeft,0,o),bottomRight:Xn(!l||a.bottom||a.right,i.bottomRight,0,o)}}function J2(t){const e=Ty(t),n=e.right-e.left,s=e.bottom-e.top,r=q2(t,n/2,s/2),i=G2(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 mu(t,e,n,s){const r=e===null,i=n===null,a=t&&!(r&&i)&&Ty(t,s);return a&&(r||hr(e,a.left,a.right))&&(i||hr(n,a.top,a.bottom))}function Z2(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function eC(t,e){t.rect(e.x,e.y,e.w,e.h)}function gu(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 Li extends ds{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}=J2(this),a=Z2(o.radius)?Za:eC;e.save(),(o.w!==i.w||o.h!==i.h)&&(e.beginPath(),a(e,gu(o,n,i)),e.clip(),a(e,gu(i,-n,o)),e.fillStyle=s,e.fill("evenodd")),e.beginPath(),a(e,gu(i,n)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,n,s){return mu(this,e,n,s)}inXRange(e,n){return mu(this,e,null,n)}inYRange(e,n){return mu(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}}G(Li,"id","bar"),G(Li,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),G(Li,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Mp=(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)}},tC=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Rp extends ds{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=Ye(s.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Mp(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((y,m)=>{const b=s+n/2+i.measureText(y.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,y=0,m=0;return this.legendItems.forEach((b,g)=>{const{itemWidth:x,itemHeight:v}=nC(s,n,i,b,r);g>0&&p+v+2*a>d&&(h+=f+a,u.push({width:f,height:p}),y+=f+a,m++,f=p=0),l[g]={left:y,top:p,col:m,width:x,height:v},f=Math.max(f,x),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=br(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ve(s,this.left+r,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Ve(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=Ve(s,this.top+e+r,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Ve(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;Yd(e,this),this._draw(),Kd(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:s,ctx:r}=this,{align:i,labels:o}=e,a=je.color,l=br(e.rtl,this.left,this.width),u=Ye(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:y,boxHeight:m,itemHeight:b}=Mp(o,h),g=function(E,k,N){if(isNaN(y)||y<=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},T=l.xPlus(E,y/2),z=k+f;ly(r,C,T,z,o.pointStyleWidth&&y)}else{const C=k+Math.max((h-m)/2,0),T=l.leftForLtr(E,y),z=vr(N.borderRadius);r.beginPath(),Object.values(z).some(V=>V!==0)?Za(r,{x:T,y:C,w:y,h:m,radius:z}):r.rect(T,C,y,m),r.fill(),R!==0&&r.stroke()}r.restore()},x=function(E,k,N){oo(r,N.text,E,k+b/2,u,{strikethrough:N.hidden,textAlign:l.textAlign(N.textAlign)})},v=this.isHorizontal(),w=this._computeTitleHeight();v?p={x:Ve(i,this.left+d,this.right-s[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:Ve(i,this.top+w+d,this.bottom-n[0].height),line:0},gy(this.ctx,e.textDirection);const j=b+d;this.legendItems.forEach((E,k)=>{r.strokeStyle=E.fontColor,r.fillStyle=E.fontColor;const N=r.measureText(E.text).width,R=l.textAlign(E.textAlign||(E.textAlign=o.textAlign)),C=y+f+N;let T=p.x,z=p.y;l.setWidth(this.width),v?k>0&&T+C+d>this.right&&(z=p.y+=j,p.line++,T=p.x=Ve(i,this.left+d,this.right-s[p.line])):k>0&&z+j>this.bottom&&(T=p.x=T+n[p.line].width+d,p.line++,z=p.y=Ve(i,this.top+w+d,this.bottom-n[p.line].height));const V=l.x(T);if(g(V,z,E),T=R_(R,T+y+f,v?T+C:this.right,e.rtl),x(l.x(T),z,E),v)p.x+=C+d;else if(typeof E.text!="string"){const ve=u.lineHeight;p.y+=My(E,ve)+d}else p.y+=j}),yy(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,s=Ye(n.font),r=Ft(n.padding);if(!n.display)return;const i=br(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=Ve(e.align,h,this.right-f);else{const y=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);d=u+Ve(e.align,this.top,this.bottom-y-e.labels.padding-this._computeTitleHeight())}const p=Ve(a,h,h+f);o.textAlign=i.textAlign(Qd(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=s.string,oo(o,n.text,p,d,s)}_computeTitleHeight(){const e=this.options.title,n=Ye(e.font),s=Ft(e.padding);return e.display?n.lineHeight+s.height:0}_getLegendItemAt(e,n){let s,r,i;if(hr(e,this.left,this.right)&&hr(n,this.top,this.bottom)){for(i=this.legendHitBoxes,s=0;s<i.length;++s)if(r=i[s],hr(e,r.left,r.left+r.width)&&hr(n,r.top,r.top+r.height))return this.legendItems[s]}return null}handleEvent(e){const n=this.options;if(!iC(e.type,n))return;const s=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,i=tC(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 nC(t,e,n,s,r){const i=sC(s,t,e,n),o=rC(r,s,e.lineHeight);return{itemWidth:i,itemHeight:o}}function sC(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 rC(t,e,n){let s=t;return typeof e.text!="string"&&(s=My(e,n)),s}function My(t,e){const n=t.text?t.text.length:0;return e*n}function iC(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Ry={id:"legend",_element:Rp,start(t,e,n){const s=t.legend=new Rp({ctx:t.ctx,options:n,chart:t});Tt.configure(t,s,n),Tt.addBox(t,s)},stop(t){Tt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const s=t.legend;Tt.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=Ft(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 Oy extends ds{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=Me(s.text)?s.text.length:1;this._padding=Ft(s.padding);const i=r*Ye(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=Ve(a,s,i),h=n+e,u=i-s):(o.position==="left"?(d=s+e,h=Ve(a,r,n),l=Ke*-.5):(d=i-e,h=Ve(a,n,r),l=Ke*.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=Ye(n.font),i=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(i);oo(e,n.text,0,0,s,{color:n.color,maxWidth:l,rotation:u,textAlign:Qd(n.align),textBaseline:"middle",translation:[o,a]})}}function oC(t,e){const n=new Oy({ctx:t.ctx,options:e,chart:t});Tt.configure(t,n,e),Tt.addBox(t,n),t.titleBlock=n}var Dy={id:"title",_element:Oy,start(t,e,n){oC(t,n)},stop(t){const e=t.titleBlock;Tt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const s=t.titleBlock;Tt.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 wi={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=C_(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 Zt(t,e){return e&&(Me(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function hn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
210
+ `)>-1?t.split(`
211
+ `):t}function aC(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 Op(t,e){const n=t.chart.ctx,{body:s,footer:r,title:i}=t,{boxWidth:o,boxHeight:a}=e,l=Ye(e.bodyFont),u=Ye(e.titleFont),d=Ye(e.footerFont),h=i.length,f=r.length,p=s.length,y=Ft(e.padding);let m=y.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 x=0;const v=function(w){b=Math.max(b,n.measureText(w).width+x)};return n.save(),n.font=u.string,se(t.title,v),n.font=l.string,se(t.beforeBody.concat(t.afterBody),v),x=e.displayColors?o+2+e.boxPadding:0,se(s,w=>{se(w.before,v),se(w.lines,v),se(w.after,v)}),x=0,n.font=d.string,se(t.footer,v),n.restore(),b+=y.width,{width:b,height:m}}function lC(t,e){const{y:n,height:s}=e;return n<s/2?"top":n>t.height-s/2?"bottom":"center"}function uC(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 cC(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"),uC(u,t,e,n)&&(u="center"),u}function Dp(t,e,n){const s=n.yAlign||e.yAlign||lC(t,n);return{xAlign:n.xAlign||e.xAlign||cC(t,e,n,s),yAlign:s}}function dC(t,e){let{x:n,width:s}=t;return e==="right"?n-=s:e==="center"&&(n-=s/2),n}function hC(t,e,n){let{y:s,height:r}=t;return e==="top"?s+=n:e==="bottom"?s-=r+n:s-=r/2,s}function Lp(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}=vr(o);let y=dC(e,a);const m=hC(e,l,u);return l==="center"?a==="left"?y+=u:a==="right"&&(y-=u):a==="left"?y-=Math.max(d,f)+r:a==="right"&&(y+=Math.max(h,p)+r),{x:Ut(y,0,s.width-e.width),y:Ut(m,0,s.height-e.height)}}function na(t,e,n){const s=Ft(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-s.right:t.x+s.left}function Fp(t){return Zt([],hn(t))}function fC(t,e,n){return Xr(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Ip(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Ly={beforeTitle:un,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:un,beforeBody:un,beforeLabel:un,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 ae(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:un,afterBody:un,beforeFooter:un,footer:un,afterFooter:un};function at(t,e,n,s){const r=t[e].call(n,s);return typeof r>"u"?Ly[e].call(n,s):r}class Oc extends ds{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 xy(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=fC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:s}=n,r=at(s,"beforeTitle",this,e),i=at(s,"title",this,e),o=at(s,"afterTitle",this,e);let a=[];return a=Zt(a,hn(r)),a=Zt(a,hn(i)),a=Zt(a,hn(o)),a}getBeforeBody(e,n){return Fp(at(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:s}=n,r=[];return se(e,i=>{const o={before:[],lines:[],after:[]},a=Ip(s,i);Zt(o.before,hn(at(a,"beforeLabel",this,i))),Zt(o.lines,at(a,"label",this,i)),Zt(o.after,hn(at(a,"afterLabel",this,i))),r.push(o)}),r}getAfterBody(e,n){return Fp(at(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:s}=n,r=at(s,"beforeFooter",this,e),i=at(s,"footer",this,e),o=at(s,"afterFooter",this,e);let a=[];return a=Zt(a,hn(r)),a=Zt(a,hn(i)),a=Zt(a,hn(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(aC(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))),se(a,d=>{const h=Ip(e.callbacks,d);r.push(at(h,"labelColor",this,d)),i.push(at(h,"labelPointStyle",this,d)),o.push(at(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=wi[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=Op(this,s),u=Object.assign({},a,l),d=Dp(this.chart,s,u),h=Lp(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}=vr(a),{x:f,y:p}=e,{width:y,height:m}=n;let b,g,x,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+y,g=b+o,v=w-o,j=w+o),x=b):(r==="left"?g=f+Math.max(l,d)+o:r==="right"?g=f+y-Math.max(u,h)-o:g=this.caretX,i==="top"?(v=p,w=v-o,b=g-o,x=g+o):(v=p+m,w=v+o,b=g+o,x=g-o),j=v),{x1:b,x2:g,x3:x,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=br(s.rtl,this.x,this.width);for(e.x=na(this,s.titleAlign,s),n.textAlign=u.textAlign(s.titleAlign),n.textBaseline="middle",o=Ye(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=Ye(i.bodyFont),h=na(this,"left",i),f=r.x(h),p=l<d.lineHeight?(d.lineHeight-l)/2:0,y=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=y+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Jf(e,m,b,g),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Jf(e,m,b,g)}else{e.lineWidth=Z(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=vr(o.borderRadius);Object.values(g).some(x=>x!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Za(e,{x:m,y,w:u,h:l,radius:g}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Za(e,{x:b,y:y+1,w:u-2,h:l-2,radius:g}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(m,y,u,l),e.strokeRect(m,y,u,l),e.fillStyle=o.backgroundColor,e.fillRect(b,y+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=Ye(s.bodyFont);let f=h.lineHeight,p=0;const y=br(s.rtl,this.x,this.width),m=function(N){n.fillText(N,y.x(e.x+p),e.y+f/2),e.y+=f+i},b=y.textAlign(o);let g,x,v,w,j,E,k;for(n.textAlign=o,n.textBaseline="middle",n.font=h.string,e.x=na(this,b,s),n.fillStyle=s.bodyColor,se(this.beforeBody,m),p=a&&b!=="right"?o==="center"?u/2+d:u+2+d:0,w=0,E=r.length;w<E;++w){for(g=r[w],x=this.labelTextColors[w],n.fillStyle=x,se(g.before,m),v=g.lines,a&&v.length&&(this._drawColorBox(n,e,w,y,s),f=Math.max(h.lineHeight,l)),j=0,k=v.length;j<k;++j)m(v[j]),f=h.lineHeight;se(g.after,m)}p=0,f=h.lineHeight,se(this.afterBody,m),e.y-=i}drawFooter(e,n,s){const r=this.footer,i=r.length;let o,a;if(i){const l=br(s.rtl,this.x,this.width);for(e.x=na(this,s.footerAlign,s),e.y+=s.footerMarginTop,n.textAlign=l.textAlign(s.footerAlign),n.textBaseline="middle",o=Ye(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:y}=vr(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-y),n.quadraticCurveTo(a+u,l+d,a+u-y,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=wi[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Op(this,e),l=Object.assign({},o,this._size),u=Dp(n,e,l),d=Lp(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=Ft(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),gy(e,n.textDirection),i.y+=o.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),yy(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=!Xa(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||!Xa(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=wi[i.position].call(this,e,n);return o!==!1&&(s!==o.x||r!==o.y)}}G(Oc,"positioners",wi);var Fy={id:"tooltip",_element:Oc,positioners:wi,afterInit(t,e,n){n&&(t.tooltip=new Oc({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:Ly},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 pC=(t,e,n,s)=>(typeof e=="string"?(n=t.push(e)-1,s.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function mC(t,e,n,s){const r=t.indexOf(e);if(r===-1)return pC(t,e,n,s);const i=t.lastIndexOf(e);return r!==i?n:r}const gC=(t,e)=>t===null?null:Ut(Math.round(t),0,e);function Ap(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class nl 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(ae(e))return null;const s=this.getLabels();return n=isFinite(n)&&s[n]===e?n:mC(s,e,ee(n,e),this._addedLabels),gC(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 Ap.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}}G(nl,"id","category"),G(nl,"defaults",{ticks:{callback:Ap}});function yC(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,y=d-1,{min:m,max:b}=e,g=!ae(o),x=!ae(a),v=!ae(u),w=(b-m)/(h+1);let j=Wf((b-m)/y/p)*p,E,k,N,R;if(j<1e-14&&!g&&!x)return[{value:m},{value:b}];R=Math.ceil(b/j)-Math.floor(m/j),R>y&&(j=Wf(R*j/y/p)*p),ae(l)||(E=Math.pow(10,l),j=Math.ceil(j*E)/E),r==="ticks"?(k=Math.floor(m/j)*j,N=Math.ceil(b/j)*j):(k=m,N=b),g&&x&&i&&w_((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=x?a:N,R=u-1,j=(N-k)/R):(R=(N-k)/j,xa(R,Math.round(R),j/1e3)?R=Math.round(R):R=Math.ceil(R));const C=Math.max(Uf(j),Uf(k));E=Math.pow(10,ae(l)?C:l),k=Math.round(k*E)/E,N=Math.round(N*E)/E;let T=0;for(g&&(f&&k!==o?(n.push({value:o}),k<o&&T++,xa(Math.round((k+T*j)*E)/E,o,zp(o,w,t))&&T++):k<o&&T++);T<R;++T){const z=Math.round((k+T*j)*E)/E;if(x&&z>a)break;n.push({value:z})}return x&&f&&N!==a?n.length&&xa(n[n.length-1].value,a,zp(a,w,t))?n[n.length-1].value=a:n.push({value:a}):(!x||N===a)&&n.push({value:N}),n}function zp(t,e,{horizontal:n,minRotation:s}){const r=Es(s),i=(n?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/i,o)}class xC 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 ae(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=as(r),u=as(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=yC(r,i);return e.bounds==="ticks"&&k_(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 oy(e,this.chart.options.locale,this.options.ticks.format)}}class sl extends xC{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Lt(e)?e:0,this.max=Lt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,s=Es(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}}G(sl,"id","linear"),G(sl,"defaults",{ticks:{callback:ay.formatters.numeric}});const Nl={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}},dt=Object.keys(Nl);function $p(t,e){return t-e}function Bp(t,e){if(ae(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)),Lt(o)||(o=typeof s=="string"?n.parse(o,s):n.parse(o)),o===null?null:(r&&(o=r==="week"&&(Ja(i)||i===!0)?n.startOf(o,"isoWeek",i):n.startOf(o,r)),+o)}function Hp(t,e,n,s){const r=dt.length;for(let i=dt.indexOf(t);i<r-1;++i){const o=Nl[dt[i]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(a*o.size))<=s)return dt[i]}return dt[r-1]}function vC(t,e,n,s,r){for(let i=dt.length-1;i>=dt.indexOf(n);i--){const o=dt[i];if(Nl[o].common&&t._adapter.diff(r,s,o)>=e-1)return o}return dt[n?dt.indexOf(n):0]}function bC(t){for(let e=dt.indexOf(t)+1,n=dt.length;e<n;++e)if(Nl[dt[e]].common)return dt[e]}function Wp(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:s,hi:r}=Vd(n,e),i=n[s]>=e?n[s]:n[r];t[i]=!0}}function wC(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 Up(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:wC(t,s,r,n)}class rl 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 BS._date(e.adapters.date);r.init(n),Mi(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:Bp(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=Lt(r)&&!isNaN(r)?r:+n.startOf(Date.now(),s),i=Lt(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=P_(r,i,o);return this._unit=n.unit||(s.autoSkip?Hp(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):vC(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:bC(this._unit),this.initOffsets(r),e.reverse&&a.reverse(),Up(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=Ut(n,0,o),s=Ut(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||Hp(i.minUnit,n,s,this._getLabelCapacity(n)),a=ee(r.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,u=Ja(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 y=r.ticks.source==="data"&&this.getDataTimestamps();for(f=h,p=0;f<s;f=+e.add(f,a,o),p++)Wp(d,f,y);return(f===s||r.bounds==="ticks"||p===1)&&Wp(d,f,y),Object.keys(d).sort($p).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=Es(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,Up(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(Bp(this,r[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ny(e.sort($p))}}G(rl,"id","time"),G(rl,"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 sa(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}=Pc(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}=Pc(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 Vp extends rl{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=sa(n,this.min),this._tableRange=sa(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(sa(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return sa(this._table,s*this._tableRange+this._minPos,!0)}}G(Vp,"id","timeseries"),G(Vp,"defaults",rl.defaults);const Iy="label";function Qp(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function kC(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Ay(t,e){t.labels=e}function zy(t,e,n=Iy){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 _C(t,e=Iy){const n={labels:[],datasets:[]};return Ay(n,t.labels),zy(n,t.datasets,e),n}function SC(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=_.useRef(null),y=_.useRef(null),m=()=>{p.current&&(y.current=new So(p.current,{type:o,data:_C(a,i),options:l&&{...l},plugins:u}),Qp(e,y.current))},b=()=>{Qp(e,null),y.current&&(y.current.destroy(),y.current=null)};return _.useEffect(()=>{!r&&y.current&&l&&kC(y.current,l)},[r,l]),_.useEffect(()=>{!r&&y.current&&Ay(y.current.config.data,a.labels)},[r,a.labels]),_.useEffect(()=>{!r&&y.current&&a.datasets&&zy(y.current.config.data,a.datasets,i)},[r,a.datasets]),_.useEffect(()=>{y.current&&(r?(b(),setTimeout(m)):y.current.update(h))},[r,l,a.labels,a.datasets,h]),_.useEffect(()=>{y.current&&(b(),setTimeout(m))},[o]),_.useEffect(()=>(m(),()=>b()),[]),c.jsx("canvas",{ref:p,role:"img",height:n,width:s,...f,children:d})}const CC=_.forwardRef(SC);function jC(t,e){return So.register(e),_.forwardRef((n,s)=>c.jsx(CC,{...n,ref:s,type:t}))}const wr=jC("bar",va);function NC(t,e="12px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s?(s.font=e,s.measureText(t).width):0}function Ne({label:t,percentage:e,color:n,title:s}){const r=_.useRef(null),[i,o]=_.useState(!1),[a,l]=_.useState(!1);return _.useEffect(()=>{const u=()=>{if(r.current){const h=r.current.offsetWidth,f=NC(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 Ee({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)}`}So.register(nl,sl,Li,Dy,Fy,Ry);function EC(){const[t,e]=_.useState("7"),{data:n,isLoading:s,error:r}=wl({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:y,trends:m}=n,b=[...u.map(k=>k.tokenUsage.totalTokens)].sort((k,N)=>k-N),g=Math.floor(b.length*.95),x=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,E=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:[tt(new Date(l.dateRange.start),"MMM d, yyyy")," - ",tt(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(Ee,{title:"Total Tokens",value:D(l.tokenUsage.totalTokens),subtitle:`${l.sessionCount} sessions`,color:"blue"}),c.jsx(Ee,{title:"Total Cost",value:le(p.totalCost),subtitle:"Estimated",color:"green"}),c.jsx(Ee,{title:"Cache Hit Rate",value:`${f.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${le(f.estimatedSavings)}`,color:"purple"}),c.jsx(Ee,{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(Ne,{label:"Input",percentage:l.tokenUsage.inputTokens/l.tokenUsage.totalTokens*100,color:"bg-blue-500",title:`Input: ${D(l.tokenUsage.inputTokens)}`}),c.jsx(Ne,{label:"Output",percentage:l.tokenUsage.outputTokens/l.tokenUsage.totalTokens*100,color:"bg-green-500",title:`Output: ${D(l.tokenUsage.outputTokens)}`}),c.jsx(Ne,{label:"Cache Create",percentage:l.tokenUsage.cacheCreationTokens/l.tokenUsage.totalTokens*100,color:"bg-purple-500",title:`Cache Create: ${D(l.tokenUsage.cacheCreationTokens)}`}),c.jsx(Ne,{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(Ne,{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(Ne,{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(Ne,{label:"Input",percentage:p.inputCost/p.totalCost*100,color:"bg-blue-500",title:`Input: ${le(p.inputCost)}`}),c.jsx(Ne,{label:"Output",percentage:p.outputCost/p.totalCost*100,color:"bg-green-500",title:`Output: ${le(p.outputCost)}`}),c.jsx(Ne,{label:"Cache Create",percentage:p.cacheCreationCost/p.totalCost*100,color:"bg-purple-500",title:`Cache Create: ${le(p.cacheCreationCost)}`}),c.jsx(Ne,{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(wr,{data:{labels:u.map(k=>tt(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:x,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 tt(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}
212
+ ${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(E)})]}),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((T,z)=>T+z.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((T,z)=>T+z.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(Ee,{title:"Total Tool Calls",value:D(y.totalToolCalls),subtitle:`Across ${l.sessionCount} sessions`,color:"blue"}),c.jsx(Ee,{title:"Agent Sessions",value:D(y.agentSessions),subtitle:`${y.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),c.jsx(Ee,{title:"Avg Tools per Session",value:(y.totalToolCalls/y.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:y.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(Ee,{title:"Total Cache Created",value:D(f.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),c.jsx(Ee,{title:"Total Cache Read",value:D(f.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),c.jsx(Ee,{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(wr,{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(wr,{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()]})})}So.register(nl,sl,Li,Dy,Fy,Ry);function PC({projectInfo:t}){var h;const{projectId:e}=A0(),n=wo(),[s,r]=_.useState("7"),{data:i,isLoading:o,error:a}=wl({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:y,cache:m,cost:b,productivity:g,trends:x}=i;i.byProject[0];const v=[...p.map(C=>C.tokenUsage.totalTokens)].sort((C,T)=>C-T),w=Math.floor(v.length*.95),j=Math.max(v[w]||1,1),E=p.map(C=>C.tokenUsage.totalTokens),k=E.length>0?Math.min(...E):0,N=E.length>0?Math.max(...E):0,R=E.length>0?E.reduce((C,T)=>C+T,0)/E.length:0;return c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-gray-400 mb-6",children:[tt(new Date(f.dateRange.start),"MMM d, yyyy")," - ",tt(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(Ee,{title:"Total Tokens",value:D(f.tokenUsage.totalTokens),subtitle:`${f.sessionCount} sessions`,color:"blue"}),c.jsx(Ee,{title:"Total Cost",value:le(b.totalCost),subtitle:"Estimated",color:"green"}),c.jsx(Ee,{title:"Cache Hit Rate",value:`${m.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${le(m.estimatedSavings)}`,color:"purple"}),c.jsx(Ee,{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(Ne,{label:"Input",percentage:f.tokenUsage.inputTokens/f.tokenUsage.totalTokens*100,color:"bg-blue-500",title:`Input: ${D(f.tokenUsage.inputTokens)}`}),c.jsx(Ne,{label:"Output",percentage:f.tokenUsage.outputTokens/f.tokenUsage.totalTokens*100,color:"bg-green-500",title:`Output: ${D(f.tokenUsage.outputTokens)}`}),c.jsx(Ne,{label:"Cache Create",percentage:f.tokenUsage.cacheCreationTokens/f.tokenUsage.totalTokens*100,color:"bg-purple-500",title:`Cache Create: ${D(f.tokenUsage.cacheCreationTokens)}`}),c.jsx(Ne,{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(Ne,{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(Ne,{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(Ne,{label:"Input",percentage:b.inputCost/b.totalCost*100,color:"bg-blue-500",title:`Input: ${le(b.inputCost)}`}),c.jsx(Ne,{label:"Output",percentage:b.outputCost/b.totalCost*100,color:"bg-green-500",title:`Output: ${le(b.outputCost)}`}),c.jsx(Ne,{label:"Cache Create",percentage:b.cacheCreationCost/b.totalCost*100,color:"bg-purple-500",title:`Cache Create: ${le(b.cacheCreationCost)}`}),c.jsx(Ne,{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(wr,{data:{labels:p.map(C=>tt(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 T=C[0].dataIndex;return tt(new Date(p[T].date),"MMM d, yyyy")}return""},label:C=>{const T=C.dataset.label||"",z=C.parsed.y!==null?D(C.parsed.y):"0";return`${T}: ${z}`},footer:C=>{if(C.length>0){const T=C[0].dataIndex,z=D(p[T].tokenUsage.totalTokens),V=p[T].sessionCount;return`Total: ${z}
213
+ ${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:y.map((C,T)=>{const z=y.reduce((ve,W)=>ve+W.tokenUsage.totalTokens,0),V=C.tokenUsage.totalTokens/z*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)})]})]})]},T)})})]}),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(Ee,{title:"Total Tool Calls",value:D(g.totalToolCalls),subtitle:`Across ${f.sessionCount} sessions`,color:"blue"}),c.jsx(Ee,{title:"Agent Sessions",value:D(g.agentSessions),subtitle:`${g.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),c.jsx(Ee,{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,T)=>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)}%`}})})]},T))})]}),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(Ee,{title:"Total Cache Created",value:D(m.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),c.jsx(Ee,{title:"Total Cache Read",value:D(m.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),c.jsx(Ee,{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(wr,{data:{labels:x.byHour.map(C=>`${C.hour.toString().padStart(2,"0")}:00`),datasets:[{label:"Messages",data:x.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 T=x.byHour[C.dataIndex];return[`Messages: ${T.messageCount}`,`Sessions: ${T.sessionCount}`,`Tokens: ${D(T.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(wr,{data:{labels:x.byWeekday.map(C=>C.weekdayName),datasets:[{label:"Messages",data:x.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 T=x.byWeekday[C.dataIndex];return[`Messages: ${T.messageCount}`,`Sessions: ${T.sessionCount}`,`Tokens: ${D(T.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 $y=new $b,Yp="claude-session-viewer-sidebar-width",TC=320,MC=200,RC=600;function yu(){const t=wo(),e=En(),n=A0(),s=n.sessionId||null,r=n.projectId||null,i=e.pathname==="/dashboard",o=e.pathname.startsWith("/projects/")&&!e.pathname.includes("/sessions"),[a,l]=_.useState(()=>{const O=localStorage.getItem(Yp);return O?parseInt(O,10):TC}),[u,d]=_.useState(!1),[h,f]=_.useState(0),[p,y]=_.useState(!1),[m,b]=_.useState(null),g=_.useRef(null),x=_.useRef(null),v=_.useRef(0),{data:w,isLoading:j,error:E,refetch:k}=wl({queryKey:["sessions"],queryFn:async()=>{const O=await fetch("/api/sessions");if(!O.ok)throw new Error("Failed to fetch sessions");return O.json()}}),N=O=>{b(O),t(`/sessions/${O}`)},R=O=>{t(`/projects/${O}`)};_.useEffect(()=>{m&&m===s&&b(null)},[s,m]);const C=s?w==null?void 0:w.projects.flatMap(O=>O.sessions).flatMap(O=>[O,...O.agentSessions||[]]).find(O=>O.id===s):null,T=r?w==null?void 0:w.projects.find(O=>O.id===r):null;_.useEffect(()=>{const O=x.current;if(!O)return;const $=()=>{const P=O.scrollTop,Q=P<v.current;f(P),y(Q),v.current=P};return O.addEventListener("scroll",$),()=>O.removeEventListener("scroll",$)},[]),_.useEffect(()=>{const O=P=>{if(!u)return;const Q=P.clientX;Q>=MC&&Q<=RC&&(l(Q),localStorage.setItem(Yp,Q.toString()))},$=()=>{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",O),document.addEventListener("mouseup",$)),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",$)}},[u]),_.useEffect(()=>{const $=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;let P=null,Q=!1,Fe=null,we=0,F=!0;const H=()=>{P=new WebSocket($),Q=!1,P.onopen=()=>{if(Q){P==null||P.close();return}we=0},P.onmessage=K=>{const oe=JSON.parse(K.data);(oe.type==="file-added"||oe.type==="file-changed"||oe.type==="file-deleted")&&(k(),s&&$y.invalidateQueries({queryKey:["session",s]}))},P.onerror=K=>{console.error("WebSocket error:",K)},P.onclose=()=>{if(!F)return;const K=Math.min(1e3*2**we,1e4);we+=1,Fe=setTimeout(H,K)}};return H(),()=>{F=!1,Fe&&clearTimeout(Fe),P&&P.readyState===WebSocket.CONNECTING?Q=!0:P==null||P.close()}},[k,s]);const V=Math.max(0,1-(p?0:h)/80),ve=12+V*12,W=1.125+V*.375,ie=V,be=8+V*6,L=8+V*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:g,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:`${ve}px`,paddingRight:`${be+44}px`},children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold transition-all duration-200",style:{fontSize:`${W}rem`},children:"Claude Sessions"}),c.jsx("p",{className:"text-sm text-gray-400 mt-1 transition-opacity duration-200",style:{opacity:ie,height:ie>0?"auto":0,overflow:"hidden"},children:j?"Loading...":`${(w==null?void 0:w.projects.length)||0} project${(w==null?void 0:w.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:`${L}px`,right:`${be}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:x,className:"flex-1 overflow-y-auto",children:E?c.jsxs("div",{className:"p-4 text-red-400 text-sm",children:["Error loading sessions: ",E.message]}):c.jsx(Ik,{projects:(w==null?void 0:w.projects)||[],selectedId:m||s,onSelect:N,onNavigateToProject:R})})]}),c.jsx("div",{className:"absolute top-0 right-0 w-4 h-full cursor-col-resize group z-10",onMouseDown:O=>{O.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(EC,{}):o?c.jsx(PC,{projectInfo:T}):s?c.jsx(Hk,{sessionId:s,sessionInfo:C}):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 OC(){return c.jsx(Hb,{client:$y,children:c.jsx(w1,{children:c.jsxs(Gw,{children:[c.jsx(xi,{path:"/",element:c.jsx(Xw,{to:"/dashboard",replace:!0})}),c.jsx(xi,{path:"/dashboard",element:c.jsx(yu,{})}),c.jsx(xi,{path:"/projects/:projectId",element:c.jsx(yu,{})}),c.jsx(xi,{path:"/sessions/:sessionId",element:c.jsx(yu,{})})]})})})}xu.createRoot(document.getElementById("root")).render(c.jsx(ix.StrictMode,{children:c.jsx(OC,{})}));