claude-session-viewer 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var N0=Object.defineProperty;var Xd=t=>{throw TypeError(t)};var j0=(t,e,n)=>e in t?N0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Y=(t,e,n)=>j0(t,typeof e!="symbol"?e+"":e,n),vl=(t,e,n)=>e.has(t)||Xd("Cannot "+n);var _=(t,e,n)=>(vl(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?Xd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),D=(t,e,n,r)=>(vl(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),V=(t,e,n)=>(vl(t,e,"access private method"),n);var mo=(t,e,n,r)=>({set _(i){D(t,e,i,n)},get _(){return _(t,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function D0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zp={exports:{}},Xa={},em={exports:{}},U={};/**
1
+ var O0=Object.defineProperty;var Xd=t=>{throw TypeError(t)};var j0=(t,e,n)=>e in t?O0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Y=(t,e,n)=>j0(t,typeof e!="symbol"?e+"":e,n),vl=(t,e,n)=>e.has(t)||Xd("Cannot "+n);var S=(t,e,n)=>(vl(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?Xd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),D=(t,e,n,r)=>(vl(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),V=(t,e,n)=>(vl(t,e,"access private method"),n);var mo=(t,e,n,r)=>({set _(i){D(t,e,i,n)},get _(){return S(t,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function D0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zp={exports:{}},Xa={},em={exports:{}},U={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ var N0=Object.defineProperty;var Xd=t=>{throw TypeError(t)};var j0=(t,e,n)=>e in
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var io=Symbol.for("react.element"),L0=Symbol.for("react.portal"),F0=Symbol.for("react.fragment"),I0=Symbol.for("react.strict_mode"),A0=Symbol.for("react.profiler"),z0=Symbol.for("react.provider"),B0=Symbol.for("react.context"),W0=Symbol.for("react.forward_ref"),H0=Symbol.for("react.suspense"),$0=Symbol.for("react.memo"),U0=Symbol.for("react.lazy"),qd=Symbol.iterator;function V0(t){return t===null||typeof t!="object"?null:(t=qd&&t[qd]||t["@@iterator"],typeof t=="function"?t:null)}var tm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nm=Object.assign,rm={};function Fi(t,e,n){this.props=t,this.context=e,this.refs=rm,this.updater=n||tm}Fi.prototype.isReactComponent={};Fi.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")};Fi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function im(){}im.prototype=Fi.prototype;function Pc(t,e,n){this.props=t,this.context=e,this.refs=rm,this.updater=n||tm}var Mc=Pc.prototype=new im;Mc.constructor=Pc;nm(Mc,Fi.prototype);Mc.isPureReactComponent=!0;var Gd=Array.isArray,sm=Object.prototype.hasOwnProperty,Rc={current:null},om={key:!0,ref:!0,__self:!0,__source:!0};function am(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)sm.call(e,r)&&!om.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:io,type:t,key:s,ref:o,props:i,_owner:Rc.current}}function Q0(t,e){return{$$typeof:io,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Tc(t){return typeof t=="object"&&t!==null&&t.$$typeof===io}function Y0(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Jd=/\/+/g;function xl(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Y0(""+t.key):e.toString(36)}function Ko(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case io:case L0:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+xl(o,0):r,Gd(i)?(n="",t!=null&&(n=t.replace(Jd,"$&/")+"/"),Ko(i,e,n,"",function(u){return u})):i!=null&&(Tc(i)&&(i=Q0(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Jd,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",Gd(t))for(var a=0;a<t.length;a++){s=t[a];var l=r+xl(s,a);o+=Ko(s,e,n,l,i)}else if(l=V0(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=r+xl(s,a++),o+=Ko(s,e,n,l,i);else if(s==="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 go(t,e,n){if(t==null)return t;var r=[],i=0;return Ko(t,r,"","",function(s){return e.call(n,s,i++)}),r}function K0(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 Xe={current:null},Xo={transition:null},X0={ReactCurrentDispatcher:Xe,ReactCurrentBatchConfig:Xo,ReactCurrentOwner:Rc};function lm(){throw Error("act(...) is not supported in production builds of React.")}U.Children={map:go,forEach:function(t,e,n){go(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return go(t,function(){e++}),e},toArray:function(t){return go(t,function(e){return e})||[]},only:function(t){if(!Tc(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};U.Component=Fi;U.Fragment=F0;U.Profiler=A0;U.PureComponent=Pc;U.StrictMode=I0;U.Suspense=H0;U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X0;U.act=lm;U.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=nm({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Rc.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)sm.call(e,l)&&!om.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:io,type:t.type,key:i,ref:s,props:r,_owner:o}};U.createContext=function(t){return t={$$typeof:B0,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:z0,_context:t},t.Consumer=t};U.createElement=am;U.createFactory=function(t){var e=am.bind(null,t);return e.type=t,e};U.createRef=function(){return{current:null}};U.forwardRef=function(t){return{$$typeof:W0,render:t}};U.isValidElement=Tc;U.lazy=function(t){return{$$typeof:U0,_payload:{_status:-1,_result:t},_init:K0}};U.memo=function(t,e){return{$$typeof:$0,type:t,compare:e===void 0?null:e}};U.startTransition=function(t){var e=Xo.transition;Xo.transition={};try{t()}finally{Xo.transition=e}};U.unstable_act=lm;U.useCallback=function(t,e){return Xe.current.useCallback(t,e)};U.useContext=function(t){return Xe.current.useContext(t)};U.useDebugValue=function(){};U.useDeferredValue=function(t){return Xe.current.useDeferredValue(t)};U.useEffect=function(t,e){return Xe.current.useEffect(t,e)};U.useId=function(){return Xe.current.useId()};U.useImperativeHandle=function(t,e,n){return Xe.current.useImperativeHandle(t,e,n)};U.useInsertionEffect=function(t,e){return Xe.current.useInsertionEffect(t,e)};U.useLayoutEffect=function(t,e){return Xe.current.useLayoutEffect(t,e)};U.useMemo=function(t,e){return Xe.current.useMemo(t,e)};U.useReducer=function(t,e,n){return Xe.current.useReducer(t,e,n)};U.useRef=function(t){return Xe.current.useRef(t)};U.useState=function(t){return Xe.current.useState(t)};U.useSyncExternalStore=function(t,e,n){return Xe.current.useSyncExternalStore(t,e,n)};U.useTransition=function(){return Xe.current.useTransition()};U.version="18.3.1";em.exports=U;var S=em.exports;const q0=D0(S);/**
9
+ */var io=Symbol.for("react.element"),L0=Symbol.for("react.portal"),F0=Symbol.for("react.fragment"),I0=Symbol.for("react.strict_mode"),A0=Symbol.for("react.profiler"),z0=Symbol.for("react.provider"),B0=Symbol.for("react.context"),W0=Symbol.for("react.forward_ref"),H0=Symbol.for("react.suspense"),$0=Symbol.for("react.memo"),U0=Symbol.for("react.lazy"),qd=Symbol.iterator;function V0(t){return t===null||typeof t!="object"?null:(t=qd&&t[qd]||t["@@iterator"],typeof t=="function"?t:null)}var tm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nm=Object.assign,rm={};function Fi(t,e,n){this.props=t,this.context=e,this.refs=rm,this.updater=n||tm}Fi.prototype.isReactComponent={};Fi.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")};Fi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function im(){}im.prototype=Fi.prototype;function Pc(t,e,n){this.props=t,this.context=e,this.refs=rm,this.updater=n||tm}var Mc=Pc.prototype=new im;Mc.constructor=Pc;nm(Mc,Fi.prototype);Mc.isPureReactComponent=!0;var Gd=Array.isArray,sm=Object.prototype.hasOwnProperty,Tc={current:null},om={key:!0,ref:!0,__self:!0,__source:!0};function am(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)sm.call(e,r)&&!om.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:io,type:t,key:s,ref:o,props:i,_owner:Tc.current}}function Q0(t,e){return{$$typeof:io,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Rc(t){return typeof t=="object"&&t!==null&&t.$$typeof===io}function Y0(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Jd=/\/+/g;function xl(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Y0(""+t.key):e.toString(36)}function Ko(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case io:case L0:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+xl(o,0):r,Gd(i)?(n="",t!=null&&(n=t.replace(Jd,"$&/")+"/"),Ko(i,e,n,"",function(u){return u})):i!=null&&(Rc(i)&&(i=Q0(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Jd,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",Gd(t))for(var a=0;a<t.length;a++){s=t[a];var l=r+xl(s,a);o+=Ko(s,e,n,l,i)}else if(l=V0(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=r+xl(s,a++),o+=Ko(s,e,n,l,i);else if(s==="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 go(t,e,n){if(t==null)return t;var r=[],i=0;return Ko(t,r,"","",function(s){return e.call(n,s,i++)}),r}function K0(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 Xe={current:null},Xo={transition:null},X0={ReactCurrentDispatcher:Xe,ReactCurrentBatchConfig:Xo,ReactCurrentOwner:Tc};function lm(){throw Error("act(...) is not supported in production builds of React.")}U.Children={map:go,forEach:function(t,e,n){go(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return go(t,function(){e++}),e},toArray:function(t){return go(t,function(e){return e})||[]},only:function(t){if(!Rc(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};U.Component=Fi;U.Fragment=F0;U.Profiler=A0;U.PureComponent=Pc;U.StrictMode=I0;U.Suspense=H0;U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X0;U.act=lm;U.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=nm({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Tc.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)sm.call(e,l)&&!om.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:io,type:t.type,key:i,ref:s,props:r,_owner:o}};U.createContext=function(t){return t={$$typeof:B0,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:z0,_context:t},t.Consumer=t};U.createElement=am;U.createFactory=function(t){var e=am.bind(null,t);return e.type=t,e};U.createRef=function(){return{current:null}};U.forwardRef=function(t){return{$$typeof:W0,render:t}};U.isValidElement=Rc;U.lazy=function(t){return{$$typeof:U0,_payload:{_status:-1,_result:t},_init:K0}};U.memo=function(t,e){return{$$typeof:$0,type:t,compare:e===void 0?null:e}};U.startTransition=function(t){var e=Xo.transition;Xo.transition={};try{t()}finally{Xo.transition=e}};U.unstable_act=lm;U.useCallback=function(t,e){return Xe.current.useCallback(t,e)};U.useContext=function(t){return Xe.current.useContext(t)};U.useDebugValue=function(){};U.useDeferredValue=function(t){return Xe.current.useDeferredValue(t)};U.useEffect=function(t,e){return Xe.current.useEffect(t,e)};U.useId=function(){return Xe.current.useId()};U.useImperativeHandle=function(t,e,n){return Xe.current.useImperativeHandle(t,e,n)};U.useInsertionEffect=function(t,e){return Xe.current.useInsertionEffect(t,e)};U.useLayoutEffect=function(t,e){return Xe.current.useLayoutEffect(t,e)};U.useMemo=function(t,e){return Xe.current.useMemo(t,e)};U.useReducer=function(t,e,n){return Xe.current.useReducer(t,e,n)};U.useRef=function(t){return Xe.current.useRef(t)};U.useState=function(t){return Xe.current.useState(t)};U.useSyncExternalStore=function(t,e,n){return Xe.current.useSyncExternalStore(t,e,n)};U.useTransition=function(){return Xe.current.useTransition()};U.version="18.3.1";em.exports=U;var k=em.exports;const q0=D0(k);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ var N0=Object.defineProperty;var Xd=t=>{throw TypeError(t)};var j0=(t,e,n)=>e in
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var G0=S,J0=Symbol.for("react.element"),Z0=Symbol.for("react.fragment"),ev=Object.prototype.hasOwnProperty,tv=G0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nv={key:!0,ref:!0,__self:!0,__source:!0};function um(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)ev.call(e,r)&&!nv.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:J0,type:t,key:s,ref:o,props:i,_owner:tv.current}}Xa.Fragment=Z0;Xa.jsx=um;Xa.jsxs=um;Zp.exports=Xa;var g=Zp.exports,lu={},cm={exports:{}},ct={},dm={exports:{}},hm={};/**
17
+ */var G0=k,J0=Symbol.for("react.element"),Z0=Symbol.for("react.fragment"),ev=Object.prototype.hasOwnProperty,tv=G0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nv={key:!0,ref:!0,__self:!0,__source:!0};function um(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)ev.call(e,r)&&!nv.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:J0,type:t,key:s,ref:o,props:i,_owner:tv.current}}Xa.Fragment=Z0;Xa.jsx=um;Xa.jsxs=um;Zp.exports=Xa;var p=Zp.exports,lu={},cm={exports:{}},ct={},dm={exports:{}},hm={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ var N0=Object.defineProperty;var Xd=t=>{throw TypeError(t)};var j0=(t,e,n)=>e in
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(t){function e(j,I){var R=j.length;j.push(I);e:for(;0<R;){var B=R-1>>>1,H=j[B];if(0<i(H,I))j[B]=I,j[R]=H,R=B;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var I=j[0],R=j.pop();if(R!==I){j[0]=R;e:for(var B=0,H=j.length,ne=H>>>1;B<ne;){var $=2*(B+1)-1,re=j[$],pe=$+1,en=j[pe];if(0>i(re,R))pe<H&&0>i(en,re)?(j[B]=en,j[pe]=R,B=pe):(j[B]=re,j[$]=R,B=$);else if(pe<H&&0>i(en,R))j[B]=en,j[pe]=R,B=pe;else break e}}return I}function i(j,I){var R=j.sortIndex-I.sortIndex;return R!==0?R:j.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,h=3,f=!1,x=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(j){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=j)r(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=n(u)}}function b(j){if(v=!1,p(j),!x)if(n(l)!==null)x=!0,F(k);else{var I=n(u);I!==null&&ve(b,I.startTime-j)}}function k(j,I){x=!1,v&&(v=!1,m(E),E=-1),f=!0;var R=h;try{for(p(I),d=n(l);d!==null&&(!(d.expirationTime>I)||j&&!T());){var B=d.callback;if(typeof B=="function"){d.callback=null,h=d.priorityLevel;var H=B(d.expirationTime<=I);I=t.unstable_now(),typeof H=="function"?d.callback=H:d===n(l)&&r(l),p(I)}else r(l);d=n(l)}if(d!==null)var ne=!0;else{var $=n(u);$!==null&&ve(b,$.startTime-I),ne=!1}return ne}finally{d=null,h=R,f=!1}}var C=!1,P=null,E=-1,N=5,M=-1;function T(){return!(t.unstable_now()-M<N)}function A(){if(P!==null){var j=t.unstable_now();M=j;var I=!0;try{I=P(!0,j)}finally{I?W():(C=!1,P=null)}}else C=!1}var W;if(typeof y=="function")W=function(){y(A)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,J=se.port2;se.port1.onmessage=A,W=function(){J.postMessage(null)}}else W=function(){w(A,0)};function F(j){P=j,C||(C=!0,W())}function ve(j,I){E=w(function(){j(t.unstable_now())},I)}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(j){j.callback=null},t.unstable_continueExecution=function(){x||f||(x=!0,F(k))},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(j){switch(h){case 1:case 2:case 3:var I=3;break;default:I=h}var R=h;h=I;try{return j()}finally{h=R}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(j,I){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var R=h;h=j;try{return I()}finally{h=R}},t.unstable_scheduleCallback=function(j,I,R){var B=t.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?B+R:B):R=B,j){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=R+H,j={id:c++,callback:I,priorityLevel:j,startTime:R,expirationTime:H,sortIndex:-1},R>B?(j.sortIndex=R,e(u,j),n(l)===null&&j===n(u)&&(v?(m(E),E=-1):v=!0,ve(b,R-B))):(j.sortIndex=H,e(l,j),x||f||(x=!0,F(k))),j},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(j){var I=h;return function(){var R=h;h=I;try{return j.apply(this,arguments)}finally{h=R}}}})(hm);dm.exports=hm;var rv=dm.exports;/**
25
+ */(function(t){function e(j,A){var R=j.length;j.push(A);e:for(;0<R;){var B=R-1>>>1,H=j[B];if(0<i(H,A))j[B]=A,j[R]=H,R=B;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var A=j[0],R=j.pop();if(R!==A){j[0]=R;e:for(var B=0,H=j.length,ne=H>>>1;B<ne;){var $=2*(B+1)-1,re=j[$],pe=$+1,en=j[pe];if(0>i(re,R))pe<H&&0>i(en,re)?(j[B]=en,j[pe]=R,B=pe):(j[B]=re,j[$]=R,B=$);else if(pe<H&&0>i(en,R))j[B]=en,j[pe]=R,B=pe;else break e}}return A}function i(j,A){var R=j.sortIndex-A.sortIndex;return R!==0?R:j.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,h=3,f=!1,v=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(j){for(var A=n(u);A!==null;){if(A.callback===null)r(u);else if(A.startTime<=j)r(u),A.sortIndex=A.expirationTime,e(l,A);else break;A=n(u)}}function b(j){if(y=!1,x(j),!v)if(n(l)!==null)v=!0,F(C);else{var A=n(u);A!==null&&ve(b,A.startTime-j)}}function C(j,A){v=!1,y&&(y=!1,m(E),E=-1),f=!0;var R=h;try{for(x(A),d=n(l);d!==null&&(!(d.expirationTime>A)||j&&!T());){var B=d.callback;if(typeof B=="function"){d.callback=null,h=d.priorityLevel;var H=B(d.expirationTime<=A);A=t.unstable_now(),typeof H=="function"?d.callback=H:d===n(l)&&r(l),x(A)}else r(l);d=n(l)}if(d!==null)var ne=!0;else{var $=n(u);$!==null&&ve(b,$.startTime-A),ne=!1}return ne}finally{d=null,h=R,f=!1}}var P=!1,_=null,E=-1,O=5,M=-1;function T(){return!(t.unstable_now()-M<O)}function I(){if(_!==null){var j=t.unstable_now();M=j;var A=!0;try{A=_(!0,j)}finally{A?W():(P=!1,_=null)}}else P=!1}var W;if(typeof g=="function")W=function(){g(I)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,J=oe.port2;oe.port1.onmessage=I,W=function(){J.postMessage(null)}}else W=function(){w(I,0)};function F(j){_=j,P||(P=!0,W())}function ve(j,A){E=w(function(){j(t.unstable_now())},A)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(j){j.callback=null},t.unstable_continueExecution=function(){v||f||(v=!0,F(C))},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(j){switch(h){case 1:case 2:case 3:var A=3;break;default:A=h}var R=h;h=A;try{return j()}finally{h=R}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(j,A){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var R=h;h=j;try{return A()}finally{h=R}},t.unstable_scheduleCallback=function(j,A,R){var B=t.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?B+R:B):R=B,j){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=R+H,j={id:c++,callback:A,priorityLevel:j,startTime:R,expirationTime:H,sortIndex:-1},R>B?(j.sortIndex=R,e(u,j),n(l)===null&&j===n(u)&&(y?(m(E),E=-1):y=!0,ve(b,R-B))):(j.sortIndex=H,e(l,j),v||f||(v=!0,F(C))),j},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(j){var A=h;return function(){var R=h;h=A;try{return j.apply(this,arguments)}finally{h=R}}}})(hm);dm.exports=hm;var rv=dm.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ var N0=Object.defineProperty;var Xd=t=>{throw TypeError(t)};var j0=(t,e,n)=>e in
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var iv=S,ut=rv;function O(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 fm=new Set,Ps={};function $r(t,e){Pi(t,e),Pi(t+"Capture",e)}function Pi(t,e){for(Ps[t]=e,t=0;t<e.length;t++)fm.add(e[t])}var gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uu=Object.prototype.hasOwnProperty,sv=/^[: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]*$/,Zd={},eh={};function ov(t){return uu.call(eh,t)?!0:uu.call(Zd,t)?!1:sv.test(t)?eh[t]=!0:(Zd[t]=!0,!1)}function av(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function lv(t,e,n,r){if(e===null||typeof e>"u"||av(t,e,n,r))return!0;if(r)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 qe(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var De={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){De[t]=new qe(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];De[e]=new qe(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){De[t]=new qe(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){De[t]=new qe(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){De[t]=new qe(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){De[t]=new qe(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){De[t]=new qe(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){De[t]=new qe(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){De[t]=new qe(t,5,!1,t.toLowerCase(),null,!1,!1)});var Oc=/[\-:]([a-z])/g;function Nc(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(Oc,Nc);De[e]=new qe(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(Oc,Nc);De[e]=new qe(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(Oc,Nc);De[e]=new qe(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){De[t]=new qe(t,1,!1,t.toLowerCase(),null,!1,!1)});De.xlinkHref=new qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){De[t]=new qe(t,1,!1,t.toLowerCase(),null,!0,!0)});function jc(t,e,n,r){var i=De.hasOwnProperty(e)?De[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(lv(e,n,i,r)&&(n=null),r||i===null?ov(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var bn=iv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yo=Symbol.for("react.element"),Kr=Symbol.for("react.portal"),Xr=Symbol.for("react.fragment"),Dc=Symbol.for("react.strict_mode"),cu=Symbol.for("react.profiler"),pm=Symbol.for("react.provider"),mm=Symbol.for("react.context"),Lc=Symbol.for("react.forward_ref"),du=Symbol.for("react.suspense"),hu=Symbol.for("react.suspense_list"),Fc=Symbol.for("react.memo"),Pn=Symbol.for("react.lazy"),gm=Symbol.for("react.offscreen"),th=Symbol.iterator;function Ui(t){return t===null||typeof t!="object"?null:(t=th&&t[th]||t["@@iterator"],typeof t=="function"?t:null)}var ye=Object.assign,wl;function os(t){if(wl===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);wl=e&&e[1]||""}return`
33
+ */var iv=k,ut=rv;function N(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 fm=new Set,Ps={};function $r(t,e){Pi(t,e),Pi(t+"Capture",e)}function Pi(t,e){for(Ps[t]=e,t=0;t<e.length;t++)fm.add(e[t])}var gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uu=Object.prototype.hasOwnProperty,sv=/^[: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]*$/,Zd={},eh={};function ov(t){return uu.call(eh,t)?!0:uu.call(Zd,t)?!1:sv.test(t)?eh[t]=!0:(Zd[t]=!0,!1)}function av(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function lv(t,e,n,r){if(e===null||typeof e>"u"||av(t,e,n,r))return!0;if(r)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 qe(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var De={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){De[t]=new qe(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];De[e]=new qe(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){De[t]=new qe(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){De[t]=new qe(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){De[t]=new qe(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){De[t]=new qe(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){De[t]=new qe(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){De[t]=new qe(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){De[t]=new qe(t,5,!1,t.toLowerCase(),null,!1,!1)});var Nc=/[\-:]([a-z])/g;function Oc(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(Nc,Oc);De[e]=new qe(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(Nc,Oc);De[e]=new qe(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(Nc,Oc);De[e]=new qe(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){De[t]=new qe(t,1,!1,t.toLowerCase(),null,!1,!1)});De.xlinkHref=new qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){De[t]=new qe(t,1,!1,t.toLowerCase(),null,!0,!0)});function jc(t,e,n,r){var i=De.hasOwnProperty(e)?De[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(lv(e,n,i,r)&&(n=null),r||i===null?ov(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var bn=iv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yo=Symbol.for("react.element"),Kr=Symbol.for("react.portal"),Xr=Symbol.for("react.fragment"),Dc=Symbol.for("react.strict_mode"),cu=Symbol.for("react.profiler"),pm=Symbol.for("react.provider"),mm=Symbol.for("react.context"),Lc=Symbol.for("react.forward_ref"),du=Symbol.for("react.suspense"),hu=Symbol.for("react.suspense_list"),Fc=Symbol.for("react.memo"),Pn=Symbol.for("react.lazy"),gm=Symbol.for("react.offscreen"),th=Symbol.iterator;function Ui(t){return t===null||typeof t!="object"?null:(t=th&&t[th]||t["@@iterator"],typeof t=="function"?t:null)}var ye=Object.assign,wl;function os(t){if(wl===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);wl=e&&e[1]||""}return`
34
34
  `+wl+t}var bl=!1;function _l(t,e){if(!t||bl)return"";bl=!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 r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
35
  `),s=r.stack.split(`
36
36
  `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
37
- `+i[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{bl=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?os(t):""}function uv(t){switch(t.tag){case 5:return os(t.type);case 16:return os("Lazy");case 13:return os("Suspense");case 19:return os("SuspenseList");case 0:case 2:case 15:return t=_l(t.type,!1),t;case 11:return t=_l(t.type.render,!1),t;case 1:return t=_l(t.type,!0),t;default:return""}}function fu(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 Xr:return"Fragment";case Kr:return"Portal";case cu:return"Profiler";case Dc:return"StrictMode";case du:return"Suspense";case hu:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mm:return(t.displayName||"Context")+".Consumer";case pm:return(t._context.displayName||"Context")+".Provider";case Lc:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Fc:return e=t.displayName||null,e!==null?e:fu(t.type)||"Memo";case Pn:e=t._payload,t=t._init;try{return fu(t(e))}catch{}}return null}function cv(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 fu(e);case 8:return e===Dc?"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 nr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ym(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dv(t){var e=ym(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function vo(t){t._valueTracker||(t._valueTracker=dv(t))}function vm(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ym(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function pa(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 pu(t,e){var n=e.checked;return ye({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function nh(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=nr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function xm(t,e){e=e.checked,e!=null&&jc(t,"checked",e,!1)}function mu(t,e){xm(t,e);var n=nr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?gu(t,e.type,n):e.hasOwnProperty("defaultValue")&&gu(t,e.type,nr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function rh(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="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 gu(t,e,n){(e!=="number"||pa(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var as=Array.isArray;function ai(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+nr(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function yu(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(O(91));return ye({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ih(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(O(92));if(as(n)){if(1<n.length)throw Error(O(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:nr(n)}}function wm(t,e){var n=nr(e.value),r=nr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function sh(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function bm(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 vu(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?bm(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var xo,_m=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(xo=xo||document.createElement("div"),xo.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=xo.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ms(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ps={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},hv=["Webkit","ms","Moz","O"];Object.keys(ps).forEach(function(t){hv.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ps[e]=ps[t]})});function Sm(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ps.hasOwnProperty(t)&&ps[t]?(""+e).trim():e+"px"}function km(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Sm(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var fv=ye({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 xu(t,e){if(e){if(fv[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(O(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(O(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(O(61))}if(e.style!=null&&typeof e.style!="object")throw Error(O(62))}}function wu(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 bu=null;function Ic(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var _u=null,li=null,ui=null;function oh(t){if(t=ao(t)){if(typeof _u!="function")throw Error(O(280));var e=t.stateNode;e&&(e=el(e),_u(t.stateNode,t.type,e))}}function Cm(t){li?ui?ui.push(t):ui=[t]:li=t}function Em(){if(li){var t=li,e=ui;if(ui=li=null,oh(t),e)for(t=0;t<e.length;t++)oh(e[t])}}function Pm(t,e){return t(e)}function Mm(){}var Sl=!1;function Rm(t,e,n){if(Sl)return t(e,n);Sl=!0;try{return Pm(t,e,n)}finally{Sl=!1,(li!==null||ui!==null)&&(Mm(),Em())}}function Rs(t,e){var n=t.stateNode;if(n===null)return null;var r=el(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(O(231,e,typeof n));return n}var Su=!1;if(gn)try{var Vi={};Object.defineProperty(Vi,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Vi,Vi),window.removeEventListener("test",Vi,Vi)}catch{Su=!1}function pv(t,e,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var ms=!1,ma=null,ga=!1,ku=null,mv={onError:function(t){ms=!0,ma=t}};function gv(t,e,n,r,i,s,o,a,l){ms=!1,ma=null,pv.apply(mv,arguments)}function yv(t,e,n,r,i,s,o,a,l){if(gv.apply(this,arguments),ms){if(ms){var u=ma;ms=!1,ma=null}else throw Error(O(198));ga||(ga=!0,ku=u)}}function Ur(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 Tm(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 ah(t){if(Ur(t)!==t)throw Error(O(188))}function vv(t){var e=t.alternate;if(!e){if(e=Ur(t),e===null)throw Error(O(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return ah(i),t;if(s===r)return ah(i),e;s=s.sibling}throw Error(O(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(O(189))}}if(n.alternate!==r)throw Error(O(190))}if(n.tag!==3)throw Error(O(188));return n.stateNode.current===n?t:e}function Om(t){return t=vv(t),t!==null?Nm(t):null}function Nm(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Nm(t);if(e!==null)return e;t=t.sibling}return null}var jm=ut.unstable_scheduleCallback,lh=ut.unstable_cancelCallback,xv=ut.unstable_shouldYield,wv=ut.unstable_requestPaint,be=ut.unstable_now,bv=ut.unstable_getCurrentPriorityLevel,Ac=ut.unstable_ImmediatePriority,Dm=ut.unstable_UserBlockingPriority,ya=ut.unstable_NormalPriority,_v=ut.unstable_LowPriority,Lm=ut.unstable_IdlePriority,qa=null,Jt=null;function Sv(t){if(Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(qa,t,void 0,(t.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:Ev,kv=Math.log,Cv=Math.LN2;function Ev(t){return t>>>=0,t===0?32:31-(kv(t)/Cv|0)|0}var wo=64,bo=4194304;function ls(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 va(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=ls(a):(s&=o,s!==0&&(r=ls(s)))}else o=n&~i,o!==0?r=ls(o):s!==0&&(r=ls(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Lt(e),i=1<<n,r|=t[n],e&=~i;return r}function Pv(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 Mv(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Lt(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=Pv(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function Cu(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Fm(){var t=wo;return wo<<=1,!(wo&4194240)&&(wo=64),t}function kl(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function so(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Lt(e),t[e]=n}function Rv(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 r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Lt(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function zc(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Lt(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var te=0;function Im(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Am,Bc,zm,Bm,Wm,Eu=!1,_o=[],Un=null,Vn=null,Qn=null,Ts=new Map,Os=new Map,Rn=[],Tv="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 uh(t,e){switch(t){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":Qn=null;break;case"pointerover":case"pointerout":Ts.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Os.delete(e.pointerId)}}function Qi(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=ao(e),e!==null&&Bc(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function Ov(t,e,n,r,i){switch(e){case"focusin":return Un=Qi(Un,t,e,n,r,i),!0;case"dragenter":return Vn=Qi(Vn,t,e,n,r,i),!0;case"mouseover":return Qn=Qi(Qn,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ts.set(s,Qi(Ts.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Os.set(s,Qi(Os.get(s)||null,t,e,n,r,i)),!0}return!1}function Hm(t){var e=vr(t.target);if(e!==null){var n=Ur(e);if(n!==null){if(e=n.tag,e===13){if(e=Tm(n),e!==null){t.blockedOn=e,Wm(t.priority,function(){zm(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 qo(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Pu(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);bu=r,n.target.dispatchEvent(r),bu=null}else return e=ao(n),e!==null&&Bc(e),t.blockedOn=n,!1;e.shift()}return!0}function ch(t,e,n){qo(t)&&n.delete(e)}function Nv(){Eu=!1,Un!==null&&qo(Un)&&(Un=null),Vn!==null&&qo(Vn)&&(Vn=null),Qn!==null&&qo(Qn)&&(Qn=null),Ts.forEach(ch),Os.forEach(ch)}function Yi(t,e){t.blockedOn===e&&(t.blockedOn=null,Eu||(Eu=!0,ut.unstable_scheduleCallback(ut.unstable_NormalPriority,Nv)))}function Ns(t){function e(i){return Yi(i,t)}if(0<_o.length){Yi(_o[0],t);for(var n=1;n<_o.length;n++){var r=_o[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Un!==null&&Yi(Un,t),Vn!==null&&Yi(Vn,t),Qn!==null&&Yi(Qn,t),Ts.forEach(e),Os.forEach(e),n=0;n<Rn.length;n++)r=Rn[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)Hm(n),n.blockedOn===null&&Rn.shift()}var ci=bn.ReactCurrentBatchConfig,xa=!0;function jv(t,e,n,r){var i=te,s=ci.transition;ci.transition=null;try{te=1,Wc(t,e,n,r)}finally{te=i,ci.transition=s}}function Dv(t,e,n,r){var i=te,s=ci.transition;ci.transition=null;try{te=4,Wc(t,e,n,r)}finally{te=i,ci.transition=s}}function Wc(t,e,n,r){if(xa){var i=Pu(t,e,n,r);if(i===null)Dl(t,e,r,wa,n),uh(t,r);else if(Ov(i,t,e,n,r))r.stopPropagation();else if(uh(t,r),e&4&&-1<Tv.indexOf(t)){for(;i!==null;){var s=ao(i);if(s!==null&&Am(s),s=Pu(t,e,n,r),s===null&&Dl(t,e,r,wa,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Dl(t,e,r,null,n)}}var wa=null;function Pu(t,e,n,r){if(wa=null,t=Ic(r),t=vr(t),t!==null)if(e=Ur(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Tm(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 wa=t,null}function $m(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(bv()){case Ac:return 1;case Dm:return 4;case ya:case _v:return 16;case Lm:return 536870912;default:return 16}default:return 16}}var zn=null,Hc=null,Go=null;function Um(){if(Go)return Go;var t,e=Hc,n=e.length,r,i="value"in zn?zn.value:zn.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return Go=i.slice(t,1<r?1-r:void 0)}function Jo(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 So(){return!0}function dh(){return!1}function dt(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?So:dh,this.isPropagationStopped=dh,this}return ye(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=So)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=So)},persist:function(){},isPersistent:So}),e}var Ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$c=dt(Ii),oo=ye({},Ii,{view:0,detail:0}),Lv=dt(oo),Cl,El,Ki,Ga=ye({},oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,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!==Ki&&(Ki&&t.type==="mousemove"?(Cl=t.screenX-Ki.screenX,El=t.screenY-Ki.screenY):El=Cl=0,Ki=t),Cl)},movementY:function(t){return"movementY"in t?t.movementY:El}}),hh=dt(Ga),Fv=ye({},Ga,{dataTransfer:0}),Iv=dt(Fv),Av=ye({},oo,{relatedTarget:0}),Pl=dt(Av),zv=ye({},Ii,{animationName:0,elapsedTime:0,pseudoElement:0}),Bv=dt(zv),Wv=ye({},Ii,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Hv=dt(Wv),$v=ye({},Ii,{data:0}),fh=dt($v),Uv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vv={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"},Qv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yv(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Qv[t])?!!e[t]:!1}function Uc(){return Yv}var Kv=ye({},oo,{key:function(t){if(t.key){var e=Uv[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Jo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Vv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(t){return t.type==="keypress"?Jo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Xv=dt(Kv),qv=ye({},Ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ph=dt(qv),Gv=ye({},oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),Jv=dt(Gv),Zv=ye({},Ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),ex=dt(Zv),tx=ye({},Ga,{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}),nx=dt(tx),rx=[9,13,27,32],Vc=gn&&"CompositionEvent"in window,gs=null;gn&&"documentMode"in document&&(gs=document.documentMode);var ix=gn&&"TextEvent"in window&&!gs,Vm=gn&&(!Vc||gs&&8<gs&&11>=gs),mh=" ",gh=!1;function Qm(t,e){switch(t){case"keyup":return rx.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ym(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qr=!1;function sx(t,e){switch(t){case"compositionend":return Ym(e);case"keypress":return e.which!==32?null:(gh=!0,mh);case"textInput":return t=e.data,t===mh&&gh?null:t;default:return null}}function ox(t,e){if(qr)return t==="compositionend"||!Vc&&Qm(t,e)?(t=Um(),Go=Hc=zn=null,qr=!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 Vm&&e.locale!=="ko"?null:e.data;default:return null}}var ax={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 yh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!ax[t.type]:e==="textarea"}function Km(t,e,n,r){Cm(r),e=ba(e,"onChange"),0<e.length&&(n=new $c("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var ys=null,js=null;function lx(t){sg(t,0)}function Ja(t){var e=Zr(t);if(vm(e))return t}function ux(t,e){if(t==="change")return e}var Xm=!1;if(gn){var Ml;if(gn){var Rl="oninput"in document;if(!Rl){var vh=document.createElement("div");vh.setAttribute("oninput","return;"),Rl=typeof vh.oninput=="function"}Ml=Rl}else Ml=!1;Xm=Ml&&(!document.documentMode||9<document.documentMode)}function xh(){ys&&(ys.detachEvent("onpropertychange",qm),js=ys=null)}function qm(t){if(t.propertyName==="value"&&Ja(js)){var e=[];Km(e,js,t,Ic(t)),Rm(lx,e)}}function cx(t,e,n){t==="focusin"?(xh(),ys=e,js=n,ys.attachEvent("onpropertychange",qm)):t==="focusout"&&xh()}function dx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ja(js)}function hx(t,e){if(t==="click")return Ja(e)}function fx(t,e){if(t==="input"||t==="change")return Ja(e)}function px(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var It=typeof Object.is=="function"?Object.is:px;function Ds(t,e){if(It(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!uu.call(e,i)||!It(t[i],e[i]))return!1}return!0}function wh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function bh(t,e){var n=wh(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wh(n)}}function Gm(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Gm(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Jm(){for(var t=window,e=pa();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=pa(t.document)}return e}function Qc(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 mx(t){var e=Jm(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Gm(n.ownerDocument.documentElement,n)){if(r!==null&&Qc(n)){if(e=r.start,t=r.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 i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=bh(n,s);var o=bh(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(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 gx=gn&&"documentMode"in document&&11>=document.documentMode,Gr=null,Mu=null,vs=null,Ru=!1;function _h(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ru||Gr==null||Gr!==pa(r)||(r=Gr,"selectionStart"in r&&Qc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),vs&&Ds(vs,r)||(vs=r,r=ba(Mu,"onSelect"),0<r.length&&(e=new $c("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Gr)))}function ko(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Jr={animationend:ko("Animation","AnimationEnd"),animationiteration:ko("Animation","AnimationIteration"),animationstart:ko("Animation","AnimationStart"),transitionend:ko("Transition","TransitionEnd")},Tl={},Zm={};gn&&(Zm=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function Za(t){if(Tl[t])return Tl[t];if(!Jr[t])return t;var e=Jr[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Zm)return Tl[t]=e[n];return t}var eg=Za("animationend"),tg=Za("animationiteration"),ng=Za("animationstart"),rg=Za("transitionend"),ig=new Map,Sh="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 or(t,e){ig.set(t,e),$r(e,[t])}for(var Ol=0;Ol<Sh.length;Ol++){var Nl=Sh[Ol],yx=Nl.toLowerCase(),vx=Nl[0].toUpperCase()+Nl.slice(1);or(yx,"on"+vx)}or(eg,"onAnimationEnd");or(tg,"onAnimationIteration");or(ng,"onAnimationStart");or("dblclick","onDoubleClick");or("focusin","onFocus");or("focusout","onBlur");or(rg,"onTransitionEnd");Pi("onMouseEnter",["mouseout","mouseover"]);Pi("onMouseLeave",["mouseout","mouseover"]);Pi("onPointerEnter",["pointerout","pointerover"]);Pi("onPointerLeave",["pointerout","pointerover"]);$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$r("onBeforeInput",["compositionend","keypress","textInput","paste"]);$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var us="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(" "),xx=new Set("cancel close invalid load scroll toggle".split(" ").concat(us));function kh(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,yv(r,e,void 0,t),t.currentTarget=null}function sg(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;kh(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;kh(i,a,u),s=l}}}if(ga)throw t=ku,ga=!1,ku=null,t}function le(t,e){var n=e[Du];n===void 0&&(n=e[Du]=new Set);var r=t+"__bubble";n.has(r)||(og(e,t,2,!1),n.add(r))}function jl(t,e,n){var r=0;e&&(r|=4),og(n,t,r,e)}var Co="_reactListening"+Math.random().toString(36).slice(2);function Ls(t){if(!t[Co]){t[Co]=!0,fm.forEach(function(n){n!=="selectionchange"&&(xx.has(n)||jl(n,!1,t),jl(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Co]||(e[Co]=!0,jl("selectionchange",!1,e))}}function og(t,e,n,r){switch($m(e)){case 1:var i=jv;break;case 4:i=Dv;break;default:i=Wc}n=i.bind(null,e,n,t),i=void 0,!Su||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Dl(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=vr(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Rm(function(){var u=s,c=Ic(n),d=[];e:{var h=ig.get(t);if(h!==void 0){var f=$c,x=t;switch(t){case"keypress":if(Jo(n)===0)break e;case"keydown":case"keyup":f=Xv;break;case"focusin":x="focus",f=Pl;break;case"focusout":x="blur",f=Pl;break;case"beforeblur":case"afterblur":f=Pl;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":f=hh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=Iv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=Jv;break;case eg:case tg:case ng:f=Bv;break;case rg:f=ex;break;case"scroll":f=Lv;break;case"wheel":f=nx;break;case"copy":case"cut":case"paste":f=Hv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=ph}var v=(e&4)!==0,w=!v&&t==="scroll",m=v?h!==null?h+"Capture":null:h;v=[];for(var y=u,p;y!==null;){p=y;var b=p.stateNode;if(p.tag===5&&b!==null&&(p=b,m!==null&&(b=Rs(y,m),b!=null&&v.push(Fs(y,b,p)))),w)break;y=y.return}0<v.length&&(h=new f(h,x,null,n,c),d.push({event:h,listeners:v}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",h&&n!==bu&&(x=n.relatedTarget||n.fromElement)&&(vr(x)||x[yn]))break e;if((f||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,f?(x=n.relatedTarget||n.toElement,f=u,x=x?vr(x):null,x!==null&&(w=Ur(x),x!==w||x.tag!==5&&x.tag!==6)&&(x=null)):(f=null,x=u),f!==x)){if(v=hh,b="onMouseLeave",m="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(v=ph,b="onPointerLeave",m="onPointerEnter",y="pointer"),w=f==null?h:Zr(f),p=x==null?h:Zr(x),h=new v(b,y+"leave",f,n,c),h.target=w,h.relatedTarget=p,b=null,vr(c)===u&&(v=new v(m,y+"enter",x,n,c),v.target=p,v.relatedTarget=w,b=v),w=b,f&&x)t:{for(v=f,m=x,y=0,p=v;p;p=Vr(p))y++;for(p=0,b=m;b;b=Vr(b))p++;for(;0<y-p;)v=Vr(v),y--;for(;0<p-y;)m=Vr(m),p--;for(;y--;){if(v===m||m!==null&&v===m.alternate)break t;v=Vr(v),m=Vr(m)}v=null}else v=null;f!==null&&Ch(d,h,f,v,!1),x!==null&&w!==null&&Ch(d,w,x,v,!0)}}e:{if(h=u?Zr(u):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var k=ux;else if(yh(h))if(Xm)k=fx;else{k=dx;var C=cx}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=hx);if(k&&(k=k(t,u))){Km(d,k,n,c);break e}C&&C(t,h,u),t==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&gu(h,"number",h.value)}switch(C=u?Zr(u):window,t){case"focusin":(yh(C)||C.contentEditable==="true")&&(Gr=C,Mu=u,vs=null);break;case"focusout":vs=Mu=Gr=null;break;case"mousedown":Ru=!0;break;case"contextmenu":case"mouseup":case"dragend":Ru=!1,_h(d,n,c);break;case"selectionchange":if(gx)break;case"keydown":case"keyup":_h(d,n,c)}var P;if(Vc)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else qr?Qm(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Vm&&n.locale!=="ko"&&(qr||E!=="onCompositionStart"?E==="onCompositionEnd"&&qr&&(P=Um()):(zn=c,Hc="value"in zn?zn.value:zn.textContent,qr=!0)),C=ba(u,E),0<C.length&&(E=new fh(E,t,null,n,c),d.push({event:E,listeners:C}),P?E.data=P:(P=Ym(n),P!==null&&(E.data=P)))),(P=ix?sx(t,n):ox(t,n))&&(u=ba(u,"onBeforeInput"),0<u.length&&(c=new fh("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=P))}sg(d,e)})}function Fs(t,e,n){return{instance:t,listener:e,currentTarget:n}}function ba(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Rs(t,n),s!=null&&r.unshift(Fs(t,s,i)),s=Rs(t,e),s!=null&&r.push(Fs(t,s,i))),t=t.return}return r}function Vr(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Ch(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Rs(n,s),l!=null&&o.unshift(Fs(n,l,a))):i||(l=Rs(n,s),l!=null&&o.push(Fs(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var wx=/\r\n?/g,bx=/\u0000|\uFFFD/g;function Eh(t){return(typeof t=="string"?t:""+t).replace(wx,`
38
- `).replace(bx,"")}function Eo(t,e,n){if(e=Eh(e),Eh(t)!==e&&n)throw Error(O(425))}function _a(){}var Tu=null,Ou=null;function Nu(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 ju=typeof setTimeout=="function"?setTimeout:void 0,_x=typeof clearTimeout=="function"?clearTimeout:void 0,Ph=typeof Promise=="function"?Promise:void 0,Sx=typeof queueMicrotask=="function"?queueMicrotask:typeof Ph<"u"?function(t){return Ph.resolve(null).then(t).catch(kx)}:ju;function kx(t){setTimeout(function(){throw t})}function Ll(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Ns(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ns(e)}function Yn(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 Mh(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 Ai=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Ai,Is="__reactProps$"+Ai,yn="__reactContainer$"+Ai,Du="__reactEvents$"+Ai,Cx="__reactListeners$"+Ai,Ex="__reactHandles$"+Ai;function vr(t){var e=t[Gt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[yn]||n[Gt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Mh(t);t!==null;){if(n=t[Gt])return n;t=Mh(t)}return e}t=n,n=t.parentNode}return null}function ao(t){return t=t[Gt]||t[yn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Zr(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(O(33))}function el(t){return t[Is]||null}var Lu=[],ei=-1;function ar(t){return{current:t}}function ce(t){0>ei||(t.current=Lu[ei],Lu[ei]=null,ei--)}function oe(t,e){ei++,Lu[ei]=t.current,t.current=e}var rr={},He=ar(rr),rt=ar(!1),Lr=rr;function Mi(t,e){var n=t.type.contextTypes;if(!n)return rr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function it(t){return t=t.childContextTypes,t!=null}function Sa(){ce(rt),ce(He)}function Rh(t,e,n){if(He.current!==rr)throw Error(O(168));oe(He,e),oe(rt,n)}function ag(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(O(108,cv(t)||"Unknown",i));return ye({},n,r)}function ka(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rr,Lr=He.current,oe(He,t),oe(rt,rt.current),!0}function Th(t,e,n){var r=t.stateNode;if(!r)throw Error(O(169));n?(t=ag(t,e,Lr),r.__reactInternalMemoizedMergedChildContext=t,ce(rt),ce(He),oe(He,t)):ce(rt),oe(rt,n)}var an=null,tl=!1,Fl=!1;function lg(t){an===null?an=[t]:an.push(t)}function Px(t){tl=!0,lg(t)}function lr(){if(!Fl&&an!==null){Fl=!0;var t=0,e=te;try{var n=an;for(te=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}an=null,tl=!1}catch(i){throw an!==null&&(an=an.slice(t+1)),jm(Ac,lr),i}finally{te=e,Fl=!1}}return null}var ti=[],ni=0,Ca=null,Ea=0,yt=[],vt=0,Fr=null,dn=1,hn="";function pr(t,e){ti[ni++]=Ea,ti[ni++]=Ca,Ca=t,Ea=e}function ug(t,e,n){yt[vt++]=dn,yt[vt++]=hn,yt[vt++]=Fr,Fr=t;var r=dn;t=hn;var i=32-Lt(r)-1;r&=~(1<<i),n+=1;var s=32-Lt(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,dn=1<<32-Lt(e)+i|n<<i|r,hn=s+t}else dn=1<<s|n<<i|r,hn=t}function Yc(t){t.return!==null&&(pr(t,1),ug(t,1,0))}function Kc(t){for(;t===Ca;)Ca=ti[--ni],ti[ni]=null,Ea=ti[--ni],ti[ni]=null;for(;t===Fr;)Fr=yt[--vt],yt[vt]=null,hn=yt[--vt],yt[vt]=null,dn=yt[--vt],yt[vt]=null}var lt=null,at=null,he=!1,Nt=null;function cg(t,e){var n=xt(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 Oh(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,lt=t,at=Yn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,lt=t,at=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Fr!==null?{id:dn,overflow:hn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=xt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,lt=t,at=null,!0):!1;default:return!1}}function Fu(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Iu(t){if(he){var e=at;if(e){var n=e;if(!Oh(t,e)){if(Fu(t))throw Error(O(418));e=Yn(n.nextSibling);var r=lt;e&&Oh(t,e)?cg(r,n):(t.flags=t.flags&-4097|2,he=!1,lt=t)}}else{if(Fu(t))throw Error(O(418));t.flags=t.flags&-4097|2,he=!1,lt=t}}}function Nh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;lt=t}function Po(t){if(t!==lt)return!1;if(!he)return Nh(t),he=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Nu(t.type,t.memoizedProps)),e&&(e=at)){if(Fu(t))throw dg(),Error(O(418));for(;e;)cg(t,e),e=Yn(e.nextSibling)}if(Nh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){at=Yn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}at=null}}else at=lt?Yn(t.stateNode.nextSibling):null;return!0}function dg(){for(var t=at;t;)t=Yn(t.nextSibling)}function Ri(){at=lt=null,he=!1}function Xc(t){Nt===null?Nt=[t]:Nt.push(t)}var Mx=bn.ReactCurrentBatchConfig;function Xi(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(O(309));var r=n.stateNode}if(!r)throw Error(O(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(O(284));if(!n._owner)throw Error(O(290,t))}return t}function Mo(t,e){throw t=Object.prototype.toString.call(e),Error(O(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function jh(t){var e=t._init;return e(t._payload)}function hg(t){function e(m,y){if(t){var p=m.deletions;p===null?(m.deletions=[y],m.flags|=16):p.push(y)}}function n(m,y){if(!t)return null;for(;y!==null;)e(m,y),y=y.sibling;return null}function r(m,y){for(m=new Map;y!==null;)y.key!==null?m.set(y.key,y):m.set(y.index,y),y=y.sibling;return m}function i(m,y){return m=Gn(m,y),m.index=0,m.sibling=null,m}function s(m,y,p){return m.index=p,t?(p=m.alternate,p!==null?(p=p.index,p<y?(m.flags|=2,y):p):(m.flags|=2,y)):(m.flags|=1048576,y)}function o(m){return t&&m.alternate===null&&(m.flags|=2),m}function a(m,y,p,b){return y===null||y.tag!==6?(y=$l(p,m.mode,b),y.return=m,y):(y=i(y,p),y.return=m,y)}function l(m,y,p,b){var k=p.type;return k===Xr?c(m,y,p.props.children,b,p.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pn&&jh(k)===y.type)?(b=i(y,p.props),b.ref=Xi(m,y,p),b.return=m,b):(b=sa(p.type,p.key,p.props,null,m.mode,b),b.ref=Xi(m,y,p),b.return=m,b)}function u(m,y,p,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==p.containerInfo||y.stateNode.implementation!==p.implementation?(y=Ul(p,m.mode,b),y.return=m,y):(y=i(y,p.children||[]),y.return=m,y)}function c(m,y,p,b,k){return y===null||y.tag!==7?(y=jr(p,m.mode,b,k),y.return=m,y):(y=i(y,p),y.return=m,y)}function d(m,y,p){if(typeof y=="string"&&y!==""||typeof y=="number")return y=$l(""+y,m.mode,p),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case yo:return p=sa(y.type,y.key,y.props,null,m.mode,p),p.ref=Xi(m,null,y),p.return=m,p;case Kr:return y=Ul(y,m.mode,p),y.return=m,y;case Pn:var b=y._init;return d(m,b(y._payload),p)}if(as(y)||Ui(y))return y=jr(y,m.mode,p,null),y.return=m,y;Mo(m,y)}return null}function h(m,y,p,b){var k=y!==null?y.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return k!==null?null:a(m,y,""+p,b);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case yo:return p.key===k?l(m,y,p,b):null;case Kr:return p.key===k?u(m,y,p,b):null;case Pn:return k=p._init,h(m,y,k(p._payload),b)}if(as(p)||Ui(p))return k!==null?null:c(m,y,p,b,null);Mo(m,p)}return null}function f(m,y,p,b,k){if(typeof b=="string"&&b!==""||typeof b=="number")return m=m.get(p)||null,a(y,m,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case yo:return m=m.get(b.key===null?p:b.key)||null,l(y,m,b,k);case Kr:return m=m.get(b.key===null?p:b.key)||null,u(y,m,b,k);case Pn:var C=b._init;return f(m,y,p,C(b._payload),k)}if(as(b)||Ui(b))return m=m.get(p)||null,c(y,m,b,k,null);Mo(y,b)}return null}function x(m,y,p,b){for(var k=null,C=null,P=y,E=y=0,N=null;P!==null&&E<p.length;E++){P.index>E?(N=P,P=null):N=P.sibling;var M=h(m,P,p[E],b);if(M===null){P===null&&(P=N);break}t&&P&&M.alternate===null&&e(m,P),y=s(M,y,E),C===null?k=M:C.sibling=M,C=M,P=N}if(E===p.length)return n(m,P),he&&pr(m,E),k;if(P===null){for(;E<p.length;E++)P=d(m,p[E],b),P!==null&&(y=s(P,y,E),C===null?k=P:C.sibling=P,C=P);return he&&pr(m,E),k}for(P=r(m,P);E<p.length;E++)N=f(P,m,E,p[E],b),N!==null&&(t&&N.alternate!==null&&P.delete(N.key===null?E:N.key),y=s(N,y,E),C===null?k=N:C.sibling=N,C=N);return t&&P.forEach(function(T){return e(m,T)}),he&&pr(m,E),k}function v(m,y,p,b){var k=Ui(p);if(typeof k!="function")throw Error(O(150));if(p=k.call(p),p==null)throw Error(O(151));for(var C=k=null,P=y,E=y=0,N=null,M=p.next();P!==null&&!M.done;E++,M=p.next()){P.index>E?(N=P,P=null):N=P.sibling;var T=h(m,P,M.value,b);if(T===null){P===null&&(P=N);break}t&&P&&T.alternate===null&&e(m,P),y=s(T,y,E),C===null?k=T:C.sibling=T,C=T,P=N}if(M.done)return n(m,P),he&&pr(m,E),k;if(P===null){for(;!M.done;E++,M=p.next())M=d(m,M.value,b),M!==null&&(y=s(M,y,E),C===null?k=M:C.sibling=M,C=M);return he&&pr(m,E),k}for(P=r(m,P);!M.done;E++,M=p.next())M=f(P,m,E,M.value,b),M!==null&&(t&&M.alternate!==null&&P.delete(M.key===null?E:M.key),y=s(M,y,E),C===null?k=M:C.sibling=M,C=M);return t&&P.forEach(function(A){return e(m,A)}),he&&pr(m,E),k}function w(m,y,p,b){if(typeof p=="object"&&p!==null&&p.type===Xr&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case yo:e:{for(var k=p.key,C=y;C!==null;){if(C.key===k){if(k=p.type,k===Xr){if(C.tag===7){n(m,C.sibling),y=i(C,p.props.children),y.return=m,m=y;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pn&&jh(k)===C.type){n(m,C.sibling),y=i(C,p.props),y.ref=Xi(m,C,p),y.return=m,m=y;break e}n(m,C);break}else e(m,C);C=C.sibling}p.type===Xr?(y=jr(p.props.children,m.mode,b,p.key),y.return=m,m=y):(b=sa(p.type,p.key,p.props,null,m.mode,b),b.ref=Xi(m,y,p),b.return=m,m=b)}return o(m);case Kr:e:{for(C=p.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===p.containerInfo&&y.stateNode.implementation===p.implementation){n(m,y.sibling),y=i(y,p.children||[]),y.return=m,m=y;break e}else{n(m,y);break}else e(m,y);y=y.sibling}y=Ul(p,m.mode,b),y.return=m,m=y}return o(m);case Pn:return C=p._init,w(m,y,C(p._payload),b)}if(as(p))return x(m,y,p,b);if(Ui(p))return v(m,y,p,b);Mo(m,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,y!==null&&y.tag===6?(n(m,y.sibling),y=i(y,p),y.return=m,m=y):(n(m,y),y=$l(p,m.mode,b),y.return=m,m=y),o(m)):n(m,y)}return w}var Ti=hg(!0),fg=hg(!1),Pa=ar(null),Ma=null,ri=null,qc=null;function Gc(){qc=ri=Ma=null}function Jc(t){var e=Pa.current;ce(Pa),t._currentValue=e}function Au(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function di(t,e){Ma=t,qc=ri=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(nt=!0),t.firstContext=null)}function _t(t){var e=t._currentValue;if(qc!==t)if(t={context:t,memoizedValue:e,next:null},ri===null){if(Ma===null)throw Error(O(308));ri=t,Ma.dependencies={lanes:0,firstContext:t}}else ri=ri.next=t;return e}var xr=null;function Zc(t){xr===null?xr=[t]:xr.push(t)}function pg(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Zc(e)):(n.next=i.next,i.next=n),e.interleaved=n,vn(t,r)}function vn(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Mn=!1;function ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mg(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 pn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Kn(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,vn(t,n)}return i=r.interleaved,i===null?(e.next=e,Zc(r)):(e.next=i.next,i.next=e),r.interleaved=e,vn(t,n)}function Zo(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zc(t,n)}}function Dh(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=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};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Ra(t,e,n,r){var i=t.updateQueue;Mn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var h=a.lane,f=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=t,v=a;switch(h=e,f=n,v.tag){case 1:if(x=v.payload,typeof x=="function"){d=x.call(f,d,h);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,h=typeof x=="function"?x.call(f,d,h):x,h==null)break e;d=ye({},d,h);break e;case 2:Mn=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=f,l=d):c=c.next=f,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ar|=o,t.lanes=o,t.memoizedState=d}}function Lh(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(O(191,i));i.call(r)}}}var lo={},Zt=ar(lo),As=ar(lo),zs=ar(lo);function wr(t){if(t===lo)throw Error(O(174));return t}function td(t,e){switch(oe(zs,e),oe(As,t),oe(Zt,lo),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:vu(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=vu(e,t)}ce(Zt),oe(Zt,e)}function Oi(){ce(Zt),ce(As),ce(zs)}function gg(t){wr(zs.current);var e=wr(Zt.current),n=vu(e,t.type);e!==n&&(oe(As,t),oe(Zt,n))}function nd(t){As.current===t&&(ce(Zt),ce(As))}var me=ar(0);function Ta(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 Il=[];function rd(){for(var t=0;t<Il.length;t++)Il[t]._workInProgressVersionPrimary=null;Il.length=0}var ea=bn.ReactCurrentDispatcher,Al=bn.ReactCurrentBatchConfig,Ir=0,ge=null,ke=null,Me=null,Oa=!1,xs=!1,Bs=0,Rx=0;function Fe(){throw Error(O(321))}function id(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!It(t[n],e[n]))return!1;return!0}function sd(t,e,n,r,i,s){if(Ir=s,ge=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ea.current=t===null||t.memoizedState===null?jx:Dx,t=n(r,i),xs){s=0;do{if(xs=!1,Bs=0,25<=s)throw Error(O(301));s+=1,Me=ke=null,e.updateQueue=null,ea.current=Lx,t=n(r,i)}while(xs)}if(ea.current=Na,e=ke!==null&&ke.next!==null,Ir=0,Me=ke=ge=null,Oa=!1,e)throw Error(O(300));return t}function od(){var t=Bs!==0;return Bs=0,t}function Qt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Me===null?ge.memoizedState=Me=t:Me=Me.next=t,Me}function St(){if(ke===null){var t=ge.alternate;t=t!==null?t.memoizedState:null}else t=ke.next;var e=Me===null?ge.memoizedState:Me.next;if(e!==null)Me=e,ke=t;else{if(t===null)throw Error(O(310));ke=t,t={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Me===null?ge.memoizedState=Me=t:Me=Me.next=t}return Me}function Ws(t,e){return typeof e=="function"?e(t):e}function zl(t){var e=St(),n=e.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=t;var r=ke,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if((Ir&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,ge.lanes|=c,Ar|=c}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,It(r,e.memoizedState)||(nt=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,ge.lanes|=s,Ar|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Bl(t){var e=St(),n=e.queue;if(n===null)throw Error(O(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);It(s,e.memoizedState)||(nt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function yg(){}function vg(t,e){var n=ge,r=St(),i=e(),s=!It(r.memoizedState,i);if(s&&(r.memoizedState=i,nt=!0),r=r.queue,ad(bg.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||Me!==null&&Me.memoizedState.tag&1){if(n.flags|=2048,Hs(9,wg.bind(null,n,r,i,e),void 0,null),Re===null)throw Error(O(349));Ir&30||xg(n,e,i)}return i}function xg(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ge.updateQueue,e===null?(e={lastEffect:null,stores:null},ge.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function wg(t,e,n,r){e.value=n,e.getSnapshot=r,_g(e)&&Sg(t)}function bg(t,e,n){return n(function(){_g(e)&&Sg(t)})}function _g(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!It(t,n)}catch{return!0}}function Sg(t){var e=vn(t,1);e!==null&&Ft(e,t,1,-1)}function Fh(t){var e=Qt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:t},e.queue=t,t=t.dispatch=Nx.bind(null,ge,t),[e.memoizedState,t]}function Hs(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=ge.updateQueue,e===null?(e={lastEffect:null,stores:null},ge.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function kg(){return St().memoizedState}function ta(t,e,n,r){var i=Qt();ge.flags|=t,i.memoizedState=Hs(1|e,n,void 0,r===void 0?null:r)}function nl(t,e,n,r){var i=St();r=r===void 0?null:r;var s=void 0;if(ke!==null){var o=ke.memoizedState;if(s=o.destroy,r!==null&&id(r,o.deps)){i.memoizedState=Hs(e,n,s,r);return}}ge.flags|=t,i.memoizedState=Hs(1|e,n,s,r)}function Ih(t,e){return ta(8390656,8,t,e)}function ad(t,e){return nl(2048,8,t,e)}function Cg(t,e){return nl(4,2,t,e)}function Eg(t,e){return nl(4,4,t,e)}function Pg(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 Mg(t,e,n){return n=n!=null?n.concat([t]):null,nl(4,4,Pg.bind(null,e,t),n)}function ld(){}function Rg(t,e){var n=St();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&id(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Tg(t,e){var n=St();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&id(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Og(t,e,n){return Ir&21?(It(n,e)||(n=Fm(),ge.lanes|=n,Ar|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,nt=!0),t.memoizedState=n)}function Tx(t,e){var n=te;te=n!==0&&4>n?n:4,t(!0);var r=Al.transition;Al.transition={};try{t(!1),e()}finally{te=n,Al.transition=r}}function Ng(){return St().memoizedState}function Ox(t,e,n){var r=qn(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jg(t))Dg(e,n);else if(n=pg(t,e,n,r),n!==null){var i=Ke();Ft(n,t,r,i),Lg(n,e,r)}}function Nx(t,e,n){var r=qn(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jg(t))Dg(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,It(a,o)){var l=e.interleaved;l===null?(i.next=i,Zc(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=pg(t,e,i,r),n!==null&&(i=Ke(),Ft(n,t,r,i),Lg(n,e,r))}}function jg(t){var e=t.alternate;return t===ge||e!==null&&e===ge}function Dg(t,e){xs=Oa=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Lg(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zc(t,n)}}var Na={readContext:_t,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},jx={readContext:_t,useCallback:function(t,e){return Qt().memoizedState=[t,e===void 0?null:e],t},useContext:_t,useEffect:Ih,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,ta(4194308,4,Pg.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ta(4194308,4,t,e)},useInsertionEffect:function(t,e){return ta(4,2,t,e)},useMemo:function(t,e){var n=Qt();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Qt();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Ox.bind(null,ge,t),[r.memoizedState,t]},useRef:function(t){var e=Qt();return t={current:t},e.memoizedState=t},useState:Fh,useDebugValue:ld,useDeferredValue:function(t){return Qt().memoizedState=t},useTransition:function(){var t=Fh(!1),e=t[0];return t=Tx.bind(null,t[1]),Qt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ge,i=Qt();if(he){if(n===void 0)throw Error(O(407));n=n()}else{if(n=e(),Re===null)throw Error(O(349));Ir&30||xg(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Ih(bg.bind(null,r,s,t),[t]),r.flags|=2048,Hs(9,wg.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Qt(),e=Re.identifierPrefix;if(he){var n=hn,r=dn;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Bs++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=Rx++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Dx={readContext:_t,useCallback:Rg,useContext:_t,useEffect:ad,useImperativeHandle:Mg,useInsertionEffect:Cg,useLayoutEffect:Eg,useMemo:Tg,useReducer:zl,useRef:kg,useState:function(){return zl(Ws)},useDebugValue:ld,useDeferredValue:function(t){var e=St();return Og(e,ke.memoizedState,t)},useTransition:function(){var t=zl(Ws)[0],e=St().memoizedState;return[t,e]},useMutableSource:yg,useSyncExternalStore:vg,useId:Ng,unstable_isNewReconciler:!1},Lx={readContext:_t,useCallback:Rg,useContext:_t,useEffect:ad,useImperativeHandle:Mg,useInsertionEffect:Cg,useLayoutEffect:Eg,useMemo:Tg,useReducer:Bl,useRef:kg,useState:function(){return Bl(Ws)},useDebugValue:ld,useDeferredValue:function(t){var e=St();return ke===null?e.memoizedState=t:Og(e,ke.memoizedState,t)},useTransition:function(){var t=Bl(Ws)[0],e=St().memoizedState;return[t,e]},useMutableSource:yg,useSyncExternalStore:vg,useId:Ng,unstable_isNewReconciler:!1};function Mt(t,e){if(t&&t.defaultProps){e=ye({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function zu(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:ye({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var rl={isMounted:function(t){return(t=t._reactInternals)?Ur(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Ke(),i=qn(t),s=pn(r,i);s.payload=e,n!=null&&(s.callback=n),e=Kn(t,s,i),e!==null&&(Ft(e,t,i,r),Zo(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Ke(),i=qn(t),s=pn(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Kn(t,s,i),e!==null&&(Ft(e,t,i,r),Zo(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Ke(),r=qn(t),i=pn(n,r);i.tag=2,e!=null&&(i.callback=e),e=Kn(t,i,r),e!==null&&(Ft(e,t,r,n),Zo(e,t,r))}};function Ah(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!Ds(n,r)||!Ds(i,s):!0}function Fg(t,e,n){var r=!1,i=rr,s=e.contextType;return typeof s=="object"&&s!==null?s=_t(s):(i=it(e)?Lr:He.current,r=e.contextTypes,s=(r=r!=null)?Mi(t,i):rr),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=rl,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function zh(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&rl.enqueueReplaceState(e,e.state,null)}function Bu(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},ed(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=_t(s):(s=it(e)?Lr:He.current,i.context=Mi(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(zu(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&rl.enqueueReplaceState(i,i.state,null),Ra(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Ni(t,e){try{var n="",r=e;do n+=uv(r),r=r.return;while(r);var i=n}catch(s){i=`
37
+ `+i[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{bl=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?os(t):""}function uv(t){switch(t.tag){case 5:return os(t.type);case 16:return os("Lazy");case 13:return os("Suspense");case 19:return os("SuspenseList");case 0:case 2:case 15:return t=_l(t.type,!1),t;case 11:return t=_l(t.type.render,!1),t;case 1:return t=_l(t.type,!0),t;default:return""}}function fu(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 Xr:return"Fragment";case Kr:return"Portal";case cu:return"Profiler";case Dc:return"StrictMode";case du:return"Suspense";case hu:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mm:return(t.displayName||"Context")+".Consumer";case pm:return(t._context.displayName||"Context")+".Provider";case Lc:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Fc:return e=t.displayName||null,e!==null?e:fu(t.type)||"Memo";case Pn:e=t._payload,t=t._init;try{return fu(t(e))}catch{}}return null}function cv(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 fu(e);case 8:return e===Dc?"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 nr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ym(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function dv(t){var e=ym(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function vo(t){t._valueTracker||(t._valueTracker=dv(t))}function vm(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ym(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function pa(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 pu(t,e){var n=e.checked;return ye({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function nh(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=nr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function xm(t,e){e=e.checked,e!=null&&jc(t,"checked",e,!1)}function mu(t,e){xm(t,e);var n=nr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?gu(t,e.type,n):e.hasOwnProperty("defaultValue")&&gu(t,e.type,nr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function rh(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="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 gu(t,e,n){(e!=="number"||pa(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var as=Array.isArray;function ai(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+nr(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function yu(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(N(91));return ye({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ih(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(N(92));if(as(n)){if(1<n.length)throw Error(N(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:nr(n)}}function wm(t,e){var n=nr(e.value),r=nr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function sh(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function bm(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 vu(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?bm(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var xo,_m=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(xo=xo||document.createElement("div"),xo.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=xo.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ms(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ps={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},hv=["Webkit","ms","Moz","O"];Object.keys(ps).forEach(function(t){hv.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ps[e]=ps[t]})});function Sm(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ps.hasOwnProperty(t)&&ps[t]?(""+e).trim():e+"px"}function km(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Sm(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var fv=ye({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 xu(t,e){if(e){if(fv[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(N(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(N(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(N(61))}if(e.style!=null&&typeof e.style!="object")throw Error(N(62))}}function wu(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 bu=null;function Ic(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var _u=null,li=null,ui=null;function oh(t){if(t=ao(t)){if(typeof _u!="function")throw Error(N(280));var e=t.stateNode;e&&(e=el(e),_u(t.stateNode,t.type,e))}}function Cm(t){li?ui?ui.push(t):ui=[t]:li=t}function Em(){if(li){var t=li,e=ui;if(ui=li=null,oh(t),e)for(t=0;t<e.length;t++)oh(e[t])}}function Pm(t,e){return t(e)}function Mm(){}var Sl=!1;function Tm(t,e,n){if(Sl)return t(e,n);Sl=!0;try{return Pm(t,e,n)}finally{Sl=!1,(li!==null||ui!==null)&&(Mm(),Em())}}function Ts(t,e){var n=t.stateNode;if(n===null)return null;var r=el(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(N(231,e,typeof n));return n}var Su=!1;if(gn)try{var Vi={};Object.defineProperty(Vi,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Vi,Vi),window.removeEventListener("test",Vi,Vi)}catch{Su=!1}function pv(t,e,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var ms=!1,ma=null,ga=!1,ku=null,mv={onError:function(t){ms=!0,ma=t}};function gv(t,e,n,r,i,s,o,a,l){ms=!1,ma=null,pv.apply(mv,arguments)}function yv(t,e,n,r,i,s,o,a,l){if(gv.apply(this,arguments),ms){if(ms){var u=ma;ms=!1,ma=null}else throw Error(N(198));ga||(ga=!0,ku=u)}}function Ur(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 Rm(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 ah(t){if(Ur(t)!==t)throw Error(N(188))}function vv(t){var e=t.alternate;if(!e){if(e=Ur(t),e===null)throw Error(N(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return ah(i),t;if(s===r)return ah(i),e;s=s.sibling}throw Error(N(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(N(189))}}if(n.alternate!==r)throw Error(N(190))}if(n.tag!==3)throw Error(N(188));return n.stateNode.current===n?t:e}function Nm(t){return t=vv(t),t!==null?Om(t):null}function Om(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Om(t);if(e!==null)return e;t=t.sibling}return null}var jm=ut.unstable_scheduleCallback,lh=ut.unstable_cancelCallback,xv=ut.unstable_shouldYield,wv=ut.unstable_requestPaint,be=ut.unstable_now,bv=ut.unstable_getCurrentPriorityLevel,Ac=ut.unstable_ImmediatePriority,Dm=ut.unstable_UserBlockingPriority,ya=ut.unstable_NormalPriority,_v=ut.unstable_LowPriority,Lm=ut.unstable_IdlePriority,qa=null,Jt=null;function Sv(t){if(Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(qa,t,void 0,(t.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:Ev,kv=Math.log,Cv=Math.LN2;function Ev(t){return t>>>=0,t===0?32:31-(kv(t)/Cv|0)|0}var wo=64,bo=4194304;function ls(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 va(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=ls(a):(s&=o,s!==0&&(r=ls(s)))}else o=n&~i,o!==0?r=ls(o):s!==0&&(r=ls(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Lt(e),i=1<<n,r|=t[n],e&=~i;return r}function Pv(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 Mv(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Lt(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=Pv(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function Cu(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Fm(){var t=wo;return wo<<=1,!(wo&4194240)&&(wo=64),t}function kl(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function so(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Lt(e),t[e]=n}function Tv(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 r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Lt(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function zc(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Lt(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var te=0;function Im(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Am,Bc,zm,Bm,Wm,Eu=!1,_o=[],Un=null,Vn=null,Qn=null,Rs=new Map,Ns=new Map,Tn=[],Rv="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 uh(t,e){switch(t){case"focusin":case"focusout":Un=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":Qn=null;break;case"pointerover":case"pointerout":Rs.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ns.delete(e.pointerId)}}function Qi(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=ao(e),e!==null&&Bc(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function Nv(t,e,n,r,i){switch(e){case"focusin":return Un=Qi(Un,t,e,n,r,i),!0;case"dragenter":return Vn=Qi(Vn,t,e,n,r,i),!0;case"mouseover":return Qn=Qi(Qn,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Rs.set(s,Qi(Rs.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Ns.set(s,Qi(Ns.get(s)||null,t,e,n,r,i)),!0}return!1}function Hm(t){var e=vr(t.target);if(e!==null){var n=Ur(e);if(n!==null){if(e=n.tag,e===13){if(e=Rm(n),e!==null){t.blockedOn=e,Wm(t.priority,function(){zm(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 qo(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Pu(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);bu=r,n.target.dispatchEvent(r),bu=null}else return e=ao(n),e!==null&&Bc(e),t.blockedOn=n,!1;e.shift()}return!0}function ch(t,e,n){qo(t)&&n.delete(e)}function Ov(){Eu=!1,Un!==null&&qo(Un)&&(Un=null),Vn!==null&&qo(Vn)&&(Vn=null),Qn!==null&&qo(Qn)&&(Qn=null),Rs.forEach(ch),Ns.forEach(ch)}function Yi(t,e){t.blockedOn===e&&(t.blockedOn=null,Eu||(Eu=!0,ut.unstable_scheduleCallback(ut.unstable_NormalPriority,Ov)))}function Os(t){function e(i){return Yi(i,t)}if(0<_o.length){Yi(_o[0],t);for(var n=1;n<_o.length;n++){var r=_o[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Un!==null&&Yi(Un,t),Vn!==null&&Yi(Vn,t),Qn!==null&&Yi(Qn,t),Rs.forEach(e),Ns.forEach(e),n=0;n<Tn.length;n++)r=Tn[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Tn.length&&(n=Tn[0],n.blockedOn===null);)Hm(n),n.blockedOn===null&&Tn.shift()}var ci=bn.ReactCurrentBatchConfig,xa=!0;function jv(t,e,n,r){var i=te,s=ci.transition;ci.transition=null;try{te=1,Wc(t,e,n,r)}finally{te=i,ci.transition=s}}function Dv(t,e,n,r){var i=te,s=ci.transition;ci.transition=null;try{te=4,Wc(t,e,n,r)}finally{te=i,ci.transition=s}}function Wc(t,e,n,r){if(xa){var i=Pu(t,e,n,r);if(i===null)Dl(t,e,r,wa,n),uh(t,r);else if(Nv(i,t,e,n,r))r.stopPropagation();else if(uh(t,r),e&4&&-1<Rv.indexOf(t)){for(;i!==null;){var s=ao(i);if(s!==null&&Am(s),s=Pu(t,e,n,r),s===null&&Dl(t,e,r,wa,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Dl(t,e,r,null,n)}}var wa=null;function Pu(t,e,n,r){if(wa=null,t=Ic(r),t=vr(t),t!==null)if(e=Ur(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Rm(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 wa=t,null}function $m(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(bv()){case Ac:return 1;case Dm:return 4;case ya:case _v:return 16;case Lm:return 536870912;default:return 16}default:return 16}}var zn=null,Hc=null,Go=null;function Um(){if(Go)return Go;var t,e=Hc,n=e.length,r,i="value"in zn?zn.value:zn.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return Go=i.slice(t,1<r?1-r:void 0)}function Jo(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 So(){return!0}function dh(){return!1}function dt(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?So:dh,this.isPropagationStopped=dh,this}return ye(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=So)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=So)},persist:function(){},isPersistent:So}),e}var Ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$c=dt(Ii),oo=ye({},Ii,{view:0,detail:0}),Lv=dt(oo),Cl,El,Ki,Ga=ye({},oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,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!==Ki&&(Ki&&t.type==="mousemove"?(Cl=t.screenX-Ki.screenX,El=t.screenY-Ki.screenY):El=Cl=0,Ki=t),Cl)},movementY:function(t){return"movementY"in t?t.movementY:El}}),hh=dt(Ga),Fv=ye({},Ga,{dataTransfer:0}),Iv=dt(Fv),Av=ye({},oo,{relatedTarget:0}),Pl=dt(Av),zv=ye({},Ii,{animationName:0,elapsedTime:0,pseudoElement:0}),Bv=dt(zv),Wv=ye({},Ii,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Hv=dt(Wv),$v=ye({},Ii,{data:0}),fh=dt($v),Uv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vv={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"},Qv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yv(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Qv[t])?!!e[t]:!1}function Uc(){return Yv}var Kv=ye({},oo,{key:function(t){if(t.key){var e=Uv[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Jo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Vv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(t){return t.type==="keypress"?Jo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Xv=dt(Kv),qv=ye({},Ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ph=dt(qv),Gv=ye({},oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),Jv=dt(Gv),Zv=ye({},Ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),ex=dt(Zv),tx=ye({},Ga,{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}),nx=dt(tx),rx=[9,13,27,32],Vc=gn&&"CompositionEvent"in window,gs=null;gn&&"documentMode"in document&&(gs=document.documentMode);var ix=gn&&"TextEvent"in window&&!gs,Vm=gn&&(!Vc||gs&&8<gs&&11>=gs),mh=" ",gh=!1;function Qm(t,e){switch(t){case"keyup":return rx.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ym(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qr=!1;function sx(t,e){switch(t){case"compositionend":return Ym(e);case"keypress":return e.which!==32?null:(gh=!0,mh);case"textInput":return t=e.data,t===mh&&gh?null:t;default:return null}}function ox(t,e){if(qr)return t==="compositionend"||!Vc&&Qm(t,e)?(t=Um(),Go=Hc=zn=null,qr=!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 Vm&&e.locale!=="ko"?null:e.data;default:return null}}var ax={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 yh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!ax[t.type]:e==="textarea"}function Km(t,e,n,r){Cm(r),e=ba(e,"onChange"),0<e.length&&(n=new $c("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var ys=null,js=null;function lx(t){sg(t,0)}function Ja(t){var e=Zr(t);if(vm(e))return t}function ux(t,e){if(t==="change")return e}var Xm=!1;if(gn){var Ml;if(gn){var Tl="oninput"in document;if(!Tl){var vh=document.createElement("div");vh.setAttribute("oninput","return;"),Tl=typeof vh.oninput=="function"}Ml=Tl}else Ml=!1;Xm=Ml&&(!document.documentMode||9<document.documentMode)}function xh(){ys&&(ys.detachEvent("onpropertychange",qm),js=ys=null)}function qm(t){if(t.propertyName==="value"&&Ja(js)){var e=[];Km(e,js,t,Ic(t)),Tm(lx,e)}}function cx(t,e,n){t==="focusin"?(xh(),ys=e,js=n,ys.attachEvent("onpropertychange",qm)):t==="focusout"&&xh()}function dx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ja(js)}function hx(t,e){if(t==="click")return Ja(e)}function fx(t,e){if(t==="input"||t==="change")return Ja(e)}function px(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var It=typeof Object.is=="function"?Object.is:px;function Ds(t,e){if(It(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!uu.call(e,i)||!It(t[i],e[i]))return!1}return!0}function wh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function bh(t,e){var n=wh(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wh(n)}}function Gm(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Gm(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Jm(){for(var t=window,e=pa();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=pa(t.document)}return e}function Qc(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 mx(t){var e=Jm(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Gm(n.ownerDocument.documentElement,n)){if(r!==null&&Qc(n)){if(e=r.start,t=r.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 i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=bh(n,s);var o=bh(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(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 gx=gn&&"documentMode"in document&&11>=document.documentMode,Gr=null,Mu=null,vs=null,Tu=!1;function _h(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tu||Gr==null||Gr!==pa(r)||(r=Gr,"selectionStart"in r&&Qc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),vs&&Ds(vs,r)||(vs=r,r=ba(Mu,"onSelect"),0<r.length&&(e=new $c("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Gr)))}function ko(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Jr={animationend:ko("Animation","AnimationEnd"),animationiteration:ko("Animation","AnimationIteration"),animationstart:ko("Animation","AnimationStart"),transitionend:ko("Transition","TransitionEnd")},Rl={},Zm={};gn&&(Zm=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function Za(t){if(Rl[t])return Rl[t];if(!Jr[t])return t;var e=Jr[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Zm)return Rl[t]=e[n];return t}var eg=Za("animationend"),tg=Za("animationiteration"),ng=Za("animationstart"),rg=Za("transitionend"),ig=new Map,Sh="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 or(t,e){ig.set(t,e),$r(e,[t])}for(var Nl=0;Nl<Sh.length;Nl++){var Ol=Sh[Nl],yx=Ol.toLowerCase(),vx=Ol[0].toUpperCase()+Ol.slice(1);or(yx,"on"+vx)}or(eg,"onAnimationEnd");or(tg,"onAnimationIteration");or(ng,"onAnimationStart");or("dblclick","onDoubleClick");or("focusin","onFocus");or("focusout","onBlur");or(rg,"onTransitionEnd");Pi("onMouseEnter",["mouseout","mouseover"]);Pi("onMouseLeave",["mouseout","mouseover"]);Pi("onPointerEnter",["pointerout","pointerover"]);Pi("onPointerLeave",["pointerout","pointerover"]);$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$r("onBeforeInput",["compositionend","keypress","textInput","paste"]);$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var us="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(" "),xx=new Set("cancel close invalid load scroll toggle".split(" ").concat(us));function kh(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,yv(r,e,void 0,t),t.currentTarget=null}function sg(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;kh(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;kh(i,a,u),s=l}}}if(ga)throw t=ku,ga=!1,ku=null,t}function ue(t,e){var n=e[Du];n===void 0&&(n=e[Du]=new Set);var r=t+"__bubble";n.has(r)||(og(e,t,2,!1),n.add(r))}function jl(t,e,n){var r=0;e&&(r|=4),og(n,t,r,e)}var Co="_reactListening"+Math.random().toString(36).slice(2);function Ls(t){if(!t[Co]){t[Co]=!0,fm.forEach(function(n){n!=="selectionchange"&&(xx.has(n)||jl(n,!1,t),jl(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Co]||(e[Co]=!0,jl("selectionchange",!1,e))}}function og(t,e,n,r){switch($m(e)){case 1:var i=jv;break;case 4:i=Dv;break;default:i=Wc}n=i.bind(null,e,n,t),i=void 0,!Su||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Dl(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=vr(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Tm(function(){var u=s,c=Ic(n),d=[];e:{var h=ig.get(t);if(h!==void 0){var f=$c,v=t;switch(t){case"keypress":if(Jo(n)===0)break e;case"keydown":case"keyup":f=Xv;break;case"focusin":v="focus",f=Pl;break;case"focusout":v="blur",f=Pl;break;case"beforeblur":case"afterblur":f=Pl;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":f=hh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=Iv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=Jv;break;case eg:case tg:case ng:f=Bv;break;case rg:f=ex;break;case"scroll":f=Lv;break;case"wheel":f=nx;break;case"copy":case"cut":case"paste":f=Hv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=ph}var y=(e&4)!==0,w=!y&&t==="scroll",m=y?h!==null?h+"Capture":null:h;y=[];for(var g=u,x;g!==null;){x=g;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,m!==null&&(b=Ts(g,m),b!=null&&y.push(Fs(g,b,x)))),w)break;g=g.return}0<y.length&&(h=new f(h,v,null,n,c),d.push({event:h,listeners:y}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",h&&n!==bu&&(v=n.relatedTarget||n.fromElement)&&(vr(v)||v[yn]))break e;if((f||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,f?(v=n.relatedTarget||n.toElement,f=u,v=v?vr(v):null,v!==null&&(w=Ur(v),v!==w||v.tag!==5&&v.tag!==6)&&(v=null)):(f=null,v=u),f!==v)){if(y=hh,b="onMouseLeave",m="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(y=ph,b="onPointerLeave",m="onPointerEnter",g="pointer"),w=f==null?h:Zr(f),x=v==null?h:Zr(v),h=new y(b,g+"leave",f,n,c),h.target=w,h.relatedTarget=x,b=null,vr(c)===u&&(y=new y(m,g+"enter",v,n,c),y.target=x,y.relatedTarget=w,b=y),w=b,f&&v)t:{for(y=f,m=v,g=0,x=y;x;x=Vr(x))g++;for(x=0,b=m;b;b=Vr(b))x++;for(;0<g-x;)y=Vr(y),g--;for(;0<x-g;)m=Vr(m),x--;for(;g--;){if(y===m||m!==null&&y===m.alternate)break t;y=Vr(y),m=Vr(m)}y=null}else y=null;f!==null&&Ch(d,h,f,y,!1),v!==null&&w!==null&&Ch(d,w,v,y,!0)}}e:{if(h=u?Zr(u):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var C=ux;else if(yh(h))if(Xm)C=fx;else{C=dx;var P=cx}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=hx);if(C&&(C=C(t,u))){Km(d,C,n,c);break e}P&&P(t,h,u),t==="focusout"&&(P=h._wrapperState)&&P.controlled&&h.type==="number"&&gu(h,"number",h.value)}switch(P=u?Zr(u):window,t){case"focusin":(yh(P)||P.contentEditable==="true")&&(Gr=P,Mu=u,vs=null);break;case"focusout":vs=Mu=Gr=null;break;case"mousedown":Tu=!0;break;case"contextmenu":case"mouseup":case"dragend":Tu=!1,_h(d,n,c);break;case"selectionchange":if(gx)break;case"keydown":case"keyup":_h(d,n,c)}var _;if(Vc)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else qr?Qm(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Vm&&n.locale!=="ko"&&(qr||E!=="onCompositionStart"?E==="onCompositionEnd"&&qr&&(_=Um()):(zn=c,Hc="value"in zn?zn.value:zn.textContent,qr=!0)),P=ba(u,E),0<P.length&&(E=new fh(E,t,null,n,c),d.push({event:E,listeners:P}),_?E.data=_:(_=Ym(n),_!==null&&(E.data=_)))),(_=ix?sx(t,n):ox(t,n))&&(u=ba(u,"onBeforeInput"),0<u.length&&(c=new fh("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=_))}sg(d,e)})}function Fs(t,e,n){return{instance:t,listener:e,currentTarget:n}}function ba(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ts(t,n),s!=null&&r.unshift(Fs(t,s,i)),s=Ts(t,e),s!=null&&r.push(Fs(t,s,i))),t=t.return}return r}function Vr(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Ch(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=Ts(n,s),l!=null&&o.unshift(Fs(n,l,a))):i||(l=Ts(n,s),l!=null&&o.push(Fs(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var wx=/\r\n?/g,bx=/\u0000|\uFFFD/g;function Eh(t){return(typeof t=="string"?t:""+t).replace(wx,`
38
+ `).replace(bx,"")}function Eo(t,e,n){if(e=Eh(e),Eh(t)!==e&&n)throw Error(N(425))}function _a(){}var Ru=null,Nu=null;function Ou(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 ju=typeof setTimeout=="function"?setTimeout:void 0,_x=typeof clearTimeout=="function"?clearTimeout:void 0,Ph=typeof Promise=="function"?Promise:void 0,Sx=typeof queueMicrotask=="function"?queueMicrotask:typeof Ph<"u"?function(t){return Ph.resolve(null).then(t).catch(kx)}:ju;function kx(t){setTimeout(function(){throw t})}function Ll(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Os(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Os(e)}function Yn(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 Mh(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 Ai=Math.random().toString(36).slice(2),Gt="__reactFiber$"+Ai,Is="__reactProps$"+Ai,yn="__reactContainer$"+Ai,Du="__reactEvents$"+Ai,Cx="__reactListeners$"+Ai,Ex="__reactHandles$"+Ai;function vr(t){var e=t[Gt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[yn]||n[Gt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Mh(t);t!==null;){if(n=t[Gt])return n;t=Mh(t)}return e}t=n,n=t.parentNode}return null}function ao(t){return t=t[Gt]||t[yn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Zr(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(N(33))}function el(t){return t[Is]||null}var Lu=[],ei=-1;function ar(t){return{current:t}}function de(t){0>ei||(t.current=Lu[ei],Lu[ei]=null,ei--)}function ae(t,e){ei++,Lu[ei]=t.current,t.current=e}var rr={},He=ar(rr),rt=ar(!1),Lr=rr;function Mi(t,e){var n=t.type.contextTypes;if(!n)return rr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function it(t){return t=t.childContextTypes,t!=null}function Sa(){de(rt),de(He)}function Th(t,e,n){if(He.current!==rr)throw Error(N(168));ae(He,e),ae(rt,n)}function ag(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(N(108,cv(t)||"Unknown",i));return ye({},n,r)}function ka(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rr,Lr=He.current,ae(He,t),ae(rt,rt.current),!0}function Rh(t,e,n){var r=t.stateNode;if(!r)throw Error(N(169));n?(t=ag(t,e,Lr),r.__reactInternalMemoizedMergedChildContext=t,de(rt),de(He),ae(He,t)):de(rt),ae(rt,n)}var an=null,tl=!1,Fl=!1;function lg(t){an===null?an=[t]:an.push(t)}function Px(t){tl=!0,lg(t)}function lr(){if(!Fl&&an!==null){Fl=!0;var t=0,e=te;try{var n=an;for(te=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}an=null,tl=!1}catch(i){throw an!==null&&(an=an.slice(t+1)),jm(Ac,lr),i}finally{te=e,Fl=!1}}return null}var ti=[],ni=0,Ca=null,Ea=0,yt=[],vt=0,Fr=null,dn=1,hn="";function pr(t,e){ti[ni++]=Ea,ti[ni++]=Ca,Ca=t,Ea=e}function ug(t,e,n){yt[vt++]=dn,yt[vt++]=hn,yt[vt++]=Fr,Fr=t;var r=dn;t=hn;var i=32-Lt(r)-1;r&=~(1<<i),n+=1;var s=32-Lt(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,dn=1<<32-Lt(e)+i|n<<i|r,hn=s+t}else dn=1<<s|n<<i|r,hn=t}function Yc(t){t.return!==null&&(pr(t,1),ug(t,1,0))}function Kc(t){for(;t===Ca;)Ca=ti[--ni],ti[ni]=null,Ea=ti[--ni],ti[ni]=null;for(;t===Fr;)Fr=yt[--vt],yt[vt]=null,hn=yt[--vt],yt[vt]=null,dn=yt[--vt],yt[vt]=null}var lt=null,at=null,he=!1,Ot=null;function cg(t,e){var n=xt(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 Nh(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,lt=t,at=Yn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,lt=t,at=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Fr!==null?{id:dn,overflow:hn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=xt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,lt=t,at=null,!0):!1;default:return!1}}function Fu(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Iu(t){if(he){var e=at;if(e){var n=e;if(!Nh(t,e)){if(Fu(t))throw Error(N(418));e=Yn(n.nextSibling);var r=lt;e&&Nh(t,e)?cg(r,n):(t.flags=t.flags&-4097|2,he=!1,lt=t)}}else{if(Fu(t))throw Error(N(418));t.flags=t.flags&-4097|2,he=!1,lt=t}}}function Oh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;lt=t}function Po(t){if(t!==lt)return!1;if(!he)return Oh(t),he=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ou(t.type,t.memoizedProps)),e&&(e=at)){if(Fu(t))throw dg(),Error(N(418));for(;e;)cg(t,e),e=Yn(e.nextSibling)}if(Oh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(N(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){at=Yn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}at=null}}else at=lt?Yn(t.stateNode.nextSibling):null;return!0}function dg(){for(var t=at;t;)t=Yn(t.nextSibling)}function Ti(){at=lt=null,he=!1}function Xc(t){Ot===null?Ot=[t]:Ot.push(t)}var Mx=bn.ReactCurrentBatchConfig;function Xi(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(N(309));var r=n.stateNode}if(!r)throw Error(N(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(N(284));if(!n._owner)throw Error(N(290,t))}return t}function Mo(t,e){throw t=Object.prototype.toString.call(e),Error(N(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function jh(t){var e=t._init;return e(t._payload)}function hg(t){function e(m,g){if(t){var x=m.deletions;x===null?(m.deletions=[g],m.flags|=16):x.push(g)}}function n(m,g){if(!t)return null;for(;g!==null;)e(m,g),g=g.sibling;return null}function r(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function i(m,g){return m=Gn(m,g),m.index=0,m.sibling=null,m}function s(m,g,x){return m.index=x,t?(x=m.alternate,x!==null?(x=x.index,x<g?(m.flags|=2,g):x):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return t&&m.alternate===null&&(m.flags|=2),m}function a(m,g,x,b){return g===null||g.tag!==6?(g=$l(x,m.mode,b),g.return=m,g):(g=i(g,x),g.return=m,g)}function l(m,g,x,b){var C=x.type;return C===Xr?c(m,g,x.props.children,b,x.key):g!==null&&(g.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Pn&&jh(C)===g.type)?(b=i(g,x.props),b.ref=Xi(m,g,x),b.return=m,b):(b=sa(x.type,x.key,x.props,null,m.mode,b),b.ref=Xi(m,g,x),b.return=m,b)}function u(m,g,x,b){return g===null||g.tag!==4||g.stateNode.containerInfo!==x.containerInfo||g.stateNode.implementation!==x.implementation?(g=Ul(x,m.mode,b),g.return=m,g):(g=i(g,x.children||[]),g.return=m,g)}function c(m,g,x,b,C){return g===null||g.tag!==7?(g=jr(x,m.mode,b,C),g.return=m,g):(g=i(g,x),g.return=m,g)}function d(m,g,x){if(typeof g=="string"&&g!==""||typeof g=="number")return g=$l(""+g,m.mode,x),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case yo:return x=sa(g.type,g.key,g.props,null,m.mode,x),x.ref=Xi(m,null,g),x.return=m,x;case Kr:return g=Ul(g,m.mode,x),g.return=m,g;case Pn:var b=g._init;return d(m,b(g._payload),x)}if(as(g)||Ui(g))return g=jr(g,m.mode,x,null),g.return=m,g;Mo(m,g)}return null}function h(m,g,x,b){var C=g!==null?g.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return C!==null?null:a(m,g,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case yo:return x.key===C?l(m,g,x,b):null;case Kr:return x.key===C?u(m,g,x,b):null;case Pn:return C=x._init,h(m,g,C(x._payload),b)}if(as(x)||Ui(x))return C!==null?null:c(m,g,x,b,null);Mo(m,x)}return null}function f(m,g,x,b,C){if(typeof b=="string"&&b!==""||typeof b=="number")return m=m.get(x)||null,a(g,m,""+b,C);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case yo:return m=m.get(b.key===null?x:b.key)||null,l(g,m,b,C);case Kr:return m=m.get(b.key===null?x:b.key)||null,u(g,m,b,C);case Pn:var P=b._init;return f(m,g,x,P(b._payload),C)}if(as(b)||Ui(b))return m=m.get(x)||null,c(g,m,b,C,null);Mo(g,b)}return null}function v(m,g,x,b){for(var C=null,P=null,_=g,E=g=0,O=null;_!==null&&E<x.length;E++){_.index>E?(O=_,_=null):O=_.sibling;var M=h(m,_,x[E],b);if(M===null){_===null&&(_=O);break}t&&_&&M.alternate===null&&e(m,_),g=s(M,g,E),P===null?C=M:P.sibling=M,P=M,_=O}if(E===x.length)return n(m,_),he&&pr(m,E),C;if(_===null){for(;E<x.length;E++)_=d(m,x[E],b),_!==null&&(g=s(_,g,E),P===null?C=_:P.sibling=_,P=_);return he&&pr(m,E),C}for(_=r(m,_);E<x.length;E++)O=f(_,m,E,x[E],b),O!==null&&(t&&O.alternate!==null&&_.delete(O.key===null?E:O.key),g=s(O,g,E),P===null?C=O:P.sibling=O,P=O);return t&&_.forEach(function(T){return e(m,T)}),he&&pr(m,E),C}function y(m,g,x,b){var C=Ui(x);if(typeof C!="function")throw Error(N(150));if(x=C.call(x),x==null)throw Error(N(151));for(var P=C=null,_=g,E=g=0,O=null,M=x.next();_!==null&&!M.done;E++,M=x.next()){_.index>E?(O=_,_=null):O=_.sibling;var T=h(m,_,M.value,b);if(T===null){_===null&&(_=O);break}t&&_&&T.alternate===null&&e(m,_),g=s(T,g,E),P===null?C=T:P.sibling=T,P=T,_=O}if(M.done)return n(m,_),he&&pr(m,E),C;if(_===null){for(;!M.done;E++,M=x.next())M=d(m,M.value,b),M!==null&&(g=s(M,g,E),P===null?C=M:P.sibling=M,P=M);return he&&pr(m,E),C}for(_=r(m,_);!M.done;E++,M=x.next())M=f(_,m,E,M.value,b),M!==null&&(t&&M.alternate!==null&&_.delete(M.key===null?E:M.key),g=s(M,g,E),P===null?C=M:P.sibling=M,P=M);return t&&_.forEach(function(I){return e(m,I)}),he&&pr(m,E),C}function w(m,g,x,b){if(typeof x=="object"&&x!==null&&x.type===Xr&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case yo:e:{for(var C=x.key,P=g;P!==null;){if(P.key===C){if(C=x.type,C===Xr){if(P.tag===7){n(m,P.sibling),g=i(P,x.props.children),g.return=m,m=g;break e}}else if(P.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Pn&&jh(C)===P.type){n(m,P.sibling),g=i(P,x.props),g.ref=Xi(m,P,x),g.return=m,m=g;break e}n(m,P);break}else e(m,P);P=P.sibling}x.type===Xr?(g=jr(x.props.children,m.mode,b,x.key),g.return=m,m=g):(b=sa(x.type,x.key,x.props,null,m.mode,b),b.ref=Xi(m,g,x),b.return=m,m=b)}return o(m);case Kr:e:{for(P=x.key;g!==null;){if(g.key===P)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(m,g.sibling),g=i(g,x.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else e(m,g);g=g.sibling}g=Ul(x,m.mode,b),g.return=m,m=g}return o(m);case Pn:return P=x._init,w(m,g,P(x._payload),b)}if(as(x))return v(m,g,x,b);if(Ui(x))return y(m,g,x,b);Mo(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(m,g.sibling),g=i(g,x),g.return=m,m=g):(n(m,g),g=$l(x,m.mode,b),g.return=m,m=g),o(m)):n(m,g)}return w}var Ri=hg(!0),fg=hg(!1),Pa=ar(null),Ma=null,ri=null,qc=null;function Gc(){qc=ri=Ma=null}function Jc(t){var e=Pa.current;de(Pa),t._currentValue=e}function Au(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function di(t,e){Ma=t,qc=ri=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(nt=!0),t.firstContext=null)}function _t(t){var e=t._currentValue;if(qc!==t)if(t={context:t,memoizedValue:e,next:null},ri===null){if(Ma===null)throw Error(N(308));ri=t,Ma.dependencies={lanes:0,firstContext:t}}else ri=ri.next=t;return e}var xr=null;function Zc(t){xr===null?xr=[t]:xr.push(t)}function pg(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Zc(e)):(n.next=i.next,i.next=n),e.interleaved=n,vn(t,r)}function vn(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Mn=!1;function ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mg(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 pn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Kn(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,vn(t,n)}return i=r.interleaved,i===null?(e.next=e,Zc(r)):(e.next=i.next,i.next=e),r.interleaved=e,vn(t,n)}function Zo(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zc(t,n)}}function Dh(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=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};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Ta(t,e,n,r){var i=t.updateQueue;Mn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var h=a.lane,f=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,y=a;switch(h=e,f=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){d=v.call(f,d,h);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,h=typeof v=="function"?v.call(f,d,h):v,h==null)break e;d=ye({},d,h);break e;case 2:Mn=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=f,l=d):c=c.next=f,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ar|=o,t.lanes=o,t.memoizedState=d}}function Lh(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(N(191,i));i.call(r)}}}var lo={},Zt=ar(lo),As=ar(lo),zs=ar(lo);function wr(t){if(t===lo)throw Error(N(174));return t}function td(t,e){switch(ae(zs,e),ae(As,t),ae(Zt,lo),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:vu(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=vu(e,t)}de(Zt),ae(Zt,e)}function Ni(){de(Zt),de(As),de(zs)}function gg(t){wr(zs.current);var e=wr(Zt.current),n=vu(e,t.type);e!==n&&(ae(As,t),ae(Zt,n))}function nd(t){As.current===t&&(de(Zt),de(As))}var me=ar(0);function Ra(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 Il=[];function rd(){for(var t=0;t<Il.length;t++)Il[t]._workInProgressVersionPrimary=null;Il.length=0}var ea=bn.ReactCurrentDispatcher,Al=bn.ReactCurrentBatchConfig,Ir=0,ge=null,ke=null,Me=null,Na=!1,xs=!1,Bs=0,Tx=0;function Fe(){throw Error(N(321))}function id(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!It(t[n],e[n]))return!1;return!0}function sd(t,e,n,r,i,s){if(Ir=s,ge=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ea.current=t===null||t.memoizedState===null?jx:Dx,t=n(r,i),xs){s=0;do{if(xs=!1,Bs=0,25<=s)throw Error(N(301));s+=1,Me=ke=null,e.updateQueue=null,ea.current=Lx,t=n(r,i)}while(xs)}if(ea.current=Oa,e=ke!==null&&ke.next!==null,Ir=0,Me=ke=ge=null,Na=!1,e)throw Error(N(300));return t}function od(){var t=Bs!==0;return Bs=0,t}function Qt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Me===null?ge.memoizedState=Me=t:Me=Me.next=t,Me}function St(){if(ke===null){var t=ge.alternate;t=t!==null?t.memoizedState:null}else t=ke.next;var e=Me===null?ge.memoizedState:Me.next;if(e!==null)Me=e,ke=t;else{if(t===null)throw Error(N(310));ke=t,t={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Me===null?ge.memoizedState=Me=t:Me=Me.next=t}return Me}function Ws(t,e){return typeof e=="function"?e(t):e}function zl(t){var e=St(),n=e.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=t;var r=ke,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if((Ir&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,ge.lanes|=c,Ar|=c}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,It(r,e.memoizedState)||(nt=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,ge.lanes|=s,Ar|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Bl(t){var e=St(),n=e.queue;if(n===null)throw Error(N(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);It(s,e.memoizedState)||(nt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function yg(){}function vg(t,e){var n=ge,r=St(),i=e(),s=!It(r.memoizedState,i);if(s&&(r.memoizedState=i,nt=!0),r=r.queue,ad(bg.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||Me!==null&&Me.memoizedState.tag&1){if(n.flags|=2048,Hs(9,wg.bind(null,n,r,i,e),void 0,null),Te===null)throw Error(N(349));Ir&30||xg(n,e,i)}return i}function xg(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ge.updateQueue,e===null?(e={lastEffect:null,stores:null},ge.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function wg(t,e,n,r){e.value=n,e.getSnapshot=r,_g(e)&&Sg(t)}function bg(t,e,n){return n(function(){_g(e)&&Sg(t)})}function _g(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!It(t,n)}catch{return!0}}function Sg(t){var e=vn(t,1);e!==null&&Ft(e,t,1,-1)}function Fh(t){var e=Qt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:t},e.queue=t,t=t.dispatch=Ox.bind(null,ge,t),[e.memoizedState,t]}function Hs(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=ge.updateQueue,e===null?(e={lastEffect:null,stores:null},ge.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function kg(){return St().memoizedState}function ta(t,e,n,r){var i=Qt();ge.flags|=t,i.memoizedState=Hs(1|e,n,void 0,r===void 0?null:r)}function nl(t,e,n,r){var i=St();r=r===void 0?null:r;var s=void 0;if(ke!==null){var o=ke.memoizedState;if(s=o.destroy,r!==null&&id(r,o.deps)){i.memoizedState=Hs(e,n,s,r);return}}ge.flags|=t,i.memoizedState=Hs(1|e,n,s,r)}function Ih(t,e){return ta(8390656,8,t,e)}function ad(t,e){return nl(2048,8,t,e)}function Cg(t,e){return nl(4,2,t,e)}function Eg(t,e){return nl(4,4,t,e)}function Pg(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 Mg(t,e,n){return n=n!=null?n.concat([t]):null,nl(4,4,Pg.bind(null,e,t),n)}function ld(){}function Tg(t,e){var n=St();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&id(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Rg(t,e){var n=St();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&id(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function Ng(t,e,n){return Ir&21?(It(n,e)||(n=Fm(),ge.lanes|=n,Ar|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,nt=!0),t.memoizedState=n)}function Rx(t,e){var n=te;te=n!==0&&4>n?n:4,t(!0);var r=Al.transition;Al.transition={};try{t(!1),e()}finally{te=n,Al.transition=r}}function Og(){return St().memoizedState}function Nx(t,e,n){var r=qn(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jg(t))Dg(e,n);else if(n=pg(t,e,n,r),n!==null){var i=Ke();Ft(n,t,r,i),Lg(n,e,r)}}function Ox(t,e,n){var r=qn(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jg(t))Dg(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,It(a,o)){var l=e.interleaved;l===null?(i.next=i,Zc(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=pg(t,e,i,r),n!==null&&(i=Ke(),Ft(n,t,r,i),Lg(n,e,r))}}function jg(t){var e=t.alternate;return t===ge||e!==null&&e===ge}function Dg(t,e){xs=Na=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Lg(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,zc(t,n)}}var Oa={readContext:_t,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},jx={readContext:_t,useCallback:function(t,e){return Qt().memoizedState=[t,e===void 0?null:e],t},useContext:_t,useEffect:Ih,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,ta(4194308,4,Pg.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ta(4194308,4,t,e)},useInsertionEffect:function(t,e){return ta(4,2,t,e)},useMemo:function(t,e){var n=Qt();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Qt();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Nx.bind(null,ge,t),[r.memoizedState,t]},useRef:function(t){var e=Qt();return t={current:t},e.memoizedState=t},useState:Fh,useDebugValue:ld,useDeferredValue:function(t){return Qt().memoizedState=t},useTransition:function(){var t=Fh(!1),e=t[0];return t=Rx.bind(null,t[1]),Qt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ge,i=Qt();if(he){if(n===void 0)throw Error(N(407));n=n()}else{if(n=e(),Te===null)throw Error(N(349));Ir&30||xg(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Ih(bg.bind(null,r,s,t),[t]),r.flags|=2048,Hs(9,wg.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=Qt(),e=Te.identifierPrefix;if(he){var n=hn,r=dn;n=(r&~(1<<32-Lt(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Bs++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=Tx++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Dx={readContext:_t,useCallback:Tg,useContext:_t,useEffect:ad,useImperativeHandle:Mg,useInsertionEffect:Cg,useLayoutEffect:Eg,useMemo:Rg,useReducer:zl,useRef:kg,useState:function(){return zl(Ws)},useDebugValue:ld,useDeferredValue:function(t){var e=St();return Ng(e,ke.memoizedState,t)},useTransition:function(){var t=zl(Ws)[0],e=St().memoizedState;return[t,e]},useMutableSource:yg,useSyncExternalStore:vg,useId:Og,unstable_isNewReconciler:!1},Lx={readContext:_t,useCallback:Tg,useContext:_t,useEffect:ad,useImperativeHandle:Mg,useInsertionEffect:Cg,useLayoutEffect:Eg,useMemo:Rg,useReducer:Bl,useRef:kg,useState:function(){return Bl(Ws)},useDebugValue:ld,useDeferredValue:function(t){var e=St();return ke===null?e.memoizedState=t:Ng(e,ke.memoizedState,t)},useTransition:function(){var t=Bl(Ws)[0],e=St().memoizedState;return[t,e]},useMutableSource:yg,useSyncExternalStore:vg,useId:Og,unstable_isNewReconciler:!1};function Mt(t,e){if(t&&t.defaultProps){e=ye({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function zu(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:ye({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var rl={isMounted:function(t){return(t=t._reactInternals)?Ur(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Ke(),i=qn(t),s=pn(r,i);s.payload=e,n!=null&&(s.callback=n),e=Kn(t,s,i),e!==null&&(Ft(e,t,i,r),Zo(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Ke(),i=qn(t),s=pn(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Kn(t,s,i),e!==null&&(Ft(e,t,i,r),Zo(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Ke(),r=qn(t),i=pn(n,r);i.tag=2,e!=null&&(i.callback=e),e=Kn(t,i,r),e!==null&&(Ft(e,t,r,n),Zo(e,t,r))}};function Ah(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!Ds(n,r)||!Ds(i,s):!0}function Fg(t,e,n){var r=!1,i=rr,s=e.contextType;return typeof s=="object"&&s!==null?s=_t(s):(i=it(e)?Lr:He.current,r=e.contextTypes,s=(r=r!=null)?Mi(t,i):rr),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=rl,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function zh(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&rl.enqueueReplaceState(e,e.state,null)}function Bu(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},ed(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=_t(s):(s=it(e)?Lr:He.current,i.context=Mi(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(zu(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&rl.enqueueReplaceState(i,i.state,null),Ta(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Oi(t,e){try{var n="",r=e;do n+=uv(r),r=r.return;while(r);var i=n}catch(s){i=`
39
39
  Error generating stack: `+s.message+`
40
- `+s.stack}return{value:t,source:e,stack:i,digest:null}}function Wl(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Wu(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Fx=typeof WeakMap=="function"?WeakMap:Map;function Ig(t,e,n){n=pn(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Da||(Da=!0,Gu=r),Wu(t,e)},n}function Ag(t,e,n){n=pn(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Wu(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Wu(t,e),typeof r!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Bh(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new Fx;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=qx.bind(null,t,e,n),e.then(t,t))}function Wh(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 Hh(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,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=pn(-1,1),e.tag=2,Kn(n,e,1))),n.lanes|=1),t)}var Ix=bn.ReactCurrentOwner,nt=!1;function Ye(t,e,n,r){e.child=t===null?fg(e,null,n,r):Ti(e,t.child,n,r)}function $h(t,e,n,r,i){n=n.render;var s=e.ref;return di(e,i),r=sd(t,e,n,r,s,i),n=od(),t!==null&&!nt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xn(t,e,i)):(he&&n&&Yc(e),e.flags|=1,Ye(t,e,r,i),e.child)}function Uh(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!gd(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,zg(t,e,s,r,i)):(t=sa(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ds,n(o,r)&&t.ref===e.ref)return xn(t,e,i)}return e.flags|=1,t=Gn(s,r),t.ref=e.ref,t.return=e,e.child=t}function zg(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Ds(s,r)&&t.ref===e.ref)if(nt=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(nt=!0);else return e.lanes=t.lanes,xn(t,e,i)}return Hu(t,e,n,r,i)}function Bg(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},oe(si,ot),ot|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,oe(si,ot),ot|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,oe(si,ot),ot|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,oe(si,ot),ot|=r;return Ye(t,e,i,n),e.child}function Wg(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Hu(t,e,n,r,i){var s=it(n)?Lr:He.current;return s=Mi(e,s),di(e,i),n=sd(t,e,n,r,s,i),r=od(),t!==null&&!nt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xn(t,e,i)):(he&&r&&Yc(e),e.flags|=1,Ye(t,e,n,i),e.child)}function Vh(t,e,n,r,i){if(it(n)){var s=!0;ka(e)}else s=!1;if(di(e,i),e.stateNode===null)na(t,e),Fg(e,n,r),Bu(e,n,r,i),r=!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=_t(u):(u=it(n)?Lr:He.current,u=Mi(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&zh(e,o,r,u),Mn=!1;var h=e.memoizedState;o.state=h,Ra(e,r,o,i),l=e.memoizedState,a!==r||h!==l||rt.current||Mn?(typeof c=="function"&&(zu(e,n,c,r),l=e.memoizedState),(a=Mn||Ah(e,n,a,r,h,l,u))?(d||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=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,mg(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Mt(e.type,a),o.props=u,d=e.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=_t(l):(l=it(n)?Lr:He.current,l=Mi(e,l));var f=n.getDerivedStateFromProps;(c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&zh(e,o,r,l),Mn=!1,h=e.memoizedState,o.state=h,Ra(e,r,o,i);var x=e.memoizedState;a!==d||h!==x||rt.current||Mn?(typeof f=="function"&&(zu(e,n,f,r),x=e.memoizedState),(u=Mn||Ah(e,n,u,r,h,x,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,x,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,x,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=x),o.props=r,o.state=x,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return $u(t,e,n,r,s,i)}function $u(t,e,n,r,i,s){Wg(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&Th(e,n,!1),xn(t,e,s);r=e.stateNode,Ix.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Ti(e,t.child,null,s),e.child=Ti(e,null,a,s)):Ye(t,e,a,s),e.memoizedState=r.state,i&&Th(e,n,!0),e.child}function Hg(t){var e=t.stateNode;e.pendingContext?Rh(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Rh(t,e.context,!1),td(t,e.containerInfo)}function Qh(t,e,n,r,i){return Ri(),Xc(i),e.flags|=256,Ye(t,e,n,r),e.child}var Uu={dehydrated:null,treeContext:null,retryLane:0};function Vu(t){return{baseLanes:t,cachePool:null,transitions:null}}function $g(t,e,n){var r=e.pendingProps,i=me.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),oe(me,i&1),t===null)return Iu(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=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ol(o,r,0,null),t=jr(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Vu(n),e.memoizedState=Uu,t):ud(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Ax(t,e,o,r,a,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Gn(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Gn(a,s):(s=jr(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?Vu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=Uu,r}return s=t.child,t=s.sibling,r=Gn(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function ud(t,e){return e=ol({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ro(t,e,n,r){return r!==null&&Xc(r),Ti(e,t.child,null,n),t=ud(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Ax(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=Wl(Error(O(422))),Ro(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=ol({mode:"visible",children:r.children},i,0,null),s=jr(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Ti(e,t.child,null,o),e.child.memoizedState=Vu(o),e.memoizedState=Uu,s);if(!(e.mode&1))return Ro(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(O(419)),r=Wl(s,r,void 0),Ro(t,e,o,r)}if(a=(o&t.childLanes)!==0,nt||a){if(r=Re,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,vn(t,i),Ft(r,t,i,-1))}return md(),r=Wl(Error(O(421))),Ro(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Gx.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,at=Yn(i.nextSibling),lt=e,he=!0,Nt=null,t!==null&&(yt[vt++]=dn,yt[vt++]=hn,yt[vt++]=Fr,dn=t.id,hn=t.overflow,Fr=e),e=ud(e,r.children),e.flags|=4096,e)}function Yh(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Au(t.return,e,n)}function Hl(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Ug(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Ye(t,e,r.children,n),r=me.current,r&2)r=r&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&&Yh(t,n,e);else if(t.tag===19)Yh(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}r&=1}if(oe(me,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Ta(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Hl(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Ta(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Hl(e,!0,n,null,s);break;case"together":Hl(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function na(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function xn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ar|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(O(153));if(e.child!==null){for(t=e.child,n=Gn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Gn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function zx(t,e,n){switch(e.tag){case 3:Hg(e),Ri();break;case 5:gg(e);break;case 1:it(e.type)&&ka(e);break;case 4:td(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;oe(Pa,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(oe(me,me.current&1),e.flags|=128,null):n&e.child.childLanes?$g(t,e,n):(oe(me,me.current&1),t=xn(t,e,n),t!==null?t.sibling:null);oe(me,me.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return Ug(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(me,me.current),r)break;return null;case 22:case 23:return e.lanes=0,Bg(t,e,n)}return xn(t,e,n)}var Vg,Qu,Qg,Yg;Vg=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}};Qu=function(){};Qg=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,wr(Zt.current);var s=null;switch(n){case"input":i=pu(t,i),r=pu(t,r),s=[];break;case"select":i=ye({},i,{value:void 0}),r=ye({},r,{value:void 0}),s=[];break;case"textarea":i=yu(t,i),r=yu(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=_a)}xu(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ps.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.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||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ps.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&le("scroll",t),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};Yg=function(t,e,n,r){n!==r&&(e.flags|=4)};function qi(t,e){if(!he)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Ie(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Bx(t,e,n){var r=e.pendingProps;switch(Kc(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(e),null;case 1:return it(e.type)&&Sa(),Ie(e),null;case 3:return r=e.stateNode,Oi(),ce(rt),ce(He),rd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Po(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Nt!==null&&(ec(Nt),Nt=null))),Qu(t,e),Ie(e),null;case 5:nd(e);var i=wr(zs.current);if(n=e.type,t!==null&&e.stateNode!=null)Qg(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(O(166));return Ie(e),null}if(t=wr(Zt.current),Po(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Gt]=e,r[Is]=s,t=(e.mode&1)!==0,n){case"dialog":le("cancel",r),le("close",r);break;case"iframe":case"object":case"embed":le("load",r);break;case"video":case"audio":for(i=0;i<us.length;i++)le(us[i],r);break;case"source":le("error",r);break;case"img":case"image":case"link":le("error",r),le("load",r);break;case"details":le("toggle",r);break;case"input":nh(r,s),le("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},le("invalid",r);break;case"textarea":ih(r,s),le("invalid",r)}xu(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Eo(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Eo(r.textContent,a,t),i=["children",""+a]):Ps.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&le("scroll",r)}switch(n){case"input":vo(r),rh(r,s,!0);break;case"textarea":vo(r),sh(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=_a)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=bm(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Gt]=e,t[Is]=r,Vg(t,e,!1,!1),e.stateNode=t;e:{switch(o=wu(n,r),n){case"dialog":le("cancel",t),le("close",t),i=r;break;case"iframe":case"object":case"embed":le("load",t),i=r;break;case"video":case"audio":for(i=0;i<us.length;i++)le(us[i],t);i=r;break;case"source":le("error",t),i=r;break;case"img":case"image":case"link":le("error",t),le("load",t),i=r;break;case"details":le("toggle",t),i=r;break;case"input":nh(t,r),i=pu(t,r),le("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=ye({},r,{value:void 0}),le("invalid",t);break;case"textarea":ih(t,r),i=yu(t,r),le("invalid",t);break;default:i=r}xu(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?km(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&_m(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ms(t,l):typeof l=="number"&&Ms(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ps.hasOwnProperty(s)?l!=null&&s==="onScroll"&&le("scroll",t):l!=null&&jc(t,s,l,o))}switch(n){case"input":vo(t),rh(t,r,!1);break;case"textarea":vo(t),sh(t);break;case"option":r.value!=null&&t.setAttribute("value",""+nr(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?ai(t,!!r.multiple,s,!1):r.defaultValue!=null&&ai(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=_a)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Ie(e),null;case 6:if(t&&e.stateNode!=null)Yg(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(O(166));if(n=wr(zs.current),wr(Zt.current),Po(e)){if(r=e.stateNode,n=e.memoizedProps,r[Gt]=e,(s=r.nodeValue!==n)&&(t=lt,t!==null))switch(t.tag){case 3:Eo(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Eo(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Gt]=e,e.stateNode=r}return Ie(e),null;case 13:if(ce(me),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(he&&at!==null&&e.mode&1&&!(e.flags&128))dg(),Ri(),e.flags|=98560,s=!1;else if(s=Po(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(O(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(O(317));s[Gt]=e}else Ri(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ie(e),s=!1}else Nt!==null&&(ec(Nt),Nt=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||me.current&1?Ee===0&&(Ee=3):md())),e.updateQueue!==null&&(e.flags|=4),Ie(e),null);case 4:return Oi(),Qu(t,e),t===null&&Ls(e.stateNode.containerInfo),Ie(e),null;case 10:return Jc(e.type._context),Ie(e),null;case 17:return it(e.type)&&Sa(),Ie(e),null;case 19:if(ce(me),s=e.memoizedState,s===null)return Ie(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)qi(s,!1);else{if(Ee!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Ta(t),o!==null){for(e.flags|=128,qi(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return oe(me,me.current&1|2),e.child}t=t.sibling}s.tail!==null&&be()>ji&&(e.flags|=128,r=!0,qi(s,!1),e.lanes=4194304)}else{if(!r)if(t=Ta(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),qi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!he)return Ie(e),null}else 2*be()-s.renderingStartTime>ji&&n!==1073741824&&(e.flags|=128,r=!0,qi(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=be(),e.sibling=null,n=me.current,oe(me,r?n&1|2:n&1),e):(Ie(e),null);case 22:case 23:return pd(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ot&1073741824&&(Ie(e),e.subtreeFlags&6&&(e.flags|=8192)):Ie(e),null;case 24:return null;case 25:return null}throw Error(O(156,e.tag))}function Wx(t,e){switch(Kc(e),e.tag){case 1:return it(e.type)&&Sa(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Oi(),ce(rt),ce(He),rd(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return nd(e),null;case 13:if(ce(me),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(O(340));Ri()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ce(me),null;case 4:return Oi(),null;case 10:return Jc(e.type._context),null;case 22:case 23:return pd(),null;case 24:return null;default:return null}}var To=!1,ze=!1,Hx=typeof WeakSet=="function"?WeakSet:Set,L=null;function ii(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(t,e,r)}else n.current=null}function Yu(t,e,n){try{n()}catch(r){we(t,e,r)}}var Kh=!1;function $x(t,e){if(Tu=xa,t=Jm(),Qc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=t,h=null;t:for(;;){for(var f;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===t)break t;if(h===n&&++u===i&&(a=o),h===s&&++c===r&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ou={focusedElem:t,selectionRange:n},xa=!1,L=e;L!==null;)if(e=L,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,L=t;else for(;L!==null;){e=L;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,w=x.memoizedState,m=e.stateNode,y=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:Mt(e.type,v),w);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var p=e.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(b){we(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,L=t;break}L=e.return}return x=Kh,Kh=!1,x}function ws(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Yu(e,n,s)}i=i.next}while(i!==r)}}function il(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 r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Ku(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 Kg(t){var e=t.alternate;e!==null&&(t.alternate=null,Kg(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Gt],delete e[Is],delete e[Du],delete e[Cx],delete e[Ex])),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 Xg(t){return t.tag===5||t.tag===3||t.tag===4}function Xh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xg(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 Xu(t,e,n){var r=t.tag;if(r===5||r===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=_a));else if(r!==4&&(t=t.child,t!==null))for(Xu(t,e,n),t=t.sibling;t!==null;)Xu(t,e,n),t=t.sibling}function qu(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(qu(t,e,n),t=t.sibling;t!==null;)qu(t,e,n),t=t.sibling}var Oe=null,Ot=!1;function Sn(t,e,n){for(n=n.child;n!==null;)qg(t,e,n),n=n.sibling}function qg(t,e,n){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(qa,n)}catch{}switch(n.tag){case 5:ze||ii(n,e);case 6:var r=Oe,i=Ot;Oe=null,Sn(t,e,n),Oe=r,Ot=i,Oe!==null&&(Ot?(t=Oe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Oe.removeChild(n.stateNode));break;case 18:Oe!==null&&(Ot?(t=Oe,n=n.stateNode,t.nodeType===8?Ll(t.parentNode,n):t.nodeType===1&&Ll(t,n),Ns(t)):Ll(Oe,n.stateNode));break;case 4:r=Oe,i=Ot,Oe=n.stateNode.containerInfo,Ot=!0,Sn(t,e,n),Oe=r,Ot=i;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Yu(n,e,o),i=i.next}while(i!==r)}Sn(t,e,n);break;case 1:if(!ze&&(ii(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){we(n,e,a)}Sn(t,e,n);break;case 21:Sn(t,e,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,Sn(t,e,n),ze=r):Sn(t,e,n);break;default:Sn(t,e,n)}}function qh(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Hx),e.forEach(function(r){var i=Jx.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Pt(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Oe=a.stateNode,Ot=!1;break e;case 3:Oe=a.stateNode.containerInfo,Ot=!0;break e;case 4:Oe=a.stateNode.containerInfo,Ot=!0;break e}a=a.return}if(Oe===null)throw Error(O(160));qg(s,o,i),Oe=null,Ot=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){we(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Gg(e,t),e=e.sibling}function Gg(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Pt(e,t),Wt(t),r&4){try{ws(3,t,t.return),il(3,t)}catch(v){we(t,t.return,v)}try{ws(5,t,t.return)}catch(v){we(t,t.return,v)}}break;case 1:Pt(e,t),Wt(t),r&512&&n!==null&&ii(n,n.return);break;case 5:if(Pt(e,t),Wt(t),r&512&&n!==null&&ii(n,n.return),t.flags&32){var i=t.stateNode;try{Ms(i,"")}catch(v){we(t,t.return,v)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&xm(i,s),wu(a,o);var u=wu(a,s);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?km(i,d):c==="dangerouslySetInnerHTML"?_m(i,d):c==="children"?Ms(i,d):jc(i,c,d,u)}switch(a){case"input":mu(i,s);break;case"textarea":wm(i,s);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?ai(i,!!s.multiple,f,!1):h!==!!s.multiple&&(s.defaultValue!=null?ai(i,!!s.multiple,s.defaultValue,!0):ai(i,!!s.multiple,s.multiple?[]:"",!1))}i[Is]=s}catch(v){we(t,t.return,v)}}break;case 6:if(Pt(e,t),Wt(t),r&4){if(t.stateNode===null)throw Error(O(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(v){we(t,t.return,v)}}break;case 3:if(Pt(e,t),Wt(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ns(e.containerInfo)}catch(v){we(t,t.return,v)}break;case 4:Pt(e,t),Wt(t);break;case 13:Pt(e,t),Wt(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(hd=be())),r&4&&qh(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(ze=(u=ze)||c,Pt(e,t),ze=u):Pt(e,t),Wt(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(L=t,c=t.child;c!==null;){for(d=L=c;L!==null;){switch(h=L,f=h.child,h.tag){case 0:case 11:case 14:case 15:ws(4,h,h.return);break;case 1:ii(h,h.return);var x=h.stateNode;if(typeof x.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,x.props=e.memoizedProps,x.state=e.memoizedState,x.componentWillUnmount()}catch(v){we(r,n,v)}}break;case 5:ii(h,h.return);break;case 22:if(h.memoizedState!==null){Jh(d);continue}}f!==null?(f.return=h,L=f):Jh(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Sm("display",o))}catch(v){we(t,t.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){we(t,t.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Pt(e,t),Wt(t),r&4&&qh(t);break;case 21:break;default:Pt(e,t),Wt(t)}}function Wt(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Xg(n)){var r=n;break e}n=n.return}throw Error(O(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ms(i,""),r.flags&=-33);var s=Xh(t);qu(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Xh(t);Xu(t,a,o);break;default:throw Error(O(161))}}catch(l){we(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Ux(t,e,n){L=t,Jg(t)}function Jg(t,e,n){for(var r=(t.mode&1)!==0;L!==null;){var i=L,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||To;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||ze;a=To;var u=ze;if(To=o,(ze=l)&&!u)for(L=i;L!==null;)o=L,l=o.child,o.tag===22&&o.memoizedState!==null?Zh(i):l!==null?(l.return=o,L=l):Zh(i);for(;s!==null;)L=s,Jg(s),s=s.sibling;L=i,To=a,ze=u}Gh(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,L=s):Gh(t)}}function Gh(t){for(;L!==null;){var e=L;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:ze||il(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!ze)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Mt(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Lh(e,s,r);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}Lh(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 c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ns(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}ze||e.flags&512&&Ku(e)}catch(h){we(e,e.return,h)}}if(e===t){L=null;break}if(n=e.sibling,n!==null){n.return=e.return,L=n;break}L=e.return}}function Jh(t){for(;L!==null;){var e=L;if(e===t){L=null;break}var n=e.sibling;if(n!==null){n.return=e.return,L=n;break}L=e.return}}function Zh(t){for(;L!==null;){var e=L;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{il(4,e)}catch(l){we(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){we(e,i,l)}}var s=e.return;try{Ku(e)}catch(l){we(e,s,l)}break;case 5:var o=e.return;try{Ku(e)}catch(l){we(e,o,l)}}}catch(l){we(e,e.return,l)}if(e===t){L=null;break}var a=e.sibling;if(a!==null){a.return=e.return,L=a;break}L=e.return}}var Vx=Math.ceil,ja=bn.ReactCurrentDispatcher,cd=bn.ReactCurrentOwner,bt=bn.ReactCurrentBatchConfig,K=0,Re=null,Se=null,je=0,ot=0,si=ar(0),Ee=0,$s=null,Ar=0,sl=0,dd=0,bs=null,et=null,hd=0,ji=1/0,on=null,Da=!1,Gu=null,Xn=null,Oo=!1,Bn=null,La=0,_s=0,Ju=null,ra=-1,ia=0;function Ke(){return K&6?be():ra!==-1?ra:ra=be()}function qn(t){return t.mode&1?K&2&&je!==0?je&-je:Mx.transition!==null?(ia===0&&(ia=Fm()),ia):(t=te,t!==0||(t=window.event,t=t===void 0?16:$m(t.type)),t):1}function Ft(t,e,n,r){if(50<_s)throw _s=0,Ju=null,Error(O(185));so(t,n,r),(!(K&2)||t!==Re)&&(t===Re&&(!(K&2)&&(sl|=n),Ee===4&&Tn(t,je)),st(t,r),n===1&&K===0&&!(e.mode&1)&&(ji=be()+500,tl&&lr()))}function st(t,e){var n=t.callbackNode;Mv(t,e);var r=va(t,t===Re?je:0);if(r===0)n!==null&&lh(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&lh(n),e===1)t.tag===0?Px(ef.bind(null,t)):lg(ef.bind(null,t)),Sx(function(){!(K&6)&&lr()}),n=null;else{switch(Im(r)){case 1:n=Ac;break;case 4:n=Dm;break;case 16:n=ya;break;case 536870912:n=Lm;break;default:n=ya}n=oy(n,Zg.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Zg(t,e){if(ra=-1,ia=0,K&6)throw Error(O(327));var n=t.callbackNode;if(hi()&&t.callbackNode!==n)return null;var r=va(t,t===Re?je:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Fa(t,r);else{e=r;var i=K;K|=2;var s=ty();(Re!==t||je!==e)&&(on=null,ji=be()+500,Nr(t,e));do try{Kx();break}catch(a){ey(t,a)}while(!0);Gc(),ja.current=s,K=i,Se!==null?e=0:(Re=null,je=0,e=Ee)}if(e!==0){if(e===2&&(i=Cu(t),i!==0&&(r=i,e=Zu(t,i))),e===1)throw n=$s,Nr(t,0),Tn(t,r),st(t,be()),n;if(e===6)Tn(t,r);else{if(i=t.current.alternate,!(r&30)&&!Qx(i)&&(e=Fa(t,r),e===2&&(s=Cu(t),s!==0&&(r=s,e=Zu(t,s))),e===1))throw n=$s,Nr(t,0),Tn(t,r),st(t,be()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(O(345));case 2:mr(t,et,on);break;case 3:if(Tn(t,r),(r&130023424)===r&&(e=hd+500-be(),10<e)){if(va(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Ke(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=ju(mr.bind(null,t,et,on),e);break}mr(t,et,on);break;case 4:if(Tn(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-Lt(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Vx(r/1960))-r,10<r){t.timeoutHandle=ju(mr.bind(null,t,et,on),r);break}mr(t,et,on);break;case 5:mr(t,et,on);break;default:throw Error(O(329))}}}return st(t,be()),t.callbackNode===n?Zg.bind(null,t):null}function Zu(t,e){var n=bs;return t.current.memoizedState.isDehydrated&&(Nr(t,e).flags|=256),t=Fa(t,e),t!==2&&(e=et,et=n,e!==null&&ec(e)),t}function ec(t){et===null?et=t:et.push.apply(et,t)}function Qx(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!It(s(),i))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 Tn(t,e){for(e&=~dd,e&=~sl,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Lt(e),r=1<<n;t[n]=-1,e&=~r}}function ef(t){if(K&6)throw Error(O(327));hi();var e=va(t,0);if(!(e&1))return st(t,be()),null;var n=Fa(t,e);if(t.tag!==0&&n===2){var r=Cu(t);r!==0&&(e=r,n=Zu(t,r))}if(n===1)throw n=$s,Nr(t,0),Tn(t,e),st(t,be()),n;if(n===6)throw Error(O(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,mr(t,et,on),st(t,be()),null}function fd(t,e){var n=K;K|=1;try{return t(e)}finally{K=n,K===0&&(ji=be()+500,tl&&lr())}}function zr(t){Bn!==null&&Bn.tag===0&&!(K&6)&&hi();var e=K;K|=1;var n=bt.transition,r=te;try{if(bt.transition=null,te=1,t)return t()}finally{te=r,bt.transition=n,K=e,!(K&6)&&lr()}}function pd(){ot=si.current,ce(si)}function Nr(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,_x(n)),Se!==null)for(n=Se.return;n!==null;){var r=n;switch(Kc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sa();break;case 3:Oi(),ce(rt),ce(He),rd();break;case 5:nd(r);break;case 4:Oi();break;case 13:ce(me);break;case 19:ce(me);break;case 10:Jc(r.type._context);break;case 22:case 23:pd()}n=n.return}if(Re=t,Se=t=Gn(t.current,null),je=ot=e,Ee=0,$s=null,dd=sl=Ar=0,et=bs=null,xr!==null){for(e=0;e<xr.length;e++)if(n=xr[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}xr=null}return t}function ey(t,e){do{var n=Se;try{if(Gc(),ea.current=Na,Oa){for(var r=ge.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Oa=!1}if(Ir=0,Me=ke=ge=null,xs=!1,Bs=0,cd.current=null,n===null||n.return===null){Ee=1,$s=e,Se=null;break}e:{var s=t,o=n.return,a=n,l=e;if(e=je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var f=Wh(o);if(f!==null){f.flags&=-257,Hh(f,o,a,s,e),f.mode&1&&Bh(s,u,e),e=f,l=u;var x=e.updateQueue;if(x===null){var v=new Set;v.add(l),e.updateQueue=v}else x.add(l);break e}else{if(!(e&1)){Bh(s,u,e),md();break e}l=Error(O(426))}}else if(he&&a.mode&1){var w=Wh(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Hh(w,o,a,s,e),Xc(Ni(l,a));break e}}s=l=Ni(l,a),Ee!==4&&(Ee=2),bs===null?bs=[s]:bs.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=Ig(s,l,e);Dh(s,m);break e;case 1:a=l;var y=s.type,p=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Xn===null||!Xn.has(p)))){s.flags|=65536,e&=-e,s.lanes|=e;var b=Ag(s,a,e);Dh(s,b);break e}}s=s.return}while(s!==null)}ry(n)}catch(k){e=k,Se===n&&n!==null&&(Se=n=n.return);continue}break}while(!0)}function ty(){var t=ja.current;return ja.current=Na,t===null?Na:t}function md(){(Ee===0||Ee===3||Ee===2)&&(Ee=4),Re===null||!(Ar&268435455)&&!(sl&268435455)||Tn(Re,je)}function Fa(t,e){var n=K;K|=2;var r=ty();(Re!==t||je!==e)&&(on=null,Nr(t,e));do try{Yx();break}catch(i){ey(t,i)}while(!0);if(Gc(),K=n,ja.current=r,Se!==null)throw Error(O(261));return Re=null,je=0,Ee}function Yx(){for(;Se!==null;)ny(Se)}function Kx(){for(;Se!==null&&!xv();)ny(Se)}function ny(t){var e=sy(t.alternate,t,ot);t.memoizedProps=t.pendingProps,e===null?ry(t):Se=e,cd.current=null}function ry(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Wx(n,e),n!==null){n.flags&=32767,Se=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ee=6,Se=null;return}}else if(n=Bx(n,e,ot),n!==null){Se=n;return}if(e=e.sibling,e!==null){Se=e;return}Se=e=t}while(e!==null);Ee===0&&(Ee=5)}function mr(t,e,n){var r=te,i=bt.transition;try{bt.transition=null,te=1,Xx(t,e,n,r)}finally{bt.transition=i,te=r}return null}function Xx(t,e,n,r){do hi();while(Bn!==null);if(K&6)throw Error(O(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(O(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(Rv(t,s),t===Re&&(Se=Re=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Oo||(Oo=!0,oy(ya,function(){return hi(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=bt.transition,bt.transition=null;var o=te;te=1;var a=K;K|=4,cd.current=null,$x(t,n),Gg(n,t),mx(Ou),xa=!!Tu,Ou=Tu=null,t.current=n,Ux(n),wv(),K=a,te=o,bt.transition=s}else t.current=n;if(Oo&&(Oo=!1,Bn=t,La=i),s=t.pendingLanes,s===0&&(Xn=null),Sv(n.stateNode),st(t,be()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Da)throw Da=!1,t=Gu,Gu=null,t;return La&1&&t.tag!==0&&hi(),s=t.pendingLanes,s&1?t===Ju?_s++:(_s=0,Ju=t):_s=0,lr(),null}function hi(){if(Bn!==null){var t=Im(La),e=bt.transition,n=te;try{if(bt.transition=null,te=16>t?16:t,Bn===null)var r=!1;else{if(t=Bn,Bn=null,La=0,K&6)throw Error(O(331));var i=K;for(K|=4,L=t.current;L!==null;){var s=L,o=s.child;if(L.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(L=u;L!==null;){var c=L;switch(c.tag){case 0:case 11:case 15:ws(8,c,s)}var d=c.child;if(d!==null)d.return=c,L=d;else for(;L!==null;){c=L;var h=c.sibling,f=c.return;if(Kg(c),c===u){L=null;break}if(h!==null){h.return=f,L=h;break}L=f}}}var x=s.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}L=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,L=o;else e:for(;L!==null;){if(s=L,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ws(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,L=m;break e}L=s.return}}var y=t.current;for(L=y;L!==null;){o=L;var p=o.child;if(o.subtreeFlags&2064&&p!==null)p.return=o,L=p;else e:for(o=y;L!==null;){if(a=L,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:il(9,a)}}catch(k){we(a,a.return,k)}if(a===o){L=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,L=b;break e}L=a.return}}if(K=i,lr(),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(qa,t)}catch{}r=!0}return r}finally{te=n,bt.transition=e}}return!1}function tf(t,e,n){e=Ni(n,e),e=Ig(t,e,1),t=Kn(t,e,1),e=Ke(),t!==null&&(so(t,1,e),st(t,e))}function we(t,e,n){if(t.tag===3)tf(t,t,n);else for(;e!==null;){if(e.tag===3){tf(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Xn===null||!Xn.has(r))){t=Ni(n,t),t=Ag(e,t,1),e=Kn(e,t,1),t=Ke(),e!==null&&(so(e,1,t),st(e,t));break}}e=e.return}}function qx(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Ke(),t.pingedLanes|=t.suspendedLanes&n,Re===t&&(je&n)===n&&(Ee===4||Ee===3&&(je&130023424)===je&&500>be()-hd?Nr(t,0):dd|=n),st(t,e)}function iy(t,e){e===0&&(t.mode&1?(e=bo,bo<<=1,!(bo&130023424)&&(bo=4194304)):e=1);var n=Ke();t=vn(t,e),t!==null&&(so(t,e,n),st(t,n))}function Gx(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),iy(t,n)}function Jx(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(O(314))}r!==null&&r.delete(e),iy(t,n)}var sy;sy=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||rt.current)nt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return nt=!1,zx(t,e,n);nt=!!(t.flags&131072)}else nt=!1,he&&e.flags&1048576&&ug(e,Ea,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;na(t,e),t=e.pendingProps;var i=Mi(e,He.current);di(e,n),i=sd(null,e,r,t,i,n);var s=od();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,it(r)?(s=!0,ka(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ed(e),i.updater=rl,e.stateNode=i,i._reactInternals=e,Bu(e,r,t,n),e=$u(null,e,r,!0,s,n)):(e.tag=0,he&&s&&Yc(e),Ye(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(na(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=ew(r),t=Mt(r,t),i){case 0:e=Hu(null,e,r,t,n);break e;case 1:e=Vh(null,e,r,t,n);break e;case 11:e=$h(null,e,r,t,n);break e;case 14:e=Uh(null,e,r,Mt(r.type,t),n);break e}throw Error(O(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),Hu(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),Vh(t,e,r,i,n);case 3:e:{if(Hg(e),t===null)throw Error(O(387));r=e.pendingProps,s=e.memoizedState,i=s.element,mg(t,e),Ra(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Ni(Error(O(423)),e),e=Qh(t,e,r,n,i);break e}else if(r!==i){i=Ni(Error(O(424)),e),e=Qh(t,e,r,n,i);break e}else for(at=Yn(e.stateNode.containerInfo.firstChild),lt=e,he=!0,Nt=null,n=fg(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ri(),r===i){e=xn(t,e,n);break e}Ye(t,e,r,n)}e=e.child}return e;case 5:return gg(e),t===null&&Iu(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Nu(r,i)?o=null:s!==null&&Nu(r,s)&&(e.flags|=32),Wg(t,e),Ye(t,e,o,n),e.child;case 6:return t===null&&Iu(e),null;case 13:return $g(t,e,n);case 4:return td(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ti(e,null,r,n):Ye(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),$h(t,e,r,i,n);case 7:return Ye(t,e,e.pendingProps,n),e.child;case 8:return Ye(t,e,e.pendingProps.children,n),e.child;case 12:return Ye(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,oe(Pa,r._currentValue),r._currentValue=o,s!==null)if(It(s.value,o)){if(s.children===i.children&&!rt.current){e=xn(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=pn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Au(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(O(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Au(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ye(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,di(e,n),i=_t(i),r=r(i),e.flags|=1,Ye(t,e,r,n),e.child;case 14:return r=e.type,i=Mt(r,e.pendingProps),i=Mt(r.type,i),Uh(t,e,r,i,n);case 15:return zg(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),na(t,e),e.tag=1,it(r)?(t=!0,ka(e)):t=!1,di(e,n),Fg(e,r,i),Bu(e,r,i,n),$u(null,e,r,!0,t,n);case 19:return Ug(t,e,n);case 22:return Bg(t,e,n)}throw Error(O(156,e.tag))};function oy(t,e){return jm(t,e)}function Zx(t,e,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(t,e,n,r){return new Zx(t,e,n,r)}function gd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ew(t){if(typeof t=="function")return gd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Lc)return 11;if(t===Fc)return 14}return 2}function Gn(t,e){var n=t.alternate;return n===null?(n=xt(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 sa(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")gd(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Xr:return jr(n.children,i,s,e);case Dc:o=8,i|=8;break;case cu:return t=xt(12,n,e,i|2),t.elementType=cu,t.lanes=s,t;case du:return t=xt(13,n,e,i),t.elementType=du,t.lanes=s,t;case hu:return t=xt(19,n,e,i),t.elementType=hu,t.lanes=s,t;case gm:return ol(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case pm:o=10;break e;case mm:o=9;break e;case Lc:o=11;break e;case Fc:o=14;break e;case Pn:o=16,r=null;break e}throw Error(O(130,t==null?t:typeof t,""))}return e=xt(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function jr(t,e,n,r){return t=xt(7,t,r,e),t.lanes=n,t}function ol(t,e,n,r){return t=xt(22,t,r,e),t.elementType=gm,t.lanes=n,t.stateNode={isHidden:!1},t}function $l(t,e,n){return t=xt(6,t,null,e),t.lanes=n,t}function Ul(t,e,n){return e=xt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function tw(t,e,n,r,i){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=kl(0),this.expirationTimes=kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function yd(t,e,n,r,i,s,o,a,l){return t=new tw(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=xt(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ed(s),t}function nw(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kr,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function ay(t){if(!t)return rr;t=t._reactInternals;e:{if(Ur(t)!==t||t.tag!==1)throw Error(O(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(it(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(O(171))}if(t.tag===1){var n=t.type;if(it(n))return ag(t,n,e)}return e}function ly(t,e,n,r,i,s,o,a,l){return t=yd(n,r,!0,t,i,s,o,a,l),t.context=ay(null),n=t.current,r=Ke(),i=qn(n),s=pn(r,i),s.callback=e??null,Kn(n,s,i),t.current.lanes=i,so(t,i,r),st(t,r),t}function al(t,e,n,r){var i=e.current,s=Ke(),o=qn(i);return n=ay(n),e.context===null?e.context=n:e.pendingContext=n,e=pn(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Kn(i,e,o),t!==null&&(Ft(t,i,o,s),Zo(t,i,o)),o}function Ia(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 nf(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function vd(t,e){nf(t,e),(t=t.alternate)&&nf(t,e)}function rw(){return null}var uy=typeof reportError=="function"?reportError:function(t){console.error(t)};function xd(t){this._internalRoot=t}ll.prototype.render=xd.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(O(409));al(t,e,null,null)};ll.prototype.unmount=xd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;zr(function(){al(null,t,null,null)}),e[yn]=null}};function ll(t){this._internalRoot=t}ll.prototype.unstable_scheduleHydration=function(t){if(t){var e=Bm();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Rn.length&&e!==0&&e<Rn[n].priority;n++);Rn.splice(n,0,t),n===0&&Hm(t)}};function wd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ul(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function rf(){}function iw(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Ia(o);s.call(u)}}var o=ly(e,r,t,0,null,!1,!1,"",rf);return t._reactRootContainer=o,t[yn]=o.current,Ls(t.nodeType===8?t.parentNode:t),zr(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Ia(l);a.call(u)}}var l=yd(t,0,!1,null,null,!1,!1,"",rf);return t._reactRootContainer=l,t[yn]=l.current,Ls(t.nodeType===8?t.parentNode:t),zr(function(){al(e,l,n,r)}),l}function cl(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ia(o);a.call(l)}}al(e,o,t,i)}else o=iw(n,e,t,i,r);return Ia(o)}Am=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=ls(e.pendingLanes);n!==0&&(zc(e,n|1),st(e,be()),!(K&6)&&(ji=be()+500,lr()))}break;case 13:zr(function(){var r=vn(t,1);if(r!==null){var i=Ke();Ft(r,t,1,i)}}),vd(t,1)}};Bc=function(t){if(t.tag===13){var e=vn(t,134217728);if(e!==null){var n=Ke();Ft(e,t,134217728,n)}vd(t,134217728)}};zm=function(t){if(t.tag===13){var e=qn(t),n=vn(t,e);if(n!==null){var r=Ke();Ft(n,t,e,r)}vd(t,e)}};Bm=function(){return te};Wm=function(t,e){var n=te;try{return te=t,e()}finally{te=n}};_u=function(t,e,n){switch(e){case"input":if(mu(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 r=n[e];if(r!==t&&r.form===t.form){var i=el(r);if(!i)throw Error(O(90));vm(r),mu(r,i)}}}break;case"textarea":wm(t,n);break;case"select":e=n.value,e!=null&&ai(t,!!n.multiple,e,!1)}};Pm=fd;Mm=zr;var sw={usingClientEntryPoint:!1,Events:[ao,Zr,el,Cm,Em,fd]},Gi={findFiberByHostInstance:vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ow={bundleType:Gi.bundleType,version:Gi.version,rendererPackageName:Gi.rendererPackageName,rendererConfig:Gi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:bn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Om(t),t===null?null:t.stateNode},findFiberByHostInstance:Gi.findFiberByHostInstance||rw,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 No=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!No.isDisabled&&No.supportsFiber)try{qa=No.inject(ow),Jt=No}catch{}}ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sw;ct.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wd(e))throw Error(O(200));return nw(t,e,null,n)};ct.createRoot=function(t,e){if(!wd(t))throw Error(O(299));var n=!1,r="",i=uy;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=yd(t,1,!1,null,null,n,!1,r,i),t[yn]=e.current,Ls(t.nodeType===8?t.parentNode:t),new xd(e)};ct.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(O(188)):(t=Object.keys(t).join(","),Error(O(268,t)));return t=Om(e),t=t===null?null:t.stateNode,t};ct.flushSync=function(t){return zr(t)};ct.hydrate=function(t,e,n){if(!ul(e))throw Error(O(200));return cl(null,t,e,!0,n)};ct.hydrateRoot=function(t,e,n){if(!wd(t))throw Error(O(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=uy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=ly(e,null,t,1,n??null,i,!1,s,o),t[yn]=e.current,Ls(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new ll(e)};ct.render=function(t,e,n){if(!ul(e))throw Error(O(200));return cl(null,t,e,!1,n)};ct.unmountComponentAtNode=function(t){if(!ul(t))throw Error(O(40));return t._reactRootContainer?(zr(function(){cl(null,null,t,!1,function(){t._reactRootContainer=null,t[yn]=null})}),!0):!1};ct.unstable_batchedUpdates=fd;ct.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!ul(n))throw Error(O(200));if(t==null||t._reactInternals===void 0)throw Error(O(38));return cl(t,e,n,!1,r)};ct.version="18.3.1-next-f1338f8080-20240426";function cy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cy)}catch(t){console.error(t)}}cy(),cm.exports=ct;var aw=cm.exports,sf=aw;lu.createRoot=sf.createRoot,lu.hydrateRoot=sf.hydrateRoot;var uo=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(){}},lw={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},On,Ec,$p,uw=($p=class{constructor(){z(this,On,lw);z(this,Ec,!1)}setTimeoutProvider(t){D(this,On,t)}setTimeout(t,e){return _(this,On).setTimeout(t,e)}clearTimeout(t){_(this,On).clearTimeout(t)}setInterval(t,e){return _(this,On).setInterval(t,e)}clearInterval(t){_(this,On).clearInterval(t)}},On=new WeakMap,Ec=new WeakMap,$p),br=new uw;function cw(t){setTimeout(t,0)}var Br=typeof window>"u"||"Deno"in globalThis;function Ze(){}function dw(t,e){return typeof t=="function"?t(e):t}function tc(t){return typeof t=="number"&&t>=0&&t!==1/0}function dy(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Jn(t,e){return typeof t=="function"?t(e):t}function gt(t,e){return typeof t=="function"?t(e):t}function of(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==bd(o,e.options))return!1}else if(!Vs(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||i&&i!==e.state.fetchStatus||s&&!s(e))}function af(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Us(e.options.mutationKey)!==Us(s))return!1}else if(!Vs(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function bd(t,e){return((e==null?void 0:e.queryKeyHashFn)||Us)(t)}function Us(t){return JSON.stringify(t,(e,n)=>rc(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Vs(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Vs(t[n],e[n])):!1}var hw=Object.prototype.hasOwnProperty;function hy(t,e){if(t===e)return t;const n=lf(t)&&lf(e);if(!n&&!(rc(t)&&rc(e)))return e;const i=(n?t:Object.keys(t)).length,s=n?e:Object.keys(e),o=s.length,a=n?new Array(o):{};let l=0;for(let u=0;u<o;u++){const c=n?u:s[u],d=t[c],h=e[c];if(d===h){a[c]=d,(n?u<i:hw.call(t,c))&&l++;continue}if(d===null||h===null||typeof d!="object"||typeof h!="object"){a[c]=h;continue}const f=hy(d,h);a[c]=f,f===d&&l++}return i===o&&l===i?t:a}function nc(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 lf(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function rc(t){if(!uf(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!uf(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function uf(t){return Object.prototype.toString.call(t)==="[object Object]"}function fw(t){return new Promise(e=>{br.setTimeout(e,t)})}function ic(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?hy(t,e):e}function pw(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function mw(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var _d=Symbol();function fy(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===_d?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function py(t,e){return typeof t=="function"?t(...e):!!t}function gw(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Sr,Nn,mi,Up,yw=(Up=class extends uo{constructor(){super();z(this,Sr);z(this,Nn);z(this,mi);D(this,mi,e=>{if(!Br&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Nn)||this.setEventListener(_(this,mi))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,Nn))==null||e.call(this),D(this,Nn,void 0))}setEventListener(e){var n;D(this,mi,e),(n=_(this,Nn))==null||n.call(this),D(this,Nn,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){_(this,Sr)!==e&&(D(this,Sr,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof _(this,Sr)=="boolean"?_(this,Sr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Sr=new WeakMap,Nn=new WeakMap,mi=new WeakMap,Up),Sd=new yw;function sc(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var vw=cw;function xw(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=vw;const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Ne=xw(),gi,jn,yi,Vp,ww=(Vp=class extends uo{constructor(){super();z(this,gi,!0);z(this,jn);z(this,yi);D(this,yi,e=>{if(!Br&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,jn)||this.setEventListener(_(this,yi))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,jn))==null||e.call(this),D(this,jn,void 0))}setEventListener(e){var n;D(this,yi,e),(n=_(this,jn))==null||n.call(this),D(this,jn,e(this.setOnline.bind(this)))}setOnline(e){_(this,gi)!==e&&(D(this,gi,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return _(this,gi)}},gi=new WeakMap,jn=new WeakMap,yi=new WeakMap,Vp),Aa=new ww;function bw(t){return Math.min(1e3*2**t,3e4)}function my(t){return(t??"online")==="online"?Aa.isOnline():!0}var oc=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function gy(t){let e=!1,n=0,r;const i=sc(),s=()=>i.status!=="pending",o=v=>{var w;if(!s()){const m=new oc(v);h(m),(w=t.onCancel)==null||w.call(t,m)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Sd.isFocused()&&(t.networkMode==="always"||Aa.isOnline())&&t.canRun(),c=()=>my(t.networkMode)&&t.canRun(),d=v=>{s()||(r==null||r(),i.resolve(v))},h=v=>{s()||(r==null||r(),i.reject(v))},f=()=>new Promise(v=>{var w;r=m=>{(s()||u())&&v(m)},(w=t.onPause)==null||w.call(t)}).then(()=>{var v;r=void 0,s()||(v=t.onContinue)==null||v.call(t)}),x=()=>{if(s())return;let v;const w=n===0?t.initialPromise:void 0;try{v=w??t.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var C;if(s())return;const y=t.retry??(Br?0:3),p=t.retryDelay??bw,b=typeof p=="function"?p(n,m):p,k=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,m);if(e||!k){h(m);return}n++,(C=t.onFail)==null||C.call(t,n,m),fw(b).then(()=>u()?void 0:f()).then(()=>{e?h(m):x()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?x():f().then(x),i)}}var kr,Qp,yy=(Qp=class{constructor(){z(this,kr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tc(this.gcTime)&&D(this,kr,br.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Br?1/0:5*60*1e3))}clearGcTimeout(){_(this,kr)&&(br.clearTimeout(_(this,kr)),D(this,kr,void 0))}},kr=new WeakMap,Qp),Cr,vi,mt,Er,Pe,Zs,Pr,Rt,nn,Yp,_w=(Yp=class extends yy{constructor(e){super();z(this,Rt);z(this,Cr);z(this,vi);z(this,mt);z(this,Er);z(this,Pe);z(this,Zs);z(this,Pr);D(this,Pr,!1),D(this,Zs,e.defaultOptions),this.setOptions(e.options),this.observers=[],D(this,Er,e.client),D(this,mt,_(this,Er).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,D(this,Cr,df(this.options)),this.state=e.state??_(this,Cr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=_(this,Pe))==null?void 0:e.promise}setOptions(e){if(this.options={..._(this,Zs),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=df(this.options);n.data!==void 0&&(this.setState(cf(n.data,n.dataUpdatedAt)),D(this,Cr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,mt).remove(this)}setData(e,n){const r=ic(this.state.data,e,this.options);return V(this,Rt,nn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){V(this,Rt,nn).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=_(this,Pe))==null?void 0:r.promise;return(i=_(this,Pe))==null||i.cancel(e),n?n.then(Ze).catch(Ze):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Cr))}isActive(){return this.observers.some(e=>gt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_d||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Jn(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:!dy(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Pe))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Pe))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),_(this,mt).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(_(this,Pe)&&(_(this,Pr)?_(this,Pe).cancel({revert:!0}):_(this,Pe).cancelRetry()),this.scheduleGc()),_(this,mt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||V(this,Rt,nn).call(this,{type:"invalidate"})}async fetch(e,n){var l,u,c,d,h,f,x,v,w,m,y,p;if(this.state.fetchStatus!=="idle"&&((l=_(this,Pe))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Pe))return _(this,Pe).continueRetry(),_(this,Pe).promise}if(e&&this.setOptions(e),!this.options.queryFn){const b=this.observers.find(k=>k.options.queryFn);b&&this.setOptions(b.options)}const r=new AbortController,i=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(D(this,Pr,!0),r.signal)})},s=()=>{const b=fy(this.options,n),C=(()=>{const P={client:_(this,Er),queryKey:this.queryKey,meta:this.meta};return i(P),P})();return D(this,Pr,!1),this.options.persister?this.options.persister(b,C,this):b(C)},a=(()=>{const b={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,Er),state:this.state,fetchFn:s};return i(b),b})();(u=this.options.behavior)==null||u.onFetch(a,this),D(this,vi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&V(this,Rt,nn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),D(this,Pe,gy({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof oc&&b.revert&&this.setState({..._(this,vi),fetchStatus:"idle"}),r.abort()},onFail:(b,k)=>{V(this,Rt,nn).call(this,{type:"failed",failureCount:b,error:k})},onPause:()=>{V(this,Rt,nn).call(this,{type:"pause"})},onContinue:()=>{V(this,Rt,nn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await _(this,Pe).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(f=(h=_(this,mt).config).onSuccess)==null||f.call(h,b,this),(v=(x=_(this,mt).config).onSettled)==null||v.call(x,b,this.state.error,this),b}catch(b){if(b instanceof oc){if(b.silent)return _(this,Pe).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw V(this,Rt,nn).call(this,{type:"error",error:b}),(m=(w=_(this,mt).config).onError)==null||m.call(w,b,this),(p=(y=_(this,mt).config).onSettled)==null||p.call(y,this.state.data,b,this),b}finally{this.scheduleGc()}}},Cr=new WeakMap,vi=new WeakMap,mt=new WeakMap,Er=new WeakMap,Pe=new WeakMap,Zs=new WeakMap,Pr=new WeakMap,Rt=new WeakSet,nn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...vy(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...cf(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return D(this,vi,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Ne.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,mt).notify({query:this,type:"updated",action:e})})},Yp);function vy(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:my(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function cf(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function df(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Je,Q,eo,Ve,Mr,xi,un,Dn,to,wi,bi,Rr,Tr,Ln,_i,G,cs,ac,lc,uc,cc,dc,hc,fc,xy,Kp,Sw=(Kp=class extends uo{constructor(e,n){super();z(this,G);z(this,Je);z(this,Q);z(this,eo);z(this,Ve);z(this,Mr);z(this,xi);z(this,un);z(this,Dn);z(this,to);z(this,wi);z(this,bi);z(this,Rr);z(this,Tr);z(this,Ln);z(this,_i,new Set);this.options=n,D(this,Je,e),D(this,Dn,null),D(this,un,sc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Q).addObserver(this),hf(_(this,Q),this.options)?V(this,G,cs).call(this):this.updateResult(),V(this,G,cc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pc(_(this,Q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pc(_(this,Q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,V(this,G,dc).call(this),V(this,G,hc).call(this),_(this,Q).removeObserver(this)}setOptions(e){const n=this.options,r=_(this,Q);if(this.options=_(this,Je).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gt(this.options.enabled,_(this,Q))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");V(this,G,fc).call(this),_(this,Q).setOptions(this.options),n._defaulted&&!nc(this.options,n)&&_(this,Je).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Q),observer:this});const i=this.hasListeners();i&&ff(_(this,Q),r,this.options,n)&&V(this,G,cs).call(this),this.updateResult(),i&&(_(this,Q)!==r||gt(this.options.enabled,_(this,Q))!==gt(n.enabled,_(this,Q))||Jn(this.options.staleTime,_(this,Q))!==Jn(n.staleTime,_(this,Q)))&&V(this,G,ac).call(this);const s=V(this,G,lc).call(this);i&&(_(this,Q)!==r||gt(this.options.enabled,_(this,Q))!==gt(n.enabled,_(this,Q))||s!==_(this,Ln))&&V(this,G,uc).call(this,s)}getOptimisticResult(e){const n=_(this,Je).getQueryCache().build(_(this,Je),e),r=this.createResult(n,e);return Cw(this,r)&&(D(this,Ve,r),D(this,xi,this.options),D(this,Mr,_(this,Q).state)),r}getCurrentResult(){return _(this,Ve)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,un).status==="pending"&&_(this,un).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){_(this,_i).add(e)}getCurrentQuery(){return _(this,Q)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=_(this,Je).defaultQueryOptions(e),r=_(this,Je).getQueryCache().build(_(this,Je),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return V(this,G,cs).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Ve)))}createResult(e,n){var N;const r=_(this,Q),i=this.options,s=_(this,Ve),o=_(this,Mr),a=_(this,xi),u=e!==r?e.state:_(this,eo),{state:c}=e;let d={...c},h=!1,f;if(n._optimisticResults){const M=this.hasListeners(),T=!M&&hf(e,n),A=M&&ff(e,r,n,i);(T||A)&&(d={...d,...vy(c.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:x,errorUpdatedAt:v,status:w}=d;f=d.data;let m=!1;if(n.placeholderData!==void 0&&f===void 0&&w==="pending"){let M;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(M=s.data,m=!0):M=typeof n.placeholderData=="function"?n.placeholderData((N=_(this,bi))==null?void 0:N.state.data,_(this,bi)):n.placeholderData,M!==void 0&&(w="success",f=ic(s==null?void 0:s.data,M,n),h=!0)}if(n.select&&f!==void 0&&!m)if(s&&f===(o==null?void 0:o.data)&&n.select===_(this,to))f=_(this,wi);else try{D(this,to,n.select),f=n.select(f),f=ic(s==null?void 0:s.data,f,n),D(this,wi,f),D(this,Dn,null)}catch(M){D(this,Dn,M)}_(this,Dn)&&(x=_(this,Dn),f=_(this,wi),v=Date.now(),w="error");const y=d.fetchStatus==="fetching",p=w==="pending",b=w==="error",k=p&&y,C=f!==void 0,E={status:w,fetchStatus:d.fetchStatus,isPending:p,isSuccess:w==="success",isError:b,isInitialLoading:k,isLoading:k,data:f,dataUpdatedAt:d.dataUpdatedAt,error:x,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!p,isLoadingError:b&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:b&&C,isStale:kd(e,n),refetch:this.refetch,promise:_(this,un),isEnabled:gt(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const M=W=>{E.status==="error"?W.reject(E.error):E.data!==void 0&&W.resolve(E.data)},T=()=>{const W=D(this,un,E.promise=sc());M(W)},A=_(this,un);switch(A.status){case"pending":e.queryHash===r.queryHash&&M(A);break;case"fulfilled":(E.status==="error"||E.data!==A.value)&&T();break;case"rejected":(E.status!=="error"||E.error!==A.reason)&&T();break}}return E}updateResult(){const e=_(this,Ve),n=this.createResult(_(this,Q),this.options);if(D(this,Mr,_(this,Q).state),D(this,xi,this.options),_(this,Mr).data!==void 0&&D(this,bi,_(this,Q)),nc(n,e))return;D(this,Ve,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!_(this,_i).size)return!0;const o=new Set(s??_(this,_i));return this.options.throwOnError&&o.add("error"),Object.keys(_(this,Ve)).some(a=>{const l=a;return _(this,Ve)[l]!==e[l]&&o.has(l)})};V(this,G,xy).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&V(this,G,cc).call(this)}},Je=new WeakMap,Q=new WeakMap,eo=new WeakMap,Ve=new WeakMap,Mr=new WeakMap,xi=new WeakMap,un=new WeakMap,Dn=new WeakMap,to=new WeakMap,wi=new WeakMap,bi=new WeakMap,Rr=new WeakMap,Tr=new WeakMap,Ln=new WeakMap,_i=new WeakMap,G=new WeakSet,cs=function(e){V(this,G,fc).call(this);let n=_(this,Q).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Ze)),n},ac=function(){V(this,G,dc).call(this);const e=Jn(this.options.staleTime,_(this,Q));if(Br||_(this,Ve).isStale||!tc(e))return;const r=dy(_(this,Ve).dataUpdatedAt,e)+1;D(this,Rr,br.setTimeout(()=>{_(this,Ve).isStale||this.updateResult()},r))},lc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Q)):this.options.refetchInterval)??!1},uc=function(e){V(this,G,hc).call(this),D(this,Ln,e),!(Br||gt(this.options.enabled,_(this,Q))===!1||!tc(_(this,Ln))||_(this,Ln)===0)&&D(this,Tr,br.setInterval(()=>{(this.options.refetchIntervalInBackground||Sd.isFocused())&&V(this,G,cs).call(this)},_(this,Ln)))},cc=function(){V(this,G,ac).call(this),V(this,G,uc).call(this,V(this,G,lc).call(this))},dc=function(){_(this,Rr)&&(br.clearTimeout(_(this,Rr)),D(this,Rr,void 0))},hc=function(){_(this,Tr)&&(br.clearInterval(_(this,Tr)),D(this,Tr,void 0))},fc=function(){const e=_(this,Je).getQueryCache().build(_(this,Je),this.options);if(e===_(this,Q))return;const n=_(this,Q);D(this,Q,e),D(this,eo,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},xy=function(e){Ne.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(_(this,Ve))}),_(this,Je).getQueryCache().notify({query:_(this,Q),type:"observerResultsUpdated"})})},Kp);function kw(t,e){return gt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function hf(t,e){return kw(t,e)||t.state.data!==void 0&&pc(t,e,e.refetchOnMount)}function pc(t,e,n){if(gt(e.enabled,t)!==!1&&Jn(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&kd(t,e)}return!1}function ff(t,e,n,r){return(t!==e||gt(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&kd(t,n)}function kd(t,e){return gt(e.enabled,t)!==!1&&t.isStaleByTime(Jn(e.staleTime,t))}function Cw(t,e){return!nc(t.getCurrentResult(),e)}function pf(t){return{onFetch:(e,n)=>{var c,d,h,f,x;const r=e.options,i=(h=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,s=((f=e.state.data)==null?void 0:f.pages)||[],o=((x=e.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const w=p=>{gw(p,()=>e.signal,()=>v=!0)},m=fy(e.options,e.fetchOptions),y=async(p,b,k)=>{if(v)return Promise.reject();if(b==null&&p.pages.length)return Promise.resolve(p);const P=(()=>{const T={client:e.client,queryKey:e.queryKey,pageParam:b,direction:k?"backward":"forward",meta:e.options.meta};return w(T),T})(),E=await m(P),{maxPages:N}=e.options,M=k?mw:pw;return{pages:M(p.pages,E,N),pageParams:M(p.pageParams,b,N)}};if(i&&s.length){const p=i==="backward",b=p?Ew:mf,k={pages:s,pageParams:o},C=b(r,k);a=await y(k,C,p)}else{const p=t??s.length;do{const b=l===0?o[0]??r.initialPageParam:mf(r,a);if(l>0&&b==null)break;a=await y(a,b),l++}while(l<p)}return a};e.options.persister?e.fetchFn=()=>{var v,w;return(w=(v=e.options).persister)==null?void 0:w.call(v,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function mf(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function Ew(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var no,Kt,Qe,Or,Xt,En,Xp,Pw=(Xp=class extends yy{constructor(e){super();z(this,Xt);z(this,no);z(this,Kt);z(this,Qe);z(this,Or);D(this,no,e.client),this.mutationId=e.mutationId,D(this,Qe,e.mutationCache),D(this,Kt,[]),this.state=e.state||Mw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){_(this,Kt).includes(e)||(_(this,Kt).push(e),this.clearGcTimeout(),_(this,Qe).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){D(this,Kt,_(this,Kt).filter(n=>n!==e)),this.scheduleGc(),_(this,Qe).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){_(this,Kt).length||(this.state.status==="pending"?this.scheduleGc():_(this,Qe).remove(this))}continue(){var e;return((e=_(this,Or))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,c,d,h,f,x,v,w,m,y,p,b,k,C,P,E,N;const n=()=>{V(this,Xt,En).call(this,{type:"continue"})},r={client:_(this,no),meta:this.options.meta,mutationKey:this.options.mutationKey};D(this,Or,gy({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,T)=>{V(this,Xt,En).call(this,{type:"failed",failureCount:M,error:T})},onPause:()=>{V(this,Xt,En).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Qe).canRun(this)}));const i=this.state.status==="pending",s=!_(this,Or).canStart();try{if(i)n();else{V(this,Xt,En).call(this,{type:"pending",variables:e,isPaused:s}),await((a=(o=_(this,Qe).config).onMutate)==null?void 0:a.call(o,e,this,r));const T=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));T!==this.state.context&&V(this,Xt,En).call(this,{type:"pending",context:T,variables:e,isPaused:s})}const M=await _(this,Or).start();return await((d=(c=_(this,Qe).config).onSuccess)==null?void 0:d.call(c,M,e,this.state.context,this,r)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,M,e,this.state.context,r)),await((v=(x=_(this,Qe).config).onSettled)==null?void 0:v.call(x,M,null,this.state.variables,this.state.context,this,r)),await((m=(w=this.options).onSettled)==null?void 0:m.call(w,M,null,e,this.state.context,r)),V(this,Xt,En).call(this,{type:"success",data:M}),M}catch(M){try{await((p=(y=_(this,Qe).config).onError)==null?void 0:p.call(y,M,e,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((k=(b=this.options).onError)==null?void 0:k.call(b,M,e,this.state.context,r))}catch(T){Promise.reject(T)}try{await((P=(C=_(this,Qe).config).onSettled)==null?void 0:P.call(C,void 0,M,this.state.variables,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((N=(E=this.options).onSettled)==null?void 0:N.call(E,void 0,M,e,this.state.context,r))}catch(T){Promise.reject(T)}throw V(this,Xt,En).call(this,{type:"error",error:M}),M}finally{_(this,Qe).runNext(this)}}},no=new WeakMap,Kt=new WeakMap,Qe=new WeakMap,Or=new WeakMap,Xt=new WeakSet,En=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ne.batch(()=>{_(this,Kt).forEach(r=>{r.onMutationUpdate(e)}),_(this,Qe).notify({mutation:this,type:"updated",action:e})})},Xp);function Mw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cn,Tt,ro,qp,Rw=(qp=class extends uo{constructor(e={}){super();z(this,cn);z(this,Tt);z(this,ro);this.config=e,D(this,cn,new Set),D(this,Tt,new Map),D(this,ro,0)}build(e,n,r){const i=new Pw({client:e,mutationCache:this,mutationId:++mo(this,ro)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){_(this,cn).add(e);const n=jo(e);if(typeof n=="string"){const r=_(this,Tt).get(n);r?r.push(e):_(this,Tt).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(_(this,cn).delete(e)){const n=jo(e);if(typeof n=="string"){const r=_(this,Tt).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&_(this,Tt).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=jo(e);if(typeof n=="string"){const r=_(this,Tt).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=jo(e);if(typeof n=="string"){const i=(r=_(this,Tt).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ne.batch(()=>{_(this,cn).forEach(e=>{this.notify({type:"removed",mutation:e})}),_(this,cn).clear(),_(this,Tt).clear()})}getAll(){return Array.from(_(this,cn))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>af(n,r))}findAll(e={}){return this.getAll().filter(n=>af(e,n))}notify(e){Ne.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ne.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ze))))}},cn=new WeakMap,Tt=new WeakMap,ro=new WeakMap,qp);function jo(t){var e;return(e=t.options.scope)==null?void 0:e.id}var qt,Gp,Tw=(Gp=class extends uo{constructor(e={}){super();z(this,qt);this.config=e,D(this,qt,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??bd(i,n);let o=this.get(s);return o||(o=new _w({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){_(this,qt).has(e.queryHash)||(_(this,qt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=_(this,qt).get(e.queryHash);n&&(e.destroy(),n===e&&_(this,qt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ne.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return _(this,qt).get(e)}getAll(){return[..._(this,qt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>of(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>of(e,r)):n}notify(e){Ne.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ne.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ne.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qt=new WeakMap,Gp),xe,Fn,In,Si,ki,An,Ci,Ei,Jp,Ow=(Jp=class{constructor(t={}){z(this,xe);z(this,Fn);z(this,In);z(this,Si);z(this,ki);z(this,An);z(this,Ci);z(this,Ei);D(this,xe,t.queryCache||new Tw),D(this,Fn,t.mutationCache||new Rw),D(this,In,t.defaultOptions||{}),D(this,Si,new Map),D(this,ki,new Map),D(this,An,0)}mount(){mo(this,An)._++,_(this,An)===1&&(D(this,Ci,Sd.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,xe).onFocus())})),D(this,Ei,Aa.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,xe).onOnline())})))}unmount(){var t,e;mo(this,An)._--,_(this,An)===0&&((t=_(this,Ci))==null||t.call(this),D(this,Ci,void 0),(e=_(this,Ei))==null||e.call(this),D(this,Ei,void 0))}isFetching(t){return _(this,xe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return _(this,Fn).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,xe).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=_(this,xe).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Jn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return _(this,xe).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=_(this,xe).get(r.queryHash),s=i==null?void 0:i.state.data,o=dw(e,s);if(o!==void 0)return _(this,xe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Ne.batch(()=>_(this,xe).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,xe).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=_(this,xe);Ne.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=_(this,xe);return Ne.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Ne.batch(()=>_(this,xe).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Ze).catch(Ze)}invalidateQueries(t,e={}){return Ne.batch(()=>(_(this,xe).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},r=Ne.batch(()=>_(this,xe).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ze)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ze)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=_(this,xe).build(this,e);return n.isStaleByTime(Jn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ze).catch(Ze)}fetchInfiniteQuery(t){return t.behavior=pf(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ze).catch(Ze)}ensureInfiniteQueryData(t){return t.behavior=pf(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Aa.isOnline()?_(this,Fn).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,xe)}getMutationCache(){return _(this,Fn)}getDefaultOptions(){return _(this,In)}setDefaultOptions(t){D(this,In,t)}setQueryDefaults(t,e){_(this,Si).set(Us(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[..._(this,Si).values()],n={};return e.forEach(r=>{Vs(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){_(this,ki).set(Us(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[..._(this,ki).values()],n={};return e.forEach(r=>{Vs(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={..._(this,In).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=bd(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===_d&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{..._(this,In).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){_(this,xe).clear(),_(this,Fn).clear()}},xe=new WeakMap,Fn=new WeakMap,In=new WeakMap,Si=new WeakMap,ki=new WeakMap,An=new WeakMap,Ci=new WeakMap,Ei=new WeakMap,Jp),wy=S.createContext(void 0),Nw=t=>{const e=S.useContext(wy);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},jw=({client:t,children:e})=>(S.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),g.jsx(wy.Provider,{value:t,children:e})),by=S.createContext(!1),Dw=()=>S.useContext(by);by.Provider;function Lw(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Fw=S.createContext(Lw()),Iw=()=>S.useContext(Fw),Aw=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?py(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},zw=t=>{S.useEffect(()=>{t.clearReset()},[t])},Bw=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||py(n,[t.error,r])),Ww=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Hw=(t,e)=>t.isLoading&&t.isFetching&&!e,$w=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,gf=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Uw(t,e,n){var h,f,x,v;const r=Dw(),i=Iw(),s=Nw(),o=s.defaultQueryOptions(t);(f=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,o);const a=s.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",Ww(o),Aw(o,i,a),zw(i);const l=!s.getQueryCache().get(o.queryHash),[u]=S.useState(()=>new e(s,o)),c=u.getOptimisticResult(o),d=!r&&t.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(w=>{const m=d?u.subscribe(Ne.batchCalls(w)):Ze;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),S.useEffect(()=>{u.setOptions(o)},[o,u]),$w(o,c))throw gf(o,u,i);if(Bw({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw c.error;if((v=(x=s.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||v.call(x,o,c),o.experimental_prefetchInRender&&!Br&&Hw(c,r)){const w=l?gf(o,u,i):a==null?void 0:a.promise;w==null||w.catch(Ze).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?c:u.trackResult(c)}function Cd(t,e){return Uw(t,Sw)}/**
40
+ `+s.stack}return{value:t,source:e,stack:i,digest:null}}function Wl(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Wu(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Fx=typeof WeakMap=="function"?WeakMap:Map;function Ig(t,e,n){n=pn(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Da||(Da=!0,Gu=r),Wu(t,e)},n}function Ag(t,e,n){n=pn(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Wu(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Wu(t,e),typeof r!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Bh(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new Fx;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=qx.bind(null,t,e,n),e.then(t,t))}function Wh(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 Hh(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,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=pn(-1,1),e.tag=2,Kn(n,e,1))),n.lanes|=1),t)}var Ix=bn.ReactCurrentOwner,nt=!1;function Ye(t,e,n,r){e.child=t===null?fg(e,null,n,r):Ri(e,t.child,n,r)}function $h(t,e,n,r,i){n=n.render;var s=e.ref;return di(e,i),r=sd(t,e,n,r,s,i),n=od(),t!==null&&!nt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xn(t,e,i)):(he&&n&&Yc(e),e.flags|=1,Ye(t,e,r,i),e.child)}function Uh(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!gd(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,zg(t,e,s,r,i)):(t=sa(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ds,n(o,r)&&t.ref===e.ref)return xn(t,e,i)}return e.flags|=1,t=Gn(s,r),t.ref=e.ref,t.return=e,e.child=t}function zg(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(Ds(s,r)&&t.ref===e.ref)if(nt=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(nt=!0);else return e.lanes=t.lanes,xn(t,e,i)}return Hu(t,e,n,r,i)}function Bg(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ae(si,ot),ot|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ae(si,ot),ot|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ae(si,ot),ot|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,ae(si,ot),ot|=r;return Ye(t,e,i,n),e.child}function Wg(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Hu(t,e,n,r,i){var s=it(n)?Lr:He.current;return s=Mi(e,s),di(e,i),n=sd(t,e,n,r,s,i),r=od(),t!==null&&!nt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,xn(t,e,i)):(he&&r&&Yc(e),e.flags|=1,Ye(t,e,n,i),e.child)}function Vh(t,e,n,r,i){if(it(n)){var s=!0;ka(e)}else s=!1;if(di(e,i),e.stateNode===null)na(t,e),Fg(e,n,r),Bu(e,n,r,i),r=!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=_t(u):(u=it(n)?Lr:He.current,u=Mi(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&zh(e,o,r,u),Mn=!1;var h=e.memoizedState;o.state=h,Ta(e,r,o,i),l=e.memoizedState,a!==r||h!==l||rt.current||Mn?(typeof c=="function"&&(zu(e,n,c,r),l=e.memoizedState),(a=Mn||Ah(e,n,a,r,h,l,u))?(d||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=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,mg(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Mt(e.type,a),o.props=u,d=e.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=_t(l):(l=it(n)?Lr:He.current,l=Mi(e,l));var f=n.getDerivedStateFromProps;(c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&zh(e,o,r,l),Mn=!1,h=e.memoizedState,o.state=h,Ta(e,r,o,i);var v=e.memoizedState;a!==d||h!==v||rt.current||Mn?(typeof f=="function"&&(zu(e,n,f,r),v=e.memoizedState),(u=Mn||Ah(e,n,u,r,h,v,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),o.props=r,o.state=v,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return $u(t,e,n,r,s,i)}function $u(t,e,n,r,i,s){Wg(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&Rh(e,n,!1),xn(t,e,s);r=e.stateNode,Ix.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Ri(e,t.child,null,s),e.child=Ri(e,null,a,s)):Ye(t,e,a,s),e.memoizedState=r.state,i&&Rh(e,n,!0),e.child}function Hg(t){var e=t.stateNode;e.pendingContext?Th(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Th(t,e.context,!1),td(t,e.containerInfo)}function Qh(t,e,n,r,i){return Ti(),Xc(i),e.flags|=256,Ye(t,e,n,r),e.child}var Uu={dehydrated:null,treeContext:null,retryLane:0};function Vu(t){return{baseLanes:t,cachePool:null,transitions:null}}function $g(t,e,n){var r=e.pendingProps,i=me.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),ae(me,i&1),t===null)return Iu(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=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ol(o,r,0,null),t=jr(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Vu(n),e.memoizedState=Uu,t):ud(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Ax(t,e,o,r,a,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Gn(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Gn(a,s):(s=jr(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?Vu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=Uu,r}return s=t.child,t=s.sibling,r=Gn(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function ud(t,e){return e=ol({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function To(t,e,n,r){return r!==null&&Xc(r),Ri(e,t.child,null,n),t=ud(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Ax(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=Wl(Error(N(422))),To(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=ol({mode:"visible",children:r.children},i,0,null),s=jr(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Ri(e,t.child,null,o),e.child.memoizedState=Vu(o),e.memoizedState=Uu,s);if(!(e.mode&1))return To(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(N(419)),r=Wl(s,r,void 0),To(t,e,o,r)}if(a=(o&t.childLanes)!==0,nt||a){if(r=Te,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,vn(t,i),Ft(r,t,i,-1))}return md(),r=Wl(Error(N(421))),To(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Gx.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,at=Yn(i.nextSibling),lt=e,he=!0,Ot=null,t!==null&&(yt[vt++]=dn,yt[vt++]=hn,yt[vt++]=Fr,dn=t.id,hn=t.overflow,Fr=e),e=ud(e,r.children),e.flags|=4096,e)}function Yh(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Au(t.return,e,n)}function Hl(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Ug(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Ye(t,e,r.children,n),r=me.current,r&2)r=r&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&&Yh(t,n,e);else if(t.tag===19)Yh(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}r&=1}if(ae(me,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Ra(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Hl(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Ra(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Hl(e,!0,n,null,s);break;case"together":Hl(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function na(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function xn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ar|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(N(153));if(e.child!==null){for(t=e.child,n=Gn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Gn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function zx(t,e,n){switch(e.tag){case 3:Hg(e),Ti();break;case 5:gg(e);break;case 1:it(e.type)&&ka(e);break;case 4:td(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;ae(Pa,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(ae(me,me.current&1),e.flags|=128,null):n&e.child.childLanes?$g(t,e,n):(ae(me,me.current&1),t=xn(t,e,n),t!==null?t.sibling:null);ae(me,me.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return Ug(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ae(me,me.current),r)break;return null;case 22:case 23:return e.lanes=0,Bg(t,e,n)}return xn(t,e,n)}var Vg,Qu,Qg,Yg;Vg=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}};Qu=function(){};Qg=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,wr(Zt.current);var s=null;switch(n){case"input":i=pu(t,i),r=pu(t,r),s=[];break;case"select":i=ye({},i,{value:void 0}),r=ye({},r,{value:void 0}),s=[];break;case"textarea":i=yu(t,i),r=yu(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=_a)}xu(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ps.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.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||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ps.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ue("scroll",t),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};Yg=function(t,e,n,r){n!==r&&(e.flags|=4)};function qi(t,e){if(!he)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Ie(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Bx(t,e,n){var r=e.pendingProps;switch(Kc(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(e),null;case 1:return it(e.type)&&Sa(),Ie(e),null;case 3:return r=e.stateNode,Ni(),de(rt),de(He),rd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Po(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ot!==null&&(ec(Ot),Ot=null))),Qu(t,e),Ie(e),null;case 5:nd(e);var i=wr(zs.current);if(n=e.type,t!==null&&e.stateNode!=null)Qg(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(N(166));return Ie(e),null}if(t=wr(Zt.current),Po(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Gt]=e,r[Is]=s,t=(e.mode&1)!==0,n){case"dialog":ue("cancel",r),ue("close",r);break;case"iframe":case"object":case"embed":ue("load",r);break;case"video":case"audio":for(i=0;i<us.length;i++)ue(us[i],r);break;case"source":ue("error",r);break;case"img":case"image":case"link":ue("error",r),ue("load",r);break;case"details":ue("toggle",r);break;case"input":nh(r,s),ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ue("invalid",r);break;case"textarea":ih(r,s),ue("invalid",r)}xu(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Eo(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Eo(r.textContent,a,t),i=["children",""+a]):Ps.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ue("scroll",r)}switch(n){case"input":vo(r),rh(r,s,!0);break;case"textarea":vo(r),sh(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=_a)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=bm(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Gt]=e,t[Is]=r,Vg(t,e,!1,!1),e.stateNode=t;e:{switch(o=wu(n,r),n){case"dialog":ue("cancel",t),ue("close",t),i=r;break;case"iframe":case"object":case"embed":ue("load",t),i=r;break;case"video":case"audio":for(i=0;i<us.length;i++)ue(us[i],t);i=r;break;case"source":ue("error",t),i=r;break;case"img":case"image":case"link":ue("error",t),ue("load",t),i=r;break;case"details":ue("toggle",t),i=r;break;case"input":nh(t,r),i=pu(t,r),ue("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=ye({},r,{value:void 0}),ue("invalid",t);break;case"textarea":ih(t,r),i=yu(t,r),ue("invalid",t);break;default:i=r}xu(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?km(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&_m(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ms(t,l):typeof l=="number"&&Ms(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ps.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ue("scroll",t):l!=null&&jc(t,s,l,o))}switch(n){case"input":vo(t),rh(t,r,!1);break;case"textarea":vo(t),sh(t);break;case"option":r.value!=null&&t.setAttribute("value",""+nr(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?ai(t,!!r.multiple,s,!1):r.defaultValue!=null&&ai(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=_a)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Ie(e),null;case 6:if(t&&e.stateNode!=null)Yg(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(N(166));if(n=wr(zs.current),wr(Zt.current),Po(e)){if(r=e.stateNode,n=e.memoizedProps,r[Gt]=e,(s=r.nodeValue!==n)&&(t=lt,t!==null))switch(t.tag){case 3:Eo(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Eo(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Gt]=e,e.stateNode=r}return Ie(e),null;case 13:if(de(me),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(he&&at!==null&&e.mode&1&&!(e.flags&128))dg(),Ti(),e.flags|=98560,s=!1;else if(s=Po(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(N(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(N(317));s[Gt]=e}else Ti(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ie(e),s=!1}else Ot!==null&&(ec(Ot),Ot=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||me.current&1?Ee===0&&(Ee=3):md())),e.updateQueue!==null&&(e.flags|=4),Ie(e),null);case 4:return Ni(),Qu(t,e),t===null&&Ls(e.stateNode.containerInfo),Ie(e),null;case 10:return Jc(e.type._context),Ie(e),null;case 17:return it(e.type)&&Sa(),Ie(e),null;case 19:if(de(me),s=e.memoizedState,s===null)return Ie(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)qi(s,!1);else{if(Ee!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Ra(t),o!==null){for(e.flags|=128,qi(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return ae(me,me.current&1|2),e.child}t=t.sibling}s.tail!==null&&be()>ji&&(e.flags|=128,r=!0,qi(s,!1),e.lanes=4194304)}else{if(!r)if(t=Ra(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),qi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!he)return Ie(e),null}else 2*be()-s.renderingStartTime>ji&&n!==1073741824&&(e.flags|=128,r=!0,qi(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=be(),e.sibling=null,n=me.current,ae(me,r?n&1|2:n&1),e):(Ie(e),null);case 22:case 23:return pd(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ot&1073741824&&(Ie(e),e.subtreeFlags&6&&(e.flags|=8192)):Ie(e),null;case 24:return null;case 25:return null}throw Error(N(156,e.tag))}function Wx(t,e){switch(Kc(e),e.tag){case 1:return it(e.type)&&Sa(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ni(),de(rt),de(He),rd(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return nd(e),null;case 13:if(de(me),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(N(340));Ti()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return de(me),null;case 4:return Ni(),null;case 10:return Jc(e.type._context),null;case 22:case 23:return pd(),null;case 24:return null;default:return null}}var Ro=!1,ze=!1,Hx=typeof WeakSet=="function"?WeakSet:Set,L=null;function ii(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(t,e,r)}else n.current=null}function Yu(t,e,n){try{n()}catch(r){we(t,e,r)}}var Kh=!1;function $x(t,e){if(Ru=xa,t=Jm(),Qc(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=t,h=null;t:for(;;){for(var f;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===t)break t;if(h===n&&++u===i&&(a=o),h===s&&++c===r&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nu={focusedElem:t,selectionRange:n},xa=!1,L=e;L!==null;)if(e=L,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,L=t;else for(;L!==null;){e=L;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,w=v.memoizedState,m=e.stateNode,g=m.getSnapshotBeforeUpdate(e.elementType===e.type?y:Mt(e.type,y),w);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(b){we(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,L=t;break}L=e.return}return v=Kh,Kh=!1,v}function ws(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Yu(e,n,s)}i=i.next}while(i!==r)}}function il(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 r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Ku(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 Kg(t){var e=t.alternate;e!==null&&(t.alternate=null,Kg(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Gt],delete e[Is],delete e[Du],delete e[Cx],delete e[Ex])),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 Xg(t){return t.tag===5||t.tag===3||t.tag===4}function Xh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xg(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 Xu(t,e,n){var r=t.tag;if(r===5||r===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=_a));else if(r!==4&&(t=t.child,t!==null))for(Xu(t,e,n),t=t.sibling;t!==null;)Xu(t,e,n),t=t.sibling}function qu(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(qu(t,e,n),t=t.sibling;t!==null;)qu(t,e,n),t=t.sibling}var Ne=null,Nt=!1;function Sn(t,e,n){for(n=n.child;n!==null;)qg(t,e,n),n=n.sibling}function qg(t,e,n){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(qa,n)}catch{}switch(n.tag){case 5:ze||ii(n,e);case 6:var r=Ne,i=Nt;Ne=null,Sn(t,e,n),Ne=r,Nt=i,Ne!==null&&(Nt?(t=Ne,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ne.removeChild(n.stateNode));break;case 18:Ne!==null&&(Nt?(t=Ne,n=n.stateNode,t.nodeType===8?Ll(t.parentNode,n):t.nodeType===1&&Ll(t,n),Os(t)):Ll(Ne,n.stateNode));break;case 4:r=Ne,i=Nt,Ne=n.stateNode.containerInfo,Nt=!0,Sn(t,e,n),Ne=r,Nt=i;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Yu(n,e,o),i=i.next}while(i!==r)}Sn(t,e,n);break;case 1:if(!ze&&(ii(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){we(n,e,a)}Sn(t,e,n);break;case 21:Sn(t,e,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,Sn(t,e,n),ze=r):Sn(t,e,n);break;default:Sn(t,e,n)}}function qh(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Hx),e.forEach(function(r){var i=Jx.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Pt(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Ne=a.stateNode,Nt=!1;break e;case 3:Ne=a.stateNode.containerInfo,Nt=!0;break e;case 4:Ne=a.stateNode.containerInfo,Nt=!0;break e}a=a.return}if(Ne===null)throw Error(N(160));qg(s,o,i),Ne=null,Nt=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){we(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Gg(e,t),e=e.sibling}function Gg(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Pt(e,t),Wt(t),r&4){try{ws(3,t,t.return),il(3,t)}catch(y){we(t,t.return,y)}try{ws(5,t,t.return)}catch(y){we(t,t.return,y)}}break;case 1:Pt(e,t),Wt(t),r&512&&n!==null&&ii(n,n.return);break;case 5:if(Pt(e,t),Wt(t),r&512&&n!==null&&ii(n,n.return),t.flags&32){var i=t.stateNode;try{Ms(i,"")}catch(y){we(t,t.return,y)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&xm(i,s),wu(a,o);var u=wu(a,s);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?km(i,d):c==="dangerouslySetInnerHTML"?_m(i,d):c==="children"?Ms(i,d):jc(i,c,d,u)}switch(a){case"input":mu(i,s);break;case"textarea":wm(i,s);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?ai(i,!!s.multiple,f,!1):h!==!!s.multiple&&(s.defaultValue!=null?ai(i,!!s.multiple,s.defaultValue,!0):ai(i,!!s.multiple,s.multiple?[]:"",!1))}i[Is]=s}catch(y){we(t,t.return,y)}}break;case 6:if(Pt(e,t),Wt(t),r&4){if(t.stateNode===null)throw Error(N(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(y){we(t,t.return,y)}}break;case 3:if(Pt(e,t),Wt(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Os(e.containerInfo)}catch(y){we(t,t.return,y)}break;case 4:Pt(e,t),Wt(t);break;case 13:Pt(e,t),Wt(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(hd=be())),r&4&&qh(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(ze=(u=ze)||c,Pt(e,t),ze=u):Pt(e,t),Wt(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(L=t,c=t.child;c!==null;){for(d=L=c;L!==null;){switch(h=L,f=h.child,h.tag){case 0:case 11:case 14:case 15:ws(4,h,h.return);break;case 1:ii(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(y){we(r,n,y)}}break;case 5:ii(h,h.return);break;case 22:if(h.memoizedState!==null){Jh(d);continue}}f!==null?(f.return=h,L=f):Jh(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Sm("display",o))}catch(y){we(t,t.return,y)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){we(t,t.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Pt(e,t),Wt(t),r&4&&qh(t);break;case 21:break;default:Pt(e,t),Wt(t)}}function Wt(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Xg(n)){var r=n;break e}n=n.return}throw Error(N(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ms(i,""),r.flags&=-33);var s=Xh(t);qu(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Xh(t);Xu(t,a,o);break;default:throw Error(N(161))}}catch(l){we(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Ux(t,e,n){L=t,Jg(t)}function Jg(t,e,n){for(var r=(t.mode&1)!==0;L!==null;){var i=L,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ro;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||ze;a=Ro;var u=ze;if(Ro=o,(ze=l)&&!u)for(L=i;L!==null;)o=L,l=o.child,o.tag===22&&o.memoizedState!==null?Zh(i):l!==null?(l.return=o,L=l):Zh(i);for(;s!==null;)L=s,Jg(s),s=s.sibling;L=i,Ro=a,ze=u}Gh(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,L=s):Gh(t)}}function Gh(t){for(;L!==null;){var e=L;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:ze||il(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!ze)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Mt(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Lh(e,s,r);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}Lh(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 c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Os(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(N(163))}ze||e.flags&512&&Ku(e)}catch(h){we(e,e.return,h)}}if(e===t){L=null;break}if(n=e.sibling,n!==null){n.return=e.return,L=n;break}L=e.return}}function Jh(t){for(;L!==null;){var e=L;if(e===t){L=null;break}var n=e.sibling;if(n!==null){n.return=e.return,L=n;break}L=e.return}}function Zh(t){for(;L!==null;){var e=L;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{il(4,e)}catch(l){we(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){we(e,i,l)}}var s=e.return;try{Ku(e)}catch(l){we(e,s,l)}break;case 5:var o=e.return;try{Ku(e)}catch(l){we(e,o,l)}}}catch(l){we(e,e.return,l)}if(e===t){L=null;break}var a=e.sibling;if(a!==null){a.return=e.return,L=a;break}L=e.return}}var Vx=Math.ceil,ja=bn.ReactCurrentDispatcher,cd=bn.ReactCurrentOwner,bt=bn.ReactCurrentBatchConfig,K=0,Te=null,Se=null,je=0,ot=0,si=ar(0),Ee=0,$s=null,Ar=0,sl=0,dd=0,bs=null,et=null,hd=0,ji=1/0,on=null,Da=!1,Gu=null,Xn=null,No=!1,Bn=null,La=0,_s=0,Ju=null,ra=-1,ia=0;function Ke(){return K&6?be():ra!==-1?ra:ra=be()}function qn(t){return t.mode&1?K&2&&je!==0?je&-je:Mx.transition!==null?(ia===0&&(ia=Fm()),ia):(t=te,t!==0||(t=window.event,t=t===void 0?16:$m(t.type)),t):1}function Ft(t,e,n,r){if(50<_s)throw _s=0,Ju=null,Error(N(185));so(t,n,r),(!(K&2)||t!==Te)&&(t===Te&&(!(K&2)&&(sl|=n),Ee===4&&Rn(t,je)),st(t,r),n===1&&K===0&&!(e.mode&1)&&(ji=be()+500,tl&&lr()))}function st(t,e){var n=t.callbackNode;Mv(t,e);var r=va(t,t===Te?je:0);if(r===0)n!==null&&lh(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&lh(n),e===1)t.tag===0?Px(ef.bind(null,t)):lg(ef.bind(null,t)),Sx(function(){!(K&6)&&lr()}),n=null;else{switch(Im(r)){case 1:n=Ac;break;case 4:n=Dm;break;case 16:n=ya;break;case 536870912:n=Lm;break;default:n=ya}n=oy(n,Zg.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Zg(t,e){if(ra=-1,ia=0,K&6)throw Error(N(327));var n=t.callbackNode;if(hi()&&t.callbackNode!==n)return null;var r=va(t,t===Te?je:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Fa(t,r);else{e=r;var i=K;K|=2;var s=ty();(Te!==t||je!==e)&&(on=null,ji=be()+500,Or(t,e));do try{Kx();break}catch(a){ey(t,a)}while(!0);Gc(),ja.current=s,K=i,Se!==null?e=0:(Te=null,je=0,e=Ee)}if(e!==0){if(e===2&&(i=Cu(t),i!==0&&(r=i,e=Zu(t,i))),e===1)throw n=$s,Or(t,0),Rn(t,r),st(t,be()),n;if(e===6)Rn(t,r);else{if(i=t.current.alternate,!(r&30)&&!Qx(i)&&(e=Fa(t,r),e===2&&(s=Cu(t),s!==0&&(r=s,e=Zu(t,s))),e===1))throw n=$s,Or(t,0),Rn(t,r),st(t,be()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(N(345));case 2:mr(t,et,on);break;case 3:if(Rn(t,r),(r&130023424)===r&&(e=hd+500-be(),10<e)){if(va(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Ke(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=ju(mr.bind(null,t,et,on),e);break}mr(t,et,on);break;case 4:if(Rn(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-Lt(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Vx(r/1960))-r,10<r){t.timeoutHandle=ju(mr.bind(null,t,et,on),r);break}mr(t,et,on);break;case 5:mr(t,et,on);break;default:throw Error(N(329))}}}return st(t,be()),t.callbackNode===n?Zg.bind(null,t):null}function Zu(t,e){var n=bs;return t.current.memoizedState.isDehydrated&&(Or(t,e).flags|=256),t=Fa(t,e),t!==2&&(e=et,et=n,e!==null&&ec(e)),t}function ec(t){et===null?et=t:et.push.apply(et,t)}function Qx(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!It(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Rn(t,e){for(e&=~dd,e&=~sl,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Lt(e),r=1<<n;t[n]=-1,e&=~r}}function ef(t){if(K&6)throw Error(N(327));hi();var e=va(t,0);if(!(e&1))return st(t,be()),null;var n=Fa(t,e);if(t.tag!==0&&n===2){var r=Cu(t);r!==0&&(e=r,n=Zu(t,r))}if(n===1)throw n=$s,Or(t,0),Rn(t,e),st(t,be()),n;if(n===6)throw Error(N(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,mr(t,et,on),st(t,be()),null}function fd(t,e){var n=K;K|=1;try{return t(e)}finally{K=n,K===0&&(ji=be()+500,tl&&lr())}}function zr(t){Bn!==null&&Bn.tag===0&&!(K&6)&&hi();var e=K;K|=1;var n=bt.transition,r=te;try{if(bt.transition=null,te=1,t)return t()}finally{te=r,bt.transition=n,K=e,!(K&6)&&lr()}}function pd(){ot=si.current,de(si)}function Or(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,_x(n)),Se!==null)for(n=Se.return;n!==null;){var r=n;switch(Kc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sa();break;case 3:Ni(),de(rt),de(He),rd();break;case 5:nd(r);break;case 4:Ni();break;case 13:de(me);break;case 19:de(me);break;case 10:Jc(r.type._context);break;case 22:case 23:pd()}n=n.return}if(Te=t,Se=t=Gn(t.current,null),je=ot=e,Ee=0,$s=null,dd=sl=Ar=0,et=bs=null,xr!==null){for(e=0;e<xr.length;e++)if(n=xr[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}xr=null}return t}function ey(t,e){do{var n=Se;try{if(Gc(),ea.current=Oa,Na){for(var r=ge.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Na=!1}if(Ir=0,Me=ke=ge=null,xs=!1,Bs=0,cd.current=null,n===null||n.return===null){Ee=1,$s=e,Se=null;break}e:{var s=t,o=n.return,a=n,l=e;if(e=je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var f=Wh(o);if(f!==null){f.flags&=-257,Hh(f,o,a,s,e),f.mode&1&&Bh(s,u,e),e=f,l=u;var v=e.updateQueue;if(v===null){var y=new Set;y.add(l),e.updateQueue=y}else v.add(l);break e}else{if(!(e&1)){Bh(s,u,e),md();break e}l=Error(N(426))}}else if(he&&a.mode&1){var w=Wh(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Hh(w,o,a,s,e),Xc(Oi(l,a));break e}}s=l=Oi(l,a),Ee!==4&&(Ee=2),bs===null?bs=[s]:bs.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var m=Ig(s,l,e);Dh(s,m);break e;case 1:a=l;var g=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Xn===null||!Xn.has(x)))){s.flags|=65536,e&=-e,s.lanes|=e;var b=Ag(s,a,e);Dh(s,b);break e}}s=s.return}while(s!==null)}ry(n)}catch(C){e=C,Se===n&&n!==null&&(Se=n=n.return);continue}break}while(!0)}function ty(){var t=ja.current;return ja.current=Oa,t===null?Oa:t}function md(){(Ee===0||Ee===3||Ee===2)&&(Ee=4),Te===null||!(Ar&268435455)&&!(sl&268435455)||Rn(Te,je)}function Fa(t,e){var n=K;K|=2;var r=ty();(Te!==t||je!==e)&&(on=null,Or(t,e));do try{Yx();break}catch(i){ey(t,i)}while(!0);if(Gc(),K=n,ja.current=r,Se!==null)throw Error(N(261));return Te=null,je=0,Ee}function Yx(){for(;Se!==null;)ny(Se)}function Kx(){for(;Se!==null&&!xv();)ny(Se)}function ny(t){var e=sy(t.alternate,t,ot);t.memoizedProps=t.pendingProps,e===null?ry(t):Se=e,cd.current=null}function ry(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Wx(n,e),n!==null){n.flags&=32767,Se=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ee=6,Se=null;return}}else if(n=Bx(n,e,ot),n!==null){Se=n;return}if(e=e.sibling,e!==null){Se=e;return}Se=e=t}while(e!==null);Ee===0&&(Ee=5)}function mr(t,e,n){var r=te,i=bt.transition;try{bt.transition=null,te=1,Xx(t,e,n,r)}finally{bt.transition=i,te=r}return null}function Xx(t,e,n,r){do hi();while(Bn!==null);if(K&6)throw Error(N(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(N(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(Tv(t,s),t===Te&&(Se=Te=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||No||(No=!0,oy(ya,function(){return hi(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=bt.transition,bt.transition=null;var o=te;te=1;var a=K;K|=4,cd.current=null,$x(t,n),Gg(n,t),mx(Nu),xa=!!Ru,Nu=Ru=null,t.current=n,Ux(n),wv(),K=a,te=o,bt.transition=s}else t.current=n;if(No&&(No=!1,Bn=t,La=i),s=t.pendingLanes,s===0&&(Xn=null),Sv(n.stateNode),st(t,be()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Da)throw Da=!1,t=Gu,Gu=null,t;return La&1&&t.tag!==0&&hi(),s=t.pendingLanes,s&1?t===Ju?_s++:(_s=0,Ju=t):_s=0,lr(),null}function hi(){if(Bn!==null){var t=Im(La),e=bt.transition,n=te;try{if(bt.transition=null,te=16>t?16:t,Bn===null)var r=!1;else{if(t=Bn,Bn=null,La=0,K&6)throw Error(N(331));var i=K;for(K|=4,L=t.current;L!==null;){var s=L,o=s.child;if(L.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(L=u;L!==null;){var c=L;switch(c.tag){case 0:case 11:case 15:ws(8,c,s)}var d=c.child;if(d!==null)d.return=c,L=d;else for(;L!==null;){c=L;var h=c.sibling,f=c.return;if(Kg(c),c===u){L=null;break}if(h!==null){h.return=f,L=h;break}L=f}}}var v=s.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var w=y.sibling;y.sibling=null,y=w}while(y!==null)}}L=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,L=o;else e:for(;L!==null;){if(s=L,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ws(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,L=m;break e}L=s.return}}var g=t.current;for(L=g;L!==null;){o=L;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,L=x;else e:for(o=g;L!==null;){if(a=L,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:il(9,a)}}catch(C){we(a,a.return,C)}if(a===o){L=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,L=b;break e}L=a.return}}if(K=i,lr(),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(qa,t)}catch{}r=!0}return r}finally{te=n,bt.transition=e}}return!1}function tf(t,e,n){e=Oi(n,e),e=Ig(t,e,1),t=Kn(t,e,1),e=Ke(),t!==null&&(so(t,1,e),st(t,e))}function we(t,e,n){if(t.tag===3)tf(t,t,n);else for(;e!==null;){if(e.tag===3){tf(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Xn===null||!Xn.has(r))){t=Oi(n,t),t=Ag(e,t,1),e=Kn(e,t,1),t=Ke(),e!==null&&(so(e,1,t),st(e,t));break}}e=e.return}}function qx(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Ke(),t.pingedLanes|=t.suspendedLanes&n,Te===t&&(je&n)===n&&(Ee===4||Ee===3&&(je&130023424)===je&&500>be()-hd?Or(t,0):dd|=n),st(t,e)}function iy(t,e){e===0&&(t.mode&1?(e=bo,bo<<=1,!(bo&130023424)&&(bo=4194304)):e=1);var n=Ke();t=vn(t,e),t!==null&&(so(t,e,n),st(t,n))}function Gx(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),iy(t,n)}function Jx(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(e),iy(t,n)}var sy;sy=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||rt.current)nt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return nt=!1,zx(t,e,n);nt=!!(t.flags&131072)}else nt=!1,he&&e.flags&1048576&&ug(e,Ea,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;na(t,e),t=e.pendingProps;var i=Mi(e,He.current);di(e,n),i=sd(null,e,r,t,i,n);var s=od();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,it(r)?(s=!0,ka(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ed(e),i.updater=rl,e.stateNode=i,i._reactInternals=e,Bu(e,r,t,n),e=$u(null,e,r,!0,s,n)):(e.tag=0,he&&s&&Yc(e),Ye(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(na(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=ew(r),t=Mt(r,t),i){case 0:e=Hu(null,e,r,t,n);break e;case 1:e=Vh(null,e,r,t,n);break e;case 11:e=$h(null,e,r,t,n);break e;case 14:e=Uh(null,e,r,Mt(r.type,t),n);break e}throw Error(N(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),Hu(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),Vh(t,e,r,i,n);case 3:e:{if(Hg(e),t===null)throw Error(N(387));r=e.pendingProps,s=e.memoizedState,i=s.element,mg(t,e),Ta(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Oi(Error(N(423)),e),e=Qh(t,e,r,n,i);break e}else if(r!==i){i=Oi(Error(N(424)),e),e=Qh(t,e,r,n,i);break e}else for(at=Yn(e.stateNode.containerInfo.firstChild),lt=e,he=!0,Ot=null,n=fg(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ti(),r===i){e=xn(t,e,n);break e}Ye(t,e,r,n)}e=e.child}return e;case 5:return gg(e),t===null&&Iu(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Ou(r,i)?o=null:s!==null&&Ou(r,s)&&(e.flags|=32),Wg(t,e),Ye(t,e,o,n),e.child;case 6:return t===null&&Iu(e),null;case 13:return $g(t,e,n);case 4:return td(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ri(e,null,r,n):Ye(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),$h(t,e,r,i,n);case 7:return Ye(t,e,e.pendingProps,n),e.child;case 8:return Ye(t,e,e.pendingProps.children,n),e.child;case 12:return Ye(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,ae(Pa,r._currentValue),r._currentValue=o,s!==null)if(It(s.value,o)){if(s.children===i.children&&!rt.current){e=xn(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=pn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Au(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(N(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Au(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ye(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,di(e,n),i=_t(i),r=r(i),e.flags|=1,Ye(t,e,r,n),e.child;case 14:return r=e.type,i=Mt(r,e.pendingProps),i=Mt(r.type,i),Uh(t,e,r,i,n);case 15:return zg(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Mt(r,i),na(t,e),e.tag=1,it(r)?(t=!0,ka(e)):t=!1,di(e,n),Fg(e,r,i),Bu(e,r,i,n),$u(null,e,r,!0,t,n);case 19:return Ug(t,e,n);case 22:return Bg(t,e,n)}throw Error(N(156,e.tag))};function oy(t,e){return jm(t,e)}function Zx(t,e,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(t,e,n,r){return new Zx(t,e,n,r)}function gd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ew(t){if(typeof t=="function")return gd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Lc)return 11;if(t===Fc)return 14}return 2}function Gn(t,e){var n=t.alternate;return n===null?(n=xt(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 sa(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")gd(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Xr:return jr(n.children,i,s,e);case Dc:o=8,i|=8;break;case cu:return t=xt(12,n,e,i|2),t.elementType=cu,t.lanes=s,t;case du:return t=xt(13,n,e,i),t.elementType=du,t.lanes=s,t;case hu:return t=xt(19,n,e,i),t.elementType=hu,t.lanes=s,t;case gm:return ol(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case pm:o=10;break e;case mm:o=9;break e;case Lc:o=11;break e;case Fc:o=14;break e;case Pn:o=16,r=null;break e}throw Error(N(130,t==null?t:typeof t,""))}return e=xt(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function jr(t,e,n,r){return t=xt(7,t,r,e),t.lanes=n,t}function ol(t,e,n,r){return t=xt(22,t,r,e),t.elementType=gm,t.lanes=n,t.stateNode={isHidden:!1},t}function $l(t,e,n){return t=xt(6,t,null,e),t.lanes=n,t}function Ul(t,e,n){return e=xt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function tw(t,e,n,r,i){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=kl(0),this.expirationTimes=kl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function yd(t,e,n,r,i,s,o,a,l){return t=new tw(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=xt(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ed(s),t}function nw(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kr,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function ay(t){if(!t)return rr;t=t._reactInternals;e:{if(Ur(t)!==t||t.tag!==1)throw Error(N(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(it(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(N(171))}if(t.tag===1){var n=t.type;if(it(n))return ag(t,n,e)}return e}function ly(t,e,n,r,i,s,o,a,l){return t=yd(n,r,!0,t,i,s,o,a,l),t.context=ay(null),n=t.current,r=Ke(),i=qn(n),s=pn(r,i),s.callback=e??null,Kn(n,s,i),t.current.lanes=i,so(t,i,r),st(t,r),t}function al(t,e,n,r){var i=e.current,s=Ke(),o=qn(i);return n=ay(n),e.context===null?e.context=n:e.pendingContext=n,e=pn(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Kn(i,e,o),t!==null&&(Ft(t,i,o,s),Zo(t,i,o)),o}function Ia(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 nf(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function vd(t,e){nf(t,e),(t=t.alternate)&&nf(t,e)}function rw(){return null}var uy=typeof reportError=="function"?reportError:function(t){console.error(t)};function xd(t){this._internalRoot=t}ll.prototype.render=xd.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(N(409));al(t,e,null,null)};ll.prototype.unmount=xd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;zr(function(){al(null,t,null,null)}),e[yn]=null}};function ll(t){this._internalRoot=t}ll.prototype.unstable_scheduleHydration=function(t){if(t){var e=Bm();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Tn.length&&e!==0&&e<Tn[n].priority;n++);Tn.splice(n,0,t),n===0&&Hm(t)}};function wd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ul(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function rf(){}function iw(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Ia(o);s.call(u)}}var o=ly(e,r,t,0,null,!1,!1,"",rf);return t._reactRootContainer=o,t[yn]=o.current,Ls(t.nodeType===8?t.parentNode:t),zr(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Ia(l);a.call(u)}}var l=yd(t,0,!1,null,null,!1,!1,"",rf);return t._reactRootContainer=l,t[yn]=l.current,Ls(t.nodeType===8?t.parentNode:t),zr(function(){al(e,l,n,r)}),l}function cl(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ia(o);a.call(l)}}al(e,o,t,i)}else o=iw(n,e,t,i,r);return Ia(o)}Am=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=ls(e.pendingLanes);n!==0&&(zc(e,n|1),st(e,be()),!(K&6)&&(ji=be()+500,lr()))}break;case 13:zr(function(){var r=vn(t,1);if(r!==null){var i=Ke();Ft(r,t,1,i)}}),vd(t,1)}};Bc=function(t){if(t.tag===13){var e=vn(t,134217728);if(e!==null){var n=Ke();Ft(e,t,134217728,n)}vd(t,134217728)}};zm=function(t){if(t.tag===13){var e=qn(t),n=vn(t,e);if(n!==null){var r=Ke();Ft(n,t,e,r)}vd(t,e)}};Bm=function(){return te};Wm=function(t,e){var n=te;try{return te=t,e()}finally{te=n}};_u=function(t,e,n){switch(e){case"input":if(mu(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 r=n[e];if(r!==t&&r.form===t.form){var i=el(r);if(!i)throw Error(N(90));vm(r),mu(r,i)}}}break;case"textarea":wm(t,n);break;case"select":e=n.value,e!=null&&ai(t,!!n.multiple,e,!1)}};Pm=fd;Mm=zr;var sw={usingClientEntryPoint:!1,Events:[ao,Zr,el,Cm,Em,fd]},Gi={findFiberByHostInstance:vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ow={bundleType:Gi.bundleType,version:Gi.version,rendererPackageName:Gi.rendererPackageName,rendererConfig:Gi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:bn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Nm(t),t===null?null:t.stateNode},findFiberByHostInstance:Gi.findFiberByHostInstance||rw,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 Oo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oo.isDisabled&&Oo.supportsFiber)try{qa=Oo.inject(ow),Jt=Oo}catch{}}ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sw;ct.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wd(e))throw Error(N(200));return nw(t,e,null,n)};ct.createRoot=function(t,e){if(!wd(t))throw Error(N(299));var n=!1,r="",i=uy;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=yd(t,1,!1,null,null,n,!1,r,i),t[yn]=e.current,Ls(t.nodeType===8?t.parentNode:t),new xd(e)};ct.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(N(188)):(t=Object.keys(t).join(","),Error(N(268,t)));return t=Nm(e),t=t===null?null:t.stateNode,t};ct.flushSync=function(t){return zr(t)};ct.hydrate=function(t,e,n){if(!ul(e))throw Error(N(200));return cl(null,t,e,!0,n)};ct.hydrateRoot=function(t,e,n){if(!wd(t))throw Error(N(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=uy;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=ly(e,null,t,1,n??null,i,!1,s,o),t[yn]=e.current,Ls(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new ll(e)};ct.render=function(t,e,n){if(!ul(e))throw Error(N(200));return cl(null,t,e,!1,n)};ct.unmountComponentAtNode=function(t){if(!ul(t))throw Error(N(40));return t._reactRootContainer?(zr(function(){cl(null,null,t,!1,function(){t._reactRootContainer=null,t[yn]=null})}),!0):!1};ct.unstable_batchedUpdates=fd;ct.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!ul(n))throw Error(N(200));if(t==null||t._reactInternals===void 0)throw Error(N(38));return cl(t,e,n,!1,r)};ct.version="18.3.1-next-f1338f8080-20240426";function cy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cy)}catch(t){console.error(t)}}cy(),cm.exports=ct;var aw=cm.exports,sf=aw;lu.createRoot=sf.createRoot,lu.hydrateRoot=sf.hydrateRoot;var uo=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(){}},lw={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Nn,Ec,$p,uw=($p=class{constructor(){z(this,Nn,lw);z(this,Ec,!1)}setTimeoutProvider(t){D(this,Nn,t)}setTimeout(t,e){return S(this,Nn).setTimeout(t,e)}clearTimeout(t){S(this,Nn).clearTimeout(t)}setInterval(t,e){return S(this,Nn).setInterval(t,e)}clearInterval(t){S(this,Nn).clearInterval(t)}},Nn=new WeakMap,Ec=new WeakMap,$p),br=new uw;function cw(t){setTimeout(t,0)}var Br=typeof window>"u"||"Deno"in globalThis;function Ze(){}function dw(t,e){return typeof t=="function"?t(e):t}function tc(t){return typeof t=="number"&&t>=0&&t!==1/0}function dy(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Jn(t,e){return typeof t=="function"?t(e):t}function gt(t,e){return typeof t=="function"?t(e):t}function of(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==bd(o,e.options))return!1}else if(!Vs(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||i&&i!==e.state.fetchStatus||s&&!s(e))}function af(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Us(e.options.mutationKey)!==Us(s))return!1}else if(!Vs(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function bd(t,e){return((e==null?void 0:e.queryKeyHashFn)||Us)(t)}function Us(t){return JSON.stringify(t,(e,n)=>rc(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Vs(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Vs(t[n],e[n])):!1}var hw=Object.prototype.hasOwnProperty;function hy(t,e){if(t===e)return t;const n=lf(t)&&lf(e);if(!n&&!(rc(t)&&rc(e)))return e;const i=(n?t:Object.keys(t)).length,s=n?e:Object.keys(e),o=s.length,a=n?new Array(o):{};let l=0;for(let u=0;u<o;u++){const c=n?u:s[u],d=t[c],h=e[c];if(d===h){a[c]=d,(n?u<i:hw.call(t,c))&&l++;continue}if(d===null||h===null||typeof d!="object"||typeof h!="object"){a[c]=h;continue}const f=hy(d,h);a[c]=f,f===d&&l++}return i===o&&l===i?t:a}function nc(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 lf(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function rc(t){if(!uf(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!uf(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function uf(t){return Object.prototype.toString.call(t)==="[object Object]"}function fw(t){return new Promise(e=>{br.setTimeout(e,t)})}function ic(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?hy(t,e):e}function pw(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function mw(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var _d=Symbol();function fy(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===_d?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function py(t,e){return typeof t=="function"?t(...e):!!t}function gw(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Sr,On,mi,Up,yw=(Up=class extends uo{constructor(){super();z(this,Sr);z(this,On);z(this,mi);D(this,mi,e=>{if(!Br&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,On)||this.setEventListener(S(this,mi))}onUnsubscribe(){var e;this.hasListeners()||((e=S(this,On))==null||e.call(this),D(this,On,void 0))}setEventListener(e){var n;D(this,mi,e),(n=S(this,On))==null||n.call(this),D(this,On,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){S(this,Sr)!==e&&(D(this,Sr,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof S(this,Sr)=="boolean"?S(this,Sr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Sr=new WeakMap,On=new WeakMap,mi=new WeakMap,Up),Sd=new yw;function sc(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var vw=cw;function xw(){let t=[],e=0,n=a=>{a()},r=a=>{a()},i=vw;const s=a=>{e?t.push(a):i(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Oe=xw(),gi,jn,yi,Vp,ww=(Vp=class extends uo{constructor(){super();z(this,gi,!0);z(this,jn);z(this,yi);D(this,yi,e=>{if(!Br&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){S(this,jn)||this.setEventListener(S(this,yi))}onUnsubscribe(){var e;this.hasListeners()||((e=S(this,jn))==null||e.call(this),D(this,jn,void 0))}setEventListener(e){var n;D(this,yi,e),(n=S(this,jn))==null||n.call(this),D(this,jn,e(this.setOnline.bind(this)))}setOnline(e){S(this,gi)!==e&&(D(this,gi,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return S(this,gi)}},gi=new WeakMap,jn=new WeakMap,yi=new WeakMap,Vp),Aa=new ww;function bw(t){return Math.min(1e3*2**t,3e4)}function my(t){return(t??"online")==="online"?Aa.isOnline():!0}var oc=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function gy(t){let e=!1,n=0,r;const i=sc(),s=()=>i.status!=="pending",o=y=>{var w;if(!s()){const m=new oc(y);h(m),(w=t.onCancel)==null||w.call(t,m)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Sd.isFocused()&&(t.networkMode==="always"||Aa.isOnline())&&t.canRun(),c=()=>my(t.networkMode)&&t.canRun(),d=y=>{s()||(r==null||r(),i.resolve(y))},h=y=>{s()||(r==null||r(),i.reject(y))},f=()=>new Promise(y=>{var w;r=m=>{(s()||u())&&y(m)},(w=t.onPause)==null||w.call(t)}).then(()=>{var y;r=void 0,s()||(y=t.onContinue)==null||y.call(t)}),v=()=>{if(s())return;let y;const w=n===0?t.initialPromise:void 0;try{y=w??t.fn()}catch(m){y=Promise.reject(m)}Promise.resolve(y).then(d).catch(m=>{var P;if(s())return;const g=t.retry??(Br?0:3),x=t.retryDelay??bw,b=typeof x=="function"?x(n,m):x,C=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,m);if(e||!C){h(m);return}n++,(P=t.onFail)==null||P.call(t,n,m),fw(b).then(()=>u()?void 0:f()).then(()=>{e?h(m):v()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?v():f().then(v),i)}}var kr,Qp,yy=(Qp=class{constructor(){z(this,kr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tc(this.gcTime)&&D(this,kr,br.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Br?1/0:5*60*1e3))}clearGcTimeout(){S(this,kr)&&(br.clearTimeout(S(this,kr)),D(this,kr,void 0))}},kr=new WeakMap,Qp),Cr,vi,mt,Er,Pe,Zs,Pr,Tt,nn,Yp,_w=(Yp=class extends yy{constructor(e){super();z(this,Tt);z(this,Cr);z(this,vi);z(this,mt);z(this,Er);z(this,Pe);z(this,Zs);z(this,Pr);D(this,Pr,!1),D(this,Zs,e.defaultOptions),this.setOptions(e.options),this.observers=[],D(this,Er,e.client),D(this,mt,S(this,Er).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,D(this,Cr,df(this.options)),this.state=e.state??S(this,Cr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=S(this,Pe))==null?void 0:e.promise}setOptions(e){if(this.options={...S(this,Zs),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=df(this.options);n.data!==void 0&&(this.setState(cf(n.data,n.dataUpdatedAt)),D(this,Cr,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,mt).remove(this)}setData(e,n){const r=ic(this.state.data,e,this.options);return V(this,Tt,nn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){V(this,Tt,nn).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=S(this,Pe))==null?void 0:r.promise;return(i=S(this,Pe))==null||i.cancel(e),n?n.then(Ze).catch(Ze):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,Cr))}isActive(){return this.observers.some(e=>gt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_d||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Jn(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:!dy(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=S(this,Pe))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=S(this,Pe))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),S(this,mt).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,Pe)&&(S(this,Pr)?S(this,Pe).cancel({revert:!0}):S(this,Pe).cancelRetry()),this.scheduleGc()),S(this,mt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||V(this,Tt,nn).call(this,{type:"invalidate"})}async fetch(e,n){var l,u,c,d,h,f,v,y,w,m,g,x;if(this.state.fetchStatus!=="idle"&&((l=S(this,Pe))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,Pe))return S(this,Pe).continueRetry(),S(this,Pe).promise}if(e&&this.setOptions(e),!this.options.queryFn){const b=this.observers.find(C=>C.options.queryFn);b&&this.setOptions(b.options)}const r=new AbortController,i=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(D(this,Pr,!0),r.signal)})},s=()=>{const b=fy(this.options,n),P=(()=>{const _={client:S(this,Er),queryKey:this.queryKey,meta:this.meta};return i(_),_})();return D(this,Pr,!1),this.options.persister?this.options.persister(b,P,this):b(P)},a=(()=>{const b={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,Er),state:this.state,fetchFn:s};return i(b),b})();(u=this.options.behavior)==null||u.onFetch(a,this),D(this,vi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&V(this,Tt,nn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),D(this,Pe,gy({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof oc&&b.revert&&this.setState({...S(this,vi),fetchStatus:"idle"}),r.abort()},onFail:(b,C)=>{V(this,Tt,nn).call(this,{type:"failed",failureCount:b,error:C})},onPause:()=>{V(this,Tt,nn).call(this,{type:"pause"})},onContinue:()=>{V(this,Tt,nn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await S(this,Pe).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(f=(h=S(this,mt).config).onSuccess)==null||f.call(h,b,this),(y=(v=S(this,mt).config).onSettled)==null||y.call(v,b,this.state.error,this),b}catch(b){if(b instanceof oc){if(b.silent)return S(this,Pe).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw V(this,Tt,nn).call(this,{type:"error",error:b}),(m=(w=S(this,mt).config).onError)==null||m.call(w,b,this),(x=(g=S(this,mt).config).onSettled)==null||x.call(g,this.state.data,b,this),b}finally{this.scheduleGc()}}},Cr=new WeakMap,vi=new WeakMap,mt=new WeakMap,Er=new WeakMap,Pe=new WeakMap,Zs=new WeakMap,Pr=new WeakMap,Tt=new WeakSet,nn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...vy(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...cf(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return D(this,vi,e.manual?i:void 0),i;case"error":const s=e.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),Oe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,mt).notify({query:this,type:"updated",action:e})})},Yp);function vy(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:my(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function cf(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function df(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Je,Q,eo,Ve,Mr,xi,un,Dn,to,wi,bi,Tr,Rr,Ln,_i,G,cs,ac,lc,uc,cc,dc,hc,fc,xy,Kp,Sw=(Kp=class extends uo{constructor(e,n){super();z(this,G);z(this,Je);z(this,Q);z(this,eo);z(this,Ve);z(this,Mr);z(this,xi);z(this,un);z(this,Dn);z(this,to);z(this,wi);z(this,bi);z(this,Tr);z(this,Rr);z(this,Ln);z(this,_i,new Set);this.options=n,D(this,Je,e),D(this,Dn,null),D(this,un,sc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,Q).addObserver(this),hf(S(this,Q),this.options)?V(this,G,cs).call(this):this.updateResult(),V(this,G,cc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pc(S(this,Q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pc(S(this,Q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,V(this,G,dc).call(this),V(this,G,hc).call(this),S(this,Q).removeObserver(this)}setOptions(e){const n=this.options,r=S(this,Q);if(this.options=S(this,Je).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gt(this.options.enabled,S(this,Q))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");V(this,G,fc).call(this),S(this,Q).setOptions(this.options),n._defaulted&&!nc(this.options,n)&&S(this,Je).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,Q),observer:this});const i=this.hasListeners();i&&ff(S(this,Q),r,this.options,n)&&V(this,G,cs).call(this),this.updateResult(),i&&(S(this,Q)!==r||gt(this.options.enabled,S(this,Q))!==gt(n.enabled,S(this,Q))||Jn(this.options.staleTime,S(this,Q))!==Jn(n.staleTime,S(this,Q)))&&V(this,G,ac).call(this);const s=V(this,G,lc).call(this);i&&(S(this,Q)!==r||gt(this.options.enabled,S(this,Q))!==gt(n.enabled,S(this,Q))||s!==S(this,Ln))&&V(this,G,uc).call(this,s)}getOptimisticResult(e){const n=S(this,Je).getQueryCache().build(S(this,Je),e),r=this.createResult(n,e);return Cw(this,r)&&(D(this,Ve,r),D(this,xi,this.options),D(this,Mr,S(this,Q).state)),r}getCurrentResult(){return S(this,Ve)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&S(this,un).status==="pending"&&S(this,un).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){S(this,_i).add(e)}getCurrentQuery(){return S(this,Q)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=S(this,Je).defaultQueryOptions(e),r=S(this,Je).getQueryCache().build(S(this,Je),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return V(this,G,cs).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,Ve)))}createResult(e,n){var O;const r=S(this,Q),i=this.options,s=S(this,Ve),o=S(this,Mr),a=S(this,xi),u=e!==r?e.state:S(this,eo),{state:c}=e;let d={...c},h=!1,f;if(n._optimisticResults){const M=this.hasListeners(),T=!M&&hf(e,n),I=M&&ff(e,r,n,i);(T||I)&&(d={...d,...vy(c.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:w}=d;f=d.data;let m=!1;if(n.placeholderData!==void 0&&f===void 0&&w==="pending"){let M;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(M=s.data,m=!0):M=typeof n.placeholderData=="function"?n.placeholderData((O=S(this,bi))==null?void 0:O.state.data,S(this,bi)):n.placeholderData,M!==void 0&&(w="success",f=ic(s==null?void 0:s.data,M,n),h=!0)}if(n.select&&f!==void 0&&!m)if(s&&f===(o==null?void 0:o.data)&&n.select===S(this,to))f=S(this,wi);else try{D(this,to,n.select),f=n.select(f),f=ic(s==null?void 0:s.data,f,n),D(this,wi,f),D(this,Dn,null)}catch(M){D(this,Dn,M)}S(this,Dn)&&(v=S(this,Dn),f=S(this,wi),y=Date.now(),w="error");const g=d.fetchStatus==="fetching",x=w==="pending",b=w==="error",C=x&&g,P=f!==void 0,E={status:w,fetchStatus:d.fetchStatus,isPending:x,isSuccess:w==="success",isError:b,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!x,isLoadingError:b&&!P,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:b&&P,isStale:kd(e,n),refetch:this.refetch,promise:S(this,un),isEnabled:gt(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const M=W=>{E.status==="error"?W.reject(E.error):E.data!==void 0&&W.resolve(E.data)},T=()=>{const W=D(this,un,E.promise=sc());M(W)},I=S(this,un);switch(I.status){case"pending":e.queryHash===r.queryHash&&M(I);break;case"fulfilled":(E.status==="error"||E.data!==I.value)&&T();break;case"rejected":(E.status!=="error"||E.error!==I.reason)&&T();break}}return E}updateResult(){const e=S(this,Ve),n=this.createResult(S(this,Q),this.options);if(D(this,Mr,S(this,Q).state),D(this,xi,this.options),S(this,Mr).data!==void 0&&D(this,bi,S(this,Q)),nc(n,e))return;D(this,Ve,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!S(this,_i).size)return!0;const o=new Set(s??S(this,_i));return this.options.throwOnError&&o.add("error"),Object.keys(S(this,Ve)).some(a=>{const l=a;return S(this,Ve)[l]!==e[l]&&o.has(l)})};V(this,G,xy).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&V(this,G,cc).call(this)}},Je=new WeakMap,Q=new WeakMap,eo=new WeakMap,Ve=new WeakMap,Mr=new WeakMap,xi=new WeakMap,un=new WeakMap,Dn=new WeakMap,to=new WeakMap,wi=new WeakMap,bi=new WeakMap,Tr=new WeakMap,Rr=new WeakMap,Ln=new WeakMap,_i=new WeakMap,G=new WeakSet,cs=function(e){V(this,G,fc).call(this);let n=S(this,Q).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Ze)),n},ac=function(){V(this,G,dc).call(this);const e=Jn(this.options.staleTime,S(this,Q));if(Br||S(this,Ve).isStale||!tc(e))return;const r=dy(S(this,Ve).dataUpdatedAt,e)+1;D(this,Tr,br.setTimeout(()=>{S(this,Ve).isStale||this.updateResult()},r))},lc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,Q)):this.options.refetchInterval)??!1},uc=function(e){V(this,G,hc).call(this),D(this,Ln,e),!(Br||gt(this.options.enabled,S(this,Q))===!1||!tc(S(this,Ln))||S(this,Ln)===0)&&D(this,Rr,br.setInterval(()=>{(this.options.refetchIntervalInBackground||Sd.isFocused())&&V(this,G,cs).call(this)},S(this,Ln)))},cc=function(){V(this,G,ac).call(this),V(this,G,uc).call(this,V(this,G,lc).call(this))},dc=function(){S(this,Tr)&&(br.clearTimeout(S(this,Tr)),D(this,Tr,void 0))},hc=function(){S(this,Rr)&&(br.clearInterval(S(this,Rr)),D(this,Rr,void 0))},fc=function(){const e=S(this,Je).getQueryCache().build(S(this,Je),this.options);if(e===S(this,Q))return;const n=S(this,Q);D(this,Q,e),D(this,eo,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},xy=function(e){Oe.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(S(this,Ve))}),S(this,Je).getQueryCache().notify({query:S(this,Q),type:"observerResultsUpdated"})})},Kp);function kw(t,e){return gt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function hf(t,e){return kw(t,e)||t.state.data!==void 0&&pc(t,e,e.refetchOnMount)}function pc(t,e,n){if(gt(e.enabled,t)!==!1&&Jn(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&kd(t,e)}return!1}function ff(t,e,n,r){return(t!==e||gt(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&kd(t,n)}function kd(t,e){return gt(e.enabled,t)!==!1&&t.isStaleByTime(Jn(e.staleTime,t))}function Cw(t,e){return!nc(t.getCurrentResult(),e)}function pf(t){return{onFetch:(e,n)=>{var c,d,h,f,v;const r=e.options,i=(h=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,s=((f=e.state.data)==null?void 0:f.pages)||[],o=((v=e.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const w=x=>{gw(x,()=>e.signal,()=>y=!0)},m=fy(e.options,e.fetchOptions),g=async(x,b,C)=>{if(y)return Promise.reject();if(b==null&&x.pages.length)return Promise.resolve(x);const _=(()=>{const T={client:e.client,queryKey:e.queryKey,pageParam:b,direction:C?"backward":"forward",meta:e.options.meta};return w(T),T})(),E=await m(_),{maxPages:O}=e.options,M=C?mw:pw;return{pages:M(x.pages,E,O),pageParams:M(x.pageParams,b,O)}};if(i&&s.length){const x=i==="backward",b=x?Ew:mf,C={pages:s,pageParams:o},P=b(r,C);a=await g(C,P,x)}else{const x=t??s.length;do{const b=l===0?o[0]??r.initialPageParam:mf(r,a);if(l>0&&b==null)break;a=await g(a,b),l++}while(l<x)}return a};e.options.persister?e.fetchFn=()=>{var y,w;return(w=(y=e.options).persister)==null?void 0:w.call(y,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function mf(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function Ew(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var no,Kt,Qe,Nr,Xt,En,Xp,Pw=(Xp=class extends yy{constructor(e){super();z(this,Xt);z(this,no);z(this,Kt);z(this,Qe);z(this,Nr);D(this,no,e.client),this.mutationId=e.mutationId,D(this,Qe,e.mutationCache),D(this,Kt,[]),this.state=e.state||Mw(),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,Kt).includes(e)||(S(this,Kt).push(e),this.clearGcTimeout(),S(this,Qe).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){D(this,Kt,S(this,Kt).filter(n=>n!==e)),this.scheduleGc(),S(this,Qe).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){S(this,Kt).length||(this.state.status==="pending"?this.scheduleGc():S(this,Qe).remove(this))}continue(){var e;return((e=S(this,Nr))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,c,d,h,f,v,y,w,m,g,x,b,C,P,_,E,O;const n=()=>{V(this,Xt,En).call(this,{type:"continue"})},r={client:S(this,no),meta:this.options.meta,mutationKey:this.options.mutationKey};D(this,Nr,gy({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,T)=>{V(this,Xt,En).call(this,{type:"failed",failureCount:M,error:T})},onPause:()=>{V(this,Xt,En).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,Qe).canRun(this)}));const i=this.state.status==="pending",s=!S(this,Nr).canStart();try{if(i)n();else{V(this,Xt,En).call(this,{type:"pending",variables:e,isPaused:s}),await((a=(o=S(this,Qe).config).onMutate)==null?void 0:a.call(o,e,this,r));const T=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));T!==this.state.context&&V(this,Xt,En).call(this,{type:"pending",context:T,variables:e,isPaused:s})}const M=await S(this,Nr).start();return await((d=(c=S(this,Qe).config).onSuccess)==null?void 0:d.call(c,M,e,this.state.context,this,r)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,M,e,this.state.context,r)),await((y=(v=S(this,Qe).config).onSettled)==null?void 0:y.call(v,M,null,this.state.variables,this.state.context,this,r)),await((m=(w=this.options).onSettled)==null?void 0:m.call(w,M,null,e,this.state.context,r)),V(this,Xt,En).call(this,{type:"success",data:M}),M}catch(M){try{await((x=(g=S(this,Qe).config).onError)==null?void 0:x.call(g,M,e,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((C=(b=this.options).onError)==null?void 0:C.call(b,M,e,this.state.context,r))}catch(T){Promise.reject(T)}try{await((_=(P=S(this,Qe).config).onSettled)==null?void 0:_.call(P,void 0,M,this.state.variables,this.state.context,this,r))}catch(T){Promise.reject(T)}try{await((O=(E=this.options).onSettled)==null?void 0:O.call(E,void 0,M,e,this.state.context,r))}catch(T){Promise.reject(T)}throw V(this,Xt,En).call(this,{type:"error",error:M}),M}finally{S(this,Qe).runNext(this)}}},no=new WeakMap,Kt=new WeakMap,Qe=new WeakMap,Nr=new WeakMap,Xt=new WeakSet,En=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,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{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Oe.batch(()=>{S(this,Kt).forEach(r=>{r.onMutationUpdate(e)}),S(this,Qe).notify({mutation:this,type:"updated",action:e})})},Xp);function Mw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cn,Rt,ro,qp,Tw=(qp=class extends uo{constructor(e={}){super();z(this,cn);z(this,Rt);z(this,ro);this.config=e,D(this,cn,new Set),D(this,Rt,new Map),D(this,ro,0)}build(e,n,r){const i=new Pw({client:e,mutationCache:this,mutationId:++mo(this,ro)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){S(this,cn).add(e);const n=jo(e);if(typeof n=="string"){const r=S(this,Rt).get(n);r?r.push(e):S(this,Rt).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(S(this,cn).delete(e)){const n=jo(e);if(typeof n=="string"){const r=S(this,Rt).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&S(this,Rt).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=jo(e);if(typeof n=="string"){const r=S(this,Rt).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=jo(e);if(typeof n=="string"){const i=(r=S(this,Rt).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Oe.batch(()=>{S(this,cn).forEach(e=>{this.notify({type:"removed",mutation:e})}),S(this,cn).clear(),S(this,Rt).clear()})}getAll(){return Array.from(S(this,cn))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>af(n,r))}findAll(e={}){return this.getAll().filter(n=>af(e,n))}notify(e){Oe.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Oe.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ze))))}},cn=new WeakMap,Rt=new WeakMap,ro=new WeakMap,qp);function jo(t){var e;return(e=t.options.scope)==null?void 0:e.id}var qt,Gp,Rw=(Gp=class extends uo{constructor(e={}){super();z(this,qt);this.config=e,D(this,qt,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??bd(i,n);let o=this.get(s);return o||(o=new _w({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){S(this,qt).has(e.queryHash)||(S(this,qt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=S(this,qt).get(e.queryHash);n&&(e.destroy(),n===e&&S(this,qt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Oe.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return S(this,qt).get(e)}getAll(){return[...S(this,qt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>of(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>of(e,r)):n}notify(e){Oe.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Oe.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Oe.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qt=new WeakMap,Gp),xe,Fn,In,Si,ki,An,Ci,Ei,Jp,Nw=(Jp=class{constructor(t={}){z(this,xe);z(this,Fn);z(this,In);z(this,Si);z(this,ki);z(this,An);z(this,Ci);z(this,Ei);D(this,xe,t.queryCache||new Rw),D(this,Fn,t.mutationCache||new Tw),D(this,In,t.defaultOptions||{}),D(this,Si,new Map),D(this,ki,new Map),D(this,An,0)}mount(){mo(this,An)._++,S(this,An)===1&&(D(this,Ci,Sd.subscribe(async t=>{t&&(await this.resumePausedMutations(),S(this,xe).onFocus())})),D(this,Ei,Aa.subscribe(async t=>{t&&(await this.resumePausedMutations(),S(this,xe).onOnline())})))}unmount(){var t,e;mo(this,An)._--,S(this,An)===0&&((t=S(this,Ci))==null||t.call(this),D(this,Ci,void 0),(e=S(this,Ei))==null||e.call(this),D(this,Ei,void 0))}isFetching(t){return S(this,xe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return S(this,Fn).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=S(this,xe).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=S(this,xe).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Jn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return S(this,xe).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=S(this,xe).get(r.queryHash),s=i==null?void 0:i.state.data,o=dw(e,s);if(o!==void 0)return S(this,xe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Oe.batch(()=>S(this,xe).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=S(this,xe).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=S(this,xe);Oe.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=S(this,xe);return Oe.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Oe.batch(()=>S(this,xe).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Ze).catch(Ze)}invalidateQueries(t,e={}){return Oe.batch(()=>(S(this,xe).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},r=Oe.batch(()=>S(this,xe).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ze)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ze)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=S(this,xe).build(this,e);return n.isStaleByTime(Jn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ze).catch(Ze)}fetchInfiniteQuery(t){return t.behavior=pf(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ze).catch(Ze)}ensureInfiniteQueryData(t){return t.behavior=pf(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Aa.isOnline()?S(this,Fn).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,xe)}getMutationCache(){return S(this,Fn)}getDefaultOptions(){return S(this,In)}setDefaultOptions(t){D(this,In,t)}setQueryDefaults(t,e){S(this,Si).set(Us(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...S(this,Si).values()],n={};return e.forEach(r=>{Vs(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){S(this,ki).set(Us(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...S(this,ki).values()],n={};return e.forEach(r=>{Vs(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...S(this,In).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=bd(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===_d&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...S(this,In).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){S(this,xe).clear(),S(this,Fn).clear()}},xe=new WeakMap,Fn=new WeakMap,In=new WeakMap,Si=new WeakMap,ki=new WeakMap,An=new WeakMap,Ci=new WeakMap,Ei=new WeakMap,Jp),wy=k.createContext(void 0),Ow=t=>{const e=k.useContext(wy);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},jw=({client:t,children:e})=>(k.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),p.jsx(wy.Provider,{value:t,children:e})),by=k.createContext(!1),Dw=()=>k.useContext(by);by.Provider;function Lw(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Fw=k.createContext(Lw()),Iw=()=>k.useContext(Fw),Aw=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?py(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},zw=t=>{k.useEffect(()=>{t.clearReset()},[t])},Bw=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||py(n,[t.error,r])),Ww=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Hw=(t,e)=>t.isLoading&&t.isFetching&&!e,$w=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,gf=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Uw(t,e,n){var h,f,v,y;const r=Dw(),i=Iw(),s=Ow(),o=s.defaultQueryOptions(t);(f=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,o);const a=s.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",Ww(o),Aw(o,i,a),zw(i);const l=!s.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new e(s,o)),c=u.getOptimisticResult(o),d=!r&&t.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(w=>{const m=d?u.subscribe(Oe.batchCalls(w)):Ze;return u.updateResult(),m},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),$w(o,c))throw gf(o,u,i);if(Bw({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw c.error;if((y=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||y.call(v,o,c),o.experimental_prefetchInRender&&!Br&&Hw(c,r)){const w=l?gf(o,u,i):a==null?void 0:a.promise;w==null||w.catch(Ze).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?c:u.trackResult(c)}function Cd(t,e){return Uw(t,Sw)}/**
41
41
  * react-router v7.11.0
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,24 +46,24 @@ Error generating stack: `+s.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */var yf="popstate";function Vw(t={}){function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return mc("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Qs(i)}return Yw(e,n,null,t)}function fe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function kt(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Qw(){return Math.random().toString(36).substring(2,10)}function vf(t,e){return{usr:t.state,key:t.key,idx:e}}function mc(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?zi(e):e,state:n,key:e&&e.key||r||Qw()}}function Qs({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 zi(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function Yw(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a="POP",l=null,u=c();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function c(){return(o.state||{idx:null}).idx}function d(){a="POP";let w=c(),m=w==null?null:w-u;u=w,l&&l({action:a,location:v.location,delta:m})}function h(w,m){a="PUSH";let y=mc(v.location,w,m);u=c()+1;let p=vf(y,u),b=v.createHref(y);try{o.pushState(p,"",b)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(b)}s&&l&&l({action:a,location:v.location,delta:1})}function f(w,m){a="REPLACE";let y=mc(v.location,w,m);u=c();let p=vf(y,u),b=v.createHref(y);o.replaceState(p,"",b),s&&l&&l({action:a,location:v.location,delta:0})}function x(w){return Kw(w)}let v={get action(){return a},get location(){return t(i,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(yf,d),l=w,()=>{i.removeEventListener(yf,d),l=null}},createHref(w){return e(i,w)},createURL:x,encodeLocation(w){let m=x(w);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:f,go(w){return o.go(w)}};return v}function Kw(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),fe(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Qs(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function _y(t,e,n="/"){return Xw(t,e,n,!1)}function Xw(t,e,n,r){let i=typeof e=="string"?zi(e):e,s=wn(i.pathname||"/",n);if(s==null)return null;let o=Sy(t);qw(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=ab(s);a=sb(o[l],u,r)}return a}function Sy(t,e=[],n=[],r="",i=!1){let s=(o,a,l=i,u)=>{let c={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(r)&&l)return;fe(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let d=mn([r,c.relativePath]),h=n.concat(c);o.children&&o.children.length>0&&(fe(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Sy(o.children,e,h,d,l)),!(o.path==null&&!o.index)&&e.push({path:d,score:rb(d,o.index),routesMeta:h})};return t.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,a);else for(let u of ky(o.path))s(o,a,!0,u)}),e}function ky(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=ky(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function qw(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:ib(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Gw=/^:[\w-]+$/,Jw=3,Zw=2,eb=1,tb=10,nb=-2,xf=t=>t==="*";function rb(t,e){let n=t.split("/"),r=n.length;return n.some(xf)&&(r+=nb),e&&(r+=Zw),n.filter(i=>!xf(i)).reduce((i,s)=>i+(Gw.test(s)?Jw:s===""?eb:tb),r)}function ib(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function sb(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,c=s==="/"?e:e.slice(s.length)||"/",d=za({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),h=l.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=za({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:mn([s,d.pathname]),pathnameBase:db(mn([s,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(s=mn([s,d.pathnameBase]))}return o}function za(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=ob(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,{paramName:c,isOptional:d},h)=>{if(c==="*"){let x=a[h]||"";o=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const f=a[h];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:t}}function ob(t,e=!1,n=!0){kt(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 r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function ab(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return kt(!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 wn(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var Cy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lb=t=>Cy.test(t);function ub(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?zi(t):t,s;if(n)if(lb(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),kt(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${n}`)}n.startsWith("/")?s=wf(n.substring(1),"/"):s=wf(n,e)}else s=e;return{pathname:s,search:hb(r),hash:fb(i)}}function wf(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vl(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function cb(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Ed(t){let e=cb(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Pd(t,e,n,r=!1){let i;typeof t=="string"?i=zi(t):(i={...t},fe(!i.pathname||!i.pathname.includes("?"),Vl("?","pathname","search",i)),fe(!i.pathname||!i.pathname.includes("#"),Vl("#","pathname","hash",i)),fe(!i.search||!i.search.includes("#"),Vl("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=ub(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var mn=t=>t.join("/").replace(/\/\/+/g,"/"),db=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),hb=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,fb=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,pb=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function mb(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function gb(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ey=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Py(t,e){let n=t;if(typeof n!="string"||!Cy.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ey)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),a=wn(o.pathname,e);o.origin===s.origin&&a!=null?n=a+o.search+o.hash:i=!0}catch{kt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var My=["POST","PUT","PATCH","DELETE"];new Set(My);var yb=["GET",...My];new Set(yb);var Bi=S.createContext(null);Bi.displayName="DataRouter";var dl=S.createContext(null);dl.displayName="DataRouterState";var vb=S.createContext(!1),Ry=S.createContext({isTransitioning:!1});Ry.displayName="ViewTransition";var xb=S.createContext(new Map);xb.displayName="Fetchers";var wb=S.createContext(null);wb.displayName="Await";var ht=S.createContext(null);ht.displayName="Navigation";var co=S.createContext(null);co.displayName="Location";var At=S.createContext({outlet:null,matches:[],isDataRoute:!1});At.displayName="Route";var Md=S.createContext(null);Md.displayName="RouteError";var Ty="REACT_ROUTER_ERROR",bb="REDIRECT",_b="ROUTE_ERROR_RESPONSE";function Sb(t){if(t.startsWith(`${Ty}:${bb}:{`))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 kb(t){if(t.startsWith(`${Ty}:${_b}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new pb(e.status,e.statusText,e.data)}catch{}}function Cb(t,{relative:e}={}){fe(Wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=S.useContext(ht),{hash:i,pathname:s,search:o}=ho(t,{relative:e}),a=s;return n!=="/"&&(a=s==="/"?n:mn([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Wi(){return S.useContext(co)!=null}function _n(){return fe(Wi(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(co).location}var Oy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ny(t){S.useContext(ht).static||S.useLayoutEffect(t)}function Rd(){let{isDataRoute:t}=S.useContext(At);return t?zb():Eb()}function Eb(){fe(Wi(),"useNavigate() may be used only in the context of a <Router> component.");let t=S.useContext(Bi),{basename:e,navigator:n}=S.useContext(ht),{matches:r}=S.useContext(At),{pathname:i}=_n(),s=JSON.stringify(Ed(r)),o=S.useRef(!1);return Ny(()=>{o.current=!0}),S.useCallback((l,u={})=>{if(kt(o.current,Oy),!o.current)return;if(typeof l=="number"){n.go(l);return}let c=Pd(l,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(c.pathname=c.pathname==="/"?e:mn([e,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[e,n,s,i,t])}S.createContext(null);function Pb(){let{matches:t}=S.useContext(At),e=t[t.length-1];return e?e.params:{}}function ho(t,{relative:e}={}){let{matches:n}=S.useContext(At),{pathname:r}=_n(),i=JSON.stringify(Ed(n));return S.useMemo(()=>Pd(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function Mb(t,e){return jy(t,e)}function jy(t,e,n,r,i){var y;fe(Wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=S.useContext(ht),{matches:o}=S.useContext(At),a=o[o.length-1],l=a?a.params:{},u=a?a.pathname:"/",c=a?a.pathnameBase:"/",d=a&&a.route;{let p=d&&d.path||"";Ly(u,!d||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${p}">) 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.
49
+ */var yf="popstate";function Vw(t={}){function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return mc("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Qs(i)}return Yw(e,n,null,t)}function fe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function kt(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Qw(){return Math.random().toString(36).substring(2,10)}function vf(t,e){return{usr:t.state,key:t.key,idx:e}}function mc(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?zi(e):e,state:n,key:e&&e.key||r||Qw()}}function Qs({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 zi(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function Yw(t,e,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a="POP",l=null,u=c();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function c(){return(o.state||{idx:null}).idx}function d(){a="POP";let w=c(),m=w==null?null:w-u;u=w,l&&l({action:a,location:y.location,delta:m})}function h(w,m){a="PUSH";let g=mc(y.location,w,m);u=c()+1;let x=vf(g,u),b=y.createHref(g);try{o.pushState(x,"",b)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(b)}s&&l&&l({action:a,location:y.location,delta:1})}function f(w,m){a="REPLACE";let g=mc(y.location,w,m);u=c();let x=vf(g,u),b=y.createHref(g);o.replaceState(x,"",b),s&&l&&l({action:a,location:y.location,delta:0})}function v(w){return Kw(w)}let y={get action(){return a},get location(){return t(i,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(yf,d),l=w,()=>{i.removeEventListener(yf,d),l=null}},createHref(w){return e(i,w)},createURL:v,encodeLocation(w){let m=v(w);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:f,go(w){return o.go(w)}};return y}function Kw(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),fe(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Qs(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function _y(t,e,n="/"){return Xw(t,e,n,!1)}function Xw(t,e,n,r){let i=typeof e=="string"?zi(e):e,s=wn(i.pathname||"/",n);if(s==null)return null;let o=Sy(t);qw(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=ab(s);a=sb(o[l],u,r)}return a}function Sy(t,e=[],n=[],r="",i=!1){let s=(o,a,l=i,u)=>{let c={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(r)&&l)return;fe(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let d=mn([r,c.relativePath]),h=n.concat(c);o.children&&o.children.length>0&&(fe(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Sy(o.children,e,h,d,l)),!(o.path==null&&!o.index)&&e.push({path:d,score:rb(d,o.index),routesMeta:h})};return t.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,a);else for(let u of ky(o.path))s(o,a,!0,u)}),e}function ky(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=ky(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function qw(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:ib(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Gw=/^:[\w-]+$/,Jw=3,Zw=2,eb=1,tb=10,nb=-2,xf=t=>t==="*";function rb(t,e){let n=t.split("/"),r=n.length;return n.some(xf)&&(r+=nb),e&&(r+=Zw),n.filter(i=>!xf(i)).reduce((i,s)=>i+(Gw.test(s)?Jw:s===""?eb:tb),r)}function ib(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function sb(t,e,n=!1){let{routesMeta:r}=t,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,c=s==="/"?e:e.slice(s.length)||"/",d=za({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),h=l.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=za({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:mn([s,d.pathname]),pathnameBase:db(mn([s,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(s=mn([s,d.pathnameBase]))}return o}function za(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=ob(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,{paramName:c,isOptional:d},h)=>{if(c==="*"){let v=a[h]||"";o=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const f=a[h];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:t}}function ob(t,e=!1,n=!0){kt(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 r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function ab(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return kt(!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 wn(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}var Cy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lb=t=>Cy.test(t);function ub(t,e="/"){let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?zi(t):t,s;if(n)if(lb(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),kt(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${n}`)}n.startsWith("/")?s=wf(n.substring(1),"/"):s=wf(n,e)}else s=e;return{pathname:s,search:hb(r),hash:fb(i)}}function wf(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Vl(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function cb(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Ed(t){let e=cb(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Pd(t,e,n,r=!1){let i;typeof t=="string"?i=zi(t):(i={...t},fe(!i.pathname||!i.pathname.includes("?"),Vl("?","pathname","search",i)),fe(!i.pathname||!i.pathname.includes("#"),Vl("#","pathname","hash",i)),fe(!i.search||!i.search.includes("#"),Vl("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=ub(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}var mn=t=>t.join("/").replace(/\/\/+/g,"/"),db=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),hb=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,fb=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,pb=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function mb(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function gb(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ey=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Py(t,e){let n=t;if(typeof n!="string"||!Cy.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ey)try{let s=new URL(window.location.href),o=n.startsWith("//")?new URL(s.protocol+n):new URL(n),a=wn(o.pathname,e);o.origin===s.origin&&a!=null?n=a+o.search+o.hash:i=!0}catch{kt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var My=["POST","PUT","PATCH","DELETE"];new Set(My);var yb=["GET",...My];new Set(yb);var Bi=k.createContext(null);Bi.displayName="DataRouter";var dl=k.createContext(null);dl.displayName="DataRouterState";var vb=k.createContext(!1),Ty=k.createContext({isTransitioning:!1});Ty.displayName="ViewTransition";var xb=k.createContext(new Map);xb.displayName="Fetchers";var wb=k.createContext(null);wb.displayName="Await";var ht=k.createContext(null);ht.displayName="Navigation";var co=k.createContext(null);co.displayName="Location";var At=k.createContext({outlet:null,matches:[],isDataRoute:!1});At.displayName="Route";var Md=k.createContext(null);Md.displayName="RouteError";var Ry="REACT_ROUTER_ERROR",bb="REDIRECT",_b="ROUTE_ERROR_RESPONSE";function Sb(t){if(t.startsWith(`${Ry}:${bb}:{`))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 kb(t){if(t.startsWith(`${Ry}:${_b}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new pb(e.status,e.statusText,e.data)}catch{}}function Cb(t,{relative:e}={}){fe(Wi(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=k.useContext(ht),{hash:i,pathname:s,search:o}=ho(t,{relative:e}),a=s;return n!=="/"&&(a=s==="/"?n:mn([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Wi(){return k.useContext(co)!=null}function _n(){return fe(Wi(),"useLocation() may be used only in the context of a <Router> component."),k.useContext(co).location}var Ny="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Oy(t){k.useContext(ht).static||k.useLayoutEffect(t)}function Td(){let{isDataRoute:t}=k.useContext(At);return t?zb():Eb()}function Eb(){fe(Wi(),"useNavigate() may be used only in the context of a <Router> component.");let t=k.useContext(Bi),{basename:e,navigator:n}=k.useContext(ht),{matches:r}=k.useContext(At),{pathname:i}=_n(),s=JSON.stringify(Ed(r)),o=k.useRef(!1);return Oy(()=>{o.current=!0}),k.useCallback((l,u={})=>{if(kt(o.current,Ny),!o.current)return;if(typeof l=="number"){n.go(l);return}let c=Pd(l,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(c.pathname=c.pathname==="/"?e:mn([e,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[e,n,s,i,t])}k.createContext(null);function Pb(){let{matches:t}=k.useContext(At),e=t[t.length-1];return e?e.params:{}}function ho(t,{relative:e}={}){let{matches:n}=k.useContext(At),{pathname:r}=_n(),i=JSON.stringify(Ed(n));return k.useMemo(()=>Pd(t,JSON.parse(i),r,e==="path"),[t,i,r,e])}function Mb(t,e){return jy(t,e)}function jy(t,e,n,r,i){var g;fe(Wi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=k.useContext(ht),{matches:o}=k.useContext(At),a=o[o.length-1],l=a?a.params:{},u=a?a.pathname:"/",c=a?a.pathnameBase:"/",d=a&&a.route;{let x=d&&d.path||"";Ly(u,!d||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${x}">) 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
50
 
51
- Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let h=_n(),f;if(e){let p=typeof e=="string"?zi(e):e;fe(c==="/"||((y=p.pathname)==null?void 0:y.startsWith(c)),`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 "${c}" but pathname "${p.pathname}" was given in the \`location\` prop.`),f=p}else f=h;let x=f.pathname||"/",v=x;if(c!=="/"){let p=c.replace(/^\//,"").split("/");v="/"+x.replace(/^\//,"").split("/").slice(p.length).join("/")}let w=_y(t,{pathname:v});kt(d||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),kt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 m=jb(w&&w.map(p=>Object.assign({},p,{params:Object.assign({},l,p.params),pathname:mn([c,s.encodeLocation?s.encodeLocation(p.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?c:mn([c,s.encodeLocation?s.encodeLocation(p.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),o,n,r,i);return e&&m?S.createElement(co.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},m):m}function Rb(){let t=Ab(),e=mb(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:s},"ErrorBoundary")," or"," ",S.createElement("code",{style:s},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},e),n?S.createElement("pre",{style:i},n):null,o)}var Tb=S.createElement(Rb,null),Dy=class extends S.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=kb(t.digest);n&&(t=n)}let e=t!==void 0?S.createElement(At.Provider,{value:this.props.routeContext},S.createElement(Md.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?S.createElement(Ob,{error:t},e):e}};Dy.contextType=vb;var Ql=new WeakMap;function Ob({children:t,error:e}){let{basename:n}=S.useContext(ht);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=Sb(e.digest);if(r){let i=Ql.get(e);if(i)throw i;let s=Py(r.location,n);if(Ey&&!Ql.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Ql.set(e,o),o}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function Nb({routeContext:t,match:e,children:n}){let r=S.useContext(Bi);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),S.createElement(At.Provider,{value:t},n)}function jb(t,e=[],n=null,r=null,i=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 s=t,o=n==null?void 0:n.errors;if(o!=null){let c=s.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);fe(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,c+1))}let a=!1,l=-1;if(n)for(let c=0;c<s.length;c++){let d=s[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:h,errors:f}=n,x=d.route.loader&&!h.hasOwnProperty(d.route.id)&&(!f||f[d.route.id]===void 0);if(d.route.lazy||x){a=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}let u=n&&r?(c,d)=>{var h,f;r(c,{location:n.location,params:((f=(h=n.matches)==null?void 0:h[0])==null?void 0:f.params)??{},unstable_pattern:gb(n.matches),errorInfo:d})}:void 0;return s.reduceRight((c,d,h)=>{let f,x=!1,v=null,w=null;n&&(f=o&&d.route.id?o[d.route.id]:void 0,v=d.route.errorElement||Tb,a&&(l<0&&h===0?(Ly("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,w=null):l===h&&(x=!0,w=d.route.hydrateFallbackElement||null)));let m=e.concat(s.slice(0,h+1)),y=()=>{let p;return f?p=v:x?p=w:d.route.Component?p=S.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=c,S.createElement(Nb,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:p})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?S.createElement(Dy,{location:n.location,revalidation:n.revalidation,component:v,error:f,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):y()},null)}function Td(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Db(t){let e=S.useContext(Bi);return fe(e,Td(t)),e}function Lb(t){let e=S.useContext(dl);return fe(e,Td(t)),e}function Fb(t){let e=S.useContext(At);return fe(e,Td(t)),e}function Od(t){let e=Fb(t),n=e.matches[e.matches.length-1];return fe(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Ib(){return Od("useRouteId")}function Ab(){var r;let t=S.useContext(Md),e=Lb("useRouteError"),n=Od("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function zb(){let{router:t}=Db("useNavigate"),e=Od("useNavigate"),n=S.useRef(!1);return Ny(()=>{n.current=!0}),S.useCallback(async(i,s={})=>{kt(n.current,Oy),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var bf={};function Ly(t,e,n){!e&&!bf[t]&&(bf[t]=!0,kt(!1,n))}S.memo(Bb);function Bb({routes:t,future:e,state:n,onError:r}){return jy(t,void 0,n,r,e)}function Wb({to:t,replace:e,state:n,relative:r}){fe(Wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=S.useContext(ht);kt(!i,"<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:s}=S.useContext(At),{pathname:o}=_n(),a=Rd(),l=Pd(t,Ed(s),o,r==="path"),u=JSON.stringify(l);return S.useEffect(()=>{a(JSON.parse(u),{replace:e,state:n,relative:r})},[a,u,r,e,n]),null}function oa(t){fe(!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 Hb({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:o}){fe(!Wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=S.useMemo(()=>({basename:a,navigator:i,static:s,unstable_useTransitions:o,future:{}}),[a,i,s,o]);typeof n=="string"&&(n=zi(n));let{pathname:u="/",search:c="",hash:d="",state:h=null,key:f="default"}=n,x=S.useMemo(()=>{let v=wn(u,a);return v==null?null:{location:{pathname:v,search:c,hash:d,state:h,key:f},navigationType:r}},[a,u,c,d,h,f,r]);return kt(x!=null,`<Router basename="${a}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:S.createElement(ht.Provider,{value:l},S.createElement(co.Provider,{children:e,value:x}))}function $b({children:t,location:e}){return Mb(gc(t),e)}function gc(t,e=[]){let n=[];return S.Children.forEach(t,(r,i)=>{if(!S.isValidElement(r))return;let s=[...e,i];if(r.type===S.Fragment){n.push.apply(n,gc(r.props.children,s));return}fe(r.type===oa,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),fe(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=gc(r.props.children,s)),n.push(o)}),n}var aa="get",la="application/x-www-form-urlencoded";function hl(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Ub(t){return hl(t)&&t.tagName.toLowerCase()==="button"}function Vb(t){return hl(t)&&t.tagName.toLowerCase()==="form"}function Qb(t){return hl(t)&&t.tagName.toLowerCase()==="input"}function Yb(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Kb(t,e){return t.button===0&&(!e||e==="_self")&&!Yb(t)}var Do=null;function Xb(){if(Do===null)try{new FormData(document.createElement("form"),0),Do=!1}catch{Do=!0}return Do}var qb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yl(t){return t!=null&&!qb.has(t)?(kt(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${la}"`),null):t}function Gb(t,e){let n,r,i,s,o;if(Vb(t)){let a=t.getAttribute("action");r=a?wn(a,e):null,n=t.getAttribute("method")||aa,i=Yl(t.getAttribute("enctype"))||la,s=new FormData(t)}else if(Ub(t)||Qb(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(r=l?wn(l,e):null,n=t.getAttribute("formmethod")||a.getAttribute("method")||aa,i=Yl(t.getAttribute("formenctype"))||Yl(a.getAttribute("enctype"))||la,s=new FormData(a,t),!Xb()){let{name:u,type:c,value:d}=t;if(c==="image"){let h=u?`${u}.`:"";s.append(`${h}x`,"0"),s.append(`${h}y`,"0")}else u&&s.append(u,d)}}else{if(hl(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=aa,r=null,i=la,o=t}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Nd(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Jb(t,e,n){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname=`_root.${n}`:e&&wn(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function Zb(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 e1(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 t1(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let o=await Zb(s,n);return o.links?o.links():[]}return[]}));return s1(r.flat(1).filter(e1).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function _f(t,e,n,r,i,s){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>{var c;return n[u].pathname!==l.pathname||((c=n[u].route.path)==null?void 0:c.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return s==="assets"?e.filter((l,u)=>o(l,u)||a(l,u)):s==="data"?e.filter((l,u)=>{var d;let c=r.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(o(l,u)||a(l,u))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(t,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function n1(t,e,{includeHydrateFallback:n}={}){return r1(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function r1(t){return[...new Set(t)]}function i1(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function s1(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(i1(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function Fy(){let t=S.useContext(Bi);return Nd(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function o1(){let t=S.useContext(dl);return Nd(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var jd=S.createContext(void 0);jd.displayName="FrameworkContext";function Iy(){let t=S.useContext(jd);return Nd(t,"You must render this element inside a <HydratedRouter> element"),t}function a1(t,e){let n=S.useContext(jd),[r,i]=S.useState(!1),[s,o]=S.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=e,h=S.useRef(null);S.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let v=m=>{m.forEach(y=>{o(y.isIntersecting)})},w=new IntersectionObserver(v,{threshold:.5});return h.current&&w.observe(h.current),()=>{w.disconnect()}}},[t]),S.useEffect(()=>{if(r){let v=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(v)}}},[r]);let f=()=>{i(!0)},x=()=>{i(!1),o(!1)};return n?t!=="intent"?[s,h,{}]:[s,h,{onFocus:Ji(a,f),onBlur:Ji(l,x),onMouseEnter:Ji(u,f),onMouseLeave:Ji(c,x),onTouchStart:Ji(d,f)}]:[!1,h,{}]}function Ji(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function l1({page:t,...e}){let{router:n}=Fy(),r=S.useMemo(()=>_y(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?S.createElement(c1,{page:t,matches:r,...e}):null}function u1(t){let{manifest:e,routeModules:n}=Iy(),[r,i]=S.useState([]);return S.useEffect(()=>{let s=!1;return t1(t,e,n).then(o=>{s||i(o)}),()=>{s=!0}},[t,e,n]),r}function c1({page:t,matches:e,...n}){let r=_n(),{manifest:i,routeModules:s}=Iy(),{basename:o}=Fy(),{loaderData:a,matches:l}=o1(),u=S.useMemo(()=>_f(t,e,l,i,r,"data"),[t,e,l,i,r]),c=S.useMemo(()=>_f(t,e,l,i,r,"assets"),[t,e,l,i,r]),d=S.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let x=new Set,v=!1;if(e.forEach(m=>{var p;let y=i.routes[m.route.id];!y||!y.hasLoader||(!u.some(b=>b.route.id===m.route.id)&&m.route.id in a&&((p=s[m.route.id])!=null&&p.shouldRevalidate)||y.hasClientLoader?v=!0:x.add(m.route.id))}),x.size===0)return[];let w=Jb(t,o,"data");return v&&x.size>0&&w.searchParams.set("_routes",e.filter(m=>x.has(m.route.id)).map(m=>m.route.id).join(",")),[w.pathname+w.search]},[o,a,r,i,u,e,t,s]),h=S.useMemo(()=>n1(c,i),[c,i]),f=u1(c);return S.createElement(S.Fragment,null,d.map(x=>S.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),h.map(x=>S.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),f.map(({key:x,link:v})=>S.createElement("link",{key:x,nonce:n.nonce,...v})))}function d1(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var h1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{h1&&(window.__reactRouterVersion="7.11.0")}catch{}function f1({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=S.useRef();i.current==null&&(i.current=Vw({window:r,v5Compat:!0}));let s=i.current,[o,a]=S.useState({action:s.action,location:s.location}),l=S.useCallback(u=>{n===!1?a(u):S.startTransition(()=>a(u))},[n]);return S.useLayoutEffect(()=>s.listen(l),[s,l]),S.createElement(Hb,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:s,unstable_useTransitions:n})}var Ay=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dd=S.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d,unstable_defaultShouldRevalidate:h,...f},x){let{basename:v,unstable_useTransitions:w}=S.useContext(ht),m=typeof u=="string"&&Ay.test(u),y=Py(u,v);u=y.to;let p=Cb(u,{relative:i}),[b,k,C]=a1(r,f),P=y1(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d,unstable_defaultShouldRevalidate:h,unstable_useTransitions:w});function E(M){e&&e(M),M.defaultPrevented||P(M)}let N=S.createElement("a",{...f,...C,href:y.absoluteURL||p,onClick:y.isExternal||s?e:E,ref:d1(x,k),target:l,"data-discover":!m&&n==="render"?"true":void 0});return b&&!m?S.createElement(S.Fragment,null,N,S.createElement(l1,{page:p})):N});Dd.displayName="Link";var p1=S.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...u},c){let d=ho(o,{relative:u.relative}),h=_n(),f=S.useContext(dl),{navigator:x,basename:v}=S.useContext(ht),w=f!=null&&_1(d)&&a===!0,m=x.encodeLocation?x.encodeLocation(d).pathname:d.pathname,y=h.pathname,p=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;n||(y=y.toLowerCase(),p=p?p.toLowerCase():null,m=m.toLowerCase()),p&&v&&(p=wn(p,v)||p);const b=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let k=y===m||!i&&y.startsWith(m)&&y.charAt(b)==="/",C=p!=null&&(p===m||!i&&p.startsWith(m)&&p.charAt(m.length)==="/"),P={isActive:k,isPending:C,isTransitioning:w},E=k?e:void 0,N;typeof r=="function"?N=r(P):N=[r,k?"active":null,C?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let M=typeof s=="function"?s(P):s;return S.createElement(Dd,{...u,"aria-current":E,className:N,ref:c,style:M,to:o,viewTransition:a},typeof l=="function"?l(P):l)});p1.displayName="NavLink";var m1=S.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:o=aa,action:a,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:d,unstable_defaultShouldRevalidate:h,...f},x)=>{let{unstable_useTransitions:v}=S.useContext(ht),w=w1(),m=b1(a,{relative:u}),y=o.toLowerCase()==="get"?"get":"post",p=typeof a=="string"&&Ay.test(a),b=k=>{if(l&&l(k),k.defaultPrevented)return;k.preventDefault();let C=k.nativeEvent.submitter,P=(C==null?void 0:C.getAttribute("formmethod"))||o,E=()=>w(C||k.currentTarget,{fetcherKey:e,method:P,navigate:n,replace:i,state:s,relative:u,preventScrollReset:c,viewTransition:d,unstable_defaultShouldRevalidate:h});v&&n!==!1?S.startTransition(()=>E()):E()};return S.createElement("form",{ref:x,method:y,action:m,onSubmit:r?l:b,...f,"data-discover":!p&&t==="render"?"true":void 0})});m1.displayName="Form";function g1(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zy(t){let e=S.useContext(Bi);return fe(e,g1(t)),e}function y1(t,{target:e,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:a,unstable_useTransitions:l}={}){let u=Rd(),c=_n(),d=ho(t,{relative:s});return S.useCallback(h=>{if(Kb(h,e)){h.preventDefault();let f=n!==void 0?n:Qs(c)===Qs(d),x=()=>u(t,{replace:f,state:r,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:a});l?S.startTransition(()=>x()):x()}},[c,u,d,n,r,e,t,i,s,o,a,l])}var v1=0,x1=()=>`__${String(++v1)}__`;function w1(){let{router:t}=zy("useSubmit"),{basename:e}=S.useContext(ht),n=Ib(),r=t.fetch,i=t.navigate;return S.useCallback(async(s,o={})=>{let{action:a,method:l,encType:u,formData:c,body:d}=Gb(s,e);if(o.navigate===!1){let h=o.fetcherKey||x1();await r(h,n,o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:c,body:d,formMethod:o.method||l,formEncType:o.encType||u,flushSync:o.flushSync})}else await i(o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:c,body:d,formMethod:o.method||l,formEncType:o.encType||u,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,e,n])}function b1(t,{relative:e}={}){let{basename:n}=S.useContext(ht),r=S.useContext(At);fe(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...ho(t||".",{relative:e})},o=_n();if(t==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(c=>c==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let c=a.toString();s.search=c?`?${c}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:mn([n,s.pathname])),Qs(s)}function _1(t,{relative:e}={}){let n=S.useContext(Ry);fe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zy("useViewTransitionState"),i=ho(t,{relative:e});if(!n.isTransitioning)return!1;let s=wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return za(i.pathname,o)!=null||za(i.pathname,s)!=null}function zt(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 Wr(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const By=6048e5,S1=864e5;let k1={};function fl(){return k1}function Ys(t,e){var a,l,u,c;const n=fl(),r=(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??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=zt(t),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Ba(t){return Ys(t,{weekStartsOn:1})}function Wy(t){const e=zt(t),n=e.getFullYear(),r=Wr(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Ba(r),s=Wr(t,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=Ba(s);return e.getTime()>=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function Sf(t){const e=zt(t);return e.setHours(0,0,0,0),e}function kf(t){const e=zt(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 C1(t,e){const n=Sf(t),r=Sf(e),i=+n-kf(n),s=+r-kf(r);return Math.round((i-s)/S1)}function E1(t){const e=Wy(t),n=Wr(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Ba(n)}function P1(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function M1(t){if(!P1(t)&&typeof t!="number")return!1;const e=zt(t);return!isNaN(Number(e))}function R1(t){const e=zt(t),n=Wr(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const T1={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"}},O1=(t,e,n)=>{let r;const i=T1[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Kl(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const N1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},j1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},D1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},L1={date:Kl({formats:N1,defaultWidth:"full"}),time:Kl({formats:j1,defaultWidth:"full"}),dateTime:Kl({formats:D1,defaultWidth:"full"})},F1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},I1=(t,e,n,r)=>F1[t];function Zi(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[a]||t.values[o]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const A1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},z1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},B1={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"]},W1={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"]},H1={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"}},$1={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"}},U1=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},V1={ordinalNumber:U1,era:Zi({values:A1,defaultWidth:"wide"}),quarter:Zi({values:z1,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Zi({values:B1,defaultWidth:"wide"}),day:Zi({values:W1,defaultWidth:"wide"}),dayPeriod:Zi({values:H1,defaultWidth:"wide",formattingValues:$1,defaultFormattingWidth:"wide"})};function es(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const o=s[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?Y1(a,d=>d.test(o)):Q1(a,d=>d.test(o));let u;u=t.valueCallback?t.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=e.slice(o.length);return{value:u,rest:c}}}function Q1(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Y1(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function K1(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let o=t.valueCallback?t.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(i.length);return{value:o,rest:a}}}const X1=/^(\d+)(th|st|nd|rd)?/i,q1=/\d+/i,G1={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},J1={any:[/^b/i,/^(a|c)/i]},Z1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},e_={any:[/1/i,/2/i,/3/i,/4/i]},t_={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},n_={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]},r_={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},i_={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]},s_={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},o_={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}},a_={ordinalNumber:K1({matchPattern:X1,parsePattern:q1,valueCallback:t=>parseInt(t,10)}),era:es({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:J1,defaultParseWidth:"any"}),quarter:es({matchPatterns:Z1,defaultMatchWidth:"wide",parsePatterns:e_,defaultParseWidth:"any",valueCallback:t=>t+1}),month:es({matchPatterns:t_,defaultMatchWidth:"wide",parsePatterns:n_,defaultParseWidth:"any"}),day:es({matchPatterns:r_,defaultMatchWidth:"wide",parsePatterns:i_,defaultParseWidth:"any"}),dayPeriod:es({matchPatterns:s_,defaultMatchWidth:"any",parsePatterns:o_,defaultParseWidth:"any"})},l_={code:"en-US",formatDistance:O1,formatLong:L1,formatRelative:I1,localize:V1,match:a_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function u_(t){const e=zt(t);return C1(e,R1(e))+1}function c_(t){const e=zt(t),n=+Ba(e)-+E1(e);return Math.round(n/By)+1}function Hy(t,e){var c,d,h,f;const n=zt(t),r=n.getFullYear(),i=fl(),s=(e==null?void 0:e.firstWeekContainsDate)??((d=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=Wr(t,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=Ys(o,e),l=Wr(t,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Ys(l,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function d_(t,e){var a,l,u,c;const n=fl(),r=(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??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=Hy(t,e),s=Wr(t,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Ys(s,e)}function h_(t,e){const n=zt(t),r=+Ys(n,e)-+d_(n,e);return Math.round(r/By)+1}function Z(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const kn={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Z(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Z(n+1,2)},d(t,e){return Z(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 Z(t.getHours()%12||12,e.length)},H(t,e){return Z(t.getHours(),e.length)},m(t,e){return Z(t.getMinutes(),e.length)},s(t,e){return Z(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Z(i,e.length)}},Qr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cf={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return kn.y(t,e)},Y:function(t,e,n,r){const i=Hy(t,r),s=i>0?i:1-i;if(e==="YY"){const o=s%100;return Z(o,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):Z(s,e.length)},R:function(t,e){const n=Wy(t);return Z(n,e.length)},u:function(t,e){const n=t.getFullYear();return Z(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Z(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Z(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return kn.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Z(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const i=h_(t,r);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):Z(i,e.length)},I:function(t,e,n){const r=c_(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Z(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):kn.d(t,e)},D:function(t,e,n){const r=u_(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Z(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":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"})}},e:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Z(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Z(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return Z(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let i;switch(r===12?i=Qr.noon:r===0?i=Qr.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let i;switch(r>=17?i=Qr.evening:r>=12?i=Qr.afternoon:r>=4?i=Qr.morning:i=Qr.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return kn.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):kn.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Z(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Z(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):kn.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):kn.s(t,e)},S:function(t,e){return kn.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Pf(r);case"XXXX":case"XX":return gr(r);case"XXXXX":case"XXX":default:return gr(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Pf(r);case"xxxx":case"xx":return gr(r);case"xxxxx":case"xxx":default:return gr(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ef(r,":");case"OOOO":default:return"GMT"+gr(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ef(r,":");case"zzzz":default:return"GMT"+gr(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return Z(r,e.length)},T:function(t,e,n){const r=t.getTime();return Z(r,e.length)}};function Ef(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+e+Z(s,2)}function Pf(t,e){return t%60===0?(t>0?"-":"+")+Z(Math.abs(t)/60,2):gr(t,e)}function gr(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Z(Math.trunc(r/60),2),s=Z(r%60,2);return n+i+e+s}const Mf=(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"})}},$y=(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"})}},f_=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Mf(t,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Mf(r,e)).replace("{{time}}",$y(i,e))},p_={p:$y,P:f_},m_=/^D+$/,g_=/^Y+$/,y_=["D","DD","YY","YYYY"];function v_(t){return m_.test(t)}function x_(t){return g_.test(t)}function w_(t,e,n){const r=b_(t,e,n);if(console.warn(r),y_.includes(t))throw new RangeError(r)}function b_(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const __=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,S_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,k_=/^'([^]*?)'?$/,C_=/''/g,E_=/[a-zA-Z]/;function fn(t,e,n){var c,d,h,f;const r=fl(),i=r.locale??l_,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,o=r.weekStartsOn??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??0,a=zt(t);if(!M1(a))throw new RangeError("Invalid time value");let l=e.match(S_).map(x=>{const v=x[0];if(v==="p"||v==="P"){const w=p_[v];return w(x,i.formatLong)}return x}).join("").match(__).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const v=x[0];if(v==="'")return{isToken:!1,value:P_(x)};if(Cf[v])return{isToken:!0,value:x};if(v.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:x}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(x=>{if(!x.isToken)return x.value;const v=x.value;(x_(v)||v_(v))&&w_(v,e,String(t));const w=Cf[v[0]];return w(a,v,i.localize,u)}).join("")}function P_(t){const e=t.match(k_);return e?e[1].replace(C_,"'"):t}function M_({displayName:t,sessionCount:e,lastActivity:n,sessions:r,selectedId:i,onSelectSession:s,initialExpanded:o=!1}){const[a,l]=S.useState(o);return S.useEffect(()=>{i&&r.some(c=>{var d;return c.id===i||((d=c.agentSessions)==null?void 0:d.some(h=>h.id===i))})&&l(!0)},[i,r]),g.jsxs("div",{className:"border-b border-gray-700",children:[g.jsx("button",{onClick:()=>l(!a),className:"sticky top-0 z-10 w-full text-left p-4 bg-gray-900 hover:bg-gray-800 transition-colors flex items-center justify-between",children:g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("svg",{className:`w-4 h-4 transition-transform ${a?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),g.jsx("span",{className:"font-semibold text-sm truncate",children:t})]}),g.jsxs("div",{className:"text-xs text-gray-400 mt-1 ml-6",children:[e," session",e!==1?"s":""," · Last activity"," ",fn(new Date(n),"PPp")]})]})}),a&&g.jsx("div",{className:"bg-gray-900/50",children:r.map(u=>g.jsxs("div",{children:[g.jsxs("button",{onClick:()=>s(u.id),className:`w-full text-left px-4 py-3 pl-8 hover:bg-gray-700/50 transition-colors border-l-2 ${i===u.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[u.title&&g.jsx("div",{className:"text-sm font-medium text-gray-200 mb-1 truncate",children:u.title}),g.jsx("div",{className:"text-xs text-gray-400",children:fn(new Date(u.timestamp),"PPpp")}),g.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[u.messageCount," message",u.messageCount!==1?"s":"",u.agentSessions&&u.agentSessions.length>0&&g.jsxs("span",{className:"ml-2",children:["· ",u.agentSessions.length," task",u.agentSessions.length!==1?"s":""]})]})]}),u.agentSessions&&u.agentSessions.length>0&&g.jsx("div",{className:"bg-gray-900/70",children:u.agentSessions.map(c=>g.jsxs("button",{onClick:()=>s(c.id),className:`w-full text-left px-4 py-2 pl-14 hover:bg-gray-700/50 transition-colors border-l-2 ${i===c.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:"TASK"}),c.title&&g.jsx("span",{className:"text-sm font-medium text-gray-300 truncate",children:c.title})]}),g.jsx("div",{className:"text-xs text-gray-400",children:fn(new Date(c.timestamp),"PPpp")}),g.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[c.messageCount," message",c.messageCount!==1?"s":""]})]},c.id))})]},u.id))})]})}function R_({projects:t,selectedId:e,onSelect:n}){const r=i=>e?i.sessions.some(s=>{var o;return s.id===e||((o=s.agentSessions)==null?void 0:o.some(a=>a.id===e))}):!1;return g.jsx("div",{children:t.map(i=>g.jsx(M_,{name:i.name,displayName:i.displayName,sessionCount:i.sessionCount,lastActivity:i.lastActivity,sessions:i.sessions,selectedId:e,onSelectSession:n,initialExpanded:r(i)},i.name))})}function T_({messages:t,activeId:e,onNavigate:n}){const[r,i]=S.useState([]),s=S.useRef(null),o=S.useRef(null);S.useEffect(()=>{const l=t.map((u,c)=>{var x;const d=`message-${c}`;let h="";const f=[];if((x=u.message)!=null&&x.content&&Array.isArray(u.message.content)){const v=u.message.content.find(w=>w.type==="text");v&&(h=v.text.slice(0,50)+(v.text.length>50?"...":"")),u.message.content.forEach(w=>{w.type==="tool_use"?f.push({name:w.name,type:"tool_use"}):w.type==="tool_result"&&f.push({name:"Tool Result",type:"tool_result"})})}return{id:d,type:u.type||"system",text:h,toolUses:f,timestamp:u.timestamp}});i(l)},[t]),S.useEffect(()=>{if(s.current&&o.current){const l=o.current,u=s.current,c=l.getBoundingClientRect(),d=u.getBoundingClientRect();(d.top<c.top||d.bottom>c.bottom)&&u.scrollIntoView({behavior:"smooth",block:"nearest"})}},[e]);const a=l=>{n(l,!0)};return g.jsxs("div",{className:"w-full h-full flex flex-col border-l border-gray-700 bg-gray-800",children:[g.jsxs("div",{className:"p-4 border-b border-gray-700 bg-gray-800 flex-shrink-0",children:[g.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Table of Contents"}),g.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[r.length," messages"]})]}),g.jsx("nav",{ref:o,className:"p-2 flex-1 overflow-y-auto",children:r.map((l,u)=>g.jsx("div",{className:"mb-1",children:g.jsxs("button",{ref:e===l.id?s: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:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.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}),g.jsxs("span",{className:"text-gray-500",children:["#",u+1]})]}),l.text&&g.jsx("div",{className:"text-gray-300 line-clamp-2 leading-tight",children:l.text}),l.toolUses.length>0&&g.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:l.toolUses.map((c,d)=>g.jsxs("span",{className:`px-1.5 py-0.5 text-[10px] rounded font-mono ${c.type==="tool_result"?"bg-green-900/30 text-green-400":"bg-yellow-900/30 text-yellow-400"}`,children:[c.type==="tool_result"?"✓":"🔧"," ",c.name]},d))})]})},l.id))})]})}const yc=256,Rf=640,O_=896,N_=O_+yc;function j_({sessionId:t,sessionInfo:e}){var ve,j,I;const[n,r]=S.useState(null),[i,s]=S.useState(!0),[o,a]=S.useState(null),l=S.useRef(new Map),u=S.useRef(!1),c=S.useRef(null),d=S.useRef(null),h=S.useRef(null),f=S.useRef(null),x=S.useRef(!1),v=S.useRef(0),w=S.useRef(0),m=S.useRef(null),y=S.useRef(null),p=S.useRef(null),b=S.useRef(null),k=S.useRef(null),C=S.useRef(null),P=S.useRef(null),E=S.useRef(null),N=S.useRef(0),{data:M,isLoading:T,error:A}=Cd({queryKey:["session",t],queryFn:async()=>{const R=await fetch(`/api/sessions/${t}`);if(!R.ok)throw new Error("Failed to fetch session");return R.json()}});S.useEffect(()=>{v.current=0,w.current=0,m.current!==null&&(cancelAnimationFrame(m.current),m.current=null),N.current=0,r(null),c.current=null,x.current=!1;const R=E.current;R&&(R.scrollTop=0)},[t]);const W=R=>{const B=p.current;if(!B)return;const H=14+R*8,ne=1.25+R*.25,$=R,re=R,pe=Math.max(0,1-$);B.style.padding=`${H}px 24px`,b.current&&(b.current.style.fontSize=`${ne}rem`),k.current&&(k.current.style.opacity=`${$}`,k.current.style.height=$>0?"auto":"0"),C.current&&(C.current.style.opacity=`${re}`,C.current.style.height=re>0?"auto":"0",C.current.style.marginTop=re>0?"1rem":"0"),P.current&&(P.current.style.opacity=`${pe}`)};S.useEffect(()=>{const R=o;if(!R)return;const B=()=>{var Le;const ne=v.current,$=w.current,re=$+(ne-$)*.2,pe=R.scrollHeight-(re+R.clientHeight),en=pe<=5,ft=re<N.current;let $e=x.current;$e?pe>40&&($e=!1):en&&($e=!0),x.current=$e;const ur=Math.max(0,1-(ft?0:$e?80:re)/80);W(ur),w.current=re,N.current=re,Math.abs(ne-re)>.5?m.current=requestAnimationFrame(B):(w.current=ne,N.current=ne,m.current=null,$e&&((Le=h.current)==null||Le.call(h)))},H=()=>{v.current=R.scrollTop,m.current===null&&(m.current=requestAnimationFrame(B))};return R.addEventListener("scroll",H),()=>{R.removeEventListener("scroll",H),m.current!==null&&(cancelAnimationFrame(m.current),m.current=null)}},[t,o]),S.useEffect(()=>{if(!y.current)return;const R=y.current.parentElement??y.current,B=$=>{s($>=N_)},H=new ResizeObserver($=>{for(const re of $)B(re.contentRect.width)}),ne=R.getBoundingClientRect().width;return B(ne),H.observe(R),()=>{H.disconnect()}},[]),S.useEffect(()=>{var en;if(!((en=M==null?void 0:M.session)!=null&&en.messages))return;const R=E.current;if(!R)return;const B=new Set;let H=null;const ne=()=>{if(u.current)return;const ft=[];l.current.forEach((Ue,ae)=>{const Te=Ue.getBoundingClientRect();ft.push({id:ae,element:Ue,rect:Te})}),ft.sort((Ue,ae)=>Ue.rect.top-ae.rect.top);const $e=R.getBoundingClientRect(),Bt=$e.top,ur=$e.bottom;let Le=null;for(const Ue of ft){const ae=Ue.rect.top>=Bt&&Ue.rect.bottom<=ur,Te=Ue.rect.bottom>Bt&&Ue.rect.top<ur;if(ae){Le=Ue.id;break}else Te&&!Le&&(Le=Ue.id)}Le&&Le!==c.current&&r(Le)},$=()=>{const ft=f.current;if(u.current&&ft){const ae=l.current.get(ft);if(ae){const Te=R.getBoundingClientRect(),po=ae.getBoundingClientRect();if(!(po.top>=Te.top&&po.top<=Te.top+5))return}u.current=!1,f.current=null}if(x.current){const ae=M.session.messages.length-1,Te=ae>=0?`message-${ae}`:null;Te&&Te!==c.current&&r(Te);return}if(B.size===0){ne();return}const $e=R.getBoundingClientRect(),Bt=$e.top,ur=$e.bottom;let Le=null;const Ue=Array.from(B).map(ae=>{const Te=l.current.get(ae);return Te?{id:ae,rect:Te.getBoundingClientRect()}:null}).filter(ae=>!!ae);if(Ue.length===0){ne();return}Ue.sort((ae,Te)=>ae.rect.top-Te.rect.top);for(const ae of Ue){const Te=ae.rect.top>=Bt&&ae.rect.bottom<=ur,po=ae.rect.bottom>Bt&&ae.rect.top<ur;if(Te){Le=ae.id;break}else po&&!Le&&(Le=ae.id)}Le&&Le!==c.current&&r(Le)},re=()=>{H!==null&&cancelAnimationFrame(H),H=requestAnimationFrame(()=>{H=null,$()})};h.current=$;const pe=new IntersectionObserver(ft=>{for(const $e of ft){const Bt=$e.target.dataset.messageId;Bt&&($e.isIntersecting?B.add(Bt):B.delete(Bt))}re()},{root:R,threshold:[0,.1,.5,1]});return l.current.forEach(ft=>pe.observe(ft)),re(),()=>{pe.disconnect(),h.current=null,H!==null&&cancelAnimationFrame(H)}},[(ve=M==null?void 0:M.session)==null?void 0:ve.messages,o]),S.useEffect(()=>{c.current=n},[n]),S.useEffect(()=>{W(1)},[(j=M==null?void 0:M.session)==null?void 0:j.id]);const se=S.useCallback(R=>{E.current=R,a(B=>B===R?B:R)},[]),J=(R,B=!1)=>{if(r(R),B){u.current=!0,f.current=R,d.current&&(clearTimeout(d.current),d.current=null);const H=l.current.get(R);H&&H.scrollIntoView({behavior:"smooth",block:"start"}),d.current=setTimeout(()=>{var ne;u.current=!1,f.current=null,d.current=null,(ne=h.current)==null||ne.call(h)},1500)}};if(S.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),T&&!M&&!e)return g.jsxs("div",{className:"h-full flex min-w-0",children:[g.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Rf}px`},children:[g.jsx("div",{className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 p-6",children:g.jsxs("div",{className:"animate-pulse",children:[g.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-3"}),g.jsx("div",{className:"h-5 bg-gray-700 rounded w-1/3 mb-4"}),g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"h-4 bg-gray-700 rounded w-32"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-4"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-24"})]})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:g.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(R=>g.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),g.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:g.jsxs("div",{className:"space-y-2",children:[g.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},R))})})]}),i&&g.jsx("div",{style:{width:`${yc}px`,flexShrink:0},className:"border-l border-gray-700 bg-gray-800/30 p-4",children:g.jsxs("div",{className:"animate-pulse space-y-3",children:[g.jsx("div",{className:"h-5 bg-gray-700 rounded w-3/4"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4"})]})})]});if(A)return g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsxs("div",{className:"text-red-400",children:["Error: ",A.message]})});const F=(M==null?void 0:M.session)||e;return g.jsxs("div",{ref:y,className:"h-full flex min-w-0",children:[g.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Rf}px`},children:[g.jsxs("div",{ref:p,className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 transition-all duration-200",style:{padding:"22px 24px"},children:[g.jsxs("div",{className:"flex items-center gap-2",children:[(F==null?void 0:F.isAgent)&&g.jsx("span",{className:"px-2 py-1 text-xs bg-purple-900/50 text-purple-300 rounded font-semibold",children:"TASK"}),g.jsx("h2",{ref:b,className:"font-bold truncate flex-1 transition-all duration-200",style:{fontSize:"1.5rem"},children:(F==null?void 0:F.title)||"Untitled Session"}),g.jsx("span",{ref:P,className:"px-2 py-1 text-xs bg-gray-700 text-gray-300 rounded transition-opacity duration-200",style:{opacity:0},children:F==null?void 0:F.project})]}),g.jsx("div",{ref:k,className:"text-xl text-gray-300 transition-all duration-200",style:{opacity:1,height:"auto",overflow:"hidden",marginTop:"-2px"},children:F==null?void 0:F.project}),g.jsxs("div",{ref:C,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:[g.jsx("span",{children:(F==null?void 0:F.timestamp)&&fn(new Date(F.timestamp),"PPpp")}),g.jsx("span",{children:"•"}),g.jsxs("span",{children:[(F==null?void 0:F.messageCount)||0," message",(F==null?void 0:F.messageCount)!==1?"s":""]}),(F==null?void 0:F.agentSessions)&&F.agentSessions.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("span",{children:"•"}),g.jsxs("span",{children:[F.agentSessions.length," task",F.agentSessions.length!==1?"s":""]})]})]})]}),g.jsx("div",{ref:se,className:"flex-1 overflow-y-auto p-6",children:T&&!(F!=null&&F.messages)?g.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(R=>g.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),g.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:g.jsxs("div",{className:"space-y-2",children:[g.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),g.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},R))}):g.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:(I=F==null?void 0:F.messages)==null?void 0:I.map((R,B)=>{var ne;const H=`message-${B}`;return g.jsxs("div",{ref:$=>{$?l.current.set(H,$):l.current.delete(H)},"data-message-id":H,className:"border-l-2 border-gray-700 pl-4",style:{scrollMarginTop:"24px"},children:[g.jsx("div",{className:"flex items-start justify-between mb-2",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:`px-2 py-1 text-xs rounded ${R.type==="user"?"bg-blue-900 text-blue-200":R.type==="assistant"?"bg-green-900 text-green-200":"bg-gray-700 text-gray-300"}`,children:R.type||"system"}),g.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["#",B+1]}),R.timestamp&&g.jsx("span",{className:"text-xs text-gray-500",children:fn(new Date(R.timestamp),"HH:mm:ss")})]})}),g.jsx("div",{className:"bg-gray-800 rounded-lg p-4 text-sm",children:(ne=R.message)!=null&&ne.content&&Array.isArray(R.message.content)?g.jsx("div",{className:"space-y-2",children:R.message.content.map(($,re)=>g.jsxs("div",{children:[$.type==="text"&&g.jsx("p",{className:"whitespace-pre-wrap",children:$.text}),$.type==="tool_use"&&g.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2",children:[g.jsxs("div",{className:"text-yellow-400 font-mono text-xs",children:["🔧 ",$.name]}),$.name==="Task"&&$.agentId&&g.jsx(Dd,{to:`/sessions/agent-${$.agentId}`,className:"px-2 py-1 text-xs bg-purple-700 hover:bg-purple-600 text-purple-100 rounded transition-colors",children:"View Task →"})]}),g.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify($.input,null,2)})]}),$.type==="tool_result"&&g.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[g.jsx("div",{className:"text-green-400 font-mono text-xs mb-2",children:"✓ Tool Result"}),g.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:typeof $.content=="string"?$.content:JSON.stringify($.content,null,2)})]})]},re))}):g.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify(R,null,2)})})]},B)})})})]}),i&&(F==null?void 0:F.messages)&&F.messages.length>0&&g.jsx("div",{style:{width:`${yc}px`,flexShrink:0},children:g.jsx(T_,{messages:F.messages,activeId:n,onNavigate:J})})]})}/*!
51
+ Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let h=_n(),f;if(e){let x=typeof e=="string"?zi(e):e;fe(c==="/"||((g=x.pathname)==null?void 0:g.startsWith(c)),`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 "${c}" but pathname "${x.pathname}" was given in the \`location\` prop.`),f=x}else f=h;let v=f.pathname||"/",y=v;if(c!=="/"){let x=c.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(x.length).join("/")}let w=_y(t,{pathname:y});kt(d||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),kt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 m=jb(w&&w.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:mn([c,s.encodeLocation?s.encodeLocation(x.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:mn([c,s.encodeLocation?s.encodeLocation(x.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),o,n,r,i);return e&&m?k.createElement(co.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},m):m}function Tb(){let t=Ab(),e=mb(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:s},"ErrorBoundary")," or"," ",k.createElement("code",{style:s},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},e),n?k.createElement("pre",{style:i},n):null,o)}var Rb=k.createElement(Tb,null),Dy=class extends k.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=kb(t.digest);n&&(t=n)}let e=t!==void 0?k.createElement(At.Provider,{value:this.props.routeContext},k.createElement(Md.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?k.createElement(Nb,{error:t},e):e}};Dy.contextType=vb;var Ql=new WeakMap;function Nb({children:t,error:e}){let{basename:n}=k.useContext(ht);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=Sb(e.digest);if(r){let i=Ql.get(e);if(i)throw i;let s=Py(r.location,n);if(Ey&&!Ql.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Ql.set(e,o),o}return k.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function Ob({routeContext:t,match:e,children:n}){let r=k.useContext(Bi);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),k.createElement(At.Provider,{value:t},n)}function jb(t,e=[],n=null,r=null,i=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 s=t,o=n==null?void 0:n.errors;if(o!=null){let c=s.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);fe(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,c+1))}let a=!1,l=-1;if(n)for(let c=0;c<s.length;c++){let d=s[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:h,errors:f}=n,v=d.route.loader&&!h.hasOwnProperty(d.route.id)&&(!f||f[d.route.id]===void 0);if(d.route.lazy||v){a=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}let u=n&&r?(c,d)=>{var h,f;r(c,{location:n.location,params:((f=(h=n.matches)==null?void 0:h[0])==null?void 0:f.params)??{},unstable_pattern:gb(n.matches),errorInfo:d})}:void 0;return s.reduceRight((c,d,h)=>{let f,v=!1,y=null,w=null;n&&(f=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||Rb,a&&(l<0&&h===0?(Ly("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,w=null):l===h&&(v=!0,w=d.route.hydrateFallbackElement||null)));let m=e.concat(s.slice(0,h+1)),g=()=>{let x;return f?x=y:v?x=w:d.route.Component?x=k.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=c,k.createElement(Ob,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?k.createElement(Dy,{location:n.location,revalidation:n.revalidation,component:y,error:f,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:u}):g()},null)}function Rd(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Db(t){let e=k.useContext(Bi);return fe(e,Rd(t)),e}function Lb(t){let e=k.useContext(dl);return fe(e,Rd(t)),e}function Fb(t){let e=k.useContext(At);return fe(e,Rd(t)),e}function Nd(t){let e=Fb(t),n=e.matches[e.matches.length-1];return fe(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Ib(){return Nd("useRouteId")}function Ab(){var r;let t=k.useContext(Md),e=Lb("useRouteError"),n=Nd("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function zb(){let{router:t}=Db("useNavigate"),e=Nd("useNavigate"),n=k.useRef(!1);return Oy(()=>{n.current=!0}),k.useCallback(async(i,s={})=>{kt(n.current,Ny),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...s}))},[t,e])}var bf={};function Ly(t,e,n){!e&&!bf[t]&&(bf[t]=!0,kt(!1,n))}k.memo(Bb);function Bb({routes:t,future:e,state:n,onError:r}){return jy(t,void 0,n,r,e)}function Wb({to:t,replace:e,state:n,relative:r}){fe(Wi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=k.useContext(ht);kt(!i,"<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:s}=k.useContext(At),{pathname:o}=_n(),a=Td(),l=Pd(t,Ed(s),o,r==="path"),u=JSON.stringify(l);return k.useEffect(()=>{a(JSON.parse(u),{replace:e,state:n,relative:r})},[a,u,r,e,n]),null}function oa(t){fe(!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 Hb({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:o}){fe(!Wi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=k.useMemo(()=>({basename:a,navigator:i,static:s,unstable_useTransitions:o,future:{}}),[a,i,s,o]);typeof n=="string"&&(n=zi(n));let{pathname:u="/",search:c="",hash:d="",state:h=null,key:f="default"}=n,v=k.useMemo(()=>{let y=wn(u,a);return y==null?null:{location:{pathname:y,search:c,hash:d,state:h,key:f},navigationType:r}},[a,u,c,d,h,f,r]);return kt(v!=null,`<Router basename="${a}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:k.createElement(ht.Provider,{value:l},k.createElement(co.Provider,{children:e,value:v}))}function $b({children:t,location:e}){return Mb(gc(t),e)}function gc(t,e=[]){let n=[];return k.Children.forEach(t,(r,i)=>{if(!k.isValidElement(r))return;let s=[...e,i];if(r.type===k.Fragment){n.push.apply(n,gc(r.props.children,s));return}fe(r.type===oa,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),fe(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=gc(r.props.children,s)),n.push(o)}),n}var aa="get",la="application/x-www-form-urlencoded";function hl(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Ub(t){return hl(t)&&t.tagName.toLowerCase()==="button"}function Vb(t){return hl(t)&&t.tagName.toLowerCase()==="form"}function Qb(t){return hl(t)&&t.tagName.toLowerCase()==="input"}function Yb(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Kb(t,e){return t.button===0&&(!e||e==="_self")&&!Yb(t)}var Do=null;function Xb(){if(Do===null)try{new FormData(document.createElement("form"),0),Do=!1}catch{Do=!0}return Do}var qb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yl(t){return t!=null&&!qb.has(t)?(kt(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${la}"`),null):t}function Gb(t,e){let n,r,i,s,o;if(Vb(t)){let a=t.getAttribute("action");r=a?wn(a,e):null,n=t.getAttribute("method")||aa,i=Yl(t.getAttribute("enctype"))||la,s=new FormData(t)}else if(Ub(t)||Qb(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(r=l?wn(l,e):null,n=t.getAttribute("formmethod")||a.getAttribute("method")||aa,i=Yl(t.getAttribute("formenctype"))||Yl(a.getAttribute("enctype"))||la,s=new FormData(a,t),!Xb()){let{name:u,type:c,value:d}=t;if(c==="image"){let h=u?`${u}.`:"";s.append(`${h}x`,"0"),s.append(`${h}y`,"0")}else u&&s.append(u,d)}}else{if(hl(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=aa,r=null,i=la,o=t}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Od(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Jb(t,e,n){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname=`_root.${n}`:e&&wn(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function Zb(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 e1(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 t1(t,e,n){let r=await Promise.all(t.map(async i=>{let s=e.routes[i.route.id];if(s){let o=await Zb(s,n);return o.links?o.links():[]}return[]}));return s1(r.flat(1).filter(e1).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function _f(t,e,n,r,i,s){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>{var c;return n[u].pathname!==l.pathname||((c=n[u].route.path)==null?void 0:c.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return s==="assets"?e.filter((l,u)=>o(l,u)||a(l,u)):s==="data"?e.filter((l,u)=>{var d;let c=r.routes[l.route.id];if(!c||!c.hasLoader)return!1;if(o(l,u)||a(l,u))return!0;if(l.route.shouldRevalidate){let h=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(t,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function n1(t,e,{includeHydrateFallback:n}={}){return r1(t.map(r=>{let i=e.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function r1(t){return[...new Set(t)]}function i1(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function s1(t,e){let n=new Set;return new Set(e),t.reduce((r,i)=>{let s=JSON.stringify(i1(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function Fy(){let t=k.useContext(Bi);return Od(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function o1(){let t=k.useContext(dl);return Od(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var jd=k.createContext(void 0);jd.displayName="FrameworkContext";function Iy(){let t=k.useContext(jd);return Od(t,"You must render this element inside a <HydratedRouter> element"),t}function a1(t,e){let n=k.useContext(jd),[r,i]=k.useState(!1),[s,o]=k.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=e,h=k.useRef(null);k.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let y=m=>{m.forEach(g=>{o(g.isIntersecting)})},w=new IntersectionObserver(y,{threshold:.5});return h.current&&w.observe(h.current),()=>{w.disconnect()}}},[t]),k.useEffect(()=>{if(r){let y=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(y)}}},[r]);let f=()=>{i(!0)},v=()=>{i(!1),o(!1)};return n?t!=="intent"?[s,h,{}]:[s,h,{onFocus:Ji(a,f),onBlur:Ji(l,v),onMouseEnter:Ji(u,f),onMouseLeave:Ji(c,v),onTouchStart:Ji(d,f)}]:[!1,h,{}]}function Ji(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function l1({page:t,...e}){let{router:n}=Fy(),r=k.useMemo(()=>_y(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?k.createElement(c1,{page:t,matches:r,...e}):null}function u1(t){let{manifest:e,routeModules:n}=Iy(),[r,i]=k.useState([]);return k.useEffect(()=>{let s=!1;return t1(t,e,n).then(o=>{s||i(o)}),()=>{s=!0}},[t,e,n]),r}function c1({page:t,matches:e,...n}){let r=_n(),{manifest:i,routeModules:s}=Iy(),{basename:o}=Fy(),{loaderData:a,matches:l}=o1(),u=k.useMemo(()=>_f(t,e,l,i,r,"data"),[t,e,l,i,r]),c=k.useMemo(()=>_f(t,e,l,i,r,"assets"),[t,e,l,i,r]),d=k.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let v=new Set,y=!1;if(e.forEach(m=>{var x;let g=i.routes[m.route.id];!g||!g.hasLoader||(!u.some(b=>b.route.id===m.route.id)&&m.route.id in a&&((x=s[m.route.id])!=null&&x.shouldRevalidate)||g.hasClientLoader?y=!0:v.add(m.route.id))}),v.size===0)return[];let w=Jb(t,o,"data");return y&&v.size>0&&w.searchParams.set("_routes",e.filter(m=>v.has(m.route.id)).map(m=>m.route.id).join(",")),[w.pathname+w.search]},[o,a,r,i,u,e,t,s]),h=k.useMemo(()=>n1(c,i),[c,i]),f=u1(c);return k.createElement(k.Fragment,null,d.map(v=>k.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),h.map(v=>k.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),f.map(({key:v,link:y})=>k.createElement("link",{key:v,nonce:n.nonce,...y})))}function d1(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var h1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{h1&&(window.__reactRouterVersion="7.11.0")}catch{}function f1({basename:t,children:e,unstable_useTransitions:n,window:r}){let i=k.useRef();i.current==null&&(i.current=Vw({window:r,v5Compat:!0}));let s=i.current,[o,a]=k.useState({action:s.action,location:s.location}),l=k.useCallback(u=>{n===!1?a(u):k.startTransition(()=>a(u))},[n]);return k.useLayoutEffect(()=>s.listen(l),[s,l]),k.createElement(Hb,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:s,unstable_useTransitions:n})}var Ay=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dd=k.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d,unstable_defaultShouldRevalidate:h,...f},v){let{basename:y,unstable_useTransitions:w}=k.useContext(ht),m=typeof u=="string"&&Ay.test(u),g=Py(u,y);u=g.to;let x=Cb(u,{relative:i}),[b,C,P]=a1(r,f),_=y1(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i,viewTransition:d,unstable_defaultShouldRevalidate:h,unstable_useTransitions:w});function E(M){e&&e(M),M.defaultPrevented||_(M)}let O=k.createElement("a",{...f,...P,href:g.absoluteURL||x,onClick:g.isExternal||s?e:E,ref:d1(v,C),target:l,"data-discover":!m&&n==="render"?"true":void 0});return b&&!m?k.createElement(k.Fragment,null,O,k.createElement(l1,{page:x})):O});Dd.displayName="Link";var p1=k.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...u},c){let d=ho(o,{relative:u.relative}),h=_n(),f=k.useContext(dl),{navigator:v,basename:y}=k.useContext(ht),w=f!=null&&_1(d)&&a===!0,m=v.encodeLocation?v.encodeLocation(d).pathname:d.pathname,g=h.pathname,x=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;n||(g=g.toLowerCase(),x=x?x.toLowerCase():null,m=m.toLowerCase()),x&&y&&(x=wn(x,y)||x);const b=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let C=g===m||!i&&g.startsWith(m)&&g.charAt(b)==="/",P=x!=null&&(x===m||!i&&x.startsWith(m)&&x.charAt(m.length)==="/"),_={isActive:C,isPending:P,isTransitioning:w},E=C?e:void 0,O;typeof r=="function"?O=r(_):O=[r,C?"active":null,P?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let M=typeof s=="function"?s(_):s;return k.createElement(Dd,{...u,"aria-current":E,className:O,ref:c,style:M,to:o,viewTransition:a},typeof l=="function"?l(_):l)});p1.displayName="NavLink";var m1=k.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:i,state:s,method:o=aa,action:a,onSubmit:l,relative:u,preventScrollReset:c,viewTransition:d,unstable_defaultShouldRevalidate:h,...f},v)=>{let{unstable_useTransitions:y}=k.useContext(ht),w=w1(),m=b1(a,{relative:u}),g=o.toLowerCase()==="get"?"get":"post",x=typeof a=="string"&&Ay.test(a),b=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let P=C.nativeEvent.submitter,_=(P==null?void 0:P.getAttribute("formmethod"))||o,E=()=>w(P||C.currentTarget,{fetcherKey:e,method:_,navigate:n,replace:i,state:s,relative:u,preventScrollReset:c,viewTransition:d,unstable_defaultShouldRevalidate:h});y&&n!==!1?k.startTransition(()=>E()):E()};return k.createElement("form",{ref:v,method:g,action:m,onSubmit:r?l:b,...f,"data-discover":!x&&t==="render"?"true":void 0})});m1.displayName="Form";function g1(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zy(t){let e=k.useContext(Bi);return fe(e,g1(t)),e}function y1(t,{target:e,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:a,unstable_useTransitions:l}={}){let u=Td(),c=_n(),d=ho(t,{relative:s});return k.useCallback(h=>{if(Kb(h,e)){h.preventDefault();let f=n!==void 0?n:Qs(c)===Qs(d),v=()=>u(t,{replace:f,state:r,preventScrollReset:i,relative:s,viewTransition:o,unstable_defaultShouldRevalidate:a});l?k.startTransition(()=>v()):v()}},[c,u,d,n,r,e,t,i,s,o,a,l])}var v1=0,x1=()=>`__${String(++v1)}__`;function w1(){let{router:t}=zy("useSubmit"),{basename:e}=k.useContext(ht),n=Ib(),r=t.fetch,i=t.navigate;return k.useCallback(async(s,o={})=>{let{action:a,method:l,encType:u,formData:c,body:d}=Gb(s,e);if(o.navigate===!1){let h=o.fetcherKey||x1();await r(h,n,o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:c,body:d,formMethod:o.method||l,formEncType:o.encType||u,flushSync:o.flushSync})}else await i(o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:c,body:d,formMethod:o.method||l,formEncType:o.encType||u,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,e,n])}function b1(t,{relative:e}={}){let{basename:n}=k.useContext(ht),r=k.useContext(At);fe(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...ho(t||".",{relative:e})},o=_n();if(t==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(c=>c==="")){a.delete("index"),l.filter(d=>d).forEach(d=>a.append("index",d));let c=a.toString();s.search=c?`?${c}`:""}}return(!t||t===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:mn([n,s.pathname])),Qs(s)}function _1(t,{relative:e}={}){let n=k.useContext(Ty);fe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zy("useViewTransitionState"),i=ho(t,{relative:e});if(!n.isTransitioning)return!1;let s=wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return za(i.pathname,o)!=null||za(i.pathname,s)!=null}function zt(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 Wr(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const By=6048e5,S1=864e5;let k1={};function fl(){return k1}function Ys(t,e){var a,l,u,c;const n=fl(),r=(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??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=zt(t),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Ba(t){return Ys(t,{weekStartsOn:1})}function Wy(t){const e=zt(t),n=e.getFullYear(),r=Wr(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Ba(r),s=Wr(t,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=Ba(s);return e.getTime()>=i.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function Sf(t){const e=zt(t);return e.setHours(0,0,0,0),e}function kf(t){const e=zt(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 C1(t,e){const n=Sf(t),r=Sf(e),i=+n-kf(n),s=+r-kf(r);return Math.round((i-s)/S1)}function E1(t){const e=Wy(t),n=Wr(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Ba(n)}function P1(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function M1(t){if(!P1(t)&&typeof t!="number")return!1;const e=zt(t);return!isNaN(Number(e))}function T1(t){const e=zt(t),n=Wr(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const R1={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"}},N1=(t,e,n)=>{let r;const i=R1[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Kl(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const O1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},j1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},D1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},L1={date:Kl({formats:O1,defaultWidth:"full"}),time:Kl({formats:j1,defaultWidth:"full"}),dateTime:Kl({formats:D1,defaultWidth:"full"})},F1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},I1=(t,e,n,r)=>F1[t];function Zi(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[a]||t.values[o]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const A1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},z1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},B1={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"]},W1={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"]},H1={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"}},$1={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"}},U1=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},V1={ordinalNumber:U1,era:Zi({values:A1,defaultWidth:"wide"}),quarter:Zi({values:z1,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Zi({values:B1,defaultWidth:"wide"}),day:Zi({values:W1,defaultWidth:"wide"}),dayPeriod:Zi({values:H1,defaultWidth:"wide",formattingValues:$1,defaultFormattingWidth:"wide"})};function es(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const o=s[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?Y1(a,d=>d.test(o)):Q1(a,d=>d.test(o));let u;u=t.valueCallback?t.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=e.slice(o.length);return{value:u,rest:c}}}function Q1(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Y1(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function K1(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let o=t.valueCallback?t.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(i.length);return{value:o,rest:a}}}const X1=/^(\d+)(th|st|nd|rd)?/i,q1=/\d+/i,G1={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},J1={any:[/^b/i,/^(a|c)/i]},Z1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},e_={any:[/1/i,/2/i,/3/i,/4/i]},t_={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},n_={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]},r_={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},i_={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]},s_={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},o_={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}},a_={ordinalNumber:K1({matchPattern:X1,parsePattern:q1,valueCallback:t=>parseInt(t,10)}),era:es({matchPatterns:G1,defaultMatchWidth:"wide",parsePatterns:J1,defaultParseWidth:"any"}),quarter:es({matchPatterns:Z1,defaultMatchWidth:"wide",parsePatterns:e_,defaultParseWidth:"any",valueCallback:t=>t+1}),month:es({matchPatterns:t_,defaultMatchWidth:"wide",parsePatterns:n_,defaultParseWidth:"any"}),day:es({matchPatterns:r_,defaultMatchWidth:"wide",parsePatterns:i_,defaultParseWidth:"any"}),dayPeriod:es({matchPatterns:s_,defaultMatchWidth:"any",parsePatterns:o_,defaultParseWidth:"any"})},l_={code:"en-US",formatDistance:N1,formatLong:L1,formatRelative:I1,localize:V1,match:a_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function u_(t){const e=zt(t);return C1(e,T1(e))+1}function c_(t){const e=zt(t),n=+Ba(e)-+E1(e);return Math.round(n/By)+1}function Hy(t,e){var c,d,h,f;const n=zt(t),r=n.getFullYear(),i=fl(),s=(e==null?void 0:e.firstWeekContainsDate)??((d=(c=e==null?void 0:e.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,o=Wr(t,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=Ys(o,e),l=Wr(t,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Ys(l,e);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function d_(t,e){var a,l,u,c;const n=fl(),r=(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??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=Hy(t,e),s=Wr(t,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Ys(s,e)}function h_(t,e){const n=zt(t),r=+Ys(n,e)-+d_(n,e);return Math.round(r/By)+1}function Z(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const kn={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Z(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Z(n+1,2)},d(t,e){return Z(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 Z(t.getHours()%12||12,e.length)},H(t,e){return Z(t.getHours(),e.length)},m(t,e){return Z(t.getMinutes(),e.length)},s(t,e){return Z(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Z(i,e.length)}},Qr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cf={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return kn.y(t,e)},Y:function(t,e,n,r){const i=Hy(t,r),s=i>0?i:1-i;if(e==="YY"){const o=s%100;return Z(o,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):Z(s,e.length)},R:function(t,e){const n=Wy(t);return Z(n,e.length)},u:function(t,e){const n=t.getFullYear();return Z(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Z(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Z(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return kn.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return Z(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const i=h_(t,r);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):Z(i,e.length)},I:function(t,e,n){const r=c_(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Z(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):kn.d(t,e)},D:function(t,e,n){const r=u_(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Z(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":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"})}},e:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Z(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const i=t.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Z(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return Z(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let i;switch(r===12?i=Qr.noon:r===0?i=Qr.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let i;switch(r>=17?i=Qr.evening:r>=12?i=Qr.afternoon:r>=4?i=Qr.morning:i=Qr.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return kn.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):kn.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Z(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Z(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):kn.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):kn.s(t,e)},S:function(t,e){return kn.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return Pf(r);case"XXXX":case"XX":return gr(r);case"XXXXX":case"XXX":default:return gr(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return Pf(r);case"xxxx":case"xx":return gr(r);case"xxxxx":case"xxx":default:return gr(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ef(r,":");case"OOOO":default:return"GMT"+gr(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ef(r,":");case"zzzz":default:return"GMT"+gr(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return Z(r,e.length)},T:function(t,e,n){const r=t.getTime();return Z(r,e.length)}};function Ef(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+e+Z(s,2)}function Pf(t,e){return t%60===0?(t>0?"-":"+")+Z(Math.abs(t)/60,2):gr(t,e)}function gr(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),i=Z(Math.trunc(r/60),2),s=Z(r%60,2);return n+i+e+s}const Mf=(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"})}},$y=(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"})}},f_=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Mf(t,e);let s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Mf(r,e)).replace("{{time}}",$y(i,e))},p_={p:$y,P:f_},m_=/^D+$/,g_=/^Y+$/,y_=["D","DD","YY","YYYY"];function v_(t){return m_.test(t)}function x_(t){return g_.test(t)}function w_(t,e,n){const r=b_(t,e,n);if(console.warn(r),y_.includes(t))throw new RangeError(r)}function b_(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const __=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,S_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,k_=/^'([^]*?)'?$/,C_=/''/g,E_=/[a-zA-Z]/;function fn(t,e,n){var c,d,h,f;const r=fl(),i=r.locale??l_,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,o=r.weekStartsOn??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??0,a=zt(t);if(!M1(a))throw new RangeError("Invalid time value");let l=e.match(S_).map(v=>{const y=v[0];if(y==="p"||y==="P"){const w=p_[y];return w(v,i.formatLong)}return v}).join("").match(__).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const y=v[0];if(y==="'")return{isToken:!1,value:P_(v)};if(Cf[y])return{isToken:!0,value:v};if(y.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:v}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(v=>{if(!v.isToken)return v.value;const y=v.value;(x_(y)||v_(y))&&w_(y,e,String(t));const w=Cf[y[0]];return w(a,y,i.localize,u)}).join("")}function P_(t){const e=t.match(k_);return e?e[1].replace(C_,"'"):t}function M_({displayName:t,sessionCount:e,lastActivity:n,sessions:r,selectedId:i,onSelectSession:s,initialExpanded:o=!1}){const[a,l]=k.useState(o);return k.useEffect(()=>{i&&r.some(c=>{var d;return c.id===i||((d=c.agentSessions)==null?void 0:d.some(h=>h.id===i))})&&l(!0)},[i,r]),p.jsxs("div",{className:"border-b border-gray-700",children:[p.jsx("button",{onClick:()=>l(!a),className:"sticky top-0 z-10 w-full text-left p-4 bg-gray-900 hover:bg-gray-800 transition-colors flex items-center justify-between",children:p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("svg",{className:`w-4 h-4 transition-transform ${a?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),p.jsx("span",{className:"font-semibold text-sm truncate",children:t})]}),p.jsxs("div",{className:"text-xs text-gray-400 mt-1 ml-6",children:[e," session",e!==1?"s":""," · Last activity"," ",fn(new Date(n),"PPp")]})]})}),a&&p.jsx("div",{className:"bg-gray-900/50",children:r.map(u=>p.jsxs("div",{children:[p.jsxs("button",{onClick:()=>s(u.id),className:`w-full text-left px-4 py-3 pl-8 hover:bg-gray-700/50 transition-colors border-l-2 ${i===u.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[u.title&&p.jsx("div",{className:"text-sm font-medium text-gray-200 mb-1 truncate",children:u.title}),p.jsx("div",{className:"text-xs text-gray-400",children:fn(new Date(u.timestamp),"PPpp")}),p.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[u.messageCount," message",u.messageCount!==1?"s":"",u.agentSessions&&u.agentSessions.length>0&&p.jsxs("span",{className:"ml-2",children:["· ",u.agentSessions.length," task",u.agentSessions.length!==1?"s":""]})]})]}),u.agentSessions&&u.agentSessions.length>0&&p.jsx("div",{className:"bg-gray-900/70",children:u.agentSessions.map(c=>p.jsxs("button",{onClick:()=>s(c.id),className:`w-full text-left px-4 py-2 pl-14 hover:bg-gray-700/50 transition-colors border-l-2 ${i===c.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:"TASK"}),c.title&&p.jsx("span",{className:"text-sm font-medium text-gray-300 truncate",children:c.title})]}),p.jsx("div",{className:"text-xs text-gray-400",children:fn(new Date(c.timestamp),"PPpp")}),p.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[c.messageCount," message",c.messageCount!==1?"s":""]})]},c.id))})]},u.id))})]})}function T_({projects:t,selectedId:e,onSelect:n}){const r=i=>e?i.sessions.some(s=>{var o;return s.id===e||((o=s.agentSessions)==null?void 0:o.some(a=>a.id===e))}):!1;return p.jsx("div",{children:t.map(i=>p.jsx(M_,{name:i.name,displayName:i.displayName,sessionCount:i.sessionCount,lastActivity:i.lastActivity,sessions:i.sessions,selectedId:e,onSelectSession:n,initialExpanded:r(i)},i.name))})}function R_({messages:t,activeId:e,onNavigate:n}){const[r,i]=k.useState([]),s=k.useRef(null),o=k.useRef(null);k.useEffect(()=>{const l=t.map((u,c)=>{var v;const d=`message-${c}`;let h="";const f=[];if((v=u.message)!=null&&v.content&&Array.isArray(u.message.content)){const y=u.message.content.find(w=>w.type==="text");y&&(h=y.text.slice(0,50)+(y.text.length>50?"...":"")),u.message.content.forEach(w=>{w.type==="tool_use"?f.push({name:w.name,type:"tool_use"}):w.type==="tool_result"&&f.push({name:"Tool Result",type:"tool_result"})})}return{id:d,type:u.type||"system",text:h,toolUses:f,timestamp:u.timestamp}});i(l)},[t]),k.useEffect(()=>{if(s.current&&o.current){const l=o.current,u=s.current,c=l.getBoundingClientRect(),d=u.getBoundingClientRect();(d.top<c.top||d.bottom>c.bottom)&&u.scrollIntoView({behavior:"smooth",block:"nearest"})}},[e]);const a=l=>{n(l,!0)};return p.jsxs("div",{className:"w-full h-full flex flex-col border-l border-gray-700 bg-gray-800",children:[p.jsxs("div",{className:"p-4 border-b border-gray-700 bg-gray-800 flex-shrink-0",children:[p.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Table of Contents"}),p.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[r.length," messages"]})]}),p.jsx("nav",{ref:o,className:"p-2 flex-1 overflow-y-auto",children:r.map((l,u)=>p.jsx("div",{className:"mb-1",children:p.jsxs("button",{ref:e===l.id?s: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:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.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}),p.jsxs("span",{className:"text-gray-500",children:["#",u+1]})]}),l.text&&p.jsx("div",{className:"text-gray-300 line-clamp-2 leading-tight",children:l.text}),l.toolUses.length>0&&p.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:l.toolUses.map((c,d)=>p.jsxs("span",{className:`px-1.5 py-0.5 text-[10px] rounded font-mono ${c.type==="tool_result"?"bg-green-900/30 text-green-400":"bg-yellow-900/30 text-yellow-400"}`,children:[c.type==="tool_result"?"✓":"🔧"," ",c.name]},d))})]})},l.id))})]})}const yc=256,Tf=640,N_=896,O_=N_+yc;function j_({sessionId:t,sessionInfo:e}){var ve,j,A;const[n,r]=k.useState(null),[i,s]=k.useState(!0),[o,a]=k.useState(null),l=k.useRef(new Map),u=k.useRef(!1),c=k.useRef(null),d=k.useRef(null),h=k.useRef(null),f=k.useRef(null),v=k.useRef(!1),y=k.useRef(0),w=k.useRef(0),m=k.useRef(null),g=k.useRef(null),x=k.useRef(null),b=k.useRef(null),C=k.useRef(null),P=k.useRef(null),_=k.useRef(null),E=k.useRef(null),O=k.useRef(0),{data:M,isLoading:T,error:I}=Cd({queryKey:["session",t],queryFn:async()=>{const R=await fetch(`/api/sessions/${t}`);if(!R.ok)throw new Error("Failed to fetch session");return R.json()}});k.useEffect(()=>{y.current=0,w.current=0,m.current!==null&&(cancelAnimationFrame(m.current),m.current=null),O.current=0,r(null),c.current=null,v.current=!1;const R=E.current;R&&(R.scrollTop=0)},[t]);const W=R=>{const B=x.current;if(!B)return;const H=14+R*8,ne=1.25+R*.25,$=R,re=R,pe=Math.max(0,1-$);B.style.padding=`${H}px 24px`,b.current&&(b.current.style.fontSize=`${ne}rem`),C.current&&(C.current.style.opacity=`${$}`,C.current.style.height=$>0?"auto":"0"),P.current&&(P.current.style.opacity=`${re}`,P.current.style.height=re>0?"auto":"0",P.current.style.marginTop=re>0?"1rem":"0"),_.current&&(_.current.style.opacity=`${pe}`)};k.useEffect(()=>{const R=o;if(!R)return;const B=()=>{var Le;const ne=y.current,$=w.current,re=$+(ne-$)*.2,pe=R.scrollHeight-(re+R.clientHeight),en=pe<=5,ft=re<O.current;let $e=v.current;$e?pe>40&&($e=!1):en&&($e=!0),v.current=$e;const ur=Math.max(0,1-(ft?0:$e?80:re)/80);W(ur),w.current=re,O.current=re,Math.abs(ne-re)>.5?m.current=requestAnimationFrame(B):(w.current=ne,O.current=ne,m.current=null,$e&&((Le=h.current)==null||Le.call(h)))},H=()=>{y.current=R.scrollTop,m.current===null&&(m.current=requestAnimationFrame(B))};return R.addEventListener("scroll",H),()=>{R.removeEventListener("scroll",H),m.current!==null&&(cancelAnimationFrame(m.current),m.current=null)}},[t,o]),k.useEffect(()=>{if(!g.current)return;const R=g.current.parentElement??g.current,B=$=>{s($>=O_)},H=new ResizeObserver($=>{for(const re of $)B(re.contentRect.width)}),ne=R.getBoundingClientRect().width;return B(ne),H.observe(R),()=>{H.disconnect()}},[]),k.useEffect(()=>{var en;if(!((en=M==null?void 0:M.session)!=null&&en.messages))return;const R=E.current;if(!R)return;const B=new Set;let H=null;const ne=()=>{if(u.current)return;const ft=[];l.current.forEach((Ue,le)=>{const Re=Ue.getBoundingClientRect();ft.push({id:le,element:Ue,rect:Re})}),ft.sort((Ue,le)=>Ue.rect.top-le.rect.top);const $e=R.getBoundingClientRect(),Bt=$e.top,ur=$e.bottom;let Le=null;for(const Ue of ft){const le=Ue.rect.top>=Bt&&Ue.rect.bottom<=ur,Re=Ue.rect.bottom>Bt&&Ue.rect.top<ur;if(le){Le=Ue.id;break}else Re&&!Le&&(Le=Ue.id)}Le&&Le!==c.current&&r(Le)},$=()=>{const ft=f.current;if(u.current&&ft){const le=l.current.get(ft);if(le){const Re=R.getBoundingClientRect(),po=le.getBoundingClientRect();if(!(po.top>=Re.top&&po.top<=Re.top+5))return}u.current=!1,f.current=null}if(v.current){const le=M.session.messages.length-1,Re=le>=0?`message-${le}`:null;Re&&Re!==c.current&&r(Re);return}if(B.size===0){ne();return}const $e=R.getBoundingClientRect(),Bt=$e.top,ur=$e.bottom;let Le=null;const Ue=Array.from(B).map(le=>{const Re=l.current.get(le);return Re?{id:le,rect:Re.getBoundingClientRect()}:null}).filter(le=>!!le);if(Ue.length===0){ne();return}Ue.sort((le,Re)=>le.rect.top-Re.rect.top);for(const le of Ue){const Re=le.rect.top>=Bt&&le.rect.bottom<=ur,po=le.rect.bottom>Bt&&le.rect.top<ur;if(Re){Le=le.id;break}else po&&!Le&&(Le=le.id)}Le&&Le!==c.current&&r(Le)},re=()=>{H!==null&&cancelAnimationFrame(H),H=requestAnimationFrame(()=>{H=null,$()})};h.current=$;const pe=new IntersectionObserver(ft=>{for(const $e of ft){const Bt=$e.target.dataset.messageId;Bt&&($e.isIntersecting?B.add(Bt):B.delete(Bt))}re()},{root:R,threshold:[0,.1,.5,1]});return l.current.forEach(ft=>pe.observe(ft)),re(),()=>{pe.disconnect(),h.current=null,H!==null&&cancelAnimationFrame(H)}},[(ve=M==null?void 0:M.session)==null?void 0:ve.messages,o]),k.useEffect(()=>{c.current=n},[n]),k.useEffect(()=>{W(1)},[(j=M==null?void 0:M.session)==null?void 0:j.id]);const oe=k.useCallback(R=>{E.current=R,a(B=>B===R?B:R)},[]),J=(R,B=!1)=>{if(r(R),B){u.current=!0,f.current=R,d.current&&(clearTimeout(d.current),d.current=null);const H=l.current.get(R);H&&H.scrollIntoView({behavior:"smooth",block:"start"}),d.current=setTimeout(()=>{var ne;u.current=!1,f.current=null,d.current=null,(ne=h.current)==null||ne.call(h)},1500)}};if(k.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),T&&!M&&!e)return p.jsxs("div",{className:"h-full flex min-w-0",children:[p.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Tf}px`},children:[p.jsx("div",{className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 p-6",children:p.jsxs("div",{className:"animate-pulse",children:[p.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-3"}),p.jsx("div",{className:"h-5 bg-gray-700 rounded w-1/3 mb-4"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"h-4 bg-gray-700 rounded w-32"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-4"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-24"})]})]})}),p.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:p.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(R=>p.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),p.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},R))})})]}),i&&p.jsx("div",{style:{width:`${yc}px`,flexShrink:0},className:"border-l border-gray-700 bg-gray-800/30 p-4",children:p.jsxs("div",{className:"animate-pulse space-y-3",children:[p.jsx("div",{className:"h-5 bg-gray-700 rounded w-3/4"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4"})]})})]});if(I)return p.jsx("div",{className:"flex items-center justify-center h-full",children:p.jsxs("div",{className:"text-red-400",children:["Error: ",I.message]})});const F=(M==null?void 0:M.session)||e;return p.jsxs("div",{ref:g,className:"h-full flex min-w-0",children:[p.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Tf}px`},children:[p.jsxs("div",{ref:x,className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 transition-all duration-200",style:{padding:"22px 24px"},children:[p.jsxs("div",{className:"flex items-center gap-2",children:[(F==null?void 0:F.isAgent)&&p.jsx("span",{className:"px-2 py-1 text-xs bg-purple-900/50 text-purple-300 rounded font-semibold",children:"TASK"}),p.jsx("h2",{ref:b,className:"font-bold truncate flex-1 transition-all duration-200",style:{fontSize:"1.5rem"},children:(F==null?void 0:F.title)||"Untitled Session"}),p.jsx("span",{ref:_,className:"px-2 py-1 text-xs bg-gray-700 text-gray-300 rounded transition-opacity duration-200",style:{opacity:0},children:F==null?void 0:F.project})]}),p.jsx("div",{ref:C,className:"text-xl text-gray-300 transition-all duration-200",style:{opacity:1,height:"auto",overflow:"hidden",marginTop:"-2px"},children:F==null?void 0:F.project}),p.jsxs("div",{ref:P,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:[p.jsx("span",{children:(F==null?void 0:F.timestamp)&&fn(new Date(F.timestamp),"PPpp")}),p.jsx("span",{children:"•"}),p.jsxs("span",{children:[(F==null?void 0:F.messageCount)||0," message",(F==null?void 0:F.messageCount)!==1?"s":""]}),(F==null?void 0:F.agentSessions)&&F.agentSessions.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{children:"•"}),p.jsxs("span",{children:[F.agentSessions.length," task",F.agentSessions.length!==1?"s":""]})]})]})]}),p.jsx("div",{ref:oe,className:"flex-1 overflow-y-auto p-6",children:T&&!(F!=null&&F.messages)?p.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(R=>p.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),p.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),p.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},R))}):p.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:(A=F==null?void 0:F.messages)==null?void 0:A.map((R,B)=>{var ne;const H=`message-${B}`;return p.jsxs("div",{ref:$=>{$?l.current.set(H,$):l.current.delete(H)},"data-message-id":H,className:"border-l-2 border-gray-700 pl-4",style:{scrollMarginTop:"24px"},children:[p.jsx("div",{className:"flex items-start justify-between mb-2",children:p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:`px-2 py-1 text-xs rounded ${R.type==="user"?"bg-blue-900 text-blue-200":R.type==="assistant"?"bg-green-900 text-green-200":"bg-gray-700 text-gray-300"}`,children:R.type||"system"}),p.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["#",B+1]}),R.timestamp&&p.jsx("span",{className:"text-xs text-gray-500",children:fn(new Date(R.timestamp),"HH:mm:ss")})]})}),p.jsx("div",{className:"bg-gray-800 rounded-lg p-4 text-sm",children:(ne=R.message)!=null&&ne.content&&Array.isArray(R.message.content)?p.jsx("div",{className:"space-y-2",children:R.message.content.map(($,re)=>p.jsxs("div",{children:[$.type==="text"&&p.jsx("p",{className:"whitespace-pre-wrap",children:$.text}),$.type==="tool_use"&&p.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsxs("div",{className:"text-yellow-400 font-mono text-xs",children:["🔧 ",$.name]}),$.name==="Task"&&$.agentId&&p.jsx(Dd,{to:`/sessions/agent-${$.agentId}`,className:"px-2 py-1 text-xs bg-purple-700 hover:bg-purple-600 text-purple-100 rounded transition-colors",children:"View Task →"})]}),p.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify($.input,null,2)})]}),$.type==="tool_result"&&p.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[p.jsx("div",{className:"text-green-400 font-mono text-xs mb-2",children:"✓ Tool Result"}),p.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:typeof $.content=="string"?$.content:JSON.stringify($.content,null,2)})]})]},re))}):p.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify(R,null,2)})})]},B)})})})]}),i&&(F==null?void 0:F.messages)&&F.messages.length>0&&p.jsx("div",{style:{width:`${yc}px`,flexShrink:0},children:p.jsx(R_,{messages:F.messages,activeId:n,onNavigate:J})})]})}/*!
52
52
  * @kurkle/color v0.3.4
53
53
  * https://github.com/kurkle/color#readme
54
54
  * (c) 2024 Jukka Kurkela
55
55
  * Released under the MIT License
56
- */function fo(t){return t+.5|0}const Wn=(t,e,n)=>Math.max(Math.min(t,n),e);function ds(t){return Wn(fo(t*2.55),0,255)}function Zn(t){return Wn(fo(t*255),0,255)}function ln(t){return Wn(fo(t/2.55)/100,0,1)}function Tf(t){return Wn(fo(t*100),0,100)}const pt={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},vc=[..."0123456789ABCDEF"],D_=t=>vc[t&15],L_=t=>vc[(t&240)>>4]+vc[t&15],Lo=t=>(t&240)>>4===(t&15),F_=t=>Lo(t.r)&&Lo(t.g)&&Lo(t.b)&&Lo(t.a);function I_(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&pt[t[1]]*17,g:255&pt[t[2]]*17,b:255&pt[t[3]]*17,a:e===5?pt[t[4]]*17:255}:(e===7||e===9)&&(n={r:pt[t[1]]<<4|pt[t[2]],g:pt[t[3]]<<4|pt[t[4]],b:pt[t[5]]<<4|pt[t[6]],a:e===9?pt[t[7]]<<4|pt[t[8]]:255})),n}const A_=(t,e)=>t<255?e(t):"";function z_(t){var e=F_(t)?D_:L_;return t?"#"+e(t.r)+e(t.g)+e(t.b)+A_(t.a,e):void 0}const B_=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Uy(t,e,n){const r=e*Math.min(n,1-n),i=(s,o=(s+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function W_(t,e,n){const r=(i,s=(i+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function H_(t,e,n){const r=Uy(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)r[i]*=1-e-n,r[i]+=e;return r}function $_(t,e,n,r,i){return t===i?(e-n)/r+(e<n?6:0):e===i?(n-t)/r+2:(t-e)/r+4}function Ld(t){const n=t.r/255,r=t.g/255,i=t.b/255,s=Math.max(n,r,i),o=Math.min(n,r,i),a=(s+o)/2;let l,u,c;return s!==o&&(c=s-o,u=a>.5?c/(2-s-o):c/(s+o),l=$_(n,r,i,c,s),l=l*60+.5),[l|0,u||0,a]}function Fd(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(Zn)}function Id(t,e,n){return Fd(Uy,t,e,n)}function U_(t,e,n){return Fd(H_,t,e,n)}function V_(t,e,n){return Fd(W_,t,e,n)}function Vy(t){return(t%360+360)%360}function Q_(t){const e=B_.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?ds(+e[5]):Zn(+e[5]));const i=Vy(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?r=U_(i,s,o):e[1]==="hsv"?r=V_(i,s,o):r=Id(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function Y_(t,e){var n=Ld(t);n[0]=Vy(n[0]+e),n=Id(n),t.r=n[0],t.g=n[1],t.b=n[2]}function K_(t){if(!t)return;const e=Ld(t),n=e[0],r=Tf(e[1]),i=Tf(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${i}%, ${ln(t.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const Of={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"},Nf={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 X_(){const t={},e=Object.keys(Nf),n=Object.keys(Of);let r,i,s,o,a;for(r=0;r<e.length;r++){for(o=a=e[r],i=0;i<n.length;i++)s=n[i],a=a.replace(s,Of[s]);s=parseInt(Nf[o],16),t[a]=[s>>16&255,s>>8&255,s&255]}return t}let Fo;function q_(t){Fo||(Fo=X_(),Fo.transparent=[0,0,0,0]);const e=Fo[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const G_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function J_(t){const e=G_.exec(t);let n=255,r,i,s;if(e){if(e[7]!==r){const o=+e[7];n=e[8]?ds(o):Wn(o*255,0,255)}return r=+e[1],i=+e[3],s=+e[5],r=255&(e[2]?ds(r):Wn(r,0,255)),i=255&(e[4]?ds(i):Wn(i,0,255)),s=255&(e[6]?ds(s):Wn(s,0,255)),{r,g:i,b:s,a:n}}}function Z_(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ln(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Xl=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Yr=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function eS(t,e,n){const r=Yr(ln(t.r)),i=Yr(ln(t.g)),s=Yr(ln(t.b));return{r:Zn(Xl(r+n*(Yr(ln(e.r))-r))),g:Zn(Xl(i+n*(Yr(ln(e.g))-i))),b:Zn(Xl(s+n*(Yr(ln(e.b))-s))),a:t.a+n*(e.a-t.a)}}function Io(t,e,n){if(t){let r=Ld(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=Id(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Qy(t,e){return t&&Object.assign(e||{},t)}function jf(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=Zn(t[3]))):(e=Qy(t,{r:0,g:0,b:0,a:1}),e.a=Zn(e.a)),e}function tS(t){return t.charAt(0)==="r"?J_(t):Q_(t)}class Ks{constructor(e){if(e instanceof Ks)return e;const n=typeof e;let r;n==="object"?r=jf(e):n==="string"&&(r=I_(e)||q_(e)||tS(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Qy(this._rgb);return e&&(e.a=ln(e.a)),e}set rgb(e){this._rgb=jf(e)}rgbString(){return this._valid?Z_(this._rgb):void 0}hexString(){return this._valid?z_(this._rgb):void 0}hslString(){return this._valid?K_(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,i=e.rgb;let s;const o=n===s?.5:n,a=2*o-1,l=r.a-i.a,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-u,r.r=255&u*r.r+s*i.r+.5,r.g=255&u*r.g+s*i.g+.5,r.b=255&u*r.b+s*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=eS(this._rgb,e._rgb,n)),this}clone(){return new Ks(this.rgb)}alpha(e){return this._rgb.a=Zn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=fo(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 Io(this._rgb,2,e),this}darken(e){return Io(this._rgb,2,-e),this}saturate(e){return Io(this._rgb,1,e),this}desaturate(e){return Io(this._rgb,1,-e),this}rotate(e){return Y_(this._rgb,e),this}}/*!
56
+ */function fo(t){return t+.5|0}const Wn=(t,e,n)=>Math.max(Math.min(t,n),e);function ds(t){return Wn(fo(t*2.55),0,255)}function Zn(t){return Wn(fo(t*255),0,255)}function ln(t){return Wn(fo(t/2.55)/100,0,1)}function Rf(t){return Wn(fo(t*100),0,100)}const pt={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},vc=[..."0123456789ABCDEF"],D_=t=>vc[t&15],L_=t=>vc[(t&240)>>4]+vc[t&15],Lo=t=>(t&240)>>4===(t&15),F_=t=>Lo(t.r)&&Lo(t.g)&&Lo(t.b)&&Lo(t.a);function I_(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&pt[t[1]]*17,g:255&pt[t[2]]*17,b:255&pt[t[3]]*17,a:e===5?pt[t[4]]*17:255}:(e===7||e===9)&&(n={r:pt[t[1]]<<4|pt[t[2]],g:pt[t[3]]<<4|pt[t[4]],b:pt[t[5]]<<4|pt[t[6]],a:e===9?pt[t[7]]<<4|pt[t[8]]:255})),n}const A_=(t,e)=>t<255?e(t):"";function z_(t){var e=F_(t)?D_:L_;return t?"#"+e(t.r)+e(t.g)+e(t.b)+A_(t.a,e):void 0}const B_=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Uy(t,e,n){const r=e*Math.min(n,1-n),i=(s,o=(s+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function W_(t,e,n){const r=(i,s=(i+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function H_(t,e,n){const r=Uy(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)r[i]*=1-e-n,r[i]+=e;return r}function $_(t,e,n,r,i){return t===i?(e-n)/r+(e<n?6:0):e===i?(n-t)/r+2:(t-e)/r+4}function Ld(t){const n=t.r/255,r=t.g/255,i=t.b/255,s=Math.max(n,r,i),o=Math.min(n,r,i),a=(s+o)/2;let l,u,c;return s!==o&&(c=s-o,u=a>.5?c/(2-s-o):c/(s+o),l=$_(n,r,i,c,s),l=l*60+.5),[l|0,u||0,a]}function Fd(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(Zn)}function Id(t,e,n){return Fd(Uy,t,e,n)}function U_(t,e,n){return Fd(H_,t,e,n)}function V_(t,e,n){return Fd(W_,t,e,n)}function Vy(t){return(t%360+360)%360}function Q_(t){const e=B_.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?ds(+e[5]):Zn(+e[5]));const i=Vy(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?r=U_(i,s,o):e[1]==="hsv"?r=V_(i,s,o):r=Id(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function Y_(t,e){var n=Ld(t);n[0]=Vy(n[0]+e),n=Id(n),t.r=n[0],t.g=n[1],t.b=n[2]}function K_(t){if(!t)return;const e=Ld(t),n=e[0],r=Rf(e[1]),i=Rf(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${i}%, ${ln(t.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const Nf={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"},Of={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 X_(){const t={},e=Object.keys(Of),n=Object.keys(Nf);let r,i,s,o,a;for(r=0;r<e.length;r++){for(o=a=e[r],i=0;i<n.length;i++)s=n[i],a=a.replace(s,Nf[s]);s=parseInt(Of[o],16),t[a]=[s>>16&255,s>>8&255,s&255]}return t}let Fo;function q_(t){Fo||(Fo=X_(),Fo.transparent=[0,0,0,0]);const e=Fo[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const G_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function J_(t){const e=G_.exec(t);let n=255,r,i,s;if(e){if(e[7]!==r){const o=+e[7];n=e[8]?ds(o):Wn(o*255,0,255)}return r=+e[1],i=+e[3],s=+e[5],r=255&(e[2]?ds(r):Wn(r,0,255)),i=255&(e[4]?ds(i):Wn(i,0,255)),s=255&(e[6]?ds(s):Wn(s,0,255)),{r,g:i,b:s,a:n}}}function Z_(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ln(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Xl=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Yr=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function eS(t,e,n){const r=Yr(ln(t.r)),i=Yr(ln(t.g)),s=Yr(ln(t.b));return{r:Zn(Xl(r+n*(Yr(ln(e.r))-r))),g:Zn(Xl(i+n*(Yr(ln(e.g))-i))),b:Zn(Xl(s+n*(Yr(ln(e.b))-s))),a:t.a+n*(e.a-t.a)}}function Io(t,e,n){if(t){let r=Ld(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=Id(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Qy(t,e){return t&&Object.assign(e||{},t)}function jf(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=Zn(t[3]))):(e=Qy(t,{r:0,g:0,b:0,a:1}),e.a=Zn(e.a)),e}function tS(t){return t.charAt(0)==="r"?J_(t):Q_(t)}class Ks{constructor(e){if(e instanceof Ks)return e;const n=typeof e;let r;n==="object"?r=jf(e):n==="string"&&(r=I_(e)||q_(e)||tS(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Qy(this._rgb);return e&&(e.a=ln(e.a)),e}set rgb(e){this._rgb=jf(e)}rgbString(){return this._valid?Z_(this._rgb):void 0}hexString(){return this._valid?z_(this._rgb):void 0}hslString(){return this._valid?K_(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,i=e.rgb;let s;const o=n===s?.5:n,a=2*o-1,l=r.a-i.a,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-u,r.r=255&u*r.r+s*i.r+.5,r.g=255&u*r.g+s*i.g+.5,r.b=255&u*r.b+s*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=eS(this._rgb,e._rgb,n)),this}clone(){return new Ks(this.rgb)}alpha(e){return this._rgb.a=Zn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=fo(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 Io(this._rgb,2,e),this}darken(e){return Io(this._rgb,2,-e),this}saturate(e){return Io(this._rgb,1,e),this}desaturate(e){return Io(this._rgb,1,-e),this}rotate(e){return Y_(this._rgb,e),this}}/*!
57
57
  * Chart.js v4.5.1
58
58
  * https://www.chartjs.org
59
59
  * (c) 2025 Chart.js Contributors
60
60
  * Released under the MIT License
61
- */function tn(){}const nS=(()=>{let t=0;return()=>t++})();function ie(t){return t==null}function Ce(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 X(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Ct(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Ht(t,e){return Ct(t)?t:e}function q(t,e){return typeof t>"u"?e:t}const rS=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ue(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function ee(t,e,n,r){let i,s,o;if(Ce(t))for(s=t.length,i=0;i<s;i++)e.call(n,t[i],i);else if(X(t))for(o=Object.keys(t),s=o.length,i=0;i<s;i++)e.call(n,t[o[i]],o[i])}function Wa(t,e){let n,r,i,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(i=t[n],s=e[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Ha(t){if(Ce(t))return t.map(Ha);if(X(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let i=0;for(;i<r;++i)e[n[i]]=Ha(t[n[i]]);return e}return t}function Yy(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function iS(t,e,n,r){if(!Yy(t))return;const i=e[t],s=n[t];X(i)&&X(s)?Xs(i,s,r):e[t]=Ha(s)}function Xs(t,e,n){const r=Ce(e)?e:[e],i=r.length;if(!X(t))return t;n=n||{};const s=n.merger||iS;let o;for(let a=0;a<i;++a){if(o=r[a],!X(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)s(l[u],t,o,n)}return t}function Ss(t,e){return Xs(t,e,{merger:sS})}function sS(t,e,n){if(!Yy(t))return;const r=e[t],i=n[t];X(r)&&X(i)?Ss(r,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ha(i))}const Df={"":t=>t,x:t=>t.x,y:t=>t.y};function oS(t){const e=t.split("."),n=[];let r="";for(const i of e)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function aS(t){const e=oS(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function Di(t,e){return(Df[e]||(Df[e]=aS(e)))(t)}function Ad(t){return t.charAt(0).toUpperCase()+t.slice(1)}const qs=t=>typeof t<"u",ir=t=>typeof t=="function",Lf=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function lS(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const We=Math.PI,er=2*We,$a=Number.POSITIVE_INFINITY,uS=We/180,jt=We/2,cr=We/4,Ff=We*2/3,Ky=Math.log10,tr=Math.sign;function ua(t,e,n){return Math.abs(t-e)<n}function If(t){const e=Math.round(t);t=ua(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Ky(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function cS(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((i,s)=>i-s).pop(),e}function dS(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ua(t){return!dS(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function hS(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function fS(t,e,n){let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function _r(t){return t*(We/180)}function pS(t){return t*(180/We)}function Af(t){if(!Ct(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function mS(t,e){const n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*We&&(s+=er),{angle:s,distance:i}}function gS(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dr(t){return(t%er+er)%er}function yS(t,e,n,r){const i=dr(t),s=dr(e),o=dr(n),a=dr(s-i),l=dr(o-i),u=dr(i-s),c=dr(i-o);return i===s||i===o||r||a>l&&u<c}function Dt(t,e,n){return Math.max(e,Math.min(n,t))}function vS(t){return Dt(t,-32768,32767)}function oi(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function zd(t,e,n){n=n||(o=>t[o]<e);let r=t.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const xc=(t,e,n,r)=>zd(t,n,r?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),xS=(t,e,n)=>zd(t,n,r=>t[r][e]>=n);function wS(t,e,n){let r=0,i=t.length;for(;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}const Xy=["push","pop","shift","splice","unshift"];function bS(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Xy.forEach(n=>{const r="_onData"+Ad(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function zf(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(e);i!==-1&&r.splice(i,1),!(r.length>0)&&(Xy.forEach(s=>{delete t[s]}),delete t._chartjs)}function qy(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Gy=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function Jy(t,e){let n=[],r=!1;return function(...i){n=i,r||(r=!0,Gy.call(window,()=>{r=!1,t.apply(e,n)}))}}function _S(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const Bd=t=>t==="start"?"left":t==="end"?"right":"center",Ae=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,SS=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,Ao=t=>t===0||t===1,Bf=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*er/n)),Wf=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*er/n)+1,ks={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*jt)+1,easeOutSine:t=>Math.sin(t*jt),easeInOutSine:t=>-.5*(Math.cos(We*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=>Ao(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=>Ao(t)?t:Bf(t,.075,.3),easeOutElastic:t=>Ao(t)?t:Wf(t,.075,.3),easeInOutElastic(t){return Ao(t)?t:t<.5?.5*Bf(t*2,.1125,.45):.5+.5*Wf(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-ks.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?ks.easeInBounce(t*2)*.5:ks.easeOutBounce(t*2-1)*.5+.5};function Zy(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Hf(t){return Zy(t)?t:new Ks(t)}function ql(t){return Zy(t)?t:new Ks(t).saturate(.5).darken(.1).hexString()}const kS=["x","y","borderWidth","radius","tension"],CS=["color","borderColor","backgroundColor"];function ES(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:CS},numbers:{type:"number",properties:kS}}),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 PS(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $f=new Map;function MS(t,e){e=e||{};const n=t+JSON.stringify(e);let r=$f.get(n);return r||(r=new Intl.NumberFormat(t,e),$f.set(n,r)),r}function e0(t,e,n){return MS(e,n).format(t)}const RS={values(t){return Ce(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let i,s=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)&&(i="scientific"),s=TS(t,n)}const o=Ky(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),e0(t,r,l)}};function TS(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 t0={formatters:RS};function OS(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:t0.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 Hr=Object.create(null),wc=Object.create(null);function Cs(t,e){if(!e)return t;const n=e.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];t=t[s]||(t[s]=Object.create(null))}return t}function Gl(t,e,n){return typeof e=="string"?Xs(Cs(t,e),n):Xs(Cs(t,""),e)}class NS{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=r=>r.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=(r,i)=>ql(i.backgroundColor),this.hoverBorderColor=(r,i)=>ql(i.borderColor),this.hoverColor=(r,i)=>ql(i.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 Gl(this,e,n)}get(e){return Cs(this,e)}describe(e,n){return Gl(wc,e,n)}override(e,n){return Gl(Hr,e,n)}route(e,n,r,i){const s=Cs(this,e),o=Cs(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=o[i];return X(l)?Object.assign({},u,l):q(l,u)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var _e=new NS({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ES,PS,OS]);function jS(t){return!t||ie(t.size)||ie(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Uf(t,e,n,r,i){let s=e[i];return s||(s=e[i]=t.measureText(i).width,n.push(i)),s>r&&(r=s),r}function hr(t,e,n){const r=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*r)/r+i}function Vf(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Qf(t,e,n,r){n0(t,e,n,r,null)}function n0(t,e,n,r,i){let s,o,a,l,u,c,d,h;const f=e.pointStyle,x=e.rotation,v=e.radius;let w=(x||0)*uS;if(f&&typeof f=="object"&&(s=f.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(w),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!(isNaN(v)||v<=0)){switch(t.beginPath(),f){default:i?t.ellipse(n,r,i/2,v,0,0,er):t.arc(n,r,v,0,er),t.closePath();break;case"triangle":c=i?i/2:v,t.moveTo(n+Math.sin(w)*c,r-Math.cos(w)*v),w+=Ff,t.lineTo(n+Math.sin(w)*c,r-Math.cos(w)*v),w+=Ff,t.lineTo(n+Math.sin(w)*c,r-Math.cos(w)*v),t.closePath();break;case"rectRounded":u=v*.516,l=v-u,o=Math.cos(w+cr)*l,d=Math.cos(w+cr)*(i?i/2-u:l),a=Math.sin(w+cr)*l,h=Math.sin(w+cr)*(i?i/2-u:l),t.arc(n-d,r-a,u,w-We,w-jt),t.arc(n+h,r-o,u,w-jt,w),t.arc(n+d,r+a,u,w,w+jt),t.arc(n-h,r+o,u,w+jt,w+We),t.closePath();break;case"rect":if(!x){l=Math.SQRT1_2*v,c=i?i/2:l,t.rect(n-c,r-l,2*c,2*l);break}w+=cr;case"rectRot":d=Math.cos(w)*(i?i/2:v),o=Math.cos(w)*v,a=Math.sin(w)*v,h=Math.sin(w)*(i?i/2:v),t.moveTo(n-d,r-a),t.lineTo(n+h,r-o),t.lineTo(n+d,r+a),t.lineTo(n-h,r+o),t.closePath();break;case"crossRot":w+=cr;case"cross":d=Math.cos(w)*(i?i/2:v),o=Math.cos(w)*v,a=Math.sin(w)*v,h=Math.sin(w)*(i?i/2:v),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+h,r-o),t.lineTo(n-h,r+o);break;case"star":d=Math.cos(w)*(i?i/2:v),o=Math.cos(w)*v,a=Math.sin(w)*v,h=Math.sin(w)*(i?i/2:v),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+h,r-o),t.lineTo(n-h,r+o),w+=cr,d=Math.cos(w)*(i?i/2:v),o=Math.cos(w)*v,a=Math.sin(w)*v,h=Math.sin(w)*(i?i/2:v),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+h,r-o),t.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(w)*v,a=Math.sin(w)*v,t.moveTo(n-o,r-a),t.lineTo(n+o,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(w)*(i?i/2:v),r+Math.sin(w)*v);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function r0(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 Wd(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Hd(t){t.restore()}function DS(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),ie(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 LS(t,e,n,r,i){if(i.strikethrough||i.underline){const s=t.measureText(r),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,u=n+s.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(o,c),t.lineTo(a,c),t.stroke()}}function FS(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Gs(t,e,n,r,i,s={}){const o=Ce(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let l,u;for(t.save(),t.font=i.string,DS(t,s),l=0;l<o.length;++l)u=o[l],s.backdrop&&FS(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),ie(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(u,n,r,s.maxWidth)),t.fillText(u,n,r,s.maxWidth),LS(t,n,r,u,s),r+=Number(i.lineHeight);t.restore()}function Va(t,e){const{x:n,y:r,w:i,h:s,radius:o}=e;t.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*We,We,!0),t.lineTo(n,r+s-o.bottomLeft),t.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,We,jt,!0),t.lineTo(n+i-o.bottomRight,r+s),t.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,jt,0,!0),t.lineTo(n+i,r+o.topRight),t.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-jt,!0),t.lineTo(n+o.topLeft,r)}const IS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,AS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zS(t,e){const n=(""+t).match(IS);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 BS=t=>+t||0;function i0(t,e){const n={},r=X(e),i=r?Object.keys(e):e,s=X(t)?r?o=>q(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of i)n[o]=BS(s(o));return n}function s0(t){return i0(t,{top:"y",right:"x",bottom:"y",left:"x"})}function fi(t){return i0(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Et(t){const e=s0(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Be(t,e){t=t||{},e=e||_e.font;let n=q(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=q(t.style,e.style);r&&!(""+r).match(AS)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:q(t.family,e.family),lineHeight:zS(q(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:q(t.weight,e.weight),string:""};return i.string=jS(i),i}function zo(t,e,n,r){let i,s,o;for(i=0,s=t.length;i<s;++i)if(o=t[i],o!==void 0&&o!==void 0)return o}function WS(t,e,n){const{min:r,max:i}=t,s=rS(e,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function Hi(t,e){return Object.assign(Object.create(t),e)}function $d(t,e=[""],n,r,i=()=>t[0]){const s=n||t;typeof r>"u"&&(r=u0("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>$d([a,...t],e,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return a0(a,l,()=>XS(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Kf(a).includes(l)},ownKeys(a){return Kf(a)},set(a,l,u){const c=a._storage||(a._storage=i());return a[l]=c[l]=u,delete a._keys,!0}})}function Li(t,e,n,r){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:o0(t,r),setContext:s=>Li(t,s,n,r),override:s=>Li(t.override(s),e,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete t[o],!0},get(s,o,a){return a0(s,o,()=>$S(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(s,o,a){return t[o]=a,delete s[o],!0}})}function o0(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:r,isScriptable:ir(n)?n:()=>n,isIndexable:ir(r)?r:()=>r}}const HS=(t,e)=>t?t+Ad(e):e,Ud=(t,e)=>X(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function a0(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function $S(t,e,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=t;let a=r[e];return ir(a)&&o.isScriptable(e)&&(a=US(e,a,t,n)),Ce(a)&&a.length&&(a=VS(e,a,t,o.isIndexable)),Ud(e,a)&&(a=Li(a,i,s&&s[e],o)),a}function US(t,e,n,r){const{_proxy:i,_context:s,_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(s,o||r);return a.delete(t),Ud(t,l)&&(l=Vd(i._scopes,i,t,l)),l}function VS(t,e,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index<"u"&&r(t))return e[s.index%e.length];if(X(e[0])){const l=e,u=i._scopes.filter(c=>c!==l);e=[];for(const c of l){const d=Vd(u,i,t,c);e.push(Li(d,s,o&&o[t],a))}}return e}function l0(t,e,n){return ir(t)?t(e,n):t}const QS=(t,e)=>t===!0?e:typeof t=="string"?Di(e,t):void 0;function YS(t,e,n,r,i){for(const s of e){const o=QS(n,s);if(o){t.add(o);const a=l0(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function Vd(t,e,n,r){const i=e._rootScopes,s=l0(e._fallback,n,r),o=[...t,...i],a=new Set;a.add(r);let l=Yf(a,o,n,s||n,r);return l===null||typeof s<"u"&&s!==n&&(l=Yf(a,o,s,l,r),l===null)?!1:$d(Array.from(a),[""],i,s,()=>KS(e,n,r))}function Yf(t,e,n,r,i){for(;n;)n=YS(t,e,n,r,i);return n}function KS(t,e,n){const r=t._getTarget();e in r||(r[e]={});const i=r[e];return Ce(i)&&X(n)?n:i||{}}function XS(t,e,n,r){let i;for(const s of e)if(i=u0(HS(s,t),n),typeof i<"u")return Ud(t,i)?Vd(n,r,t,i):i}function u0(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function Kf(t){let e=t._keys;return e||(e=t._keys=qS(t._scopes)),e}function qS(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(r);return Array.from(e)}function Qd(){return typeof window<"u"&&typeof document<"u"}function Yd(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Qa(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const pl=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function GS(t,e){return pl(t).getPropertyValue(e)}const JS=["top","right","bottom","left"];function Dr(t,e,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=JS[i];r[s]=parseFloat(t[e+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const ZS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function ek(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(ZS(i,s,t.target))a=i,l=s;else{const u=e.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:a,y:l,box:o}}function yr(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,i=pl(n),s=i.boxSizing==="border-box",o=Dr(i,"padding"),a=Dr(i,"border","width"),{x:l,y:u,box:c}=ek(t,n),d=o.left+(c&&a.left),h=o.top+(c&&a.top);let{width:f,height:x}=e;return s&&(f-=o.width+a.width,x-=o.height+a.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((u-h)/x*n.height/r)}}function tk(t,e,n){let r,i;if(e===void 0||n===void 0){const s=t&&Yd(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const o=s.getBoundingClientRect(),a=pl(s),l=Dr(a,"border","width"),u=Dr(a,"padding");e=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Qa(a.maxWidth,s,"clientWidth"),i=Qa(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:r||$a,maxHeight:i||$a}}const Hn=t=>Math.round(t*10)/10;function nk(t,e,n,r){const i=pl(t),s=Dr(i,"margin"),o=Qa(i.maxWidth,t,"clientWidth")||$a,a=Qa(i.maxHeight,t,"clientHeight")||$a,l=tk(t,e,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const h=Dr(i,"border","width"),f=Dr(i,"padding");u-=f.width+h.width,c-=f.height+h.height}return u=Math.max(0,u-s.width),c=Math.max(0,r?u/r:c-s.height),u=Hn(Math.min(u,o,l.maxWidth)),c=Hn(Math.min(c,a,l.maxHeight)),u&&!c&&(c=Hn(u/2)),(e!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=Hn(Math.floor(c*r))),{width:u,height:c}}function Xf(t,e,n){const r=e||1,i=Hn(t.height*r),s=Hn(t.width*r);t.height=Hn(t.height),t.width=Hn(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!==r||o.height!==i||o.width!==s?(t.currentDevicePixelRatio=r,o.height=i,o.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const rk=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Qd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function qf(t,e){const n=GS(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const ik=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,r){return n-r},leftForLtr(n,r){return n-r}}},sk=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function pi(t,e,n){return t?ik(e,n):sk()}function c0(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function d0(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Bo(t,e,n){return t.options.clip?t[n]:e[n]}function ok(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:Bo(n,e,"left"),right:Bo(n,e,"right"),top:Bo(r,e,"top"),bottom:Bo(r,e,"bottom")}:e}function ak(t,e){const n=e._clip;if(n.disabled)return!1;const r=ok(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
61
+ */function tn(){}const nS=(()=>{let t=0;return()=>t++})();function se(t){return t==null}function Ce(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 X(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Ct(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Ht(t,e){return Ct(t)?t:e}function q(t,e){return typeof t>"u"?e:t}const rS=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ce(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function ee(t,e,n,r){let i,s,o;if(Ce(t))for(s=t.length,i=0;i<s;i++)e.call(n,t[i],i);else if(X(t))for(o=Object.keys(t),s=o.length,i=0;i<s;i++)e.call(n,t[o[i]],o[i])}function Wa(t,e){let n,r,i,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(i=t[n],s=e[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Ha(t){if(Ce(t))return t.map(Ha);if(X(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let i=0;for(;i<r;++i)e[n[i]]=Ha(t[n[i]]);return e}return t}function Yy(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function iS(t,e,n,r){if(!Yy(t))return;const i=e[t],s=n[t];X(i)&&X(s)?Xs(i,s,r):e[t]=Ha(s)}function Xs(t,e,n){const r=Ce(e)?e:[e],i=r.length;if(!X(t))return t;n=n||{};const s=n.merger||iS;let o;for(let a=0;a<i;++a){if(o=r[a],!X(o))continue;const l=Object.keys(o);for(let u=0,c=l.length;u<c;++u)s(l[u],t,o,n)}return t}function Ss(t,e){return Xs(t,e,{merger:sS})}function sS(t,e,n){if(!Yy(t))return;const r=e[t],i=n[t];X(r)&&X(i)?Ss(r,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ha(i))}const Df={"":t=>t,x:t=>t.x,y:t=>t.y};function oS(t){const e=t.split("."),n=[];let r="";for(const i of e)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function aS(t){const e=oS(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function Di(t,e){return(Df[e]||(Df[e]=aS(e)))(t)}function Ad(t){return t.charAt(0).toUpperCase()+t.slice(1)}const qs=t=>typeof t<"u",ir=t=>typeof t=="function",Lf=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function lS(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const We=Math.PI,er=2*We,$a=Number.POSITIVE_INFINITY,uS=We/180,jt=We/2,cr=We/4,Ff=We*2/3,Ky=Math.log10,tr=Math.sign;function ua(t,e,n){return Math.abs(t-e)<n}function If(t){const e=Math.round(t);t=ua(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Ky(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function cS(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((i,s)=>i-s).pop(),e}function dS(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ua(t){return!dS(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function hS(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function fS(t,e,n){let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function _r(t){return t*(We/180)}function pS(t){return t*(180/We)}function Af(t){if(!Ct(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function mS(t,e){const n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*We&&(s+=er),{angle:s,distance:i}}function gS(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dr(t){return(t%er+er)%er}function yS(t,e,n,r){const i=dr(t),s=dr(e),o=dr(n),a=dr(s-i),l=dr(o-i),u=dr(i-s),c=dr(i-o);return i===s||i===o||r||a>l&&u<c}function Dt(t,e,n){return Math.max(e,Math.min(n,t))}function vS(t){return Dt(t,-32768,32767)}function oi(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function zd(t,e,n){n=n||(o=>t[o]<e);let r=t.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const xc=(t,e,n,r)=>zd(t,n,r?i=>{const s=t[i][e];return s<n||s===n&&t[i+1][e]===n}:i=>t[i][e]<n),xS=(t,e,n)=>zd(t,n,r=>t[r][e]>=n);function wS(t,e,n){let r=0,i=t.length;for(;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}const Xy=["push","pop","shift","splice","unshift"];function bS(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Xy.forEach(n=>{const r="_onData"+Ad(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function zf(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(e);i!==-1&&r.splice(i,1),!(r.length>0)&&(Xy.forEach(s=>{delete t[s]}),delete t._chartjs)}function qy(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Gy=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function Jy(t,e){let n=[],r=!1;return function(...i){n=i,r||(r=!0,Gy.call(window,()=>{r=!1,t.apply(e,n)}))}}function _S(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const Bd=t=>t==="start"?"left":t==="end"?"right":"center",Ae=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,SS=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,Ao=t=>t===0||t===1,Bf=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*er/n)),Wf=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*er/n)+1,ks={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*jt)+1,easeOutSine:t=>Math.sin(t*jt),easeInOutSine:t=>-.5*(Math.cos(We*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=>Ao(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=>Ao(t)?t:Bf(t,.075,.3),easeOutElastic:t=>Ao(t)?t:Wf(t,.075,.3),easeInOutElastic(t){return Ao(t)?t:t<.5?.5*Bf(t*2,.1125,.45):.5+.5*Wf(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-ks.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?ks.easeInBounce(t*2)*.5:ks.easeOutBounce(t*2-1)*.5+.5};function Zy(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Hf(t){return Zy(t)?t:new Ks(t)}function ql(t){return Zy(t)?t:new Ks(t).saturate(.5).darken(.1).hexString()}const kS=["x","y","borderWidth","radius","tension"],CS=["color","borderColor","backgroundColor"];function ES(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:CS},numbers:{type:"number",properties:kS}}),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 PS(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $f=new Map;function MS(t,e){e=e||{};const n=t+JSON.stringify(e);let r=$f.get(n);return r||(r=new Intl.NumberFormat(t,e),$f.set(n,r)),r}function e0(t,e,n){return MS(e,n).format(t)}const TS={values(t){return Ce(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let i,s=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)&&(i="scientific"),s=RS(t,n)}const o=Ky(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),e0(t,r,l)}};function RS(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 t0={formatters:TS};function NS(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:t0.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 Hr=Object.create(null),wc=Object.create(null);function Cs(t,e){if(!e)return t;const n=e.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];t=t[s]||(t[s]=Object.create(null))}return t}function Gl(t,e,n){return typeof e=="string"?Xs(Cs(t,e),n):Xs(Cs(t,""),e)}class OS{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=r=>r.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=(r,i)=>ql(i.backgroundColor),this.hoverBorderColor=(r,i)=>ql(i.borderColor),this.hoverColor=(r,i)=>ql(i.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 Gl(this,e,n)}get(e){return Cs(this,e)}describe(e,n){return Gl(wc,e,n)}override(e,n){return Gl(Hr,e,n)}route(e,n,r,i){const s=Cs(this,e),o=Cs(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=o[i];return X(l)?Object.assign({},u,l):q(l,u)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var _e=new OS({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ES,PS,NS]);function jS(t){return!t||se(t.size)||se(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Uf(t,e,n,r,i){let s=e[i];return s||(s=e[i]=t.measureText(i).width,n.push(i)),s>r&&(r=s),r}function hr(t,e,n){const r=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*r)/r+i}function Vf(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Qf(t,e,n,r){n0(t,e,n,r,null)}function n0(t,e,n,r,i){let s,o,a,l,u,c,d,h;const f=e.pointStyle,v=e.rotation,y=e.radius;let w=(v||0)*uS;if(f&&typeof f=="object"&&(s=f.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(w),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!(isNaN(y)||y<=0)){switch(t.beginPath(),f){default:i?t.ellipse(n,r,i/2,y,0,0,er):t.arc(n,r,y,0,er),t.closePath();break;case"triangle":c=i?i/2:y,t.moveTo(n+Math.sin(w)*c,r-Math.cos(w)*y),w+=Ff,t.lineTo(n+Math.sin(w)*c,r-Math.cos(w)*y),w+=Ff,t.lineTo(n+Math.sin(w)*c,r-Math.cos(w)*y),t.closePath();break;case"rectRounded":u=y*.516,l=y-u,o=Math.cos(w+cr)*l,d=Math.cos(w+cr)*(i?i/2-u:l),a=Math.sin(w+cr)*l,h=Math.sin(w+cr)*(i?i/2-u:l),t.arc(n-d,r-a,u,w-We,w-jt),t.arc(n+h,r-o,u,w-jt,w),t.arc(n+d,r+a,u,w,w+jt),t.arc(n-h,r+o,u,w+jt,w+We),t.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*y,c=i?i/2:l,t.rect(n-c,r-l,2*c,2*l);break}w+=cr;case"rectRot":d=Math.cos(w)*(i?i/2:y),o=Math.cos(w)*y,a=Math.sin(w)*y,h=Math.sin(w)*(i?i/2:y),t.moveTo(n-d,r-a),t.lineTo(n+h,r-o),t.lineTo(n+d,r+a),t.lineTo(n-h,r+o),t.closePath();break;case"crossRot":w+=cr;case"cross":d=Math.cos(w)*(i?i/2:y),o=Math.cos(w)*y,a=Math.sin(w)*y,h=Math.sin(w)*(i?i/2:y),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+h,r-o),t.lineTo(n-h,r+o);break;case"star":d=Math.cos(w)*(i?i/2:y),o=Math.cos(w)*y,a=Math.sin(w)*y,h=Math.sin(w)*(i?i/2:y),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+h,r-o),t.lineTo(n-h,r+o),w+=cr,d=Math.cos(w)*(i?i/2:y),o=Math.cos(w)*y,a=Math.sin(w)*y,h=Math.sin(w)*(i?i/2:y),t.moveTo(n-d,r-a),t.lineTo(n+d,r+a),t.moveTo(n+h,r-o),t.lineTo(n-h,r+o);break;case"line":o=i?i/2:Math.cos(w)*y,a=Math.sin(w)*y,t.moveTo(n-o,r-a),t.lineTo(n+o,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(w)*(i?i/2:y),r+Math.sin(w)*y);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function r0(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 Wd(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Hd(t){t.restore()}function DS(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),se(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 LS(t,e,n,r,i){if(i.strikethrough||i.underline){const s=t.measureText(r),o=e-s.actualBoundingBoxLeft,a=e+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,u=n+s.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(o,c),t.lineTo(a,c),t.stroke()}}function FS(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Gs(t,e,n,r,i,s={}){const o=Ce(e)?e:[e],a=s.strokeWidth>0&&s.strokeColor!=="";let l,u;for(t.save(),t.font=i.string,DS(t,s),l=0;l<o.length;++l)u=o[l],s.backdrop&&FS(t,s.backdrop),a&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),se(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(u,n,r,s.maxWidth)),t.fillText(u,n,r,s.maxWidth),LS(t,n,r,u,s),r+=Number(i.lineHeight);t.restore()}function Va(t,e){const{x:n,y:r,w:i,h:s,radius:o}=e;t.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*We,We,!0),t.lineTo(n,r+s-o.bottomLeft),t.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,We,jt,!0),t.lineTo(n+i-o.bottomRight,r+s),t.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,jt,0,!0),t.lineTo(n+i,r+o.topRight),t.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-jt,!0),t.lineTo(n+o.topLeft,r)}const IS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,AS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zS(t,e){const n=(""+t).match(IS);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 BS=t=>+t||0;function i0(t,e){const n={},r=X(e),i=r?Object.keys(e):e,s=X(t)?r?o=>q(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of i)n[o]=BS(s(o));return n}function s0(t){return i0(t,{top:"y",right:"x",bottom:"y",left:"x"})}function fi(t){return i0(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Et(t){const e=s0(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Be(t,e){t=t||{},e=e||_e.font;let n=q(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=q(t.style,e.style);r&&!(""+r).match(AS)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:q(t.family,e.family),lineHeight:zS(q(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:q(t.weight,e.weight),string:""};return i.string=jS(i),i}function zo(t,e,n,r){let i,s,o;for(i=0,s=t.length;i<s;++i)if(o=t[i],o!==void 0&&o!==void 0)return o}function WS(t,e,n){const{min:r,max:i}=t,s=rS(e,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function Hi(t,e){return Object.assign(Object.create(t),e)}function $d(t,e=[""],n,r,i=()=>t[0]){const s=n||t;typeof r>"u"&&(r=u0("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>$d([a,...t],e,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return a0(a,l,()=>XS(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Kf(a).includes(l)},ownKeys(a){return Kf(a)},set(a,l,u){const c=a._storage||(a._storage=i());return a[l]=c[l]=u,delete a._keys,!0}})}function Li(t,e,n,r){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:o0(t,r),setContext:s=>Li(t,s,n,r),override:s=>Li(t.override(s),e,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete t[o],!0},get(s,o,a){return a0(s,o,()=>$S(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(s,o,a){return t[o]=a,delete s[o],!0}})}function o0(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:r,isScriptable:ir(n)?n:()=>n,isIndexable:ir(r)?r:()=>r}}const HS=(t,e)=>t?t+Ad(e):e,Ud=(t,e)=>X(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function a0(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function $S(t,e,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=t;let a=r[e];return ir(a)&&o.isScriptable(e)&&(a=US(e,a,t,n)),Ce(a)&&a.length&&(a=VS(e,a,t,o.isIndexable)),Ud(e,a)&&(a=Li(a,i,s&&s[e],o)),a}function US(t,e,n,r){const{_proxy:i,_context:s,_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(s,o||r);return a.delete(t),Ud(t,l)&&(l=Vd(i._scopes,i,t,l)),l}function VS(t,e,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index<"u"&&r(t))return e[s.index%e.length];if(X(e[0])){const l=e,u=i._scopes.filter(c=>c!==l);e=[];for(const c of l){const d=Vd(u,i,t,c);e.push(Li(d,s,o&&o[t],a))}}return e}function l0(t,e,n){return ir(t)?t(e,n):t}const QS=(t,e)=>t===!0?e:typeof t=="string"?Di(e,t):void 0;function YS(t,e,n,r,i){for(const s of e){const o=QS(n,s);if(o){t.add(o);const a=l0(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function Vd(t,e,n,r){const i=e._rootScopes,s=l0(e._fallback,n,r),o=[...t,...i],a=new Set;a.add(r);let l=Yf(a,o,n,s||n,r);return l===null||typeof s<"u"&&s!==n&&(l=Yf(a,o,s,l,r),l===null)?!1:$d(Array.from(a),[""],i,s,()=>KS(e,n,r))}function Yf(t,e,n,r,i){for(;n;)n=YS(t,e,n,r,i);return n}function KS(t,e,n){const r=t._getTarget();e in r||(r[e]={});const i=r[e];return Ce(i)&&X(n)?n:i||{}}function XS(t,e,n,r){let i;for(const s of e)if(i=u0(HS(s,t),n),typeof i<"u")return Ud(t,i)?Vd(n,r,t,i):i}function u0(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function Kf(t){let e=t._keys;return e||(e=t._keys=qS(t._scopes)),e}function qS(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(r);return Array.from(e)}function Qd(){return typeof window<"u"&&typeof document<"u"}function Yd(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Qa(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const pl=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function GS(t,e){return pl(t).getPropertyValue(e)}const JS=["top","right","bottom","left"];function Dr(t,e,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=JS[i];r[s]=parseFloat(t[e+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const ZS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function ek(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(ZS(i,s,t.target))a=i,l=s;else{const u=e.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,o=!0}return{x:a,y:l,box:o}}function yr(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,i=pl(n),s=i.boxSizing==="border-box",o=Dr(i,"padding"),a=Dr(i,"border","width"),{x:l,y:u,box:c}=ek(t,n),d=o.left+(c&&a.left),h=o.top+(c&&a.top);let{width:f,height:v}=e;return s&&(f-=o.width+a.width,v-=o.height+a.height),{x:Math.round((l-d)/f*n.width/r),y:Math.round((u-h)/v*n.height/r)}}function tk(t,e,n){let r,i;if(e===void 0||n===void 0){const s=t&&Yd(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const o=s.getBoundingClientRect(),a=pl(s),l=Dr(a,"border","width"),u=Dr(a,"padding");e=o.width-u.width-l.width,n=o.height-u.height-l.height,r=Qa(a.maxWidth,s,"clientWidth"),i=Qa(a.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:r||$a,maxHeight:i||$a}}const Hn=t=>Math.round(t*10)/10;function nk(t,e,n,r){const i=pl(t),s=Dr(i,"margin"),o=Qa(i.maxWidth,t,"clientWidth")||$a,a=Qa(i.maxHeight,t,"clientHeight")||$a,l=tk(t,e,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const h=Dr(i,"border","width"),f=Dr(i,"padding");u-=f.width+h.width,c-=f.height+h.height}return u=Math.max(0,u-s.width),c=Math.max(0,r?u/r:c-s.height),u=Hn(Math.min(u,o,l.maxWidth)),c=Hn(Math.min(c,a,l.maxHeight)),u&&!c&&(c=Hn(u/2)),(e!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=Hn(Math.floor(c*r))),{width:u,height:c}}function Xf(t,e,n){const r=e||1,i=Hn(t.height*r),s=Hn(t.width*r);t.height=Hn(t.height),t.width=Hn(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!==r||o.height!==i||o.width!==s?(t.currentDevicePixelRatio=r,o.height=i,o.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const rk=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Qd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function qf(t,e){const n=GS(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const ik=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,r){return n-r},leftForLtr(n,r){return n-r}}},sk=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function pi(t,e,n){return t?ik(e,n):sk()}function c0(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function d0(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Bo(t,e,n){return t.options.clip?t[n]:e[n]}function ok(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:Bo(n,e,"left"),right:Bo(n,e,"right"),top:Bo(r,e,"top"),bottom:Bo(r,e,"bottom")}:e}function ak(t,e){const n=e._clip;if(n.disabled)return!1;const r=ok(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
62
62
  * Chart.js v4.5.1
63
63
  * https://www.chartjs.org
64
64
  * (c) 2025 Chart.js Contributors
65
65
  * Released under the MIT License
66
- */class lk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Gy.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,e,"progress")),s.length||(r.running=!1,this._notify(i,r,e,"complete"),r.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}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((r,i)=>Math.max(r,i._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 r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var rn=new lk;const Gf="transparent",uk={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=Hf(t||Gf),i=r.valid&&Hf(e||Gf);return i&&i.valid?i.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class ck{constructor(e,n,r,i){const s=n[r];i=zo([e.to,i,s,e.from]);const o=zo([e.from,s,i]);this._active=!0,this._fn=e.fn||uk[e.type||typeof o],this._easing=ks[e.easing]||ks.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=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=zo([e.to,n,i,e.from]),this._from=zo([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class h0{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!X(e))return;const n=Object.keys(_e.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!X(s))return;const o={};for(const a of n)o[a]=s[a];(Ce(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(e,n){const r=n.options,i=hk(e,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&dk(e.options.$animations,r).then(()=>{e.options=r},()=>{}),s}_createAnimations(e,n){const r=this._properties,i=[],s=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"){i.push(...this._animateOptions(e,n));continue}const c=n[u];let d=s[u];const h=r.get(u);if(d)if(h&&d.active()){d.update(h,c,a);continue}else d.cancel();if(!h||!h.duration){e[u]=c;continue}s[u]=d=new ck(h,e,u,c),i.push(d)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return rn.add(this._chart,r),!0}}function dk(t,e){const n=[],r=Object.keys(e);for(let i=0;i<r.length;i++){const s=t[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function hk(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 Jf(t,e){const n=t&&t.options||{},r=n.reverse,i=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:r?s:i,end:r?i:s}}function fk(t,e,n){if(n===!1)return!1;const r=Jf(t,n),i=Jf(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function pk(t){let e,n,r,i;return X(t)?(e=t.top,n=t.right,r=t.bottom,i=t.left):e=n=r=i=t,{top:e,right:n,bottom:r,left:i,disabled:t===!1}}function f0(t,e){const n=[],r=t._getSortedDatasetMetas(e);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Zf(t,e,n,r={}){const i=t.keys,s=r.mode==="single";let o,a,l,u;if(e===null)return;let c=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=t.values[l],Ct(u)&&(s||e===0||tr(e)===tr(u))&&(e+=u)}return!c&&!r.all?0:e}function mk(t,e){const{iScale:n,vScale:r}=e,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(t),a=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],a[l]={[i]:c,[s]:t[c]};return a}function Jl(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function gk(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function yk(t){const{min:e,max:n,minDefined:r,maxDefined:i}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function vk(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function ep(t,e,n,r){for(const i of e.getMatchingVisibleMetas(r).reverse()){const s=t[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function tp(t,e){const{chart:n,_cachedMeta:r}=t,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,u=o.axis,c=gk(s,o,r),d=e.length;let h;for(let f=0;f<d;++f){const x=e[f],{[l]:v,[u]:w}=x,m=x._stacks||(x._stacks={});h=m[u]=vk(i,c,v),h[a]=w,h._top=ep(h,o,!0,r.type),h._bottom=ep(h,o,!1,r.type);const y=h._visualValues||(h._visualValues={});y[a]=w}}function Zl(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function xk(t,e){return Hi(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function wk(t,e,n){return Hi(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function ts(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const i of e){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const eu=t=>t==="reset"||t==="none",np=(t,e)=>e?t:Object.assign({},t),bk=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:f0(n,!0),values:null};class Es{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=Jl(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&&ts(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,f,x)=>d==="x"?h:d==="r"?x:f,s=n.xAxisID=q(r.xAxisID,Zl(e,"x")),o=n.yAxisID=q(r.yAxisID,Zl(e,"y")),a=n.rAxisID=q(r.rAxisID,Zl(e,"r")),l=n.indexAxis,u=n.iAxisID=i(l,s,o,a),c=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}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&&zf(this._data,this),e._stacked&&ts(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(X(n)){const i=this._cachedMeta;this._data=mk(n,i)}else if(r!==n){if(r){zf(r,this);const i=this._cachedMeta;ts(i),i._parsed=[]}n&&Object.isExtensible(n)&&bS(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,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Jl(n.vScale,n),n.stack!==r.stack&&(i=!0,ts(n),n.stack=r.stack),this._resyncElements(e),(i||s!==n._stacked)&&(tp(this,n._parsed),n._stacked=Jl(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=e===0&&n===i.length?!0:r._sorted,u=e>0&&r._parsed[e-1],c,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{Ce(i[e])?h=this.parseArrayData(r,i,e,n):X(i[e])?h=this.parseObjectData(r,i,e,n):h=this.parsePrimitiveData(r,i,e,n);const f=()=>d[a]===null||u&&d[a]<u[a];for(c=0;c<n;++c)r._parsed[c+e]=d=h[c],l&&(f()&&(l=!1),u=d);r._sorted=l}o&&tp(this,h)}parsePrimitiveData(e,n,r,i){const{iScale:s,vScale:o}=e,a=s.axis,l=o.axis,u=s.getLabels(),c=s===o,d=new Array(i);let h,f,x;for(h=0,f=i;h<f;++h)x=h+r,d[h]={[a]:c||s.parse(u[x],x),[l]:o.parse(n[x],x)};return d}parseArrayData(e,n,r,i){const{xScale:s,yScale:o}=e,a=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],a[l]={x:s.parse(d[0],c),y:o.parse(d[1],c)};return a}parseObjectData(e,n,r,i){const{xScale:s,yScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,h,f;for(c=0,d=i;c<d;++c)h=c+r,f=n[h],u[c]={x:s.parse(Di(f,a),h),y:o.parse(Di(f,l),h)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const i=this.chart,s=this._cachedMeta,o=n[e.axis],a={keys:f0(i,!0),values:n._stacks[e.axis]._visualValues};return Zf(a,o,s.index,{mode:r})}updateRangeFromParsed(e,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Zf(i,s,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&e===r.iScale,o=i.length,a=this._getOtherScale(e),l=bk(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=yk(a);let h,f;function x(){f=i[h];const v=f[a.axis];return!Ct(f[e.axis])||c>v||d<v}for(h=0;h<o&&!(!x()&&(this.updateRangeFromParsed(u,e,f,l),s));++h);if(s){for(h=o-1;h>=0;--h)if(!x()){this.updateRangeFromParsed(u,e,f,l);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][e.axis],Ct(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(e);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=pk(q(this.options.clip,fk(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(e,s,a,l),c=a;c<a+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(e,s))}for(c=0;c<o.length;++c)o[c].draw(e,s)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const i=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];s=o.$context||(o.$context=wk(this.getContext(),e,o)),s.parsed=this.getParsed(e),s.raw=i.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=xk(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=e+"-"+n,a=s[o],l=this.enableOptionSharing&&qs(r);if(a)return np(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,e),d=i?[`${e}Hover`,"hover",e,""]:[e,""],h=u.getOptionScopes(this.getDataset(),c),f=Object.keys(_e.elements[e]),x=()=>this.getContext(r,i,n),v=u.resolveNamedOptions(h,f,x,d);return v.$shared&&(v.$shared=l,s[o]=Object.freeze(np(v,l))),v}_resolveAnimations(e,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),h=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(h,this.getContext(e,r,n))}const u=new h0(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||eu(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(e,n,r,i){eu(i)?Object.assign(e,r):this._resolveAnimations(n,i).update(e,r)}updateSharedOptions(e,n,r){e&&!eu(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,i){e.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(e,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"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,r=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,e):s<i&&this._removeElements(s,i-s)}_insertElements(e,n,r=!0){const i=this._cachedMeta,s=i.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(s),a=e;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(e,n),r&&this.updateElements(s,e,n,"reset")}updateElements(e,n,r,i){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(e,n);r._stacked&&ts(r,i)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,i]=e;this[n](r,i)}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 r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Y(Es,"defaults",{}),Y(Es,"datasetElementType",null),Y(Es,"dataElementType",null);function _k(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let i=0,s=n.length;i<s;i++)r=r.concat(n[i].controller.getAllParsedValues(t));t._cache.$bar=qy(r.sort((i,s)=>i-s))}return t._cache.$bar}function Sk(t){const e=t.iScale,n=_k(e,t.type);let r=e._length,i,s,o,a;const l=()=>{o===32767||o===-32768||(qs(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(i=0,s=n.length;i<s;++i)o=e.getPixelForValue(n[i]),l();for(a=void 0,i=0,s=e.ticks.length;i<s;++i)o=e.getPixelForTick(i),l();return r}function kk(t,e,n,r){const i=n.barThickness;let s,o;return ie(i)?(s=e.min*n.categoryPercentage,o=n.barPercentage):(s=i*r,o=1),{chunk:s/r,ratio:o,start:e.pixels[t]-s/2}}function Ck(t,e,n,r){const i=e.pixels,s=i[t];let o=t>0?i[t-1]:null,a=t<i.length-1?i[t+1]:null;const l=n.categoryPercentage;o===null&&(o=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-o);const u=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:u}}function Ek(t,e,n,r){const i=n.parse(t[0],r),s=n.parse(t[1],r),o=Math.min(i,s),a=Math.max(i,s);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:i,end:s,min:o,max:a}}function p0(t,e,n,r){return Ce(t)?Ek(t,e,n,r):e[n.axis]=n.parse(t,r),e}function rp(t,e,n,r){const i=t.iScale,s=t.vScale,o=i.getLabels(),a=i===s,l=[];let u,c,d,h;for(u=n,c=n+r;u<c;++u)h=e[u],d={},d[i.axis]=a||i.parse(o[u],u),l.push(p0(h,d,s,u));return l}function tu(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Pk(t,e,n){return t!==0?tr(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function Mk(t){let e,n,r,i,s;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(i="end",s="start"):(i="start",s="end"),{start:n,end:r,reverse:e,top:i,bottom:s}}function Rk(t,e,n,r){let i=e.borderSkipped;const s={};if(!i){t.borderSkipped=s;return}if(i===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:u,bottom:c}=Mk(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(s[ip(c,o,a,l)]=!0,i=u)),s[ip(i,o,a,l)]=!0,t.borderSkipped=s}function ip(t,e,n,r){return r?(t=Tk(t,e,n),t=sp(t,n,e)):t=sp(t,e,n),t}function Tk(t,e,n){return t===e?n:t===n?e:t}function sp(t,e,n){return t==="start"?e:t==="end"?n:t}function Ok(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class ca extends Es{parsePrimitiveData(e,n,r,i){return rp(e,n,r,i)}parseArrayData(e,n,r,i){return rp(e,n,r,i)}parseObjectData(e,n,r,i){const{iScale:s,vScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=s.axis==="x"?a:l,c=o.axis==="x"?a:l,d=[];let h,f,x,v;for(h=r,f=r+i;h<f;++h)v=n[h],x={},x[s.axis]=s.parse(Di(v,u),h),d.push(p0(Di(v,c),x,o,h));return d}updateRangeFromParsed(e,n,r,i){super.updateRangeFromParsed(e,n,r,i);const s=r._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:i}=n,s=this.getParsed(e),o=s._custom,a=tu(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+r.getLabelForValue(s[r.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,r,i){const s=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,i);for(let f=n;f<n+r;f++){const x=this.getParsed(f),v=s||ie(x[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),w=this._calculateBarIndexPixels(f,c),m=(x._stacks||{})[a.axis],y={horizontal:u,base:v.base,enableBorderRadius:!m||tu(x._custom)||o===m._top||o===m._bottom,x:u?v.head:w.center,y:u?w.center:v.head,height:u?w.size:Math.abs(v.size),width:u?Math.abs(v.size):w.size};h&&(y.options=d||this.resolveDataElementOptions(f,e[f].active?"active":i));const p=y.options||e[f].options;Rk(y,p,m,o),Ok(y,p,c.ratio),this.updateElement(e[f],f,y,i)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),s=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],u=c=>{const d=c._parsed.find(f=>f[r.axis]===l),h=d&&d[c.vScale.axis];if(ie(h)||isNaN(h))return!0};for(const c of i)if(!(n!==void 0&&u(c))&&((s===!1||o.indexOf(c.stack)===-1||s===void 0&&c.stack===void 0)&&o.push(c.stack),c.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(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[q(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const i=this._getStacks(e,r),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,i=[];let s,o;for(s=0,o=n.data.length;s<o;++s)i.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const a=e.barThickness;return{min:a||Sk(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:s,minBarLength:o}}=this,a=s||0,l=this.getParsed(e),u=l._custom,c=tu(u);let d=l[n.axis],h=0,f=r?this.applyStack(n,l,r):d,x,v;f!==d&&(h=f-d,f=d),c&&(d=u.barStart,f=u.barEnd-u.barStart,d!==0&&tr(d)!==tr(u.barEnd)&&(h=0),h+=d);const w=!ie(s)&&!c?s:h;let m=n.getPixelForValue(w);if(this.chart.getDataVisibility(e)?x=n.getPixelForValue(h+f):x=m,v=x-m,Math.abs(v)<o){v=Pk(v,n,a)*o,d===a&&(m-=v/2);const y=n.getPixelForDecimal(0),p=n.getPixelForDecimal(1),b=Math.min(y,p),k=Math.max(y,p);m=Math.max(Math.min(m,k),b),x=m+v,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(x)-n.getValueForPixel(m))}if(m===n.getPixelForValue(a)){const y=tr(v)*n.getLineWidthForValue(a)/2;m+=y,v-=y}return{size:v,base:m,head:x,center:x+v/2}}_calculateBarIndexPixels(e,n){const r=n.scale,i=this.options,s=i.skipNull,o=q(i.maxBarThickness,1/0);let a,l;const u=this._getAxisCount();if(n.grouped){const c=s?this._getStackCount(e):n.stackCount,d=i.barThickness==="flex"?Ck(e,n,i,c*u):kk(e,n,i,c*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(q(h,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0)+f;a=d.start+d.chunk*x+d.chunk/2,l=Math.min(o,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.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,r=e.data,i=r.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}Y(ca,"id","bar"),Y(ca,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Y(ca,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function fr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Kd{constructor(e){Y(this,"options");this.options=e||{}}static override(e){Object.assign(Kd.prototype,e)}init(){}formats(){return fr()}parse(){return fr()}format(){return fr()}add(){return fr()}diff(){return fr()}startOf(){return fr()}endOf(){return fr()}}var Nk={_date:Kd};function jk(t,e,n,r){const{controller:i,data:s,_sorted:o}=t,a=i._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&s.length){const u=a._reversePixels?xS:xc;if(r){if(i._sharedOptions){const c=s[0],d=typeof c.getRange=="function"&&c.getRange(e);if(d){const h=u(s,e,n-d),f=u(s,e,n+d);return{lo:h.lo,hi:f.hi}}}}else{const c=u(s,e,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:h}=t,f=h.slice(0,c.lo+1).reverse().findIndex(v=>!ie(v[d.axis]));c.lo-=Math.max(0,f);const x=h.slice(c.hi).findIndex(v=>!ie(v[d.axis]));c.hi+=Math.max(0,x)}return c}}return{lo:0,hi:s.length-1}}function ml(t,e,n,r,i){const s=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=s.length;a<l;++a){const{index:u,data:c}=s[a],{lo:d,hi:h}=jk(s[a],e,o,i);for(let f=d;f<=h;++f){const x=c[f];x.skip||r(x,u,f)}}}function Dk(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,i){const s=e?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function nu(t,e,n,r,i){const s=[];return!i&&!t.isPointInArea(e)||ml(t,n,e,function(a,l,u){!i&&!r0(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function Lk(t,e,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=mS(o,{x:e.x,y:e.y});yS(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return ml(t,n,e,s),i}function Fk(t,e,n,r,i,s){let o=[];const a=Dk(n);let l=Number.POSITIVE_INFINITY;function u(c,d,h){const f=c.inRange(e.x,e.y,i);if(r&&!f)return;const x=c.getCenterPoint(i);if(!(!!s||t.isPointInArea(x))&&!f)return;const w=a(e,x);w<l?(o=[{element:c,datasetIndex:d,index:h}],l=w):w===l&&o.push({element:c,datasetIndex:d,index:h})}return ml(t,n,e,u),o}function ru(t,e,n,r,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!r?Lk(t,e,n,i):Fk(t,e,n,r,i,s)}function op(t,e,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return ml(t,n,e,(l,u,c)=>{l[o]&&l[o](e[n],i)&&(s.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(e.x,e.y,i))}),r&&!a?[]:s}var Ik={modes:{index(t,e,n,r){const i=yr(e,t),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?nu(t,i,s,r,o):ru(t,i,s,!1,r,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(t,e,n,r){const i=yr(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?nu(t,i,s,r,o):ru(t,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,u=t.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(t,e,n,r){const i=yr(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return nu(t,i,s,r,o)},nearest(t,e,n,r){const i=yr(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return ru(t,i,s,n.intersect,r,o)},x(t,e,n,r){const i=yr(e,t);return op(t,i,"x",n.intersect,r)},y(t,e,n,r){const i=yr(e,t);return op(t,i,"y",n.intersect,r)}}};const m0=["left","top","right","bottom"];function ns(t,e){return t.filter(n=>n.pos===e)}function ap(t,e){return t.filter(n=>m0.indexOf(n.pos)===-1&&n.box.axis===e)}function rs(t,e){return t.sort((n,r)=>{const i=e?r:n,s=e?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function Ak(t){const e=[];let n,r,i,s,o,a;for(n=0,r=(t||[]).length;n<r;++n)i=t[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,e.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return e}function zk(t){const e={};for(const n of t){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!m0.includes(i))continue;const o=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function Bk(t,e){const n=zk(t),{vBoxMaxWidth:r,hBoxMaxHeight:i}=e;let s,o,a;for(s=0,o=t.length;s<o;++s){a=t[s];const{fullSize:l}=a.box,u=n[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&e.availableWidth,a.height=i):(a.width=r,a.height=c?c*i:l&&e.availableHeight)}return n}function Wk(t){const e=Ak(t),n=rs(e.filter(u=>u.box.fullSize),!0),r=rs(ns(e,"left"),!0),i=rs(ns(e,"right")),s=rs(ns(e,"top"),!0),o=rs(ns(e,"bottom")),a=ap(e,"x"),l=ap(e,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:ns(e,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function lp(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function g0(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 Hk(t,e,n,r){const{pos:i,box:s}=n,o=t.maxPadding;if(!X(i)){n.size&&(t[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,t[i]+=n.size}s.getPadding&&g0(o,s.getPadding());const a=Math.max(0,e.outerWidth-lp(o,t,"left","right")),l=Math.max(0,e.outerHeight-lp(o,t,"top","bottom")),u=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function $k(t){const e=t.maxPadding;function n(r){const i=Math.max(e[r]-t[r],0);return t[r]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Uk(t,e){const n=e.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(e[o],n[o])}),s}return r(t?["left","right"]:["top","bottom"])}function hs(t,e,n,r){const i=[];let s,o,a,l,u,c;for(s=0,o=t.length,u=0;s<o;++s){a=t[s],l=a.box,l.update(a.width||e.w,a.height||e.h,Uk(a.horizontal,e));const{same:d,other:h}=Hk(e,n,a,r);u|=d&&i.length,c=c||h,l.fullSize||i.push(a)}return u&&hs(i,e,n,r)||c}function Wo(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function up(t,e,n,r){const i=n.padding;let{x:s,y:o}=e;for(const a of t){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const d=e.w*c,h=u.size||l.height;qs(u.start)&&(o=u.start),l.fullSize?Wo(l,i.left,o,n.outerWidth-i.right-i.left,h):Wo(l,e.left+u.placed,o,d,h),u.start=o,u.placed+=d,o=l.bottom}else{const d=e.h*c,h=u.size||l.width;qs(u.start)&&(s=u.start),l.fullSize?Wo(l,s,i.top,h,n.outerHeight-i.bottom-i.top):Wo(l,s,e.top+u.placed,h,d),u.start=s,u.placed+=d,s=l.right}}e.x=s,e.y=o}var wt={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,r){if(!t)return;const i=Et(t.options.layout.padding),s=Math.max(e-i.width,0),o=Math.max(n-i.height,0),a=Wk(t.boxes),l=a.vertical,u=a.horizontal;ee(t.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const c=l.reduce((v,w)=>w.box.options&&w.box.options.display===!1?v:v+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},i);g0(h,Et(r));const f=Object.assign({maxPadding:h,w:s,h:o,x:i.left,y:i.top},i),x=Bk(l.concat(u),d);hs(a.fullSize,f,d,x),hs(l,f,d,x),hs(u,f,d,x)&&hs(l,f,d,x),$k(f),up(a.leftAndTop,f,d,x),f.x+=f.w,f.y+=f.h,up(a.rightAndBottom,f,d,x),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},ee(a.chartArea,v=>{const w=v.box;Object.assign(w,t.chartArea),w.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class y0{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,i){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(e){return!0}updateConfig(e){}}class Vk extends y0{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const da="$chartjs",Qk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},cp=t=>t===null||t==="";function Yk(t,e){const n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[da]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",cp(i)){const s=qf(t,"width");s!==void 0&&(t.width=s)}if(cp(r))if(t.style.height==="")t.height=t.width/(e||2);else{const s=qf(t,"height");s!==void 0&&(t.height=s)}return t}const v0=rk?{passive:!0}:!1;function Kk(t,e,n){t&&t.addEventListener(e,n,v0)}function Xk(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,v0)}function qk(t,e){const n=Qk[t.type]||t.type,{x:r,y:i}=yr(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Ya(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Gk(t,e,n){const r=t.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Ya(a.addedNodes,r),o=o&&!Ya(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Jk(t,e,n){const r=t.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Ya(a.removedNodes,r),o=o&&!Ya(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Js=new Map;let dp=0;function x0(){const t=window.devicePixelRatio;t!==dp&&(dp=t,Js.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Zk(t,e){Js.size||window.addEventListener("resize",x0),Js.set(t,e)}function eC(t){Js.delete(t),Js.size||window.removeEventListener("resize",x0)}function tC(t,e,n){const r=t.canvas,i=r&&Yd(r);if(!i)return;const s=Jy((a,l)=>{const u=i.clientWidth;n(a,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(i),Zk(t,s),o}function iu(t,e,n){n&&n.disconnect(),e==="resize"&&eC(t)}function nC(t,e,n){const r=t.canvas,i=Jy(s=>{t.ctx!==null&&n(qk(s,t))},t);return Kk(r,e,i),i}class rC extends y0{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(Yk(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[da])return!1;const r=n[da].initial;["height","width"].forEach(s=>{const o=r[s];ie(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[da],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),o={attach:Gk,detach:Jk,resize:tC}[n]||nC;i[n]=o(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),i=r[n];if(!i)return;({attach:iu,detach:iu,resize:iu}[n]||Xk)(e,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,i){return nk(e,n,r,i)}isAttached(e){const n=e&&Yd(e);return!!(n&&n.isConnected)}}function iC(t){return!Qd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Vk:rC}class sr{constructor(){Y(this,"x");Y(this,"y");Y(this,"active",!1);Y(this,"options");Y(this,"$animations")}tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return Ua(this.x)&&Ua(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const i={};return e.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}}Y(sr,"defaults",{}),Y(sr,"defaultRoutes");function sC(t,e){const n=t.options.ticks,r=oC(t),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?lC(e):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return uC(e,u,s,o/i),u;const c=aC(s,e,i);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(Ho(e,u,c,ie(f)?0:a-f,a),d=0,h=o-1;d<h;d++)Ho(e,u,c,s[d],s[d+1]);return Ho(e,u,c,l,ie(f)?e.length:l+f),u}return Ho(e,u,c),u}function oC(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}function aC(t,e,n){const r=cC(t),i=e.length/n;if(!r)return Math.max(i,1);const s=cS(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function lC(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function uC(t,e,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<t.length;o++)o===s&&(e.push(t[o]),i++,s=n[i*r])}function Ho(t,e,n,r,i){const s=q(r,0),o=Math.min(q(i,t.length),t.length);let a=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=s;c<0;)a++,c=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===c&&(e.push(t[u]),a++,c=Math.round(s+a*n))}function cC(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const dC=t=>t==="left"?"right":t==="right"?"left":t,hp=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,fp=(t,e)=>Math.min(e||t,t);function pp(t,e){const n=[],r=t.length/e,i=t.length;let s=0;for(;s<i;s+=r)n.push(t[Math.floor(s)]);return n}function hC(t,e,n){const r=t.ticks.length,i=Math.min(e,r-1),s=t._startPixel,o=t._endPixel,a=1e-6;let l=t.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-s,o-l):e===0?u=(t.getPixelForTick(1)-l)/2:u=(l-t.getPixelForTick(i-1))/2,l+=i<e?u:-u,l<s-a||l>o+a)))return l}function fC(t,e){ee(t,n=>{const r=n.gc,i=r.length/2;let s;if(i>e){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function is(t){return t.drawTicks?t.tickLength:0}function mp(t,e){if(!t.display)return 0;const n=Be(t.font,e),r=Et(t.padding);return(Ce(t.text)?t.text.length:1)*n.lineHeight+r.height}function pC(t,e){return Hi(t,{scale:e,type:"scale"})}function mC(t,e,n){return Hi(t,{tick:n,index:e,type:"tick"})}function gC(t,e,n){let r=Bd(t);return(n&&e!=="right"||!n&&e==="right")&&(r=dC(r)),r}function yC(t,e,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=t,{chartArea:u,scales:c}=l;let d=0,h,f,x;const v=o-i,w=a-s;if(t.isHorizontal()){if(f=Ae(r,s,a),X(n)){const m=Object.keys(n)[0],y=n[m];x=c[m].getPixelForValue(y)+v-e}else n==="center"?x=(u.bottom+u.top)/2+v-e:x=hp(t,n,e);h=a-s}else{if(X(n)){const m=Object.keys(n)[0],y=n[m];f=c[m].getPixelForValue(y)-w+e}else n==="center"?f=(u.left+u.right)/2-w+e:f=hp(t,n,e);x=Ae(r,o,i),d=n==="left"?-jt:jt}return{titleX:f,titleY:x,maxWidth:h,rotation:d}}class $i extends sr{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:r,_suggestedMax:i}=this;return e=Ht(e,Number.POSITIVE_INFINITY),n=Ht(n,Number.NEGATIVE_INFINITY),r=Ht(r,Number.POSITIVE_INFINITY),i=Ht(i,Number.NEGATIVE_INFINITY),{min:Ht(e,r),max:Ht(n,i),minDefined:Ct(e),maxDefined:Ct(n)}}getMinMax(e){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)o=a[l].controller.getMinMax(this,e),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:Ht(n,Ht(r,n)),max:Ht(r,Ht(n,r))}}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(){ue(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=WS(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?pp(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=sC(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,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ue(this.options.afterUpdate,[this])}beforeSetDimensions(){ue(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(){ue(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ue(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ue(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r],s.label=ue(n.callback,[s.value,r,e],this)}afterTickToLabelConversion(){ue(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ue(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=fp(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,f=Dt(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/r:f/(r-1),d+6>a&&(a=f/(r-(e.offset?.5:1)),l=this.maxHeight-is(e.grid)-n.padding-mp(e.title,this.chart.options.font),u=Math.sqrt(d*d+h*h),o=pS(Math.min(Math.asin(Dt((c.highest.height+6)/a,-1,1)),Math.asin(Dt(l/u,-1,1))-Math.asin(Dt(h/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ue(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ue(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=mp(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=is(s)+l):(e.height=this.maxHeight,e.width=is(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:h}=this._getLabelSizes(),f=r.padding*2,x=_r(this.labelRotation),v=Math.cos(x),w=Math.sin(x);if(a){const m=r.mirror?0:w*d.width+v*h.height;e.height=Math.min(this.maxHeight,e.height+m+f)}else{const m=r.mirror?0:v*d.width+w*h.height;e.width=Math.min(this.maxWidth,e.width+m+f)}this._calculatePadding(u,c,w,v)}}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,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?u?(h=i*e.width,f=r*n.height):(h=r*e.height,f=i*n.width):s==="start"?f=n.width:s==="end"?h=e.width:s!=="inner"&&(h=e.width/2,f=n.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=e.height/2;s==="start"?(c=0,d=e.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+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(){ue(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,r;for(n=0,r=e.length;n<r;n++)ie(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=pp(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/fp(n,r));let u=0,c=0,d,h,f,x,v,w,m,y,p,b,k;for(d=0;d<n;d+=l){if(x=e[d].label,v=this._resolveTickFontOptions(d),i.font=w=v.string,m=s[w]=s[w]||{data:{},gc:[]},y=v.lineHeight,p=b=0,!ie(x)&&!Ce(x))p=Uf(i,m.data,m.gc,p,x),b=y;else if(Ce(x))for(h=0,f=x.length;h<f;++h)k=x[h],!ie(k)&&!Ce(k)&&(p=Uf(i,m.data,m.gc,p,k),b+=y);o.push(p),a.push(b),u=Math.max(p,u),c=Math.max(b,c)}fC(s,n);const C=o.indexOf(u),P=a.indexOf(c),E=N=>({width:o[N]||0,height:a[N]||0});return{first:E(0),last:E(n-1),widest:E(C),highest:E(P),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 vS(this._alignToPixels?hr(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 r=n[e];return r.$context||(r.$context=mC(this.getContext(),e,r))}return this.$context||(this.$context=pC(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=_r(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=is(s),f=[],x=a.setContext(this.getContext()),v=x.display?x.width:0,w=v/2,m=function(F){return hr(r,F,v)};let y,p,b,k,C,P,E,N,M,T,A,W;if(o==="top")y=m(this.bottom),P=this.bottom-h,N=y-w,T=m(e.top)+w,W=e.bottom;else if(o==="bottom")y=m(this.top),T=e.top,W=m(e.bottom)-w,P=y+w,N=this.top+h;else if(o==="left")y=m(this.right),C=this.right-h,E=y-w,M=m(e.left)+w,A=e.right;else if(o==="right")y=m(this.left),M=e.left,A=m(e.right)-w,C=y+w,E=this.left+h;else if(n==="x"){if(o==="center")y=m((e.top+e.bottom)/2+.5);else if(X(o)){const F=Object.keys(o)[0],ve=o[F];y=m(this.chart.scales[F].getPixelForValue(ve))}T=e.top,W=e.bottom,P=y+w,N=P+h}else if(n==="y"){if(o==="center")y=m((e.left+e.right)/2);else if(X(o)){const F=Object.keys(o)[0],ve=o[F];y=m(this.chart.scales[F].getPixelForValue(ve))}C=y-w,E=C-h,M=e.left,A=e.right}const se=q(i.ticks.maxTicksLimit,d),J=Math.max(1,Math.ceil(d/se));for(p=0;p<d;p+=J){const F=this.getContext(p),ve=s.setContext(F),j=a.setContext(F),I=ve.lineWidth,R=ve.color,B=j.dash||[],H=j.dashOffset,ne=ve.tickWidth,$=ve.tickColor,re=ve.tickBorderDash||[],pe=ve.tickBorderDashOffset;b=hC(this,p,l),b!==void 0&&(k=hr(r,b,I),u?C=E=M=A=k:P=N=T=W=k,f.push({tx1:C,ty1:P,tx2:E,ty2:N,x1:M,y1:T,x2:A,y2:W,width:I,color:R,borderDash:B,borderDashOffset:H,tickWidth:ne,tickColor:$,tickBorderDash:re,tickBorderDashOffset:pe}))}return this._ticksLength=d,this._borderValue=y,f}_computeLabelItems(e){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=s,h=is(r.grid),f=h+c,x=d?-c:f,v=-_r(this.labelRotation),w=[];let m,y,p,b,k,C,P,E,N,M,T,A,W="middle";if(i==="top")C=this.bottom-x,P=this._getXAxisLabelAlignment();else if(i==="bottom")C=this.top+x,P=this._getXAxisLabelAlignment();else if(i==="left"){const J=this._getYAxisLabelAlignment(h);P=J.textAlign,k=J.x}else if(i==="right"){const J=this._getYAxisLabelAlignment(h);P=J.textAlign,k=J.x}else if(n==="x"){if(i==="center")C=(e.top+e.bottom)/2+f;else if(X(i)){const J=Object.keys(i)[0],F=i[J];C=this.chart.scales[J].getPixelForValue(F)+f}P=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")k=(e.left+e.right)/2-f;else if(X(i)){const J=Object.keys(i)[0],F=i[J];k=this.chart.scales[J].getPixelForValue(F)}P=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?W="top":l==="end"&&(W="bottom"));const se=this._getLabelSizes();for(m=0,y=a.length;m<y;++m){p=a[m],b=p.label;const J=s.setContext(this.getContext(m));E=this.getPixelForTick(m)+s.labelOffset,N=this._resolveTickFontOptions(m),M=N.lineHeight,T=Ce(b)?b.length:1;const F=T/2,ve=J.color,j=J.textStrokeColor,I=J.textStrokeWidth;let R=P;o?(k=E,P==="inner"&&(m===y-1?R=this.options.reverse?"left":"right":m===0?R=this.options.reverse?"right":"left":R="center"),i==="top"?u==="near"||v!==0?A=-T*M+M/2:u==="center"?A=-se.highest.height/2-F*M+M:A=-se.highest.height+M/2:u==="near"||v!==0?A=M/2:u==="center"?A=se.highest.height/2-F*M:A=se.highest.height-T*M,d&&(A*=-1),v!==0&&!J.showLabelBackdrop&&(k+=M/2*Math.sin(v))):(C=E,A=(1-T)*M/2);let B;if(J.showLabelBackdrop){const H=Et(J.backdropPadding),ne=se.heights[m],$=se.widths[m];let re=A-H.top,pe=0-H.left;switch(W){case"middle":re-=ne/2;break;case"bottom":re-=ne;break}switch(P){case"center":pe-=$/2;break;case"right":pe-=$;break;case"inner":m===y-1?pe-=$:m>0&&(pe-=$/2);break}B={left:pe,top:re,width:$+H.width,height:ne+H.height,color:J.backdropColor}}w.push({label:b,font:N,textOffset:A,options:{rotation:v,color:ve,strokeColor:j,strokeWidth:I,textAlign:R,textBaseline:W,translation:[k,C],backdrop:B}})}return w}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-_r(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=e+s,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_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:r,top:i,width:s,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,i,s,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const a=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];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:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,h;this.isHorizontal()?(u=hr(e,this.left,o)-o/2,c=hr(e,this.right,a)+a/2,d=h=l):(d=hr(e,this.top,o)-o/2,h=hr(e,this.bottom,a)+a/2,u=c=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Wd(r,i);const s=this.getLabelItems(e);for(const o of s){const a=o.options,l=o.font,u=o.label,c=o.textOffset;Gs(r,u,0,c,l,a)}i&&Hd(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=Be(r.font),o=Et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||X(n)?(l+=o.bottom,Ce(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:h}=yC(this,l,n,a);Gs(e,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:h,textAlign:gC(a,n,i),textBaseline:"middle",translation:[u,c]})}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,r=q(e.grid&&e.grid.z,-1),i=q(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==$i.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!e||a.type===e)&&i.push(a)}return i}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Be(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class $o{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,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 r;wC(n)&&(r=this.register(n));const i=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in i||(i[s]=e,vC(e,o,r),this.override&&_e.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,i=this.scope;r in n&&delete n[r],i&&r in _e[i]&&(delete _e[i][r],this.override&&delete Hr[r])}}function vC(t,e,n){const r=Xs(Object.create(null),[n?_e.get(n):{},_e.get(e),t.defaults]);_e.set(e,r),t.defaultRoutes&&xC(e,t.defaultRoutes),t.descriptors&&_e.describe(e,t.descriptors)}function xC(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),i=r.pop(),s=[t].concat(r).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");_e.route(s,i,l,a)})}function wC(t){return"id"in t&&"defaults"in t}class bC{constructor(){this.controllers=new $o(Es,"datasets",!0),this.elements=new $o(sr,"elements"),this.plugins=new $o(Object,"plugins"),this.scales=new $o($i,"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,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(e,s,i):ee(i,o=>{const a=r||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,r){const i=Ad(e);ue(r["before"+i],[],r),n[e](r),ue(r["after"+i],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const i=n.get(e);if(i===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return i}}var Yt=new bC;class _C{constructor(){this._init=void 0}notify(e,n,r,i){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const s=i?this._descriptors(e).filter(i):this._descriptors(e),o=this._notify(s,e,n,r);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,n,r,i){i=i||{};for(const s of e){const o=s.plugin,a=o[r],l=[n,i,s.options];if(ue(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){ie(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 r=e&&e.config,i=q(r.options&&r.options.plugins,{}),s=SC(r);return i===!1&&!n?[]:CC(e,s,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),e,"stop"),this._notify(i(r,n),e,"start")}}function SC(t){const e={},n=[],r=Object.keys(Yt.plugins.items);for(let s=0;s<r.length;s++)n.push(Yt.getPlugin(r[s]));const i=t.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function kC(t,e){return!e&&t===!1?null:t===!0?{}:t}function CC(t,{plugins:e,localIds:n},r,i){const s=[],o=t.getContext();for(const a of e){const l=a.id,u=kC(r[l],i);u!==null&&s.push({plugin:a,options:EC(t.config,{plugin:a,local:n[l]},u,o)})}return s}function EC(t,{plugin:e,local:n},r,i){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(r,s);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function bc(t,e){const n=_e.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function PC(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function MC(t,e){return t===e?"_index_":"_value_"}function gp(t){if(t==="x"||t==="y"||t==="r")return t}function RC(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function _c(t,...e){if(gp(t))return t;for(const n of e){const r=n.axis||RC(n.position)||t.length>1&&gp(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function yp(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function TC(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return yp(t,"x",n[0])||yp(t,"y",n[0])}return{}}function OC(t,e){const n=Hr[t.type]||{scales:{}},r=e.scales||{},i=bc(t.type,e),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!X(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=_c(o,a,TC(o,t),_e.scales[a.type]),u=MC(l,i),c=n.scales||{};s[o]=Ss(Object.create(null),[{axis:l},a,c[l],c[u]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||bc(a,e),c=(Hr[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=PC(d,l),f=o[h+"AxisID"]||h;s[f]=s[f]||Object.create(null),Ss(s[f],[{axis:h},r[f],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Ss(a,[_e.scales[a.type],_e.scale])}),s}function w0(t){const e=t.options||(t.options={});e.plugins=q(e.plugins,{}),e.scales=OC(t,e)}function b0(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function NC(t){return t=t||{},t.data=b0(t.data),w0(t),t}const vp=new Map,_0=new Set;function Uo(t,e){let n=vp.get(t);return n||(n=e(),vp.set(t,n),_0.add(n)),n}const ss=(t,e,n)=>{const r=Di(e,n);r!==void 0&&t.add(r)};class jC{constructor(e){this._config=NC(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=b0(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(),w0(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Uo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Uo(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Uo(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return Uo(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let i=r.get(e);return(!i||n)&&(i=new Map,r.set(e,i)),i}getOptionScopes(e,n,r){const{options:i,type:s}=this,o=this._cachedScopes(e,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(c=>{e&&(l.add(e),c.forEach(d=>ss(l,e,d))),c.forEach(d=>ss(l,i,d)),c.forEach(d=>ss(l,Hr[s]||{},d)),c.forEach(d=>ss(l,_e,d)),c.forEach(d=>ss(l,wc,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),_0.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,Hr[n]||{},_e.datasets[n]||{},{type:n},_e,wc]}resolveNamedOptions(e,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=xp(this._resolverCache,e,i);let l=o;if(LC(o,n)){s.$shared=!1,r=ir(r)?r():r;const u=this.createResolver(e,r,a);l=Li(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(e,n,r=[""],i){const{resolver:s}=xp(this._resolverCache,e,r);return X(n)?Li(s,n,void 0,i):s}}function xp(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const i=n.join();let s=r.get(i);return s||(s={resolver:$d(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const DC=t=>X(t)&&Object.getOwnPropertyNames(t).some(e=>ir(t[e]));function LC(t,e){const{isScriptable:n,isIndexable:r}=o0(t);for(const i of e){const s=n(i),o=r(i),a=(o||s)&&t[i];if(s&&(ir(a)||DC(a))||o&&Ce(a))return!0}return!1}var FC="4.5.1";const IC=["top","bottom","left","right","chartArea"];function wp(t,e){return t==="top"||t==="bottom"||IC.indexOf(t)===-1&&e==="x"}function bp(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function _p(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ue(n&&n.onComplete,[t],e)}function AC(t){const e=t.chart,n=e.options.animation;ue(n&&n.onProgress,[t],e)}function S0(t){return Qd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ha={},Sp=t=>{const e=S0(t);return Object.values(ha).filter(n=>n.canvas===e).pop()};function zC(t,e,n){const r=Object.keys(t);for(const i of r){const s=+i;if(s>=e){const o=t[i];delete t[i],(n>0||s>e)&&(t[s+n]=o)}}}function BC(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}var Cn;let gl=(Cn=class{static register(...e){Yt.add(...e),kp()}static unregister(...e){Yt.remove(...e),kp()}constructor(e,n){const r=this.config=new jC(n),i=S0(e),s=Sp(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||iC(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=nS(),this.ctx=a,this.canvas=l,this.width=c,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 _C,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=_S(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ha[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}rn.listen(this,"complete",_p),rn.listen(this,"progress",AC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return ie(e)?n&&s?s:i?r/i: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 Yt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Xf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vf(this.canvas,this.ctx),this}stop(){return rn.stop(this),this}resize(e,n){rn.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,e,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Xf(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),ue(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};ee(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=_c(o,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),ee(s,o=>{const a=o.options,l=a.id,u=_c(l,a),c=q(a.type,o.dtype);(a.position===void 0||wp(a.position,u)!==wp(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const h=Yt.getScale(c);d=new h({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,e)}),ee(i,(o,a)=>{o||delete r[a]}),ee(r,o=>{wt.configure(this,o,o.options),wt.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(bp("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||bc(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Yt.getController(a),{datasetElementType:u,dataElementType:c}=_e.datasets[a];Object.assign(l,{dataElementType:Yt.getElement(c),datasetElementType:u&&Yt.getElement(u)}),o.controller=new l(this,r),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ee(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 r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),h=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||ee(s,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(bp("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ee(this.scales,e=>{wt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!Lf(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;zC(e,i,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(e.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!Lf(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;wt.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],ee(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,ir(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),i={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(rn.has(this)?this.attached&&!rn.running(this)&&rn.start(this):(this.draw(),_p({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}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,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!e||o.visible)&&r.push(o)}return r}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,r={meta:e,index:e.index,cancelable:!0},i=ak(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Wd(n,i),e.controller.draw(),i&&Hd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return r0(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,i){const s=Ik.modes[n];return typeof s=="function"?s(this,e,r,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={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},r.push(i)),i}getContext(){return this.$context||(this.$context=Hi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,i);qs(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===e?i: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(),rn.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(),Vf(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ha[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,r=(s,o)=>{n.addEventListener(this,s,o),e[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};ee(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),e[l]=u},i=(l,u)=>{e[l]&&(n.removeEventListener(this,l,u),delete e[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){ee(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},ee(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){o=e[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!Wa(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const i=this.options.hover,s=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=s(n,e),a=r?e:s(e,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(e,i,r,o),l=lS(e),u=BC(e,this._lastEvent,r,l);r&&(this._lastEvent=null,ue(s.onHover,[e,a,this],this),l&&ue(s.onClick,[e,a,this],this));const c=!Wa(a,i);return(c||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,c}_getActiveElements(e,n,r,i){if(e.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,i)}},Y(Cn,"defaults",_e),Y(Cn,"instances",ha),Y(Cn,"overrides",Hr),Y(Cn,"registry",Yt),Y(Cn,"version",FC),Y(Cn,"getChart",Sp),Cn);function kp(){return ee(gl.instances,t=>t._plugins.invalidate())}function k0(t,e){const{x:n,y:r,base:i,width:s,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,u,c,d;return t.horizontal?(d=o/2,a=Math.min(n,i),l=Math.max(n,i),u=r-d,c=r+d):(d=s/2,a=n-d,l=n+d,u=Math.min(r,i),c=Math.max(r,i)),{left:a,top:u,right:l,bottom:c}}function $n(t,e,n,r){return t?0:Dt(e,n,r)}function WC(t,e,n){const r=t.options.borderWidth,i=t.borderSkipped,s=s0(r);return{t:$n(i.top,s.top,0,n),r:$n(i.right,s.right,0,e),b:$n(i.bottom,s.bottom,0,n),l:$n(i.left,s.left,0,e)}}function HC(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,s=fi(i),o=Math.min(e,n),a=t.borderSkipped,l=r||X(i);return{topLeft:$n(!l||a.top||a.left,s.topLeft,0,o),topRight:$n(!l||a.top||a.right,s.topRight,0,o),bottomLeft:$n(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:$n(!l||a.bottom||a.right,s.bottomRight,0,o)}}function $C(t){const e=k0(t),n=e.right-e.left,r=e.bottom-e.top,i=WC(t,n/2,r/2),s=HC(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:s},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function su(t,e,n,r){const i=e===null,s=n===null,a=t&&!(i&&s)&&k0(t,r);return a&&(i||oi(e,a.left,a.right))&&(s||oi(n,a.top,a.bottom))}function UC(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function VC(t,e){t.rect(e.x,e.y,e.w,e.h)}function ou(t,e,n={}){const r=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-r,o=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+r,y:t.y+i,w:t.w+s,h:t.h+o,radius:t.radius}}class fa extends sr{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:r,backgroundColor:i}}=this,{inner:s,outer:o}=$C(this),a=UC(o.radius)?Va:VC;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),a(e,ou(o,n,s)),e.clip(),a(e,ou(s,-n,o)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,ou(s,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,r){return su(this,e,n,r)}inXRange(e,n){return su(this,e,null,n)}inYRange(e,n){return su(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+i)/2:n,y:s?r:(r+i)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Y(fa,"id","bar"),Y(fa,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Y(fa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Cp=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},QC=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Ep extends sr{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,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,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=ue(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,i)=>e.sort(r,i,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 r=e.labels,i=Be(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Cp(r,s);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,a,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,a,l)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+a;let d=e;s.textAlign="left",s.textBaseline="middle";let h=-1,f=-c;return this.legendItems.forEach((x,v)=>{const w=r+n/2+s.measureText(x.text).width;(v===0||u[u.length-1]+w+2*a>o)&&(d+=c,u[u.length-(v>0?0:1)]=0,f+=c,h++),l[v]={left:0,top:f,row:h,width:w,height:i},u[u.length-1]+=w+a}),d}_fitCols(e,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-e;let d=a,h=0,f=0,x=0,v=0;return this.legendItems.forEach((w,m)=>{const{itemWidth:y,itemHeight:p}=YC(r,n,s,w,i);m>0&&f+p+2*a>c&&(d+=h+a,u.push({width:h,height:f}),x+=h+a,v++,h=f=0),l[m]={left:x,top:f,col:v,width:y,height:p},h=Math.max(h,y),f+=p+a}),d+=h,u.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=pi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ae(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Ae(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+e+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let a=0,l=Ae(r,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Ae(r,this.top+e+i,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Wd(e,this),this._draw(),Hd(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=e,a=_e.color,l=pi(e.rtl,this.left,this.width),u=Be(o.font),{padding:c}=o,d=u.size,h=d/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:x,boxHeight:v,itemHeight:w}=Cp(o,d),m=function(C,P,E){if(isNaN(x)||x<=0||isNaN(v)||v<0)return;i.save();const N=q(E.lineWidth,1);if(i.fillStyle=q(E.fillStyle,a),i.lineCap=q(E.lineCap,"butt"),i.lineDashOffset=q(E.lineDashOffset,0),i.lineJoin=q(E.lineJoin,"miter"),i.lineWidth=N,i.strokeStyle=q(E.strokeStyle,a),i.setLineDash(q(E.lineDash,[])),o.usePointStyle){const M={radius:v*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:N},T=l.xPlus(C,x/2),A=P+h;n0(i,M,T,A,o.pointStyleWidth&&x)}else{const M=P+Math.max((d-v)/2,0),T=l.leftForLtr(C,x),A=fi(E.borderRadius);i.beginPath(),Object.values(A).some(W=>W!==0)?Va(i,{x:T,y:M,w:x,h:v,radius:A}):i.rect(T,M,x,v),i.fill(),N!==0&&i.stroke()}i.restore()},y=function(C,P,E){Gs(i,E.text,C,P+w/2,u,{strikethrough:E.hidden,textAlign:l.textAlign(E.textAlign)})},p=this.isHorizontal(),b=this._computeTitleHeight();p?f={x:Ae(s,this.left+c,this.right-r[0]),y:this.top+c+b,line:0}:f={x:this.left+c,y:Ae(s,this.top+b+c,this.bottom-n[0].height),line:0},c0(this.ctx,e.textDirection);const k=w+c;this.legendItems.forEach((C,P)=>{i.strokeStyle=C.fontColor,i.fillStyle=C.fontColor;const E=i.measureText(C.text).width,N=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),M=x+h+E;let T=f.x,A=f.y;l.setWidth(this.width),p?P>0&&T+M+c>this.right&&(A=f.y+=k,f.line++,T=f.x=Ae(s,this.left+c,this.right-r[f.line])):P>0&&A+k>this.bottom&&(T=f.x=T+n[f.line].width+c,f.line++,A=f.y=Ae(s,this.top+b+c,this.bottom-n[f.line].height));const W=l.x(T);if(m(W,A,C),T=SS(N,T+x+h,p?T+M:this.right,e.rtl),y(l.x(T),A,C),p)f.x+=M+c;else if(typeof C.text!="string"){const se=u.lineHeight;f.y+=C0(C,se)+c}else f.y+=k}),d0(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=Be(n.font),i=Et(n.padding);if(!n.display)return;const s=pi(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,d=Ae(e.align,d,this.right-h);else{const x=this.columnSizes.reduce((v,w)=>Math.max(v,w.height),0);c=u+Ae(e.align,this.top,this.bottom-x-e.labels.padding-this._computeTitleHeight())}const f=Ae(a,d,d+h);o.textAlign=s.textAlign(Bd(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Gs(o,n.text,f,c,r)}_computeTitleHeight(){const e=this.options.title,n=Be(e.font),r=Et(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,i,s;if(oi(e,this.left,this.right)&&oi(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],oi(e,i.left,i.left+i.width)&&oi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!qC(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=QC(i,r);i&&!s&&ue(n.onLeave,[e,i,this],this),this._hoveredItem=r,r&&!s&&ue(n.onHover,[e,r,this],this)}else r&&ue(n.onClick,[e,r,this],this)}}function YC(t,e,n,r,i){const s=KC(r,t,e,n),o=XC(i,r,e.lineHeight);return{itemWidth:s,itemHeight:o}}function KC(t,e,n,r){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),e+n.size/2+r.measureText(i).width}function XC(t,e,n){let r=t;return typeof e.text!="string"&&(r=C0(e,n)),r}function C0(t,e){const n=t.text?t.text.length:0;return e*n}function qC(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var GC={id:"legend",_element:Ep,start(t,e,n){const r=t.legend=new Ep({ctx:t.ctx,options:n,chart:t});wt.configure(t,r,n),wt.addBox(t,r)},stop(t){wt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;wt.configure(t,r,n),r.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 r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),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:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=Et(u.borderWidth);return{text:e[l.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||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 E0 extends sr{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 r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=Ce(r.text)?r.text.length:1;this._padding=Et(r.padding);const s=i*Be(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,u,c,d;return this.isHorizontal()?(c=Ae(a,r,s),d=n+e,u=s-r):(o.position==="left"?(c=r+e,d=Ae(a,i,n),l=We*-.5):(c=s-e,d=Ae(a,n,i),l=We*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=Be(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(s);Gs(e,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Bd(n.align),textBaseline:"middle",translation:[o,a]})}}function JC(t,e){const n=new E0({ctx:t.ctx,options:e,chart:t});wt.configure(t,n,e),wt.addBox(t,n),t.titleBlock=n}var ZC={id:"title",_element:E0,start(t,e,n){JC(t,n)},stop(t){const e=t.titleBlock;wt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;wt.configure(t,r,n),r.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 fs={average(t){if(!t.length)return!1;let e,n,r=new Set,i=0,s=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=t.length;s<o;++s){const l=t[s].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=gS(e,u);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Vt(t,e){return e&&(Ce(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function sn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
66
+ */class lk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Gy.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,e,"progress")),s.length||(r.running=!1,this._notify(i,r,e,"complete"),r.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}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((r,i)=>Math.max(r,i._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 r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var rn=new lk;const Gf="transparent",uk={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=Hf(t||Gf),i=r.valid&&Hf(e||Gf);return i&&i.valid?i.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class ck{constructor(e,n,r,i){const s=n[r];i=zo([e.to,i,s,e.from]);const o=zo([e.from,s,i]);this._active=!0,this._fn=e.fn||uk[e.type||typeof o],this._easing=ks[e.easing]||ks.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=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=zo([e.to,n,i,e.from]),this._from=zo([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class h0{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!X(e))return;const n=Object.keys(_e.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!X(s))return;const o={};for(const a of n)o[a]=s[a];(Ce(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(e,n){const r=n.options,i=hk(e,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&dk(e.options.$animations,r).then(()=>{e.options=r},()=>{}),s}_createAnimations(e,n){const r=this._properties,i=[],s=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"){i.push(...this._animateOptions(e,n));continue}const c=n[u];let d=s[u];const h=r.get(u);if(d)if(h&&d.active()){d.update(h,c,a);continue}else d.cancel();if(!h||!h.duration){e[u]=c;continue}s[u]=d=new ck(h,e,u,c),i.push(d)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return rn.add(this._chart,r),!0}}function dk(t,e){const n=[],r=Object.keys(e);for(let i=0;i<r.length;i++){const s=t[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function hk(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 Jf(t,e){const n=t&&t.options||{},r=n.reverse,i=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:r?s:i,end:r?i:s}}function fk(t,e,n){if(n===!1)return!1;const r=Jf(t,n),i=Jf(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function pk(t){let e,n,r,i;return X(t)?(e=t.top,n=t.right,r=t.bottom,i=t.left):e=n=r=i=t,{top:e,right:n,bottom:r,left:i,disabled:t===!1}}function f0(t,e){const n=[],r=t._getSortedDatasetMetas(e);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Zf(t,e,n,r={}){const i=t.keys,s=r.mode==="single";let o,a,l,u;if(e===null)return;let c=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(c=!0,r.all)continue;break}u=t.values[l],Ct(u)&&(s||e===0||tr(e)===tr(u))&&(e+=u)}return!c&&!r.all?0:e}function mk(t,e){const{iScale:n,vScale:r}=e,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(t),a=new Array(o.length);let l,u,c;for(l=0,u=o.length;l<u;++l)c=o[l],a[l]={[i]:c,[s]:t[c]};return a}function Jl(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function gk(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function yk(t){const{min:e,max:n,minDefined:r,maxDefined:i}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function vk(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function ep(t,e,n,r){for(const i of e.getMatchingVisibleMetas(r).reverse()){const s=t[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function tp(t,e){const{chart:n,_cachedMeta:r}=t,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,u=o.axis,c=gk(s,o,r),d=e.length;let h;for(let f=0;f<d;++f){const v=e[f],{[l]:y,[u]:w}=v,m=v._stacks||(v._stacks={});h=m[u]=vk(i,c,y),h[a]=w,h._top=ep(h,o,!0,r.type),h._bottom=ep(h,o,!1,r.type);const g=h._visualValues||(h._visualValues={});g[a]=w}}function Zl(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function xk(t,e){return Hi(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function wk(t,e,n){return Hi(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function ts(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const i of e){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const eu=t=>t==="reset"||t==="none",np=(t,e)=>e?t:Object.assign({},t),bk=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:f0(n,!0),values:null};class Es{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=Jl(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&&ts(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,f,v)=>d==="x"?h:d==="r"?v:f,s=n.xAxisID=q(r.xAxisID,Zl(e,"x")),o=n.yAxisID=q(r.yAxisID,Zl(e,"y")),a=n.rAxisID=q(r.rAxisID,Zl(e,"r")),l=n.indexAxis,u=n.iAxisID=i(l,s,o,a),c=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}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&&zf(this._data,this),e._stacked&&ts(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(X(n)){const i=this._cachedMeta;this._data=mk(n,i)}else if(r!==n){if(r){zf(r,this);const i=this._cachedMeta;ts(i),i._parsed=[]}n&&Object.isExtensible(n)&&bS(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,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=Jl(n.vScale,n),n.stack!==r.stack&&(i=!0,ts(n),n.stack=r.stack),this._resyncElements(e),(i||s!==n._stacked)&&(tp(this,n._parsed),n._stacked=Jl(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=e===0&&n===i.length?!0:r._sorted,u=e>0&&r._parsed[e-1],c,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{Ce(i[e])?h=this.parseArrayData(r,i,e,n):X(i[e])?h=this.parseObjectData(r,i,e,n):h=this.parsePrimitiveData(r,i,e,n);const f=()=>d[a]===null||u&&d[a]<u[a];for(c=0;c<n;++c)r._parsed[c+e]=d=h[c],l&&(f()&&(l=!1),u=d);r._sorted=l}o&&tp(this,h)}parsePrimitiveData(e,n,r,i){const{iScale:s,vScale:o}=e,a=s.axis,l=o.axis,u=s.getLabels(),c=s===o,d=new Array(i);let h,f,v;for(h=0,f=i;h<f;++h)v=h+r,d[h]={[a]:c||s.parse(u[v],v),[l]:o.parse(n[v],v)};return d}parseArrayData(e,n,r,i){const{xScale:s,yScale:o}=e,a=new Array(i);let l,u,c,d;for(l=0,u=i;l<u;++l)c=l+r,d=n[c],a[l]={x:s.parse(d[0],c),y:o.parse(d[1],c)};return a}parseObjectData(e,n,r,i){const{xScale:s,yScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,d,h,f;for(c=0,d=i;c<d;++c)h=c+r,f=n[h],u[c]={x:s.parse(Di(f,a),h),y:o.parse(Di(f,l),h)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const i=this.chart,s=this._cachedMeta,o=n[e.axis],a={keys:f0(i,!0),values:n._stacks[e.axis]._visualValues};return Zf(a,o,s.index,{mode:r})}updateRangeFromParsed(e,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Zf(i,s,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&e===r.iScale,o=i.length,a=this._getOtherScale(e),l=bk(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=yk(a);let h,f;function v(){f=i[h];const y=f[a.axis];return!Ct(f[e.axis])||c>y||d<y}for(h=0;h<o&&!(!v()&&(this.updateRangeFromParsed(u,e,f,l),s));++h);if(s){for(h=o-1;h>=0;--h)if(!v()){this.updateRangeFromParsed(u,e,f,l);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][e.axis],Ct(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(e);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=pk(q(this.options.clip,fk(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(e,s,a,l),c=a;c<a+l;++c){const d=i[c];d.hidden||(d.active&&u?o.push(d):d.draw(e,s))}for(c=0;c<o.length;++c)o[c].draw(e,s)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const i=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];s=o.$context||(o.$context=wk(this.getContext(),e,o)),s.parsed=this.getParsed(e),s.raw=i.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=xk(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=e+"-"+n,a=s[o],l=this.enableOptionSharing&&qs(r);if(a)return np(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,e),d=i?[`${e}Hover`,"hover",e,""]:[e,""],h=u.getOptionScopes(this.getDataset(),c),f=Object.keys(_e.elements[e]),v=()=>this.getContext(r,i,n),y=u.resolveNamedOptions(h,f,v,d);return y.$shared&&(y.$shared=l,s[o]=Object.freeze(np(y,l))),y}_resolveAnimations(e,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,n),h=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(h,this.getContext(e,r,n))}const u=new h0(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||eu(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(e,n,r,i){eu(i)?Object.assign(e,r):this._resolveAnimations(n,i).update(e,r)}updateSharedOptions(e,n,r){e&&!eu(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,i){e.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(e,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"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,r=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,e):s<i&&this._removeElements(s,i-s)}_insertElements(e,n,r=!0){const i=this._cachedMeta,s=i.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(s),a=e;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(e,n),r&&this.updateElements(s,e,n,"reset")}updateElements(e,n,r,i){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(e,n);r._stacked&&ts(r,i)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,i]=e;this[n](r,i)}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 r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Y(Es,"defaults",{}),Y(Es,"datasetElementType",null),Y(Es,"dataElementType",null);function _k(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let i=0,s=n.length;i<s;i++)r=r.concat(n[i].controller.getAllParsedValues(t));t._cache.$bar=qy(r.sort((i,s)=>i-s))}return t._cache.$bar}function Sk(t){const e=t.iScale,n=_k(e,t.type);let r=e._length,i,s,o,a;const l=()=>{o===32767||o===-32768||(qs(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(i=0,s=n.length;i<s;++i)o=e.getPixelForValue(n[i]),l();for(a=void 0,i=0,s=e.ticks.length;i<s;++i)o=e.getPixelForTick(i),l();return r}function kk(t,e,n,r){const i=n.barThickness;let s,o;return se(i)?(s=e.min*n.categoryPercentage,o=n.barPercentage):(s=i*r,o=1),{chunk:s/r,ratio:o,start:e.pixels[t]-s/2}}function Ck(t,e,n,r){const i=e.pixels,s=i[t];let o=t>0?i[t-1]:null,a=t<i.length-1?i[t+1]:null;const l=n.categoryPercentage;o===null&&(o=s-(a===null?e.end-e.start:a-s)),a===null&&(a=s+s-o);const u=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:u}}function Ek(t,e,n,r){const i=n.parse(t[0],r),s=n.parse(t[1],r),o=Math.min(i,s),a=Math.max(i,s);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:i,end:s,min:o,max:a}}function p0(t,e,n,r){return Ce(t)?Ek(t,e,n,r):e[n.axis]=n.parse(t,r),e}function rp(t,e,n,r){const i=t.iScale,s=t.vScale,o=i.getLabels(),a=i===s,l=[];let u,c,d,h;for(u=n,c=n+r;u<c;++u)h=e[u],d={},d[i.axis]=a||i.parse(o[u],u),l.push(p0(h,d,s,u));return l}function tu(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Pk(t,e,n){return t!==0?tr(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function Mk(t){let e,n,r,i,s;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(i="end",s="start"):(i="start",s="end"),{start:n,end:r,reverse:e,top:i,bottom:s}}function Tk(t,e,n,r){let i=e.borderSkipped;const s={};if(!i){t.borderSkipped=s;return}if(i===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:u,bottom:c}=Mk(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(s[ip(c,o,a,l)]=!0,i=u)),s[ip(i,o,a,l)]=!0,t.borderSkipped=s}function ip(t,e,n,r){return r?(t=Rk(t,e,n),t=sp(t,n,e)):t=sp(t,e,n),t}function Rk(t,e,n){return t===e?n:t===n?e:t}function sp(t,e,n){return t==="start"?e:t==="end"?n:t}function Nk(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class ca extends Es{parsePrimitiveData(e,n,r,i){return rp(e,n,r,i)}parseArrayData(e,n,r,i){return rp(e,n,r,i)}parseObjectData(e,n,r,i){const{iScale:s,vScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=s.axis==="x"?a:l,c=o.axis==="x"?a:l,d=[];let h,f,v,y;for(h=r,f=r+i;h<f;++h)y=n[h],v={},v[s.axis]=s.parse(Di(y,u),h),d.push(p0(Di(y,c),v,o,h));return d}updateRangeFromParsed(e,n,r,i){super.updateRangeFromParsed(e,n,r,i);const s=r._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:i}=n,s=this.getParsed(e),o=s._custom,a=tu(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+r.getLabelForValue(s[r.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,r,i){const s=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,i);for(let f=n;f<n+r;f++){const v=this.getParsed(f),y=s||se(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),w=this._calculateBarIndexPixels(f,c),m=(v._stacks||{})[a.axis],g={horizontal:u,base:y.base,enableBorderRadius:!m||tu(v._custom)||o===m._top||o===m._bottom,x:u?y.head:w.center,y:u?w.center:y.head,height:u?w.size:Math.abs(y.size),width:u?Math.abs(y.size):w.size};h&&(g.options=d||this.resolveDataElementOptions(f,e[f].active?"active":i));const x=g.options||e[f].options;Tk(g,x,m,o),Nk(g,x,c.ratio),this.updateElement(e[f],f,g,i)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),s=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],u=c=>{const d=c._parsed.find(f=>f[r.axis]===l),h=d&&d[c.vScale.axis];if(se(h)||isNaN(h))return!0};for(const c of i)if(!(n!==void 0&&u(c))&&((s===!1||o.indexOf(c.stack)===-1||s===void 0&&c.stack===void 0)&&o.push(c.stack),c.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(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[q(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const i=this._getStacks(e,r),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,i=[];let s,o;for(s=0,o=n.data.length;s<o;++s)i.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const a=e.barThickness;return{min:a||Sk(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:s,minBarLength:o}}=this,a=s||0,l=this.getParsed(e),u=l._custom,c=tu(u);let d=l[n.axis],h=0,f=r?this.applyStack(n,l,r):d,v,y;f!==d&&(h=f-d,f=d),c&&(d=u.barStart,f=u.barEnd-u.barStart,d!==0&&tr(d)!==tr(u.barEnd)&&(h=0),h+=d);const w=!se(s)&&!c?s:h;let m=n.getPixelForValue(w);if(this.chart.getDataVisibility(e)?v=n.getPixelForValue(h+f):v=m,y=v-m,Math.abs(y)<o){y=Pk(y,n,a)*o,d===a&&(m-=y/2);const g=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),b=Math.min(g,x),C=Math.max(g,x);m=Math.max(Math.min(m,C),b),v=m+y,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(m))}if(m===n.getPixelForValue(a)){const g=tr(y)*n.getLineWidthForValue(a)/2;m+=g,y-=g}return{size:y,base:m,head:v,center:v+y/2}}_calculateBarIndexPixels(e,n){const r=n.scale,i=this.options,s=i.skipNull,o=q(i.maxBarThickness,1/0);let a,l;const u=this._getAxisCount();if(n.grouped){const c=s?this._getStackCount(e):n.stackCount,d=i.barThickness==="flex"?Ck(e,n,i,c*u):kk(e,n,i,c*u),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(q(h,this.getFirstScaleIdForIndexAxis())),v=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0)+f;a=d.start+d.chunk*v+d.chunk/2,l=Math.min(o,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.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,r=e.data,i=r.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}Y(ca,"id","bar"),Y(ca,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Y(ca,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function fr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Kd{constructor(e){Y(this,"options");this.options=e||{}}static override(e){Object.assign(Kd.prototype,e)}init(){}formats(){return fr()}parse(){return fr()}format(){return fr()}add(){return fr()}diff(){return fr()}startOf(){return fr()}endOf(){return fr()}}var Ok={_date:Kd};function jk(t,e,n,r){const{controller:i,data:s,_sorted:o}=t,a=i._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&s.length){const u=a._reversePixels?xS:xc;if(r){if(i._sharedOptions){const c=s[0],d=typeof c.getRange=="function"&&c.getRange(e);if(d){const h=u(s,e,n-d),f=u(s,e,n+d);return{lo:h.lo,hi:f.hi}}}}else{const c=u(s,e,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:h}=t,f=h.slice(0,c.lo+1).reverse().findIndex(y=>!se(y[d.axis]));c.lo-=Math.max(0,f);const v=h.slice(c.hi).findIndex(y=>!se(y[d.axis]));c.hi+=Math.max(0,v)}return c}}return{lo:0,hi:s.length-1}}function ml(t,e,n,r,i){const s=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=s.length;a<l;++a){const{index:u,data:c}=s[a],{lo:d,hi:h}=jk(s[a],e,o,i);for(let f=d;f<=h;++f){const v=c[f];v.skip||r(v,u,f)}}}function Dk(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,i){const s=e?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function nu(t,e,n,r,i){const s=[];return!i&&!t.isPointInArea(e)||ml(t,n,e,function(a,l,u){!i&&!r0(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&s.push({element:a,datasetIndex:l,index:u})},!0),s}function Lk(t,e,n,r){let i=[];function s(o,a,l){const{startAngle:u,endAngle:c}=o.getProps(["startAngle","endAngle"],r),{angle:d}=mS(o,{x:e.x,y:e.y});yS(d,u,c)&&i.push({element:o,datasetIndex:a,index:l})}return ml(t,n,e,s),i}function Fk(t,e,n,r,i,s){let o=[];const a=Dk(n);let l=Number.POSITIVE_INFINITY;function u(c,d,h){const f=c.inRange(e.x,e.y,i);if(r&&!f)return;const v=c.getCenterPoint(i);if(!(!!s||t.isPointInArea(v))&&!f)return;const w=a(e,v);w<l?(o=[{element:c,datasetIndex:d,index:h}],l=w):w===l&&o.push({element:c,datasetIndex:d,index:h})}return ml(t,n,e,u),o}function ru(t,e,n,r,i,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!r?Lk(t,e,n,i):Fk(t,e,n,r,i,s)}function op(t,e,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return ml(t,n,e,(l,u,c)=>{l[o]&&l[o](e[n],i)&&(s.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(e.x,e.y,i))}),r&&!a?[]:s}var Ik={modes:{index(t,e,n,r){const i=yr(e,t),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?nu(t,i,s,r,o):ru(t,i,s,!1,r,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(t,e,n,r){const i=yr(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?nu(t,i,s,r,o):ru(t,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,u=t.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(t,e,n,r){const i=yr(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return nu(t,i,s,r,o)},nearest(t,e,n,r){const i=yr(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return ru(t,i,s,n.intersect,r,o)},x(t,e,n,r){const i=yr(e,t);return op(t,i,"x",n.intersect,r)},y(t,e,n,r){const i=yr(e,t);return op(t,i,"y",n.intersect,r)}}};const m0=["left","top","right","bottom"];function ns(t,e){return t.filter(n=>n.pos===e)}function ap(t,e){return t.filter(n=>m0.indexOf(n.pos)===-1&&n.box.axis===e)}function rs(t,e){return t.sort((n,r)=>{const i=e?r:n,s=e?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function Ak(t){const e=[];let n,r,i,s,o,a;for(n=0,r=(t||[]).length;n<r;++n)i=t[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,e.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return e}function zk(t){const e={};for(const n of t){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!m0.includes(i))continue;const o=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function Bk(t,e){const n=zk(t),{vBoxMaxWidth:r,hBoxMaxHeight:i}=e;let s,o,a;for(s=0,o=t.length;s<o;++s){a=t[s];const{fullSize:l}=a.box,u=n[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&e.availableWidth,a.height=i):(a.width=r,a.height=c?c*i:l&&e.availableHeight)}return n}function Wk(t){const e=Ak(t),n=rs(e.filter(u=>u.box.fullSize),!0),r=rs(ns(e,"left"),!0),i=rs(ns(e,"right")),s=rs(ns(e,"top"),!0),o=rs(ns(e,"bottom")),a=ap(e,"x"),l=ap(e,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:ns(e,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function lp(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function g0(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 Hk(t,e,n,r){const{pos:i,box:s}=n,o=t.maxPadding;if(!X(i)){n.size&&(t[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,t[i]+=n.size}s.getPadding&&g0(o,s.getPadding());const a=Math.max(0,e.outerWidth-lp(o,t,"left","right")),l=Math.max(0,e.outerHeight-lp(o,t,"top","bottom")),u=a!==t.w,c=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function $k(t){const e=t.maxPadding;function n(r){const i=Math.max(e[r]-t[r],0);return t[r]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Uk(t,e){const n=e.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(e[o],n[o])}),s}return r(t?["left","right"]:["top","bottom"])}function hs(t,e,n,r){const i=[];let s,o,a,l,u,c;for(s=0,o=t.length,u=0;s<o;++s){a=t[s],l=a.box,l.update(a.width||e.w,a.height||e.h,Uk(a.horizontal,e));const{same:d,other:h}=Hk(e,n,a,r);u|=d&&i.length,c=c||h,l.fullSize||i.push(a)}return u&&hs(i,e,n,r)||c}function Wo(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function up(t,e,n,r){const i=n.padding;let{x:s,y:o}=e;for(const a of t){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const d=e.w*c,h=u.size||l.height;qs(u.start)&&(o=u.start),l.fullSize?Wo(l,i.left,o,n.outerWidth-i.right-i.left,h):Wo(l,e.left+u.placed,o,d,h),u.start=o,u.placed+=d,o=l.bottom}else{const d=e.h*c,h=u.size||l.width;qs(u.start)&&(s=u.start),l.fullSize?Wo(l,s,i.top,h,n.outerHeight-i.bottom-i.top):Wo(l,s,e.top+u.placed,h,d),u.start=s,u.placed+=d,s=l.right}}e.x=s,e.y=o}var wt={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,r){if(!t)return;const i=Et(t.options.layout.padding),s=Math.max(e-i.width,0),o=Math.max(n-i.height,0),a=Wk(t.boxes),l=a.vertical,u=a.horizontal;ee(t.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const c=l.reduce((y,w)=>w.box.options&&w.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/c,hBoxMaxHeight:o/2}),h=Object.assign({},i);g0(h,Et(r));const f=Object.assign({maxPadding:h,w:s,h:o,x:i.left,y:i.top},i),v=Bk(l.concat(u),d);hs(a.fullSize,f,d,v),hs(l,f,d,v),hs(u,f,d,v)&&hs(l,f,d,v),$k(f),up(a.leftAndTop,f,d,v),f.x+=f.w,f.y+=f.h,up(a.rightAndBottom,f,d,v),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},ee(a.chartArea,y=>{const w=y.box;Object.assign(w,t.chartArea),w.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class y0{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,i){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(e){return!0}updateConfig(e){}}class Vk extends y0{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const da="$chartjs",Qk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},cp=t=>t===null||t==="";function Yk(t,e){const n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[da]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",cp(i)){const s=qf(t,"width");s!==void 0&&(t.width=s)}if(cp(r))if(t.style.height==="")t.height=t.width/(e||2);else{const s=qf(t,"height");s!==void 0&&(t.height=s)}return t}const v0=rk?{passive:!0}:!1;function Kk(t,e,n){t&&t.addEventListener(e,n,v0)}function Xk(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,v0)}function qk(t,e){const n=Qk[t.type]||t.type,{x:r,y:i}=yr(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Ya(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Gk(t,e,n){const r=t.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Ya(a.addedNodes,r),o=o&&!Ya(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Jk(t,e,n){const r=t.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Ya(a.removedNodes,r),o=o&&!Ya(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Js=new Map;let dp=0;function x0(){const t=window.devicePixelRatio;t!==dp&&(dp=t,Js.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function Zk(t,e){Js.size||window.addEventListener("resize",x0),Js.set(t,e)}function eC(t){Js.delete(t),Js.size||window.removeEventListener("resize",x0)}function tC(t,e,n){const r=t.canvas,i=r&&Yd(r);if(!i)return;const s=Jy((a,l)=>{const u=i.clientWidth;n(a,l),u<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||s(u,c)});return o.observe(i),Zk(t,s),o}function iu(t,e,n){n&&n.disconnect(),e==="resize"&&eC(t)}function nC(t,e,n){const r=t.canvas,i=Jy(s=>{t.ctx!==null&&n(qk(s,t))},t);return Kk(r,e,i),i}class rC extends y0{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(Yk(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[da])return!1;const r=n[da].initial;["height","width"].forEach(s=>{const o=r[s];se(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[da],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),o={attach:Gk,detach:Jk,resize:tC}[n]||nC;i[n]=o(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),i=r[n];if(!i)return;({attach:iu,detach:iu,resize:iu}[n]||Xk)(e,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,i){return nk(e,n,r,i)}isAttached(e){const n=e&&Yd(e);return!!(n&&n.isConnected)}}function iC(t){return!Qd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Vk:rC}class sr{constructor(){Y(this,"x");Y(this,"y");Y(this,"active",!1);Y(this,"options");Y(this,"$animations")}tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return Ua(this.x)&&Ua(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const i={};return e.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}}Y(sr,"defaults",{}),Y(sr,"defaultRoutes");function sC(t,e){const n=t.options.ticks,r=oC(t),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?lC(e):[],o=s.length,a=s[0],l=s[o-1],u=[];if(o>i)return uC(e,u,s,o/i),u;const c=aC(s,e,i);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(Ho(e,u,c,se(f)?0:a-f,a),d=0,h=o-1;d<h;d++)Ho(e,u,c,s[d],s[d+1]);return Ho(e,u,c,l,se(f)?e.length:l+f),u}return Ho(e,u,c),u}function oC(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}function aC(t,e,n){const r=cC(t),i=e.length/n;if(!r)return Math.max(i,1);const s=cS(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function lC(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function uC(t,e,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<t.length;o++)o===s&&(e.push(t[o]),i++,s=n[i*r])}function Ho(t,e,n,r,i){const s=q(r,0),o=Math.min(q(i,t.length),t.length);let a=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=s;c<0;)a++,c=Math.round(s+a*n);for(u=Math.max(s,0);u<o;u++)u===c&&(e.push(t[u]),a++,c=Math.round(s+a*n))}function cC(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const dC=t=>t==="left"?"right":t==="right"?"left":t,hp=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,fp=(t,e)=>Math.min(e||t,t);function pp(t,e){const n=[],r=t.length/e,i=t.length;let s=0;for(;s<i;s+=r)n.push(t[Math.floor(s)]);return n}function hC(t,e,n){const r=t.ticks.length,i=Math.min(e,r-1),s=t._startPixel,o=t._endPixel,a=1e-6;let l=t.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-s,o-l):e===0?u=(t.getPixelForTick(1)-l)/2:u=(l-t.getPixelForTick(i-1))/2,l+=i<e?u:-u,l<s-a||l>o+a)))return l}function fC(t,e){ee(t,n=>{const r=n.gc,i=r.length/2;let s;if(i>e){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function is(t){return t.drawTicks?t.tickLength:0}function mp(t,e){if(!t.display)return 0;const n=Be(t.font,e),r=Et(t.padding);return(Ce(t.text)?t.text.length:1)*n.lineHeight+r.height}function pC(t,e){return Hi(t,{scale:e,type:"scale"})}function mC(t,e,n){return Hi(t,{tick:n,index:e,type:"tick"})}function gC(t,e,n){let r=Bd(t);return(n&&e!=="right"||!n&&e==="right")&&(r=dC(r)),r}function yC(t,e,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=t,{chartArea:u,scales:c}=l;let d=0,h,f,v;const y=o-i,w=a-s;if(t.isHorizontal()){if(f=Ae(r,s,a),X(n)){const m=Object.keys(n)[0],g=n[m];v=c[m].getPixelForValue(g)+y-e}else n==="center"?v=(u.bottom+u.top)/2+y-e:v=hp(t,n,e);h=a-s}else{if(X(n)){const m=Object.keys(n)[0],g=n[m];f=c[m].getPixelForValue(g)-w+e}else n==="center"?f=(u.left+u.right)/2-w+e:f=hp(t,n,e);v=Ae(r,o,i),d=n==="left"?-jt:jt}return{titleX:f,titleY:v,maxWidth:h,rotation:d}}class $i extends sr{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:r,_suggestedMax:i}=this;return e=Ht(e,Number.POSITIVE_INFINITY),n=Ht(n,Number.NEGATIVE_INFINITY),r=Ht(r,Number.POSITIVE_INFINITY),i=Ht(i,Number.NEGATIVE_INFINITY),{min:Ht(e,r),max:Ht(n,i),minDefined:Ct(e),maxDefined:Ct(n)}}getMinMax(e){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)o=a[l].controller.getMinMax(this,e),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:Ht(n,Ht(r,n)),max:Ht(r,Ht(n,r))}}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(){ce(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=WS(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?pp(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=sC(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,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ce(this.options.afterUpdate,[this])}beforeSetDimensions(){ce(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(){ce(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ce(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ce(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r],s.label=ce(n.callback,[s.value,r,e],this)}afterTickToLabelConversion(){ce(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ce(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=fp(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,u;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,f=Dt(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/r:f/(r-1),d+6>a&&(a=f/(r-(e.offset?.5:1)),l=this.maxHeight-is(e.grid)-n.padding-mp(e.title,this.chart.options.font),u=Math.sqrt(d*d+h*h),o=pS(Math.min(Math.asin(Dt((c.highest.height+6)/a,-1,1)),Math.asin(Dt(l/u,-1,1))-Math.asin(Dt(h/u,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ce(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ce(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=mp(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=is(s)+l):(e.height=this.maxHeight,e.width=is(s)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:h}=this._getLabelSizes(),f=r.padding*2,v=_r(this.labelRotation),y=Math.cos(v),w=Math.sin(v);if(a){const m=r.mirror?0:w*d.width+y*h.height;e.height=Math.min(this.maxHeight,e.height+m+f)}else{const m=r.mirror?0:y*d.width+w*h.height;e.width=Math.min(this.maxWidth,e.width+m+f)}this._calculatePadding(u,c,w,y)}}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,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?u?(h=i*e.width,f=r*n.height):(h=r*e.height,f=i*n.width):s==="start"?f=n.width:s==="end"?h=e.width:s!=="inner"&&(h=e.width/2,f=n.width/2),this.paddingLeft=Math.max((h-c+o)*this.width/(this.width-c),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let c=n.height/2,d=e.height/2;s==="start"?(c=0,d=e.height):s==="end"&&(c=n.height,d=0),this.paddingTop=c+o,this.paddingBottom=d+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(){ce(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,r;for(n=0,r=e.length;n<r;n++)se(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=pp(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/fp(n,r));let u=0,c=0,d,h,f,v,y,w,m,g,x,b,C;for(d=0;d<n;d+=l){if(v=e[d].label,y=this._resolveTickFontOptions(d),i.font=w=y.string,m=s[w]=s[w]||{data:{},gc:[]},g=y.lineHeight,x=b=0,!se(v)&&!Ce(v))x=Uf(i,m.data,m.gc,x,v),b=g;else if(Ce(v))for(h=0,f=v.length;h<f;++h)C=v[h],!se(C)&&!Ce(C)&&(x=Uf(i,m.data,m.gc,x,C),b+=g);o.push(x),a.push(b),u=Math.max(x,u),c=Math.max(b,c)}fC(s,n);const P=o.indexOf(u),_=a.indexOf(c),E=O=>({width:o[O]||0,height:a[O]||0});return{first:E(0),last:E(n-1),widest:E(P),highest:E(_),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 vS(this._alignToPixels?hr(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 r=n[e];return r.$context||(r.$context=mC(this.getContext(),e,r))}return this.$context||(this.$context=pC(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=_r(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=is(s),f=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,w=y/2,m=function(F){return hr(r,F,y)};let g,x,b,C,P,_,E,O,M,T,I,W;if(o==="top")g=m(this.bottom),_=this.bottom-h,O=g-w,T=m(e.top)+w,W=e.bottom;else if(o==="bottom")g=m(this.top),T=e.top,W=m(e.bottom)-w,_=g+w,O=this.top+h;else if(o==="left")g=m(this.right),P=this.right-h,E=g-w,M=m(e.left)+w,I=e.right;else if(o==="right")g=m(this.left),M=e.left,I=m(e.right)-w,P=g+w,E=this.left+h;else if(n==="x"){if(o==="center")g=m((e.top+e.bottom)/2+.5);else if(X(o)){const F=Object.keys(o)[0],ve=o[F];g=m(this.chart.scales[F].getPixelForValue(ve))}T=e.top,W=e.bottom,_=g+w,O=_+h}else if(n==="y"){if(o==="center")g=m((e.left+e.right)/2);else if(X(o)){const F=Object.keys(o)[0],ve=o[F];g=m(this.chart.scales[F].getPixelForValue(ve))}P=g-w,E=P-h,M=e.left,I=e.right}const oe=q(i.ticks.maxTicksLimit,d),J=Math.max(1,Math.ceil(d/oe));for(x=0;x<d;x+=J){const F=this.getContext(x),ve=s.setContext(F),j=a.setContext(F),A=ve.lineWidth,R=ve.color,B=j.dash||[],H=j.dashOffset,ne=ve.tickWidth,$=ve.tickColor,re=ve.tickBorderDash||[],pe=ve.tickBorderDashOffset;b=hC(this,x,l),b!==void 0&&(C=hr(r,b,A),u?P=E=M=I=C:_=O=T=W=C,f.push({tx1:P,ty1:_,tx2:E,ty2:O,x1:M,y1:T,x2:I,y2:W,width:A,color:R,borderDash:B,borderDashOffset:H,tickWidth:ne,tickColor:$,tickBorderDash:re,tickBorderDashOffset:pe}))}return this._ticksLength=d,this._borderValue=g,f}_computeLabelItems(e){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=s,h=is(r.grid),f=h+c,v=d?-c:f,y=-_r(this.labelRotation),w=[];let m,g,x,b,C,P,_,E,O,M,T,I,W="middle";if(i==="top")P=this.bottom-v,_=this._getXAxisLabelAlignment();else if(i==="bottom")P=this.top+v,_=this._getXAxisLabelAlignment();else if(i==="left"){const J=this._getYAxisLabelAlignment(h);_=J.textAlign,C=J.x}else if(i==="right"){const J=this._getYAxisLabelAlignment(h);_=J.textAlign,C=J.x}else if(n==="x"){if(i==="center")P=(e.top+e.bottom)/2+f;else if(X(i)){const J=Object.keys(i)[0],F=i[J];P=this.chart.scales[J].getPixelForValue(F)+f}_=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")C=(e.left+e.right)/2-f;else if(X(i)){const J=Object.keys(i)[0],F=i[J];C=this.chart.scales[J].getPixelForValue(F)}_=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?W="top":l==="end"&&(W="bottom"));const oe=this._getLabelSizes();for(m=0,g=a.length;m<g;++m){x=a[m],b=x.label;const J=s.setContext(this.getContext(m));E=this.getPixelForTick(m)+s.labelOffset,O=this._resolveTickFontOptions(m),M=O.lineHeight,T=Ce(b)?b.length:1;const F=T/2,ve=J.color,j=J.textStrokeColor,A=J.textStrokeWidth;let R=_;o?(C=E,_==="inner"&&(m===g-1?R=this.options.reverse?"left":"right":m===0?R=this.options.reverse?"right":"left":R="center"),i==="top"?u==="near"||y!==0?I=-T*M+M/2:u==="center"?I=-oe.highest.height/2-F*M+M:I=-oe.highest.height+M/2:u==="near"||y!==0?I=M/2:u==="center"?I=oe.highest.height/2-F*M:I=oe.highest.height-T*M,d&&(I*=-1),y!==0&&!J.showLabelBackdrop&&(C+=M/2*Math.sin(y))):(P=E,I=(1-T)*M/2);let B;if(J.showLabelBackdrop){const H=Et(J.backdropPadding),ne=oe.heights[m],$=oe.widths[m];let re=I-H.top,pe=0-H.left;switch(W){case"middle":re-=ne/2;break;case"bottom":re-=ne;break}switch(_){case"center":pe-=$/2;break;case"right":pe-=$;break;case"inner":m===g-1?pe-=$:m>0&&(pe-=$/2);break}B={left:pe,top:re,width:$+H.width,height:ne+H.height,color:J.backdropColor}}w.push({label:b,font:O,textOffset:I,options:{rotation:y,color:ve,strokeColor:j,strokeWidth:A,textAlign:R,textBaseline:W,translation:[C,P],backdrop:B}})}return w}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-_r(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=e+s,l=o.widest.width;let u,c;return n==="left"?i?(c=this.right+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_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:r,top:i,width:s,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,i,s,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const a=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];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:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,h;this.isHorizontal()?(u=hr(e,this.left,o)-o/2,c=hr(e,this.right,a)+a/2,d=h=l):(d=hr(e,this.top,o)-o/2,h=hr(e,this.bottom,a)+a/2,u=c=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(u,d),n.lineTo(c,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Wd(r,i);const s=this.getLabelItems(e);for(const o of s){const a=o.options,l=o.font,u=o.label,c=o.textOffset;Gs(r,u,0,c,l,a)}i&&Hd(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=Be(r.font),o=Et(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||X(n)?(l+=o.bottom,Ce(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:u,titleY:c,maxWidth:d,rotation:h}=yC(this,l,n,a);Gs(e,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:h,textAlign:gC(a,n,i),textBaseline:"middle",translation:[u,c]})}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,r=q(e.grid&&e.grid.z,-1),i=q(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==$i.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!e||a.type===e)&&i.push(a)}return i}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Be(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class $o{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,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 r;wC(n)&&(r=this.register(n));const i=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in i||(i[s]=e,vC(e,o,r),this.override&&_e.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,i=this.scope;r in n&&delete n[r],i&&r in _e[i]&&(delete _e[i][r],this.override&&delete Hr[r])}}function vC(t,e,n){const r=Xs(Object.create(null),[n?_e.get(n):{},_e.get(e),t.defaults]);_e.set(e,r),t.defaultRoutes&&xC(e,t.defaultRoutes),t.descriptors&&_e.describe(e,t.descriptors)}function xC(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),i=r.pop(),s=[t].concat(r).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");_e.route(s,i,l,a)})}function wC(t){return"id"in t&&"defaults"in t}class bC{constructor(){this.controllers=new $o(Es,"datasets",!0),this.elements=new $o(sr,"elements"),this.plugins=new $o(Object,"plugins"),this.scales=new $o($i,"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,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(e,s,i):ee(i,o=>{const a=r||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,r){const i=Ad(e);ce(r["before"+i],[],r),n[e](r),ce(r["after"+i],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const i=n.get(e);if(i===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return i}}var Yt=new bC;class _C{constructor(){this._init=void 0}notify(e,n,r,i){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const s=i?this._descriptors(e).filter(i):this._descriptors(e),o=this._notify(s,e,n,r);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,n,r,i){i=i||{};for(const s of e){const o=s.plugin,a=o[r],l=[n,i,s.options];if(ce(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){se(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 r=e&&e.config,i=q(r.options&&r.options.plugins,{}),s=SC(r);return i===!1&&!n?[]:CC(e,s,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),e,"stop"),this._notify(i(r,n),e,"start")}}function SC(t){const e={},n=[],r=Object.keys(Yt.plugins.items);for(let s=0;s<r.length;s++)n.push(Yt.getPlugin(r[s]));const i=t.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function kC(t,e){return!e&&t===!1?null:t===!0?{}:t}function CC(t,{plugins:e,localIds:n},r,i){const s=[],o=t.getContext();for(const a of e){const l=a.id,u=kC(r[l],i);u!==null&&s.push({plugin:a,options:EC(t.config,{plugin:a,local:n[l]},u,o)})}return s}function EC(t,{plugin:e,local:n},r,i){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(r,s);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function bc(t,e){const n=_e.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function PC(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function MC(t,e){return t===e?"_index_":"_value_"}function gp(t){if(t==="x"||t==="y"||t==="r")return t}function TC(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function _c(t,...e){if(gp(t))return t;for(const n of e){const r=n.axis||TC(n.position)||t.length>1&&gp(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function yp(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function RC(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return yp(t,"x",n[0])||yp(t,"y",n[0])}return{}}function NC(t,e){const n=Hr[t.type]||{scales:{}},r=e.scales||{},i=bc(t.type,e),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!X(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=_c(o,a,RC(o,t),_e.scales[a.type]),u=MC(l,i),c=n.scales||{};s[o]=Ss(Object.create(null),[{axis:l},a,c[l],c[u]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||bc(a,e),c=(Hr[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=PC(d,l),f=o[h+"AxisID"]||h;s[f]=s[f]||Object.create(null),Ss(s[f],[{axis:h},r[f],c[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Ss(a,[_e.scales[a.type],_e.scale])}),s}function w0(t){const e=t.options||(t.options={});e.plugins=q(e.plugins,{}),e.scales=NC(t,e)}function b0(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function OC(t){return t=t||{},t.data=b0(t.data),w0(t),t}const vp=new Map,_0=new Set;function Uo(t,e){let n=vp.get(t);return n||(n=e(),vp.set(t,n),_0.add(n)),n}const ss=(t,e,n)=>{const r=Di(e,n);r!==void 0&&t.add(r)};class jC{constructor(e){this._config=OC(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=b0(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(),w0(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Uo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Uo(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Uo(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return Uo(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let i=r.get(e);return(!i||n)&&(i=new Map,r.set(e,i)),i}getOptionScopes(e,n,r){const{options:i,type:s}=this,o=this._cachedScopes(e,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(c=>{e&&(l.add(e),c.forEach(d=>ss(l,e,d))),c.forEach(d=>ss(l,i,d)),c.forEach(d=>ss(l,Hr[s]||{},d)),c.forEach(d=>ss(l,_e,d)),c.forEach(d=>ss(l,wc,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),_0.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,Hr[n]||{},_e.datasets[n]||{},{type:n},_e,wc]}resolveNamedOptions(e,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=xp(this._resolverCache,e,i);let l=o;if(LC(o,n)){s.$shared=!1,r=ir(r)?r():r;const u=this.createResolver(e,r,a);l=Li(o,r,u)}for(const u of n)s[u]=l[u];return s}createResolver(e,n,r=[""],i){const{resolver:s}=xp(this._resolverCache,e,r);return X(n)?Li(s,n,void 0,i):s}}function xp(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const i=n.join();let s=r.get(i);return s||(s={resolver:$d(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const DC=t=>X(t)&&Object.getOwnPropertyNames(t).some(e=>ir(t[e]));function LC(t,e){const{isScriptable:n,isIndexable:r}=o0(t);for(const i of e){const s=n(i),o=r(i),a=(o||s)&&t[i];if(s&&(ir(a)||DC(a))||o&&Ce(a))return!0}return!1}var FC="4.5.1";const IC=["top","bottom","left","right","chartArea"];function wp(t,e){return t==="top"||t==="bottom"||IC.indexOf(t)===-1&&e==="x"}function bp(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function _p(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ce(n&&n.onComplete,[t],e)}function AC(t){const e=t.chart,n=e.options.animation;ce(n&&n.onProgress,[t],e)}function S0(t){return Qd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ha={},Sp=t=>{const e=S0(t);return Object.values(ha).filter(n=>n.canvas===e).pop()};function zC(t,e,n){const r=Object.keys(t);for(const i of r){const s=+i;if(s>=e){const o=t[i];delete t[i],(n>0||s>e)&&(t[s+n]=o)}}}function BC(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}var Cn;let gl=(Cn=class{static register(...e){Yt.add(...e),kp()}static unregister(...e){Yt.remove(...e),kp()}constructor(e,n){const r=this.config=new jC(n),i=S0(e),s=Sp(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||iC(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=nS(),this.ctx=a,this.canvas=l,this.width=c,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 _C,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=_S(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ha[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}rn.listen(this,"complete",_p),rn.listen(this,"progress",AC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return se(e)?n&&s?s:i?r/i: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 Yt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Xf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Vf(this.canvas,this.ctx),this}stop(){return rn.stop(this),this}resize(e,n){rn.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,e,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Xf(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),ce(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};ee(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=_c(o,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),ee(s,o=>{const a=o.options,l=a.id,u=_c(l,a),c=q(a.type,o.dtype);(a.position===void 0||wp(a.position,u)!==wp(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const h=Yt.getScale(c);d=new h({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,e)}),ee(i,(o,a)=>{o||delete r[a]}),ee(r,o=>{wt.configure(this,o,o.options),wt.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(bp("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||bc(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Yt.getController(a),{datasetElementType:u,dataElementType:c}=_e.datasets[a];Object.assign(l,{dataElementType:Yt.getElement(c),datasetElementType:u&&Yt.getElement(u)}),o.controller=new l(this,r),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ee(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 r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),h=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||ee(s,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(bp("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ee(this.scales,e=>{wt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!Lf(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;zC(e,i,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(e.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!Lf(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;wt.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],ee(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,ir(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),i={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(rn.has(this)?this.attached&&!rn.running(this)&&rn.start(this):(this.draw(),_p({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}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,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!e||o.visible)&&r.push(o)}return r}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,r={meta:e,index:e.index,cancelable:!0},i=ak(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&Wd(n,i),e.controller.draw(),i&&Hd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return r0(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,i){const s=Ik.modes[n];return typeof s=="function"?s(this,e,r,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={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},r.push(i)),i}getContext(){return this.$context||(this.$context=Hi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,i);qs(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===e?i: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(),rn.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(),Vf(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ha[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,r=(s,o)=>{n.addEventListener(this,s,o),e[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};ee(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),e[l]=u},i=(l,u)=>{e[l]&&(n.removeEventListener(this,l,u),delete e[l])},s=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){ee(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},ee(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){o=e[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!Wa(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const i=this.options.hover,s=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),o=s(n,e),a=r?e:s(e,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(e,i,r,o),l=lS(e),u=BC(e,this._lastEvent,r,l);r&&(this._lastEvent=null,ce(s.onHover,[e,a,this],this),l&&ce(s.onClick,[e,a,this],this));const c=!Wa(a,i);return(c||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=u,c}_getActiveElements(e,n,r,i){if(e.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,i)}},Y(Cn,"defaults",_e),Y(Cn,"instances",ha),Y(Cn,"overrides",Hr),Y(Cn,"registry",Yt),Y(Cn,"version",FC),Y(Cn,"getChart",Sp),Cn);function kp(){return ee(gl.instances,t=>t._plugins.invalidate())}function k0(t,e){const{x:n,y:r,base:i,width:s,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,u,c,d;return t.horizontal?(d=o/2,a=Math.min(n,i),l=Math.max(n,i),u=r-d,c=r+d):(d=s/2,a=n-d,l=n+d,u=Math.min(r,i),c=Math.max(r,i)),{left:a,top:u,right:l,bottom:c}}function $n(t,e,n,r){return t?0:Dt(e,n,r)}function WC(t,e,n){const r=t.options.borderWidth,i=t.borderSkipped,s=s0(r);return{t:$n(i.top,s.top,0,n),r:$n(i.right,s.right,0,e),b:$n(i.bottom,s.bottom,0,n),l:$n(i.left,s.left,0,e)}}function HC(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,s=fi(i),o=Math.min(e,n),a=t.borderSkipped,l=r||X(i);return{topLeft:$n(!l||a.top||a.left,s.topLeft,0,o),topRight:$n(!l||a.top||a.right,s.topRight,0,o),bottomLeft:$n(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:$n(!l||a.bottom||a.right,s.bottomRight,0,o)}}function $C(t){const e=k0(t),n=e.right-e.left,r=e.bottom-e.top,i=WC(t,n/2,r/2),s=HC(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:s},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function su(t,e,n,r){const i=e===null,s=n===null,a=t&&!(i&&s)&&k0(t,r);return a&&(i||oi(e,a.left,a.right))&&(s||oi(n,a.top,a.bottom))}function UC(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function VC(t,e){t.rect(e.x,e.y,e.w,e.h)}function ou(t,e,n={}){const r=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-r,o=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+r,y:t.y+i,w:t.w+s,h:t.h+o,radius:t.radius}}class fa extends sr{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:r,backgroundColor:i}}=this,{inner:s,outer:o}=$C(this),a=UC(o.radius)?Va:VC;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),a(e,ou(o,n,s)),e.clip(),a(e,ou(s,-n,o)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,ou(s,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,r){return su(this,e,n,r)}inXRange(e,n){return su(this,e,null,n)}inYRange(e,n){return su(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+i)/2:n,y:s?r:(r+i)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Y(fa,"id","bar"),Y(fa,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Y(fa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Cp=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},QC=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Ep extends sr{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,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,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=ce(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,i)=>e.sort(r,i,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 r=e.labels,i=Be(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Cp(r,s);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(o,s,a,l)+10):(c=this.maxHeight,u=this._fitCols(o,i,a,l)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+a;let d=e;s.textAlign="left",s.textBaseline="middle";let h=-1,f=-c;return this.legendItems.forEach((v,y)=>{const w=r+n/2+s.measureText(v.text).width;(y===0||u[u.length-1]+w+2*a>o)&&(d+=c,u[u.length-(y>0?0:1)]=0,f+=c,h++),l[y]={left:0,top:f,row:h,width:w,height:i},u[u.length-1]+=w+a}),d}_fitCols(e,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=o-e;let d=a,h=0,f=0,v=0,y=0;return this.legendItems.forEach((w,m)=>{const{itemWidth:g,itemHeight:x}=YC(r,n,s,w,i);m>0&&f+x+2*a>c&&(d+=h+a,u.push({width:h,height:f}),v+=h+a,y++,h=f=0),l[m]={left:v,top:f,col:y,width:g,height:x},h=Math.max(h,g),f+=x+a}),d+=h,u.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=pi(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ae(r,this.left+i,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Ae(r,this.left+i,this.right-this.lineWidths[a])),u.top+=this.top+e+i,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+i}else{let a=0,l=Ae(r,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Ae(r,this.top+e+i,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+i,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Wd(e,this),this._draw(),Hd(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=e,a=_e.color,l=pi(e.rtl,this.left,this.width),u=Be(o.font),{padding:c}=o,d=u.size,h=d/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:v,boxHeight:y,itemHeight:w}=Cp(o,d),m=function(P,_,E){if(isNaN(v)||v<=0||isNaN(y)||y<0)return;i.save();const O=q(E.lineWidth,1);if(i.fillStyle=q(E.fillStyle,a),i.lineCap=q(E.lineCap,"butt"),i.lineDashOffset=q(E.lineDashOffset,0),i.lineJoin=q(E.lineJoin,"miter"),i.lineWidth=O,i.strokeStyle=q(E.strokeStyle,a),i.setLineDash(q(E.lineDash,[])),o.usePointStyle){const M={radius:y*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:O},T=l.xPlus(P,v/2),I=_+h;n0(i,M,T,I,o.pointStyleWidth&&v)}else{const M=_+Math.max((d-y)/2,0),T=l.leftForLtr(P,v),I=fi(E.borderRadius);i.beginPath(),Object.values(I).some(W=>W!==0)?Va(i,{x:T,y:M,w:v,h:y,radius:I}):i.rect(T,M,v,y),i.fill(),O!==0&&i.stroke()}i.restore()},g=function(P,_,E){Gs(i,E.text,P,_+w/2,u,{strikethrough:E.hidden,textAlign:l.textAlign(E.textAlign)})},x=this.isHorizontal(),b=this._computeTitleHeight();x?f={x:Ae(s,this.left+c,this.right-r[0]),y:this.top+c+b,line:0}:f={x:this.left+c,y:Ae(s,this.top+b+c,this.bottom-n[0].height),line:0},c0(this.ctx,e.textDirection);const C=w+c;this.legendItems.forEach((P,_)=>{i.strokeStyle=P.fontColor,i.fillStyle=P.fontColor;const E=i.measureText(P.text).width,O=l.textAlign(P.textAlign||(P.textAlign=o.textAlign)),M=v+h+E;let T=f.x,I=f.y;l.setWidth(this.width),x?_>0&&T+M+c>this.right&&(I=f.y+=C,f.line++,T=f.x=Ae(s,this.left+c,this.right-r[f.line])):_>0&&I+C>this.bottom&&(T=f.x=T+n[f.line].width+c,f.line++,I=f.y=Ae(s,this.top+b+c,this.bottom-n[f.line].height));const W=l.x(T);if(m(W,I,P),T=SS(O,T+v+h,x?T+M:this.right,e.rtl),g(l.x(T),I,P),x)f.x+=M+c;else if(typeof P.text!="string"){const oe=u.lineHeight;f.y+=C0(P,oe)+c}else f.y+=C}),d0(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=Be(n.font),i=Et(n.padding);if(!n.display)return;const s=pi(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,u=i.top+l;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+u,d=Ae(e.align,d,this.right-h);else{const v=this.columnSizes.reduce((y,w)=>Math.max(y,w.height),0);c=u+Ae(e.align,this.top,this.bottom-v-e.labels.padding-this._computeTitleHeight())}const f=Ae(a,d,d+h);o.textAlign=s.textAlign(Bd(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,Gs(o,n.text,f,c,r)}_computeTitleHeight(){const e=this.options.title,n=Be(e.font),r=Et(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,i,s;if(oi(e,this.left,this.right)&&oi(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],oi(e,i.left,i.left+i.width)&&oi(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!qC(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,s=QC(i,r);i&&!s&&ce(n.onLeave,[e,i,this],this),this._hoveredItem=r,r&&!s&&ce(n.onHover,[e,r,this],this)}else r&&ce(n.onClick,[e,r,this],this)}}function YC(t,e,n,r,i){const s=KC(r,t,e,n),o=XC(i,r,e.lineHeight);return{itemWidth:s,itemHeight:o}}function KC(t,e,n,r){let i=t.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),e+n.size/2+r.measureText(i).width}function XC(t,e,n){let r=t;return typeof e.text!="string"&&(r=C0(e,n)),r}function C0(t,e){const n=t.text?t.text.length:0;return e*n}function qC(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var GC={id:"legend",_element:Ep,start(t,e,n){const r=t.legend=new Ep({ctx:t.ctx,options:n,chart:t});wt.configure(t,r,n),wt.addBox(t,r)},stop(t){wt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;wt.configure(t,r,n),r.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 r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),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:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=Et(u.borderWidth);return{text:e[l.index].label,fillStyle:u.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||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 E0 extends sr{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 r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=Ce(r.text)?r.text.length:1;this._padding=Et(r.padding);const s=i*Be(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,u,c,d;return this.isHorizontal()?(c=Ae(a,r,s),d=n+e,u=s-r):(o.position==="left"?(c=r+e,d=Ae(a,i,n),l=We*-.5):(c=s-e,d=Ae(a,n,i),l=We*.5),u=i-n),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=Be(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(s);Gs(e,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:Bd(n.align),textBaseline:"middle",translation:[o,a]})}}function JC(t,e){const n=new E0({ctx:t.ctx,options:e,chart:t});wt.configure(t,n,e),wt.addBox(t,n),t.titleBlock=n}var ZC={id:"title",_element:E0,start(t,e,n){JC(t,n)},stop(t){const e=t.titleBlock;wt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;wt.configure(t,r,n),r.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 fs={average(t){if(!t.length)return!1;let e,n,r=new Set,i=0,s=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=t.length;s<o;++s){const l=t[s].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=gS(e,u);c<i&&(i=c,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Vt(t,e){return e&&(Ce(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function sn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
67
67
  `)>-1?t.split(`
68
- `):t}function e2(t,e){const{element:n,datasetIndex:r,index:i}=e,s=t.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:t,label:o,parsed:s.getParsed(i),raw:t.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Pp(t,e){const n=t.chart.ctx,{body:r,footer:i,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Be(e.bodyFont),u=Be(e.titleFont),c=Be(e.footerFont),d=s.length,h=i.length,f=r.length,x=Et(e.padding);let v=x.height,w=0,m=r.reduce((b,k)=>b+k.before.length+k.lines.length+k.after.length,0);if(m+=t.beforeBody.length+t.afterBody.length,d&&(v+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),m){const b=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;v+=f*b+(m-f)*l.lineHeight+(m-1)*e.bodySpacing}h&&(v+=e.footerMarginTop+h*c.lineHeight+(h-1)*e.footerSpacing);let y=0;const p=function(b){w=Math.max(w,n.measureText(b).width+y)};return n.save(),n.font=u.string,ee(t.title,p),n.font=l.string,ee(t.beforeBody.concat(t.afterBody),p),y=e.displayColors?o+2+e.boxPadding:0,ee(r,b=>{ee(b.before,p),ee(b.lines,p),ee(b.after,p)}),y=0,n.font=c.string,ee(t.footer,p),n.restore(),w+=x.width,{width:w,height:v}}function t2(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function n2(t,e,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(t==="left"&&i+s+o>e.width||t==="right"&&i-s-o<0)return!0}function r2(t,e,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=t;let u="center";return r==="center"?u=i<=(a+l)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),n2(u,t,e,n)&&(u="center"),u}function Mp(t,e,n){const r=n.yAlign||e.yAlign||t2(t,n);return{xAlign:n.xAlign||e.xAlign||r2(t,e,n,r),yAlign:r}}function i2(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function s2(t,e,n){let{y:r,height:i}=t;return e==="top"?r+=n:e==="bottom"?r-=i+n:r-=i/2,r}function Rp(t,e,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,u=i+s,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=fi(o);let x=i2(e,a);const v=s2(e,l,u);return l==="center"?a==="left"?x+=u:a==="right"&&(x-=u):a==="left"?x-=Math.max(c,h)+i:a==="right"&&(x+=Math.max(d,f)+i),{x:Dt(x,0,r.width-e.width),y:Dt(v,0,r.height-e.height)}}function Vo(t,e,n){const r=Et(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function Tp(t){return Vt([],sn(t))}function o2(t,e,n){return Hi(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Op(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const P0={beforeTitle:tn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:tn,beforeBody:tn,beforeLabel:tn,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 ie(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:tn,afterBody:tn,beforeFooter:tn,footer:tn,afterFooter:tn};function Ge(t,e,n,r){const i=t[e].call(n,r);return typeof i>"u"?P0[e].call(n,r):i}class Sc extends sr{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,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new h0(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=o2(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,i=Ge(r,"beforeTitle",this,e),s=Ge(r,"title",this,e),o=Ge(r,"afterTitle",this,e);let a=[];return a=Vt(a,sn(i)),a=Vt(a,sn(s)),a=Vt(a,sn(o)),a}getBeforeBody(e,n){return Tp(Ge(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,i=[];return ee(e,s=>{const o={before:[],lines:[],after:[]},a=Op(r,s);Vt(o.before,sn(Ge(a,"beforeLabel",this,s))),Vt(o.lines,Ge(a,"label",this,s)),Vt(o.after,sn(Ge(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(e,n){return Tp(Ge(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,i=Ge(r,"beforeFooter",this,e),s=Ge(r,"footer",this,e),o=Ge(r,"afterFooter",this,e);let a=[];return a=Vt(a,sn(i)),a=Vt(a,sn(s)),a=Vt(a,sn(o)),a}_createItems(e){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(e2(this.chart,n[l]));return e.filter&&(a=a.filter((c,d,h)=>e.filter(c,d,h,r))),e.itemSort&&(a=a.sort((c,d)=>e.itemSort(c,d,r))),ee(a,c=>{const d=Op(e.callbacks,c);i.push(Ge(d,"labelColor",this,c)),s.push(Ge(d,"labelPointStyle",this,c)),o.push(Ge(d,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=fs[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Pp(this,r),u=Object.assign({},a,l),c=Mp(this.chart,r,u),d=Rp(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,i){const s=this.getCaretPosition(e,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=fi(a),{x:h,y:f}=e,{width:x,height:v}=n;let w,m,y,p,b,k;return s==="center"?(b=f+v/2,i==="left"?(w=h,m=w-o,p=b+o,k=b-o):(w=h+x,m=w+o,p=b-o,k=b+o),y=w):(i==="left"?m=h+Math.max(l,c)+o:i==="right"?m=h+x-Math.max(u,d)-o:m=this.caretX,s==="top"?(p=f,b=p-o,w=m-o,y=m+o):(p=f+v,b=p+o,w=m+o,y=m-o),k=p),{x1:w,x2:m,x3:y,y1:p,y2:b,y3:k}}drawTitle(e,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const u=pi(r.rtl,this.x,this.width);for(e.x=Vo(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=Be(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,l+1===s&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=s,c=Be(s.bodyFont),d=Vo(this,"left",s),h=i.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,x=n.y+f;if(s.usePointStyle){const v={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=i.leftForLtr(h,u)+u/2,m=x+l/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Qf(e,v,w,m),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Qf(e,v,w,m)}else{e.lineWidth=X(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 v=i.leftForLtr(h,u),w=i.leftForLtr(i.xPlus(h,1),u-2),m=fi(o.borderRadius);Object.values(m).some(y=>y!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Va(e,{x:v,y:x,w:u,h:l,radius:m}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Va(e,{x:w,y:x+1,w:u-2,h:l-2,radius:m}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(v,x,u,l),e.strokeRect(v,x,u,l),e.fillStyle=o.backgroundColor,e.fillRect(w,x+1,u-2,l-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:c}=r,d=Be(r.bodyFont);let h=d.lineHeight,f=0;const x=pi(r.rtl,this.x,this.width),v=function(E){n.fillText(E,x.x(e.x+f),e.y+h/2),e.y+=h+s},w=x.textAlign(o);let m,y,p,b,k,C,P;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,e.x=Vo(this,w,r),n.fillStyle=r.bodyColor,ee(this.beforeBody,v),f=a&&w!=="right"?o==="center"?u/2+c:u+2+c:0,b=0,C=i.length;b<C;++b){for(m=i[b],y=this.labelTextColors[b],n.fillStyle=y,ee(m.before,v),p=m.lines,a&&p.length&&(this._drawColorBox(n,e,b,x,r),h=Math.max(d.lineHeight,l)),k=0,P=p.length;k<P;++k)v(p[k]),h=d.lineHeight;ee(m.after,v)}f=0,h=d.lineHeight,ee(this.afterBody,v),e.y-=s}drawFooter(e,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=pi(r.rtl,this.x,this.width);for(e.x=Vo(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Be(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r.footerSpacing}}drawBackground(e,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=e,{width:u,height:c}=r,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:x}=fi(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(e,n,r,i),n.lineTo(a+u-h,l),n.quadraticCurveTo(a+u,l,a+u,l+h),o==="center"&&s==="right"&&this.drawCaret(e,n,r,i),n.lineTo(a+u,l+c-x),n.quadraticCurveTo(a+u,l+c,a+u-x,l+c),o==="bottom"&&this.drawCaret(e,n,r,i),n.lineTo(a+f,l+c),n.quadraticCurveTo(a,l+c,a,l+c-f),o==="center"&&s==="left"&&this.drawCaret(e,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=fs[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Pp(this,e),l=Object.assign({},o,this._size),u=Mp(n,e,l),c=Rp(e,l,u,n);(i._to!==c.x||s._to!==c.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,c))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Et(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=r,this.drawBackground(s,e,i,n),c0(e,n.textDirection),s.y+=o.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),d0(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,i=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}}),s=!Wa(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(e,s,n,r),a=this._positionChanged(o,e),l=n||!Wa(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,r,i){const s=this.options;if(e.type==="mouseout")return[];if(!i)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,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:r,caretY:i,options:s}=this,o=fs[s.position].call(this,e,n);return o!==!1&&(r!==o.x||i!==o.y)}}Y(Sc,"positioners",fs);var a2={id:"tooltip",_element:Sc,positioners:fs,afterInit(t,e,n){n&&(t.tooltip=new Sc({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:P0},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 l2=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function u2(t,e,n,r){const i=t.indexOf(e);if(i===-1)return l2(t,e,n,r);const s=t.lastIndexOf(e);return i!==s?n:i}const c2=(t,e)=>t===null?null:Dt(Math.round(t),0,e);function Np(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class kc extends $i{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(ie(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:u2(r,e,q(n,e),this._addedLabels),c2(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=e;o<=n;o++)i.push({value:o});return i}getLabelForValue(e){return Np.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}}Y(kc,"id","category"),Y(kc,"defaults",{ticks:{callback:Np}});function d2(t,e){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:h}=t,f=s||1,x=c-1,{min:v,max:w}=e,m=!ie(o),y=!ie(a),p=!ie(u),b=(w-v)/(d+1);let k=If((w-v)/x/f)*f,C,P,E,N;if(k<1e-14&&!m&&!y)return[{value:v},{value:w}];N=Math.ceil(w/k)-Math.floor(v/k),N>x&&(k=If(N*k/x/f)*f),ie(l)||(C=Math.pow(10,l),k=Math.ceil(k*C)/C),i==="ticks"?(P=Math.floor(v/k)*k,E=Math.ceil(w/k)*k):(P=v,E=w),m&&y&&s&&hS((a-o)/s,k/1e3)?(N=Math.round(Math.min((a-o)/k,c)),k=(a-o)/N,P=o,E=a):p?(P=m?o:P,E=y?a:E,N=u-1,k=(E-P)/N):(N=(E-P)/k,ua(N,Math.round(N),k/1e3)?N=Math.round(N):N=Math.ceil(N));const M=Math.max(Af(k),Af(P));C=Math.pow(10,ie(l)?M:l),P=Math.round(P*C)/C,E=Math.round(E*C)/C;let T=0;for(m&&(h&&P!==o?(n.push({value:o}),P<o&&T++,ua(Math.round((P+T*k)*C)/C,o,jp(o,b,t))&&T++):P<o&&T++);T<N;++T){const A=Math.round((P+T*k)*C)/C;if(y&&A>a)break;n.push({value:A})}return y&&h&&E!==a?n.length&&ua(n[n.length-1].value,a,jp(a,b,t))?n[n.length-1].value=a:n.push({value:a}):(!y||E===a)&&n.push({value:E}),n}function jp(t,e,{horizontal:n,minRotation:r}){const i=_r(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*e*(""+t).length;return Math.min(e/s,o)}class h2 extends $i{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 ie(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(e){const l=tr(i),u=tr(s);l<0&&u<0?a(0):l>0&&u>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),e||o(i-l)}this.min=i,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,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},s=this._range||this,o=d2(i,s);return e.bounds==="ticks"&&fS(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,r=this.max;if(super.configure(),this.options.offset&&e.length){const i=(r-n)/Math.max(e.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return e0(e,this.chart.options.locale,this.options.ticks.format)}}class Cc extends h2{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Ct(e)?e:0,this.max=Ct(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=_r(this.options.ticks.minRotation),i=(e?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Y(Cc,"id","linear"),Y(Cc,"defaults",{ticks:{callback:t0.formatters.numeric}});const yl={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}},tt=Object.keys(yl);function Dp(t,e){return t-e}function Lp(t,e){if(ie(e))return null;const n=t._adapter,{parser:r,round:i,isoWeekday:s}=t._parseOpts;let o=e;return typeof r=="function"&&(o=r(o)),Ct(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Ua(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Fp(t,e,n,r){const i=tt.length;for(let s=tt.indexOf(t);s<i-1;++s){const o=yl[tt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(a*o.size))<=r)return tt[s]}return tt[i-1]}function f2(t,e,n,r,i){for(let s=tt.length-1;s>=tt.indexOf(n);s--){const o=tt[s];if(yl[o].common&&t._adapter.diff(i,r,o)>=e-1)return o}return tt[n?tt.indexOf(n):0]}function p2(t){for(let e=tt.indexOf(t)+1,n=tt.length;e<n;++e)if(yl[tt[e]].common)return tt[e]}function Ip(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:i}=zd(n,e),s=n[r]>=e?n[r]:n[i];t[s]=!0}}function m2(t,e,n,r){const i=t._adapter,s=+i.startOf(e[0].value,r),o=e[e.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(e[l].major=!0);return e}function Ap(t,e,n){const r=[],i={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:m2(t,r,i,n)}class Ka extends $i{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 r=e.time||(e.time={}),i=this._adapter=new Nk._date(e.adapters.date);i.init(n),Ss(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Lp(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Ct(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Ct(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=wS(i,s,o);return this._unit=n.unit||(r.autoSkip?Fp(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):f2(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:p2(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),Ap(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,i,s;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?r=s:r=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Dt(n,0,o),r=Dt(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||Fp(s.minUnit,n,r,this._getLabelCapacity(n)),a=q(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=Ua(l)||l===!0,c={};let d=n,h,f;if(u&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,u?"day":o),e.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const x=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<r;h=+e.add(h,a,o),f++)Ip(c,h,x);return(h===r||i.bounds==="ticks"||f===1)&&Ip(c,h,x),Object.keys(c).sort(Dp).map(v=>+v)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(e,o)}_tickFormatFunction(e,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return ue(o,[e,n,r],this);const a=s.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],d=u&&a[u],h=r[n],f=u&&d&&h&&h.major;return this._adapter.format(e,i||(f?d:c))}generateTickLabels(e){let n,r,i;for(n=0,r=e.length;n<r;++n)i=e[n],i.label=this._tickFormatFunction(i.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,i=_r(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(e,0,Ap(this,[e],this._majorUnit),i),o=this._getLabelSize(s),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,r;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)e=e.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)e.push(Lp(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return qy(e.sort(Dp))}}Y(Ka,"id","time"),Y(Ka,"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 Qo(t,e,n){let r=0,i=t.length-1,s,o,a,l;n?(e>=t[r].pos&&e<=t[i].pos&&({lo:r,hi:i}=xc(t,"pos",e)),{pos:s,time:a}=t[r],{pos:o,time:l}=t[i]):(e>=t[r].time&&e<=t[i].time&&({lo:r,hi:i}=xc(t,"time",e)),{time:s,pos:a}=t[r],{time:o,pos:l}=t[i]);const u=o-s;return u?a+(l-a)*(e-s)/u:a}class zp extends Ka{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=Qo(n,this.min),this._tableRange=Qo(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,i=[],s=[];let o,a,l,u,c;for(o=0,a=e.length;o<a;++o)u=e[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&s.push({time:u,pos:o/(a-1)});return s}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(Qo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return Qo(this._table,r*this._tableRange+this._minPos,!0)}}Y(zp,"id","timeseries"),Y(zp,"defaults",Ka.defaults);const M0="label";function Bp(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function g2(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function R0(t,e){t.labels=e}function T0(t,e,n=M0){const r=[];t.datasets=e.map(i=>{const s=t.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function y2(t,e=M0){const n={labels:[],datasets:[]};return R0(n,t.labels),T0(n,t.datasets,e),n}function v2(t,e){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...h}=t,f=S.useRef(null),x=S.useRef(null),v=()=>{f.current&&(x.current=new gl(f.current,{type:o,data:y2(a,s),options:l&&{...l},plugins:u}),Bp(e,x.current))},w=()=>{Bp(e,null),x.current&&(x.current.destroy(),x.current=null)};return S.useEffect(()=>{!i&&x.current&&l&&g2(x.current,l)},[i,l]),S.useEffect(()=>{!i&&x.current&&R0(x.current.config.data,a.labels)},[i,a.labels]),S.useEffect(()=>{!i&&x.current&&a.datasets&&T0(x.current.config.data,a.datasets,s)},[i,a.datasets]),S.useEffect(()=>{x.current&&(i?(w(),setTimeout(v)):x.current.update(d))},[i,l,a.labels,a.datasets,d]),S.useEffect(()=>{x.current&&(w(),setTimeout(v))},[o]),S.useEffect(()=>(v(),()=>w()),[]),g.jsx("canvas",{ref:f,role:"img",height:n,width:r,...h,children:c})}const x2=S.forwardRef(v2);function w2(t,e){return gl.register(e),S.forwardRef((n,r)=>g.jsx(x2,{...n,ref:r,type:t}))}const au=w2("bar",ca);gl.register(kc,Cc,fa,ZC,a2,GC);function de(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(2)}K`:t.toLocaleString()}function Yo(t){return`$${t.toFixed(2)}`}function $t({title:t,value:e,subtitle:n,color:r="blue"}){const i={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 g.jsxs("div",{className:`p-6 rounded-lg border ${i[r]||i.blue}`,children:[g.jsx("div",{className:"text-sm text-gray-400 mb-1",children:t}),g.jsx("div",{className:"text-3xl font-bold mb-1",children:e}),n&&g.jsx("div",{className:"text-xs text-gray-500",children:n})]})}function Ut({label:t,value:e,max:n,color:r="blue"}){const i=n>0?e/n*100:0,s={blue:"bg-blue-500",green:"bg-green-500",purple:"bg-purple-500",orange:"bg-orange-500",pink:"bg-pink-500",cyan:"bg-cyan-500",yellow:"bg-yellow-500",red:"bg-red-500"};return g.jsxs("div",{className:"mb-4",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[g.jsx("span",{className:"text-gray-300",children:t}),g.jsxs("span",{className:"text-gray-400",children:[de(e)," (",i.toFixed(1),"%)"]})]}),g.jsx("div",{className:"w-full bg-gray-800 rounded-full h-2",children:g.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${s[r]||s.blue}`,style:{width:`${Math.min(i,100)}%`}})})]})}function b2(){const[t,e]=S.useState("7"),{data:n,isLoading:r,error:i}=Cd({queryKey:["token-statistics",t],queryFn:async()=>{const l=await fetch(`/api/statistics/tokens?days=${t}`);if(!l.ok)throw new Error("Failed to fetch token statistics");return l.json()}}),s=()=>g.jsxs("div",{className:"p-6 rounded-lg border bg-gray-800/50 border-gray-700 animate-pulse",children:[g.jsx("div",{className:"h-4 bg-gray-700 rounded w-1/2 mb-3"}),g.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-2"}),g.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3"})]}),o=()=>g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700 animate-pulse",children:[g.jsx("div",{className:"h-6 bg-gray-700 rounded w-1/3 mb-6"}),g.jsx("div",{className:"h-64 bg-gray-700 rounded"})]}),a=()=>{if(i)return g.jsx("div",{className:"flex items-center justify-center h-96",children:g.jsxs("div",{className:"text-red-400",children:["Error loading statistics: ",i.message]})});if(!n)return g.jsx("div",{className:"flex items-center justify-center h-96",children:g.jsx("div",{className:"text-gray-400",children:"No data available"})});const{overview:l,daily:u,byProject:c,byModel:d,cache:h,cost:f,productivity:x,trends:v}=n,w=[...u.map(p=>p.usage.totalTokens)].sort((p,b)=>p-b),m=Math.floor(w.length*.95),y=Math.max(w[m]||1,1);return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"text-gray-400 mb-8",children:[fn(new Date(l.dateRange.start),"MMM d, yyyy")," - ",fn(new Date(l.dateRange.end),"MMM d, yyyy")]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[g.jsx($t,{title:"Total Tokens",value:de(l.total.totalTokens),subtitle:`${l.totalSessions} sessions`,color:"blue"}),g.jsx($t,{title:"Total Cost",value:Yo(f.totalCost),subtitle:"Estimated",color:"green"}),g.jsx($t,{title:"Cache Hit Rate",value:`${h.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${Yo(h.estimatedSavings)}`,color:"purple"}),g.jsx($t,{title:"Messages",value:de(l.totalMessages),subtitle:`${l.totalSessions} sessions`,color:"orange"})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Token Breakdown"}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Input Tokens"}),g.jsx(Ut,{label:"Regular Input",value:l.total.inputTokens,max:l.total.totalTokens,color:"blue"}),g.jsx(Ut,{label:"Cache Creation",value:l.total.cacheCreationTokens,max:l.total.totalTokens,color:"purple"}),g.jsx(Ut,{label:"Cache Read",value:l.total.cacheReadTokens,max:l.total.totalTokens,color:"cyan"})]}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Output & Cache Details"}),g.jsx(Ut,{label:"Output Tokens",value:l.total.outputTokens,max:l.total.totalTokens,color:"green"}),g.jsx(Ut,{label:"5-minute Cache",value:h.ephemeral5mTokens,max:h.totalCacheCreation,color:"yellow"}),g.jsx(Ut,{label:"1-hour Cache",value:h.ephemeral1hTokens,max:h.totalCacheCreation,color:"orange"})]})]})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cost Breakdown"}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[g.jsxs("div",{children:[g.jsx(Ut,{label:"Input Cost",value:f.inputCost,max:f.totalCost,color:"blue"}),g.jsx(Ut,{label:"Output Cost",value:f.outputCost,max:f.totalCost,color:"green"})]}),g.jsxs("div",{children:[g.jsx(Ut,{label:"Cache Creation Cost",value:f.cacheCreationCost,max:f.totalCost,color:"purple"}),g.jsx(Ut,{label:"Cache Read Cost",value:f.cacheReadCost,max:f.totalCost,color:"cyan"})]})]}),g.jsxs("div",{className:"mt-4 p-4 bg-green-500/10 border border-green-500/20 rounded",children:[g.jsx("div",{className:"text-sm text-gray-400",children:"Estimated savings from cache"}),g.jsx("div",{className:"text-2xl font-bold text-green-400",children:Yo(h.estimatedSavings)})]})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Daily Token Usage"}),u.length===0?g.jsx("div",{className:"h-64 flex items-center justify-center text-gray-500",children:g.jsxs("div",{className:"text-center",children:[g.jsx("p",{children:"No daily data available"}),g.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Total sessions: ",l.totalSessions]}),g.jsxs("p",{className:"text-sm text-gray-600",children:["Daily entries: ",u.length]})]})}):g.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:g.jsx(au,{data:{labels:u.map(p=>fn(new Date(p.date),"MMM d")),datasets:[{label:"Input",data:u.map(p=>p.usage.inputTokens),backgroundColor:"rgb(59, 130, 246)",borderColor:"rgb(59, 130, 246)",borderWidth:0},{label:"Cache Create",data:u.map(p=>p.usage.cacheCreationTokens),backgroundColor:"rgb(168, 85, 247)",borderColor:"rgb(168, 85, 247)",borderWidth:0},{label:"Cache Read",data:u.map(p=>p.usage.cacheReadTokens),backgroundColor:"rgb(6, 182, 212)",borderColor:"rgb(6, 182, 212)",borderWidth:0},{label:"Output",data:u.map(p=>p.usage.outputTokens),backgroundColor:"rgb(34, 197, 94)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:0,autoSkip:!0,maxTicksLimit:15}},y:{stacked:!0,max:y,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",callback:function(p){return typeof p=="number"?de(p):p}}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:p=>{if(p.length>0){const b=p[0].dataIndex;return fn(new Date(u[b].date),"MMM d, yyyy")}return""},label:p=>{const b=p.dataset.label||"",k=p.parsed.y!==null?de(p.parsed.y):"0";return`${b}: ${k}`},footer:p=>{if(p.length>0){const b=p[0].dataIndex,k=de(u[b].usage.totalTokens),C=u[b].sessionCount;return`Total: ${k}
69
- ${C} sessions`}return""}}}}},height:300})}),g.jsxs("div",{className:"flex gap-4 mt-4 text-xs justify-center",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),g.jsx("span",{children:"Input"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),g.jsx("span",{children:"Cache Create"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),g.jsx("span",{children:"Cache Read"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),g.jsx("span",{children:"Output"})]})]})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Project"}),g.jsx("div",{className:"space-y-4",children:c.slice(0,10).map((p,b)=>{const k=c.reduce((P,E)=>P+E.usage.totalTokens,0),C=p.usage.totalTokens/k*100;return g.jsxs("div",{className:"border-b border-gray-700 pb-4 last:border-b-0 last:pb-0",children:[g.jsxs("div",{className:"flex justify-between items-start mb-2",children:[g.jsxs("div",{className:"flex-1",children:[g.jsx("div",{className:"font-semibold text-gray-200",children:p.displayName}),g.jsxs("div",{className:"text-xs text-gray-500",children:[p.sessionCount," sessions"]})]}),g.jsxs("div",{className:"text-right",children:[g.jsx("div",{className:"font-mono text-sm",children:de(p.usage.totalTokens)}),g.jsxs("div",{className:"text-xs text-gray-500",children:[C.toFixed(1),"%"]})]})]}),g.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Input"}),g.jsx("div",{className:"text-blue-400 font-mono",children:de(p.usage.inputTokens)})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Cache Create"}),g.jsx("div",{className:"text-purple-400 font-mono",children:de(p.usage.cacheCreationTokens)})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Cache Read"}),g.jsx("div",{className:"text-cyan-400 font-mono",children:de(p.usage.cacheReadTokens)})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Output"}),g.jsx("div",{className:"text-green-400 font-mono",children:de(p.usage.outputTokens)})]})]})]},b)})})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Model"}),g.jsx("div",{className:"space-y-4",children:d.map((p,b)=>{const k=d.reduce((P,E)=>P+E.usage.totalTokens,0),C=p.usage.totalTokens/k*100;return g.jsxs("div",{className:"border-b border-gray-700 pb-4 last:border-b-0 last:pb-0",children:[g.jsxs("div",{className:"flex justify-between items-start mb-2",children:[g.jsxs("div",{className:"flex-1",children:[g.jsx("div",{className:"font-semibold text-gray-200",children:p.model}),g.jsxs("div",{className:"text-xs text-gray-500",children:[p.messageCount," messages"]})]}),g.jsxs("div",{className:"text-right",children:[g.jsx("div",{className:"font-mono text-sm",children:de(p.usage.totalTokens)}),g.jsxs("div",{className:"text-xs text-gray-500",children:[C.toFixed(1),"%"]})]})]}),g.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:g.jsx("div",{className:"h-2 rounded-full bg-gradient-to-r from-blue-500 to-green-500",style:{width:`${C}%`}})}),g.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs mt-2",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Input"}),g.jsx("div",{className:"text-blue-400 font-mono",children:de(p.usage.inputTokens)})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Cache Create"}),g.jsx("div",{className:"text-purple-400 font-mono",children:de(p.usage.cacheCreationTokens)})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Cache Read"}),g.jsx("div",{className:"text-cyan-400 font-mono",children:de(p.usage.cacheReadTokens)})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-gray-500",children:"Output"}),g.jsx("div",{className:"text-green-400 font-mono",children:de(p.usage.outputTokens)})]})]})]},b)})})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Productivity Metrics"}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[g.jsx($t,{title:"Total Tool Calls",value:de(x.totalToolCalls),subtitle:`Across ${l.totalSessions} sessions`,color:"blue"}),g.jsx($t,{title:"Agent Sessions",value:de(x.agentSessions),subtitle:`${x.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),g.jsx($t,{title:"Avg Tools per Session",value:(x.totalToolCalls/x.totalSessions).toFixed(1),subtitle:"Tool calls per session",color:"cyan"})]}),g.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Tool Usage & Success Rates"}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 auto-rows-fr",children:x.toolUsage.map((p,b)=>g.jsxs("div",{className:"@container bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[g.jsxs("div",{className:"flex justify-between items-start mb-2",children:[g.jsxs("div",{className:"flex-1",children:[g.jsx("div",{className:"font-semibold text-gray-200",children:p.toolName}),g.jsxs("div",{className:"text-xs text-gray-500",children:[g.jsxs("span",{className:"hidden @[300px]:inline",children:[p.successfulUses," successful / ",p.totalUses," total calls"]}),g.jsxs("span",{className:"@[300px]:hidden",children:[p.successfulUses," / ",p.totalUses," calls"]})]})]}),g.jsxs("div",{className:"text-right ml-2",children:[g.jsxs("div",{className:`font-mono text-sm ${p.successRate>=90?"text-green-400":p.successRate>=70?"text-yellow-400":"text-red-400"}`,children:[p.successRate.toFixed(1),"%"]}),g.jsx("div",{className:"text-xs text-gray-500",children:"success"})]})]}),g.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:g.jsx("div",{className:`h-2 rounded-full ${p.successRate>=90?"bg-green-500":p.successRate>=70?"bg-yellow-500":"bg-red-500"}`,style:{width:`${Math.min(p.successRate,100)}%`}})})]},b))})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cache Efficiency Analysis"}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[g.jsx($t,{title:"Total Cache Created",value:de(h.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),g.jsx($t,{title:"Total Cache Read",value:de(h.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),g.jsx($t,{title:"Cache Hit Rate",value:`${h.cacheHitRate.toFixed(2)}%`,subtitle:`${Yo(h.estimatedSavings)} saved`,color:"green"})]}),g.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[g.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[g.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"5-minute Cache"}),g.jsx("div",{className:"text-2xl font-bold mb-1",children:de(h.ephemeral5mTokens)}),g.jsxs("div",{className:"text-xs text-gray-500",children:[h.totalCacheCreation>0?(h.ephemeral5mTokens/h.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]}),g.jsxs("div",{className:"p-4 bg-orange-500/10 border border-orange-500/20 rounded",children:[g.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"1-hour Cache"}),g.jsx("div",{className:"text-2xl font-bold mb-1",children:de(h.ephemeral1hTokens)}),g.jsxs("div",{className:"text-xs text-gray-500",children:[h.totalCacheCreation>0?(h.ephemeral1hTokens/h.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]})]})]}),g.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[g.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Activity Trends"}),g.jsxs("div",{className:"mb-8",children:[g.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Hour of Day"}),g.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:g.jsx(au,{data:{labels:v.byHour.map(p=>`${p.hour.toString().padStart(2,"0")}:00`),datasets:[{label:"Messages",data:v.byHour.map(p=>p.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:p=>{const b=v.byHour[p.dataIndex];return[`Messages: ${b.messageCount}`,`Sessions: ${b.sessionCount}`,`Tokens: ${de(b.usage.totalTokens)}`]}}}}},height:250})})]}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Day of Week"}),g.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:g.jsx(au,{data:{labels:v.byWeekday.map(p=>p.weekdayName),datasets:[{label:"Messages",data:v.byWeekday.map(p=>p.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:p=>{const b=v.byWeekday[p.dataIndex];return[`Messages: ${b.messageCount}`,`Sessions: ${b.sessionCount}`,`Tokens: ${de(b.usage.totalTokens)}`]}}}}},height:250})})]})]})]})};return g.jsx("div",{className:"h-screen overflow-y-auto bg-gray-900 text-white p-8",children:g.jsxs("div",{className:"max-w-7xl mx-auto",children:[g.jsx("div",{className:"mb-8",children:g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsx("h1",{className:"text-4xl font-bold",children:"Dashboard"}),g.jsxs("div",{className:"flex gap-2",children:[g.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"}),g.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"}),g.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"})]})]})}),r?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[g.jsx(s,{}),g.jsx(s,{}),g.jsx(s,{}),g.jsx(s,{})]}),g.jsx(o,{}),g.jsx("div",{className:"mt-8",children:g.jsx(o,{})}),g.jsx("div",{className:"mt-8",children:g.jsx(o,{})})]}):a()]})})}const O0=new Ow,Wp="claude-session-viewer-sidebar-width",_2=320,S2=200,k2=600;function Hp(){const t=Rd(),e=_n(),r=Pb().sessionId||null,i=e.pathname==="/dashboard",[s,o]=S.useState(()=>{const T=localStorage.getItem(Wp);return T?parseInt(T,10):_2}),[a,l]=S.useState(!1),[u,c]=S.useState(0),[d,h]=S.useState(!1),f=S.useRef(null),x=S.useRef(null),v=S.useRef(0),{data:w,isLoading:m,error:y,refetch:p}=Cd({queryKey:["sessions"],queryFn:async()=>{const T=await fetch("/api/sessions");if(!T.ok)throw new Error("Failed to fetch sessions");return T.json()}}),b=T=>{t(`/sessions/${T}`)},k=r?w==null?void 0:w.projects.flatMap(T=>T.sessions).flatMap(T=>[T,...T.agentSessions||[]]).find(T=>T.id===r):null;S.useEffect(()=>{const T=x.current;if(!T)return;const A=()=>{const W=T.scrollTop,se=W<v.current;c(W),h(se),v.current=W};return T.addEventListener("scroll",A),()=>T.removeEventListener("scroll",A)},[]),S.useEffect(()=>{const T=W=>{if(!a)return;const se=W.clientX;se>=S2&&se<=k2&&(o(se),localStorage.setItem(Wp,se.toString()))},A=()=>{l(!1),document.body.style.cursor="",document.body.style.userSelect=""};return a&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",T),document.addEventListener("mouseup",A)),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",A)}},[a]),S.useEffect(()=>{const A=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;let W=null,se=!1,J=null,F=0,ve=!0;const j=()=>{W=new WebSocket(A),se=!1,W.onopen=()=>{if(se){W==null||W.close();return}F=0},W.onmessage=I=>{const R=JSON.parse(I.data);(R.type==="file-added"||R.type==="file-changed"||R.type==="file-deleted")&&(p(),r&&O0.invalidateQueries({queryKey:["session",r]}))},W.onerror=I=>{console.error("WebSocket error:",I)},W.onclose=()=>{if(!ve)return;const I=Math.min(1e3*2**F,1e4);F+=1,J=setTimeout(j,I)}};return j(),()=>{ve=!1,J&&clearTimeout(J),W&&W.readyState===WebSocket.CONNECTING?se=!0:W==null||W.close()}},[p,r]);const P=Math.max(0,1-(d?0:u)/80),E=12+P*12,N=1.125+P*.375,M=P;return g.jsxs("div",{className:"flex h-screen bg-gray-900 text-white",children:[g.jsxs("div",{className:"relative flex flex-col",style:{width:`${s}px`},children:[g.jsxs("div",{ref:f,className:"border-r border-gray-700 h-full flex flex-col",children:[g.jsxs("div",{className:"border-b border-gray-700 flex-shrink-0 transition-all duration-200",style:{padding:`${E}px`},children:[g.jsx("h1",{className:"font-bold transition-all duration-200",style:{fontSize:`${N}rem`},children:g.jsx("button",{onClick:()=>t("/dashboard"),className:"hover:text-blue-400 transition-colors",children:"Claude Sessions"})}),g.jsx("p",{className:"text-sm text-gray-400 mt-1 transition-opacity duration-200",style:{opacity:M,height:M>0?"auto":0,overflow:"hidden"},children:m?"Loading...":`${(w==null?void 0:w.projects.length)||0} project${(w==null?void 0:w.projects.length)!==1?"s":""}`})]}),g.jsx("div",{ref:x,className:"flex-1 overflow-y-auto",children:y?g.jsxs("div",{className:"p-4 text-red-400 text-sm",children:["Error loading sessions: ",y.message]}):g.jsx(R_,{projects:(w==null?void 0:w.projects)||[],selectedId:r,onSelect:b})})]}),g.jsx("div",{className:"absolute top-0 right-0 w-4 h-full cursor-col-resize group z-10",onMouseDown:T=>{T.preventDefault(),l(!0)},style:{touchAction:"none"},children:g.jsx("div",{className:`w-1 h-full ml-auto transition-colors ${a?"bg-blue-500":"bg-transparent group-hover:bg-blue-500"}`})})]}),g.jsx("div",{className:"flex-1 min-w-0",children:i?g.jsx(b2,{}):r?g.jsx(j_,{sessionId:r,sessionInfo:k}):g.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:g.jsxs("div",{className:"text-center",children:[g.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:g.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"})}),g.jsx("h3",{className:"mt-2 text-sm font-medium",children:"No session selected"}),g.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Select a session from the sidebar to view details"})]})})})]})}function C2(){return g.jsx(jw,{client:O0,children:g.jsx(f1,{children:g.jsxs($b,{children:[g.jsx(oa,{path:"/",element:g.jsx(Wb,{to:"/dashboard",replace:!0})}),g.jsx(oa,{path:"/dashboard",element:g.jsx(Hp,{})}),g.jsx(oa,{path:"/sessions/:sessionId",element:g.jsx(Hp,{})})]})})})}lu.createRoot(document.getElementById("root")).render(g.jsx(q0.StrictMode,{children:g.jsx(C2,{})}));
68
+ `):t}function e2(t,e){const{element:n,datasetIndex:r,index:i}=e,s=t.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:t,label:o,parsed:s.getParsed(i),raw:t.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Pp(t,e){const n=t.chart.ctx,{body:r,footer:i,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Be(e.bodyFont),u=Be(e.titleFont),c=Be(e.footerFont),d=s.length,h=i.length,f=r.length,v=Et(e.padding);let y=v.height,w=0,m=r.reduce((b,C)=>b+C.before.length+C.lines.length+C.after.length,0);if(m+=t.beforeBody.length+t.afterBody.length,d&&(y+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),m){const b=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=f*b+(m-f)*l.lineHeight+(m-1)*e.bodySpacing}h&&(y+=e.footerMarginTop+h*c.lineHeight+(h-1)*e.footerSpacing);let g=0;const x=function(b){w=Math.max(w,n.measureText(b).width+g)};return n.save(),n.font=u.string,ee(t.title,x),n.font=l.string,ee(t.beforeBody.concat(t.afterBody),x),g=e.displayColors?o+2+e.boxPadding:0,ee(r,b=>{ee(b.before,x),ee(b.lines,x),ee(b.after,x)}),g=0,n.font=c.string,ee(t.footer,x),n.restore(),w+=v.width,{width:w,height:y}}function t2(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function n2(t,e,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(t==="left"&&i+s+o>e.width||t==="right"&&i-s-o<0)return!0}function r2(t,e,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=t;let u="center";return r==="center"?u=i<=(a+l)/2?"left":"right":i<=s/2?u="left":i>=o-s/2&&(u="right"),n2(u,t,e,n)&&(u="center"),u}function Mp(t,e,n){const r=n.yAlign||e.yAlign||t2(t,n);return{xAlign:n.xAlign||e.xAlign||r2(t,e,n,r),yAlign:r}}function i2(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function s2(t,e,n){let{y:r,height:i}=t;return e==="top"?r+=n:e==="bottom"?r-=i+n:r-=i/2,r}function Tp(t,e,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,u=i+s,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=fi(o);let v=i2(e,a);const y=s2(e,l,u);return l==="center"?a==="left"?v+=u:a==="right"&&(v-=u):a==="left"?v-=Math.max(c,h)+i:a==="right"&&(v+=Math.max(d,f)+i),{x:Dt(v,0,r.width-e.width),y:Dt(y,0,r.height-e.height)}}function Vo(t,e,n){const r=Et(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function Rp(t){return Vt([],sn(t))}function o2(t,e,n){return Hi(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Np(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const P0={beforeTitle:tn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:tn,beforeBody:tn,beforeLabel:tn,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 se(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:tn,afterBody:tn,beforeFooter:tn,footer:tn,afterFooter:tn};function Ge(t,e,n,r){const i=t[e].call(n,r);return typeof i>"u"?P0[e].call(n,r):i}class Sc extends sr{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,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new h0(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=o2(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,i=Ge(r,"beforeTitle",this,e),s=Ge(r,"title",this,e),o=Ge(r,"afterTitle",this,e);let a=[];return a=Vt(a,sn(i)),a=Vt(a,sn(s)),a=Vt(a,sn(o)),a}getBeforeBody(e,n){return Rp(Ge(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,i=[];return ee(e,s=>{const o={before:[],lines:[],after:[]},a=Np(r,s);Vt(o.before,sn(Ge(a,"beforeLabel",this,s))),Vt(o.lines,Ge(a,"label",this,s)),Vt(o.after,sn(Ge(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(e,n){return Rp(Ge(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,i=Ge(r,"beforeFooter",this,e),s=Ge(r,"footer",this,e),o=Ge(r,"afterFooter",this,e);let a=[];return a=Vt(a,sn(i)),a=Vt(a,sn(s)),a=Vt(a,sn(o)),a}_createItems(e){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(e2(this.chart,n[l]));return e.filter&&(a=a.filter((c,d,h)=>e.filter(c,d,h,r))),e.itemSort&&(a=a.sort((c,d)=>e.itemSort(c,d,r))),ee(a,c=>{const d=Np(e.callbacks,c);i.push(Ge(d,"labelColor",this,c)),s.push(Ge(d,"labelPointStyle",this,c)),o.push(Ge(d,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=fs[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Pp(this,r),u=Object.assign({},a,l),c=Mp(this.chart,r,u),d=Tp(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,i){const s=this.getCaretPosition(e,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=fi(a),{x:h,y:f}=e,{width:v,height:y}=n;let w,m,g,x,b,C;return s==="center"?(b=f+y/2,i==="left"?(w=h,m=w-o,x=b+o,C=b-o):(w=h+v,m=w+o,x=b-o,C=b+o),g=w):(i==="left"?m=h+Math.max(l,c)+o:i==="right"?m=h+v-Math.max(u,d)-o:m=this.caretX,s==="top"?(x=f,b=x-o,w=m-o,g=m+o):(x=f+y,b=x+o,w=m+o,g=m-o),C=x),{x1:w,x2:m,x3:g,y1:x,y2:b,y3:C}}drawTitle(e,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const u=pi(r.rtl,this.x,this.width);for(e.x=Vo(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",o=Be(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,l+1===s&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=s,c=Be(s.bodyFont),d=Vo(this,"left",s),h=i.x(d),f=l<c.lineHeight?(c.lineHeight-l)/2:0,v=n.y+f;if(s.usePointStyle){const y={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=i.leftForLtr(h,u)+u/2,m=v+l/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Qf(e,y,w,m),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Qf(e,y,w,m)}else{e.lineWidth=X(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 y=i.leftForLtr(h,u),w=i.leftForLtr(i.xPlus(h,1),u-2),m=fi(o.borderRadius);Object.values(m).some(g=>g!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Va(e,{x:y,y:v,w:u,h:l,radius:m}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Va(e,{x:w,y:v+1,w:u-2,h:l-2,radius:m}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(y,v,u,l),e.strokeRect(y,v,u,l),e.fillStyle=o.backgroundColor,e.fillRect(w,v+1,u-2,l-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:c}=r,d=Be(r.bodyFont);let h=d.lineHeight,f=0;const v=pi(r.rtl,this.x,this.width),y=function(E){n.fillText(E,v.x(e.x+f),e.y+h/2),e.y+=h+s},w=v.textAlign(o);let m,g,x,b,C,P,_;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,e.x=Vo(this,w,r),n.fillStyle=r.bodyColor,ee(this.beforeBody,y),f=a&&w!=="right"?o==="center"?u/2+c:u+2+c:0,b=0,P=i.length;b<P;++b){for(m=i[b],g=this.labelTextColors[b],n.fillStyle=g,ee(m.before,y),x=m.lines,a&&x.length&&(this._drawColorBox(n,e,b,v,r),h=Math.max(d.lineHeight,l)),C=0,_=x.length;C<_;++C)y(x[C]),h=d.lineHeight;ee(m.after,y)}f=0,h=d.lineHeight,ee(this.afterBody,y),e.y-=s}drawFooter(e,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=pi(r.rtl,this.x,this.width);for(e.x=Vo(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Be(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r.footerSpacing}}drawBackground(e,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=e,{width:u,height:c}=r,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:v}=fi(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(e,n,r,i),n.lineTo(a+u-h,l),n.quadraticCurveTo(a+u,l,a+u,l+h),o==="center"&&s==="right"&&this.drawCaret(e,n,r,i),n.lineTo(a+u,l+c-v),n.quadraticCurveTo(a+u,l+c,a+u-v,l+c),o==="bottom"&&this.drawCaret(e,n,r,i),n.lineTo(a+f,l+c),n.quadraticCurveTo(a,l+c,a,l+c-f),o==="center"&&s==="left"&&this.drawCaret(e,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=fs[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Pp(this,e),l=Object.assign({},o,this._size),u=Mp(n,e,l),c=Tp(e,l,u,n);(i._to!==c.x||s._to!==c.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,c))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Et(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=r,this.drawBackground(s,e,i,n),c0(e,n.textDirection),s.y+=o.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),d0(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,i=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}}),s=!Wa(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(e,s,n,r),a=this._positionChanged(o,e),l=n||!Wa(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,r,i){const s=this.options;if(e.type==="mouseout")return[];if(!i)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,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:r,caretY:i,options:s}=this,o=fs[s.position].call(this,e,n);return o!==!1&&(r!==o.x||i!==o.y)}}Y(Sc,"positioners",fs);var a2={id:"tooltip",_element:Sc,positioners:fs,afterInit(t,e,n){n&&(t.tooltip=new Sc({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:P0},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 l2=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function u2(t,e,n,r){const i=t.indexOf(e);if(i===-1)return l2(t,e,n,r);const s=t.lastIndexOf(e);return i!==s?n:i}const c2=(t,e)=>t===null?null:Dt(Math.round(t),0,e);function Op(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class kc extends $i{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(se(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:u2(r,e,q(n,e),this._addedLabels),c2(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=e;o<=n;o++)i.push({value:o});return i}getLabelForValue(e){return Op.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}}Y(kc,"id","category"),Y(kc,"defaults",{ticks:{callback:Op}});function d2(t,e){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:h}=t,f=s||1,v=c-1,{min:y,max:w}=e,m=!se(o),g=!se(a),x=!se(u),b=(w-y)/(d+1);let C=If((w-y)/v/f)*f,P,_,E,O;if(C<1e-14&&!m&&!g)return[{value:y},{value:w}];O=Math.ceil(w/C)-Math.floor(y/C),O>v&&(C=If(O*C/v/f)*f),se(l)||(P=Math.pow(10,l),C=Math.ceil(C*P)/P),i==="ticks"?(_=Math.floor(y/C)*C,E=Math.ceil(w/C)*C):(_=y,E=w),m&&g&&s&&hS((a-o)/s,C/1e3)?(O=Math.round(Math.min((a-o)/C,c)),C=(a-o)/O,_=o,E=a):x?(_=m?o:_,E=g?a:E,O=u-1,C=(E-_)/O):(O=(E-_)/C,ua(O,Math.round(O),C/1e3)?O=Math.round(O):O=Math.ceil(O));const M=Math.max(Af(C),Af(_));P=Math.pow(10,se(l)?M:l),_=Math.round(_*P)/P,E=Math.round(E*P)/P;let T=0;for(m&&(h&&_!==o?(n.push({value:o}),_<o&&T++,ua(Math.round((_+T*C)*P)/P,o,jp(o,b,t))&&T++):_<o&&T++);T<O;++T){const I=Math.round((_+T*C)*P)/P;if(g&&I>a)break;n.push({value:I})}return g&&h&&E!==a?n.length&&ua(n[n.length-1].value,a,jp(a,b,t))?n[n.length-1].value=a:n.push({value:a}):(!g||E===a)&&n.push({value:E}),n}function jp(t,e,{horizontal:n,minRotation:r}){const i=_r(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*e*(""+t).length;return Math.min(e/s,o)}class h2 extends $i{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 se(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(e){const l=tr(i),u=tr(s);l<0&&u<0?a(0):l>0&&u>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),e||o(i-l)}this.min=i,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,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},s=this._range||this,o=d2(i,s);return e.bounds==="ticks"&&fS(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,r=this.max;if(super.configure(),this.options.offset&&e.length){const i=(r-n)/Math.max(e.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return e0(e,this.chart.options.locale,this.options.ticks.format)}}class Cc extends h2{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Ct(e)?e:0,this.max=Ct(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=_r(this.options.ticks.minRotation),i=(e?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Y(Cc,"id","linear"),Y(Cc,"defaults",{ticks:{callback:t0.formatters.numeric}});const yl={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}},tt=Object.keys(yl);function Dp(t,e){return t-e}function Lp(t,e){if(se(e))return null;const n=t._adapter,{parser:r,round:i,isoWeekday:s}=t._parseOpts;let o=e;return typeof r=="function"&&(o=r(o)),Ct(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(Ua(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function Fp(t,e,n,r){const i=tt.length;for(let s=tt.indexOf(t);s<i-1;++s){const o=yl[tt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(a*o.size))<=r)return tt[s]}return tt[i-1]}function f2(t,e,n,r,i){for(let s=tt.length-1;s>=tt.indexOf(n);s--){const o=tt[s];if(yl[o].common&&t._adapter.diff(i,r,o)>=e-1)return o}return tt[n?tt.indexOf(n):0]}function p2(t){for(let e=tt.indexOf(t)+1,n=tt.length;e<n;++e)if(yl[tt[e]].common)return tt[e]}function Ip(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:i}=zd(n,e),s=n[r]>=e?n[r]:n[i];t[s]=!0}}function m2(t,e,n,r){const i=t._adapter,s=+i.startOf(e[0].value,r),o=e[e.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(e[l].major=!0);return e}function Ap(t,e,n){const r=[],i={},s=e.length;let o,a;for(o=0;o<s;++o)a=e[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:m2(t,r,i,n)}class Ka extends $i{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 r=e.time||(e.time={}),i=this._adapter=new Ok._date(e.adapters.date);i.init(n),Ss(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Lp(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!a&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Ct(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Ct(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=wS(i,s,o);return this._unit=n.unit||(r.autoSkip?Fp(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):f2(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:p2(this._unit),this.initOffsets(i),e.reverse&&a.reverse(),Ap(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,i,s;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?r=s:r=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Dt(n,0,o),r=Dt(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||Fp(s.minUnit,n,r,this._getLabelCapacity(n)),a=q(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,u=Ua(l)||l===!0,c={};let d=n,h,f;if(u&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,u?"day":o),e.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<r;h=+e.add(h,a,o),f++)Ip(c,h,v);return(h===r||i.bounds==="ticks"||f===1)&&Ip(c,h,v),Object.keys(c).sort(Dp).map(y=>+y)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(e,o)}_tickFormatFunction(e,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return ce(o,[e,n,r],this);const a=s.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],d=u&&a[u],h=r[n],f=u&&d&&h&&h.major;return this._adapter.format(e,i||(f?d:c))}generateTickLabels(e){let n,r,i;for(n=0,r=e.length;n<r;++n)i=e[n],i.label=this._tickFormatFunction(i.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,i=_r(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(e,0,Ap(this,[e],this._majorUnit),i),o=this._getLabelSize(s),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,r;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)e=e.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)e.push(Lp(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return qy(e.sort(Dp))}}Y(Ka,"id","time"),Y(Ka,"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 Qo(t,e,n){let r=0,i=t.length-1,s,o,a,l;n?(e>=t[r].pos&&e<=t[i].pos&&({lo:r,hi:i}=xc(t,"pos",e)),{pos:s,time:a}=t[r],{pos:o,time:l}=t[i]):(e>=t[r].time&&e<=t[i].time&&({lo:r,hi:i}=xc(t,"time",e)),{time:s,pos:a}=t[r],{time:o,pos:l}=t[i]);const u=o-s;return u?a+(l-a)*(e-s)/u:a}class zp extends Ka{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=Qo(n,this.min),this._tableRange=Qo(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,i=[],s=[];let o,a,l,u,c;for(o=0,a=e.length;o<a;++o)u=e[o],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],l=i[o-1],u=i[o],Math.round((c+l)/2)!==u&&s.push({time:u,pos:o/(a-1)});return s}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(Qo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return Qo(this._table,r*this._tableRange+this._minPos,!0)}}Y(zp,"id","timeseries"),Y(zp,"defaults",Ka.defaults);const M0="label";function Bp(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function g2(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function T0(t,e){t.labels=e}function R0(t,e,n=M0){const r=[];t.datasets=e.map(i=>{const s=t.datasets.find(o=>o[n]===i[n]);return!s||!i.data||r.includes(s)?{...i}:(r.push(s),Object.assign(s,i),s)})}function y2(t,e=M0){const n={labels:[],datasets:[]};return T0(n,t.labels),R0(n,t.datasets,e),n}function v2(t,e){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:s,type:o,data:a,options:l,plugins:u=[],fallbackContent:c,updateMode:d,...h}=t,f=k.useRef(null),v=k.useRef(null),y=()=>{f.current&&(v.current=new gl(f.current,{type:o,data:y2(a,s),options:l&&{...l},plugins:u}),Bp(e,v.current))},w=()=>{Bp(e,null),v.current&&(v.current.destroy(),v.current=null)};return k.useEffect(()=>{!i&&v.current&&l&&g2(v.current,l)},[i,l]),k.useEffect(()=>{!i&&v.current&&T0(v.current.config.data,a.labels)},[i,a.labels]),k.useEffect(()=>{!i&&v.current&&a.datasets&&R0(v.current.config.data,a.datasets,s)},[i,a.datasets]),k.useEffect(()=>{v.current&&(i?(w(),setTimeout(y)):v.current.update(d))},[i,l,a.labels,a.datasets,d]),k.useEffect(()=>{v.current&&(w(),setTimeout(y))},[o]),k.useEffect(()=>(y(),()=>w()),[]),p.jsx("canvas",{ref:f,role:"img",height:n,width:r,...h,children:c})}const x2=k.forwardRef(v2);function w2(t,e){return gl.register(e),k.forwardRef((n,r)=>p.jsx(x2,{...n,ref:r,type:t}))}const au=w2("bar",ca);gl.register(kc,Cc,fa,ZC,a2,GC);function ie(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(2)}K`:t.toLocaleString()}function Yo(t){return`$${t.toFixed(2)}`}function $t({title:t,value:e,subtitle:n,color:r="blue"}){const i={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 p.jsxs("div",{className:`p-6 rounded-lg border ${i[r]||i.blue}`,children:[p.jsx("div",{className:"text-sm text-gray-400 mb-1",children:t}),p.jsx("div",{className:"text-3xl font-bold mb-1",children:e}),n&&p.jsx("div",{className:"text-xs text-gray-500",children:n})]})}function Ut({label:t,value:e,max:n,color:r="blue"}){const i=n>0?e/n*100:0,s={blue:"bg-blue-500",green:"bg-green-500",purple:"bg-purple-500",orange:"bg-orange-500",pink:"bg-pink-500",cyan:"bg-cyan-500",yellow:"bg-yellow-500",red:"bg-red-500"};return p.jsxs("div",{className:"mb-4",children:[p.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[p.jsx("span",{className:"text-gray-300",children:t}),p.jsxs("span",{className:"text-gray-400",children:[ie(e)," (",i.toFixed(1),"%)"]})]}),p.jsx("div",{className:"w-full bg-gray-800 rounded-full h-2",children:p.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${s[r]||s.blue}`,style:{width:`${Math.min(i,100)}%`}})})]})}function b2(){const[t,e]=k.useState("7"),{data:n,isLoading:r,error:i}=Cd({queryKey:["token-statistics",t],queryFn:async()=>{const l=await fetch(`/api/statistics/tokens?days=${t}`);if(!l.ok)throw new Error("Failed to fetch token statistics");return l.json()}}),s=()=>p.jsxs("div",{className:"p-6 rounded-lg border bg-gray-800/50 border-gray-700 animate-pulse",children:[p.jsx("div",{className:"h-4 bg-gray-700 rounded w-1/2 mb-3"}),p.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-2"}),p.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3"})]}),o=()=>p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700 animate-pulse",children:[p.jsx("div",{className:"h-6 bg-gray-700 rounded w-1/3 mb-6"}),p.jsx("div",{className:"h-64 bg-gray-700 rounded"})]}),a=()=>{if(i)return p.jsx("div",{className:"flex items-center justify-center h-96",children:p.jsxs("div",{className:"text-red-400",children:["Error loading statistics: ",i.message]})});if(!n)return p.jsx("div",{className:"flex items-center justify-center h-96",children:p.jsx("div",{className:"text-gray-400",children:"No data available"})});const{overview:l,daily:u,byProject:c,byModel:d,cache:h,cost:f,productivity:v,trends:y}=n,w=[...u.map(_=>_.usage.totalTokens)].sort((_,E)=>_-E),m=Math.floor(w.length*.95),g=Math.max(w[m]||1,1),x=u.map(_=>_.usage.totalTokens),b=x.length>0?Math.min(...x):0,C=x.length>0?Math.max(...x):0,P=x.length>0?x.reduce((_,E)=>_+E,0)/x.length:0;return p.jsxs(p.Fragment,{children:[p.jsxs("p",{className:"text-gray-400 mb-6",children:[fn(new Date(l.dateRange.start),"MMM d, yyyy")," - ",fn(new Date(l.dateRange.end),"MMM d, yyyy")]}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[p.jsx($t,{title:"Total Tokens",value:ie(l.total.totalTokens),subtitle:`${l.totalSessions} sessions`,color:"blue"}),p.jsx($t,{title:"Total Cost",value:Yo(f.totalCost),subtitle:"Estimated",color:"green"}),p.jsx($t,{title:"Cache Hit Rate",value:`${h.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${Yo(h.estimatedSavings)}`,color:"purple"}),p.jsx($t,{title:"Messages",value:ie(l.totalMessages),subtitle:`${l.totalSessions} sessions`,color:"orange"})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Token Breakdown"}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsxs("div",{children:[p.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Input & Output Tokens"}),p.jsx(Ut,{label:"Regular Input",value:l.total.inputTokens,max:l.total.totalTokens,color:"blue"}),p.jsx(Ut,{label:"Output Tokens",value:l.total.outputTokens,max:l.total.totalTokens,color:"green"})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Cache Details"}),p.jsx(Ut,{label:"Cache Creation",value:l.total.cacheCreationTokens,max:l.total.totalTokens,color:"purple"}),p.jsx(Ut,{label:"Cache Read",value:l.total.cacheReadTokens,max:l.total.totalTokens,color:"cyan"}),p.jsx(Ut,{label:"5-minute Cache",value:h.ephemeral5mTokens,max:h.totalCacheCreation,color:"yellow"}),p.jsx(Ut,{label:"1-hour Cache",value:h.ephemeral1hTokens,max:h.totalCacheCreation,color:"orange"})]})]})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cost Breakdown"}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsxs("div",{children:[p.jsx(Ut,{label:"Input Cost",value:f.inputCost,max:f.totalCost,color:"blue"}),p.jsx(Ut,{label:"Output Cost",value:f.outputCost,max:f.totalCost,color:"green"})]}),p.jsxs("div",{children:[p.jsx(Ut,{label:"Cache Creation Cost",value:f.cacheCreationCost,max:f.totalCost,color:"purple"}),p.jsx(Ut,{label:"Cache Read Cost",value:f.cacheReadCost,max:f.totalCost,color:"cyan"})]})]}),p.jsxs("div",{className:"mt-4 p-4 bg-green-500/10 border border-green-500/20 rounded",children:[p.jsx("div",{className:"text-sm text-gray-400",children:"Estimated savings from cache"}),p.jsx("div",{className:"text-2xl font-bold text-green-400",children:Yo(h.estimatedSavings)})]})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Daily Token Usage"}),u.length===0?p.jsx("div",{className:"h-64 flex items-center justify-center text-gray-500",children:p.jsxs("div",{className:"text-center",children:[p.jsx("p",{children:"No daily data available"}),p.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Total sessions: ",l.totalSessions]}),p.jsxs("p",{className:"text-sm text-gray-600",children:["Daily entries: ",u.length]})]})}):p.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:p.jsx(au,{data:{labels:u.map(_=>fn(new Date(_.date),"MMM d")),datasets:[{label:"Input",data:u.map(_=>_.usage.inputTokens),backgroundColor:"rgb(59, 130, 246)",borderColor:"rgb(59, 130, 246)",borderWidth:0},{label:"Cache Create",data:u.map(_=>_.usage.cacheCreationTokens),backgroundColor:"rgb(168, 85, 247)",borderColor:"rgb(168, 85, 247)",borderWidth:0},{label:"Cache Read",data:u.map(_=>_.usage.cacheReadTokens),backgroundColor:"rgb(6, 182, 212)",borderColor:"rgb(6, 182, 212)",borderWidth:0},{label:"Output",data:u.map(_=>_.usage.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:g,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",callback:function(_){return typeof _=="number"?ie(_):_}}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:_=>{if(_.length>0){const E=_[0].dataIndex;return fn(new Date(u[E].date),"MMM d, yyyy")}return""},label:_=>{const E=_.dataset.label||"",O=_.parsed.y!==null?ie(_.parsed.y):"0";return`${E}: ${O}`},footer:_=>{if(_.length>0){const E=_[0].dataIndex,O=ie(u[E].usage.totalTokens),M=u[E].sessionCount;return`Total: ${O}
69
+ ${M} sessions`}return""}}}}},height:300})}),p.jsxs("div",{className:"flex gap-4 mt-4 text-xs justify-center",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),p.jsx("span",{children:"Input"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),p.jsx("span",{children:"Cache Create"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),p.jsx("span",{children:"Cache Read"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),p.jsx("span",{children:"Output"})]})]}),u.length>0&&p.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6 pt-6 border-t border-gray-700",children:[p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Min Daily"}),p.jsx("div",{className:"font-mono text-sm text-gray-300",children:ie(b)})]}),p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Avg Daily"}),p.jsx("div",{className:"font-mono text-sm text-blue-400",children:ie(P)})]}),p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Max Daily"}),p.jsx("div",{className:"font-mono text-sm text-green-400",children:ie(C)})]})]})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Project"}),p.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:c.slice(0,10).map((_,E)=>{const O=c.reduce((T,I)=>T+I.usage.totalTokens,0),M=_.usage.totalTokens/O*100;return p.jsxs("div",{className:"bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[p.jsxs("div",{className:"flex justify-between items-baseline mb-2",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:"font-semibold text-gray-200",children:_.displayName}),p.jsxs("div",{className:"text-xs text-gray-500",children:[_.sessionCount," sessions"]})]}),p.jsxs("div",{className:"text-right flex-shrink-0 ml-4",children:[p.jsx("div",{className:"font-mono text-sm",children:ie(_.usage.totalTokens)}),p.jsxs("div",{className:"text-xs text-gray-500",children:[M.toFixed(1),"%"]})]})]}),p.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs",children:[p.jsxs("div",{className:"text-left",children:[p.jsx("div",{className:"text-gray-500",children:"Input"}),p.jsx("div",{className:"text-blue-400 font-mono",children:ie(_.usage.inputTokens)})]}),p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-gray-500",children:"Cache Create"}),p.jsx("div",{className:"text-purple-400 font-mono",children:ie(_.usage.cacheCreationTokens)})]}),p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-gray-500",children:"Cache Read"}),p.jsx("div",{className:"text-cyan-400 font-mono",children:ie(_.usage.cacheReadTokens)})]}),p.jsxs("div",{className:"text-right",children:[p.jsx("div",{className:"text-gray-500",children:"Output"}),p.jsx("div",{className:"text-green-400 font-mono",children:ie(_.usage.outputTokens)})]})]})]},E)})})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Model"}),p.jsx("div",{className:"space-y-4",children:d.map((_,E)=>{const O=d.reduce((T,I)=>T+I.usage.totalTokens,0),M=_.usage.totalTokens/O*100;return p.jsxs("div",{className:"border-b border-gray-700 pb-4 last:border-b-0 last:pb-0",children:[p.jsxs("div",{className:"flex justify-between items-start mb-2",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:"font-semibold text-gray-200",children:_.model}),p.jsxs("div",{className:"text-xs text-gray-500",children:[_.messageCount," messages"]})]}),p.jsxs("div",{className:"text-right",children:[p.jsx("div",{className:"font-mono text-sm",children:ie(_.usage.totalTokens)}),p.jsxs("div",{className:"text-xs text-gray-500",children:[M.toFixed(1),"%"]})]})]}),p.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:p.jsx("div",{className:"h-2 rounded-full bg-gradient-to-r from-blue-500 to-green-500",style:{width:`${M}%`}})}),p.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs mt-2",children:[p.jsxs("div",{className:"text-left",children:[p.jsx("div",{className:"text-gray-500",children:"Input"}),p.jsx("div",{className:"text-blue-400 font-mono",children:ie(_.usage.inputTokens)})]}),p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-gray-500",children:"Cache Create"}),p.jsx("div",{className:"text-purple-400 font-mono",children:ie(_.usage.cacheCreationTokens)})]}),p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-gray-500",children:"Cache Read"}),p.jsx("div",{className:"text-cyan-400 font-mono",children:ie(_.usage.cacheReadTokens)})]}),p.jsxs("div",{className:"text-right",children:[p.jsx("div",{className:"text-gray-500",children:"Output"}),p.jsx("div",{className:"text-green-400 font-mono",children:ie(_.usage.outputTokens)})]})]})]},E)})})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Productivity Metrics"}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[p.jsx($t,{title:"Total Tool Calls",value:ie(v.totalToolCalls),subtitle:`Across ${l.totalSessions} sessions`,color:"blue"}),p.jsx($t,{title:"Agent Sessions",value:ie(v.agentSessions),subtitle:`${v.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),p.jsx($t,{title:"Avg Tools per Session",value:(v.totalToolCalls/v.totalSessions).toFixed(1),subtitle:"Tool calls per session",color:"cyan"})]}),p.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Tool Usage & Success Rates"}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 auto-rows-fr",children:v.toolUsage.map((_,E)=>p.jsxs("div",{className:"@container bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[p.jsxs("div",{className:"flex justify-between items-start mb-2",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("div",{className:"font-semibold text-gray-200",children:_.toolName}),p.jsxs("div",{className:"text-xs text-gray-500",children:[p.jsxs("span",{className:"hidden @[300px]:inline",children:[_.successfulUses," successful / ",_.totalUses," total calls"]}),p.jsxs("span",{className:"@[300px]:hidden",children:[_.successfulUses," / ",_.totalUses," calls"]})]})]}),p.jsxs("div",{className:"text-right ml-2",children:[p.jsxs("div",{className:`font-mono text-sm ${_.successRate>=90?"text-green-400":_.successRate>=70?"text-yellow-400":"text-red-400"}`,children:[_.successRate.toFixed(1),"%"]}),p.jsx("div",{className:"text-xs text-gray-500",children:"success"})]})]}),p.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:p.jsx("div",{className:`h-2 rounded-full ${_.successRate>=90?"bg-green-500":_.successRate>=70?"bg-yellow-500":"bg-red-500"}`,style:{width:`${Math.min(_.successRate,100)}%`}})})]},E))})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cache Efficiency Analysis"}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[p.jsx($t,{title:"Total Cache Created",value:ie(h.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),p.jsx($t,{title:"Total Cache Read",value:ie(h.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),p.jsx($t,{title:"Cache Hit Rate",value:`${h.cacheHitRate.toFixed(2)}%`,subtitle:`${Yo(h.estimatedSavings)} saved`,color:"green"})]}),p.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[p.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[p.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"5-minute Cache"}),p.jsx("div",{className:"text-2xl font-bold mb-1",children:ie(h.ephemeral5mTokens)}),p.jsxs("div",{className:"text-xs text-gray-500",children:[h.totalCacheCreation>0?(h.ephemeral5mTokens/h.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]}),p.jsxs("div",{className:"p-4 bg-orange-500/10 border border-orange-500/20 rounded",children:[p.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"1-hour Cache"}),p.jsx("div",{className:"text-2xl font-bold mb-1",children:ie(h.ephemeral1hTokens)}),p.jsxs("div",{className:"text-xs text-gray-500",children:[h.totalCacheCreation>0?(h.ephemeral1hTokens/h.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]})]})]}),p.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[p.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Activity Trends"}),p.jsxs("div",{className:"mb-8",children:[p.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Hour of Day"}),p.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:p.jsx(au,{data:{labels:y.byHour.map(_=>`${_.hour.toString().padStart(2,"0")}:00`),datasets:[{label:"Messages",data:y.byHour.map(_=>_.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:_=>{const E=y.byHour[_.dataIndex];return[`Messages: ${E.messageCount}`,`Sessions: ${E.sessionCount}`,`Tokens: ${ie(E.usage.totalTokens)}`]}}}}},height:250})})]}),p.jsxs("div",{children:[p.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Day of Week"}),p.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:p.jsx(au,{data:{labels:y.byWeekday.map(_=>_.weekdayName),datasets:[{label:"Messages",data:y.byWeekday.map(_=>_.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:_=>{const E=y.byWeekday[_.dataIndex];return[`Messages: ${E.messageCount}`,`Sessions: ${E.sessionCount}`,`Tokens: ${ie(E.usage.totalTokens)}`]}}}}},height:250})})]})]})]})};return p.jsx("div",{className:"h-screen overflow-y-auto bg-gray-900 text-white p-8",children:p.jsxs("div",{className:"max-w-7xl mx-auto",children:[p.jsx("div",{className:"mb-2",children:p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsx("h1",{className:"text-4xl font-bold",children:"Dashboard"}),p.jsxs("div",{className:"flex gap-2",children:[p.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"}),p.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"}),p.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"})]})]})}),r?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"h-5 bg-gray-700 rounded w-64 mb-8 animate-pulse"}),p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[p.jsx(s,{}),p.jsx(s,{}),p.jsx(s,{}),p.jsx(s,{})]}),p.jsx(o,{}),p.jsx("div",{className:"mt-8",children:p.jsx(o,{})}),p.jsx("div",{className:"mt-8",children:p.jsx(o,{})})]}):a()]})})}const N0=new Nw,Wp="claude-session-viewer-sidebar-width",_2=320,S2=200,k2=600;function Hp(){const t=Td(),e=_n(),r=Pb().sessionId||null,i=e.pathname==="/dashboard",[s,o]=k.useState(()=>{const T=localStorage.getItem(Wp);return T?parseInt(T,10):_2}),[a,l]=k.useState(!1),[u,c]=k.useState(0),[d,h]=k.useState(!1),f=k.useRef(null),v=k.useRef(null),y=k.useRef(0),{data:w,isLoading:m,error:g,refetch:x}=Cd({queryKey:["sessions"],queryFn:async()=>{const T=await fetch("/api/sessions");if(!T.ok)throw new Error("Failed to fetch sessions");return T.json()}}),b=T=>{t(`/sessions/${T}`)},C=r?w==null?void 0:w.projects.flatMap(T=>T.sessions).flatMap(T=>[T,...T.agentSessions||[]]).find(T=>T.id===r):null;k.useEffect(()=>{const T=v.current;if(!T)return;const I=()=>{const W=T.scrollTop,oe=W<y.current;c(W),h(oe),y.current=W};return T.addEventListener("scroll",I),()=>T.removeEventListener("scroll",I)},[]),k.useEffect(()=>{const T=W=>{if(!a)return;const oe=W.clientX;oe>=S2&&oe<=k2&&(o(oe),localStorage.setItem(Wp,oe.toString()))},I=()=>{l(!1),document.body.style.cursor="",document.body.style.userSelect=""};return a&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",T),document.addEventListener("mouseup",I)),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",I)}},[a]),k.useEffect(()=>{const I=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;let W=null,oe=!1,J=null,F=0,ve=!0;const j=()=>{W=new WebSocket(I),oe=!1,W.onopen=()=>{if(oe){W==null||W.close();return}F=0},W.onmessage=A=>{const R=JSON.parse(A.data);(R.type==="file-added"||R.type==="file-changed"||R.type==="file-deleted")&&(x(),r&&N0.invalidateQueries({queryKey:["session",r]}))},W.onerror=A=>{console.error("WebSocket error:",A)},W.onclose=()=>{if(!ve)return;const A=Math.min(1e3*2**F,1e4);F+=1,J=setTimeout(j,A)}};return j(),()=>{ve=!1,J&&clearTimeout(J),W&&W.readyState===WebSocket.CONNECTING?oe=!0:W==null||W.close()}},[x,r]);const _=Math.max(0,1-(d?0:u)/80),E=12+_*12,O=1.125+_*.375,M=_;return p.jsxs("div",{className:"flex h-screen bg-gray-900 text-white",children:[p.jsxs("div",{className:"relative flex flex-col",style:{width:`${s}px`},children:[p.jsxs("div",{ref:f,className:"border-r border-gray-700 h-full flex flex-col",children:[p.jsxs("div",{className:"border-b border-gray-700 flex-shrink-0 transition-all duration-200",style:{padding:`${E}px`},children:[p.jsx("h1",{className:"font-bold transition-all duration-200",style:{fontSize:`${O}rem`},children:p.jsx("button",{onClick:()=>t("/dashboard"),className:"hover:text-blue-400 transition-colors",children:"Claude Sessions"})}),p.jsx("p",{className:"text-sm text-gray-400 mt-1 transition-opacity duration-200",style:{opacity:M,height:M>0?"auto":0,overflow:"hidden"},children:m?"Loading...":`${(w==null?void 0:w.projects.length)||0} project${(w==null?void 0:w.projects.length)!==1?"s":""}`})]}),p.jsx("div",{ref:v,className:"flex-1 overflow-y-auto",children:g?p.jsxs("div",{className:"p-4 text-red-400 text-sm",children:["Error loading sessions: ",g.message]}):p.jsx(T_,{projects:(w==null?void 0:w.projects)||[],selectedId:r,onSelect:b})})]}),p.jsx("div",{className:"absolute top-0 right-0 w-4 h-full cursor-col-resize group z-10",onMouseDown:T=>{T.preventDefault(),l(!0)},style:{touchAction:"none"},children:p.jsx("div",{className:`w-1 h-full ml-auto transition-colors ${a?"bg-blue-500":"bg-transparent group-hover:bg-blue-500"}`})})]}),p.jsx("div",{className:"flex-1 min-w-0",children:i?p.jsx(b2,{}):r?p.jsx(j_,{sessionId:r,sessionInfo:C}):p.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:p.jsxs("div",{className:"text-center",children:[p.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.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"})}),p.jsx("h3",{className:"mt-2 text-sm font-medium",children:"No session selected"}),p.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Select a session from the sidebar to view details"})]})})})]})}function C2(){return p.jsx(jw,{client:N0,children:p.jsx(f1,{children:p.jsxs($b,{children:[p.jsx(oa,{path:"/",element:p.jsx(Wb,{to:"/dashboard",replace:!0})}),p.jsx(oa,{path:"/dashboard",element:p.jsx(Hp,{})}),p.jsx(oa,{path:"/sessions/:sessionId",element:p.jsx(Hp,{})})]})})})}lu.createRoot(document.getElementById("root")).render(p.jsx(q0.StrictMode,{children:p.jsx(C2,{})}));