heyio 3.1.6 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/routes/config.d.ts.map +1 -1
- package/dist/api/routes/config.js +1 -0
- package/dist/api/routes/config.js.map +1 -1
- package/dist/api/routes/squads.d.ts.map +1 -1
- package/dist/api/routes/squads.js +3 -0
- package/dist/api/routes/squads.js.map +1 -1
- package/dist/copilot/orchestrator.d.ts.map +1 -1
- package/dist/copilot/orchestrator.js +8 -2
- package/dist/copilot/orchestrator.js.map +1 -1
- package/dist/copilot/tools.js +4 -4
- package/dist/copilot/tools.js.map +1 -1
- package/dist/squad/manager.d.ts.map +1 -1
- package/dist/squad/manager.js +12 -3
- package/dist/squad/manager.js.map +1 -1
- package/dist/store/db.d.ts.map +1 -1
- package/dist/store/db.js +20 -0
- package/dist/store/db.js.map +1 -1
- package/dist/store/inbox.d.ts.map +1 -1
- package/dist/store/inbox.js +2 -1
- package/dist/store/inbox.js.map +1 -1
- package/dist/wiki/store.d.ts +2 -0
- package/dist/wiki/store.d.ts.map +1 -1
- package/dist/wiki/store.js +5 -1
- package/dist/wiki/store.js.map +1 -1
- package/node_modules/@io/shared/dist/config.d.ts +1 -0
- package/node_modules/@io/shared/dist/config.d.ts.map +1 -1
- package/node_modules/@io/shared/dist/config.js +1 -0
- package/node_modules/@io/shared/dist/config.js.map +1 -1
- package/node_modules/@io/shared/dist/constants.d.ts +6 -0
- package/node_modules/@io/shared/dist/constants.d.ts.map +1 -1
- package/node_modules/@io/shared/dist/constants.js +17 -0
- package/node_modules/@io/shared/dist/constants.js.map +1 -1
- package/node_modules/@io/shared/dist/index.d.ts +1 -1
- package/node_modules/@io/shared/dist/index.d.ts.map +1 -1
- package/node_modules/@io/shared/dist/index.js +1 -1
- package/node_modules/@io/shared/dist/index.js.map +1 -1
- package/node_modules/@io/shared/dist/types/squads.d.ts +1 -0
- package/node_modules/@io/shared/dist/types/squads.d.ts.map +1 -1
- package/node_modules/@io/shared/package.json +1 -1
- package/node_modules/@io/shared/src/config.ts +2 -0
- package/node_modules/@io/shared/src/constants.ts +18 -0
- package/node_modules/@io/shared/src/index.ts +1 -1
- package/node_modules/@io/shared/src/types/squads.ts +1 -0
- package/node_modules/@io/shared/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/public/assets/index-CecuFaTR.js +505 -0
- package/public/assets/index-CecuFaTR.js.map +1 -0
- package/public/index.html +1 -1
- package/public/assets/index-C4oirMTi.js +0 -505
- package/public/assets/index-C4oirMTi.js.map +0 -1
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
var Y3=Object.defineProperty;var J3=(t,e,r)=>e in t?Y3(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var bt=(t,e,r)=>J3(t,typeof e!="symbol"?e+"":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"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Vd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hg={exports:{}},oc={},pg={exports:{}},Je={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var fk;function Z3(){if(fk)return Je;fk=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator;function g(z){return z===null||typeof z!="object"?null:(z=h&&z[h]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function b(z,L,Z){this.props=z,this.context=L,this.refs=_,this.updater=Z||v}b.prototype.isReactComponent={},b.prototype.setState=function(z,L){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,L,"setState")},b.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function k(){}k.prototype=b.prototype;function E(z,L,Z){this.props=z,this.context=L,this.refs=_,this.updater=Z||v}var O=E.prototype=new k;O.constructor=E,x(O,b.prototype),O.isPureReactComponent=!0;var A=Array.isArray,T=Object.prototype.hasOwnProperty,C={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function R(z,L,Z){var se,le={},ve=null,qe=null;if(L!=null)for(se in L.ref!==void 0&&(qe=L.ref),L.key!==void 0&&(ve=""+L.key),L)T.call(L,se)&&!j.hasOwnProperty(se)&&(le[se]=L[se]);var xe=arguments.length-2;if(xe===1)le.children=Z;else if(1<xe){for(var ae=Array(xe),Se=0;Se<xe;Se++)ae[Se]=arguments[Se+2];le.children=ae}if(z&&z.defaultProps)for(se in xe=z.defaultProps,xe)le[se]===void 0&&(le[se]=xe[se]);return{$$typeof:t,type:z,key:ve,ref:qe,props:le,_owner:C.current}}function M(z,L){return{$$typeof:t,type:z.type,key:L,ref:z.ref,props:z.props,_owner:z._owner}}function Y(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function W(z){var L={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Z){return L[Z]})}var B=/\/+/g;function X(z,L){return typeof z=="object"&&z!==null&&z.key!=null?W(""+z.key):L.toString(36)}function K(z,L,Z,se,le){var ve=typeof z;(ve==="undefined"||ve==="boolean")&&(z=null);var qe=!1;if(z===null)qe=!0;else switch(ve){case"string":case"number":qe=!0;break;case"object":switch(z.$$typeof){case t:case e:qe=!0}}if(qe)return qe=z,le=le(qe),z=se===""?"."+X(qe,0):se,A(le)?(Z="",z!=null&&(Z=z.replace(B,"$&/")+"/"),K(le,L,Z,"",function(Se){return Se})):le!=null&&(Y(le)&&(le=M(le,Z+(!le.key||qe&&qe.key===le.key?"":(""+le.key).replace(B,"$&/")+"/")+z)),L.push(le)),1;if(qe=0,se=se===""?".":se+":",A(z))for(var xe=0;xe<z.length;xe++){ve=z[xe];var ae=se+X(ve,xe);qe+=K(ve,L,Z,ae,le)}else if(ae=g(z),typeof ae=="function")for(z=ae.call(z),xe=0;!(ve=z.next()).done;)ve=ve.value,ae=se+X(ve,xe++),qe+=K(ve,L,Z,ae,le);else if(ve==="object")throw L=String(z),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return qe}function U(z,L,Z){if(z==null)return z;var se=[],le=0;return K(z,se,"","",function(ve){return L.call(Z,ve,le++)}),se}function G(z){if(z._status===-1){var L=z._result;L=L(),L.then(function(Z){(z._status===0||z._status===-1)&&(z._status=1,z._result=Z)},function(Z){(z._status===0||z._status===-1)&&(z._status=2,z._result=Z)}),z._status===-1&&(z._status=0,z._result=L)}if(z._status===1)return z._result.default;throw z._result}var J={current:null},F={transition:null},te={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function q(){throw Error("act(...) is not supported in production builds of React.")}return Je.Children={map:U,forEach:function(z,L,Z){U(z,function(){L.apply(this,arguments)},Z)},count:function(z){var L=0;return U(z,function(){L++}),L},toArray:function(z){return U(z,function(L){return L})||[]},only:function(z){if(!Y(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Je.Component=b,Je.Fragment=r,Je.Profiler=i,Je.PureComponent=E,Je.StrictMode=n,Je.Suspense=u,Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Je.act=q,Je.cloneElement=function(z,L,Z){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var se=x({},z.props),le=z.key,ve=z.ref,qe=z._owner;if(L!=null){if(L.ref!==void 0&&(ve=L.ref,qe=C.current),L.key!==void 0&&(le=""+L.key),z.type&&z.type.defaultProps)var xe=z.type.defaultProps;for(ae in L)T.call(L,ae)&&!j.hasOwnProperty(ae)&&(se[ae]=L[ae]===void 0&&xe!==void 0?xe[ae]:L[ae])}var ae=arguments.length-2;if(ae===1)se.children=Z;else if(1<ae){xe=Array(ae);for(var Se=0;Se<ae;Se++)xe[Se]=arguments[Se+2];se.children=xe}return{$$typeof:t,type:z.type,key:le,ref:ve,props:se,_owner:qe}},Je.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:a,_context:z},z.Consumer=z},Je.createElement=R,Je.createFactory=function(z){var L=R.bind(null,z);return L.type=z,L},Je.createRef=function(){return{current:null}},Je.forwardRef=function(z){return{$$typeof:c,render:z}},Je.isValidElement=Y,Je.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:G}},Je.memo=function(z,L){return{$$typeof:d,type:z,compare:L===void 0?null:L}},Je.startTransition=function(z){var L=F.transition;F.transition={};try{z()}finally{F.transition=L}},Je.unstable_act=q,Je.useCallback=function(z,L){return J.current.useCallback(z,L)},Je.useContext=function(z){return J.current.useContext(z)},Je.useDebugValue=function(){},Je.useDeferredValue=function(z){return J.current.useDeferredValue(z)},Je.useEffect=function(z,L){return J.current.useEffect(z,L)},Je.useId=function(){return J.current.useId()},Je.useImperativeHandle=function(z,L,Z){return J.current.useImperativeHandle(z,L,Z)},Je.useInsertionEffect=function(z,L){return J.current.useInsertionEffect(z,L)},Je.useLayoutEffect=function(z,L){return J.current.useLayoutEffect(z,L)},Je.useMemo=function(z,L){return J.current.useMemo(z,L)},Je.useReducer=function(z,L,Z){return J.current.useReducer(z,L,Z)},Je.useRef=function(z){return J.current.useRef(z)},Je.useState=function(z){return J.current.useState(z)},Je.useSyncExternalStore=function(z,L,Z){return J.current.useSyncExternalStore(z,L,Z)},Je.useTransition=function(){return J.current.useTransition()},Je.version="18.3.1",Je}var hk;function xw(){return hk||(hk=1,pg.exports=Z3()),pg.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var pk;function Q3(){if(pk)return oc;pk=1;var t=xw(),e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,d){var p,h={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(p in u)n.call(u,p)&&!a.hasOwnProperty(p)&&(h[p]=u[p]);if(c&&c.defaultProps)for(p in u=c.defaultProps,u)h[p]===void 0&&(h[p]=u[p]);return{$$typeof:e,type:c,key:g,ref:v,props:h,_owner:i.current}}return oc.Fragment=r,oc.jsx=o,oc.jsxs=o,oc}var mk;function eL(){return mk||(mk=1,hg.exports=Q3()),hg.exports}var y=eL(),N=xw();const I=vt(N);var Xd={},mg={exports:{}},Vr={},gg={exports:{}},yg={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var gk;function tL(){return gk||(gk=1,(function(t){function e(F,te){var q=F.length;F.push(te);e:for(;0<q;){var z=q-1>>>1,L=F[z];if(0<i(L,te))F[z]=te,F[q]=L,q=z;else break e}}function r(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var te=F[0],q=F.pop();if(q!==te){F[0]=q;e:for(var z=0,L=F.length,Z=L>>>1;z<Z;){var se=2*(z+1)-1,le=F[se],ve=se+1,qe=F[ve];if(0>i(le,q))ve<L&&0>i(qe,le)?(F[z]=qe,F[ve]=q,z=ve):(F[z]=le,F[se]=q,z=se);else if(ve<L&&0>i(qe,q))F[z]=qe,F[ve]=q,z=ve;else break e}}return te}function i(F,te){var q=F.sortIndex-te.sortIndex;return q!==0?q:F.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var u=[],d=[],p=1,h=null,g=3,v=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(F){for(var te=r(d);te!==null;){if(te.callback===null)n(d);else if(te.startTime<=F)n(d),te.sortIndex=te.expirationTime,e(u,te);else break;te=r(d)}}function A(F){if(_=!1,O(F),!x)if(r(u)!==null)x=!0,G(T);else{var te=r(d);te!==null&&J(A,te.startTime-F)}}function T(F,te){x=!1,_&&(_=!1,k(R),R=-1),v=!0;var q=g;try{for(O(te),h=r(u);h!==null&&(!(h.expirationTime>te)||F&&!W());){var z=h.callback;if(typeof z=="function"){h.callback=null,g=h.priorityLevel;var L=z(h.expirationTime<=te);te=t.unstable_now(),typeof L=="function"?h.callback=L:h===r(u)&&n(u),O(te)}else n(u);h=r(u)}if(h!==null)var Z=!0;else{var se=r(d);se!==null&&J(A,se.startTime-te),Z=!1}return Z}finally{h=null,g=q,v=!1}}var C=!1,j=null,R=-1,M=5,Y=-1;function W(){return!(t.unstable_now()-Y<M)}function B(){if(j!==null){var F=t.unstable_now();Y=F;var te=!0;try{te=j(!0,F)}finally{te?X():(C=!1,j=null)}}else C=!1}var X;if(typeof E=="function")X=function(){E(B)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,U=K.port2;K.port1.onmessage=B,X=function(){U.postMessage(null)}}else X=function(){b(B,0)};function G(F){j=F,C||(C=!0,X())}function J(F,te){R=b(function(){F(t.unstable_now())},te)}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(F){F.callback=null},t.unstable_continueExecution=function(){x||v||(x=!0,G(T))},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(F){switch(g){case 1:case 2:case 3:var te=3;break;default:te=g}var q=g;g=te;try{return F()}finally{g=q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,te){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var q=g;g=F;try{return te()}finally{g=q}},t.unstable_scheduleCallback=function(F,te,q){var z=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?z+q:z):q=z,F){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=q+L,F={id:p++,callback:te,priorityLevel:F,startTime:q,expirationTime:L,sortIndex:-1},q>z?(F.sortIndex=q,e(d,F),r(u)===null&&F===r(d)&&(_?(k(R),R=-1):_=!0,J(A,q-z))):(F.sortIndex=L,e(u,F),x||v||(x=!0,G(T))),F},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(F){var te=g;return function(){var q=g;g=te;try{return F.apply(this,arguments)}finally{g=q}}}})(yg)),yg}var yk;function rL(){return yk||(yk=1,gg.exports=tL()),gg.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var vk;function nL(){if(vk)return Vr;vk=1;var t=xw(),e=rL();function r(s){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+s,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(s,l){o(s,l),o(s+"Capture",l)}function o(s,l){for(i[s]=l,s=0;s<l.length;s++)n.add(l[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},h={};function g(s){return u.call(h,s)?!0:u.call(p,s)?!1:d.test(s)?h[s]=!0:(p[s]=!0,!1)}function v(s,l,f,m){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return m?!1:f!==null?!f.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function x(s,l,f,m){if(l===null||typeof l>"u"||v(s,l,f,m))return!0;if(m)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function _(s,l,f,m,w,S,P){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=m,this.attributeNamespace=w,this.mustUseProperty=f,this.propertyName=s,this.type=l,this.sanitizeURL=S,this.removeEmptyString=P}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){b[s]=new _(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var l=s[0];b[l]=new _(l,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){b[s]=new _(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){b[s]=new _(s,2,!1,s,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(s){b[s]=new _(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){b[s]=new _(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){b[s]=new _(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){b[s]=new _(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){b[s]=new _(s,5,!1,s.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function E(s){return s[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(s){var l=s.replace(k,E);b[l]=new _(l,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var l=s.replace(k,E);b[l]=new _(l,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var l=s.replace(k,E);b[l]=new _(l,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){b[s]=new _(s,1,!1,s.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){b[s]=new _(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,l,f,m){var w=b.hasOwnProperty(l)?b[l]:null;(w!==null?w.type!==0:m||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,f,w,m)&&(f=null),m||w===null?g(l)&&(f===null?s.removeAttribute(l):s.setAttribute(l,""+f)):w.mustUseProperty?s[w.propertyName]=f===null?w.type===3?!1:"":f:(l=w.attributeName,m=w.attributeNamespace,f===null?s.removeAttribute(l):(w=w.type,f=w===3||w===4&&f===!0?"":""+f,m?s.setAttributeNS(m,l,f):s.setAttribute(l,f))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),C=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),W=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),F=Symbol.iterator;function te(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var q=Object.assign,z;function L(s){if(z===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
|
|
34
|
-
`+z+s}var Z=!1;function se(s,l){if(!s||Z)return"";Z=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(re){var m=re}Reflect.construct(s,[],l)}else{try{l.call()}catch(re){m=re}s.call(l.prototype)}else{try{throw Error()}catch(re){m=re}s()}}catch(re){if(re&&m&&typeof re.stack=="string"){for(var w=re.stack.split(`
|
|
35
|
-
`),S=m.stack.split(`
|
|
36
|
-
`),P=w.length-1,D=S.length-1;1<=P&&0<=D&&w[P]!==S[D];)D--;for(;1<=P&&0<=D;P--,D--)if(w[P]!==S[D]){if(P!==1||D!==1)do if(P--,D--,0>D||w[P]!==S[D]){var H=`
|
|
37
|
-
`+w[P].replace(" at new "," at ");return s.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",s.displayName)),H}while(1<=P&&0<=D);break}}}finally{Z=!1,Error.prepareStackTrace=f}return(s=s?s.displayName||s.name:"")?L(s):""}function le(s){switch(s.tag){case 5:return L(s.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return s=se(s.type,!1),s;case 11:return s=se(s.type.render,!1),s;case 1:return s=se(s.type,!0),s;default:return""}}function ve(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case j:return"Fragment";case C:return"Portal";case M:return"Profiler";case R:return"StrictMode";case X:return"Suspense";case K:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case W:return(s.displayName||"Context")+".Consumer";case Y:return(s._context.displayName||"Context")+".Provider";case B:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case U:return l=s.displayName||null,l!==null?l:ve(s.type)||"Memo";case G:l=s._payload,s=s._init;try{return ve(s(l))}catch{}}return null}function qe(s){var l=s.type;switch(s.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=l.render,s=s.displayName||s.name||"",l.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ve(l);case 8:return l===R?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function xe(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ae(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Se(s){var l=ae(s)?"checked":"value",f=Object.getOwnPropertyDescriptor(s.constructor.prototype,l),m=""+s[l];if(!s.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var w=f.get,S=f.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return w.call(this)},set:function(P){m=""+P,S.call(this,P)}}),Object.defineProperty(s,l,{enumerable:f.enumerable}),{getValue:function(){return m},setValue:function(P){m=""+P},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Me(s){s._valueTracker||(s._valueTracker=Se(s))}function oe(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var f=l.getValue(),m="";return s&&(m=ae(s)?s.checked?"true":"false":s.value),s=m,s!==f?(l.setValue(s),!0):!1}function et(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Fe(s,l){var f=l.checked;return q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??s._wrapperState.initialChecked})}function kt(s,l){var f=l.defaultValue==null?"":l.defaultValue,m=l.checked!=null?l.checked:l.defaultChecked;f=xe(l.value!=null?l.value:f),s._wrapperState={initialChecked:m,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function wt(s,l){l=l.checked,l!=null&&O(s,"checked",l,!1)}function Et(s,l){wt(s,l);var f=xe(l.value),m=l.type;if(f!=null)m==="number"?(f===0&&s.value===""||s.value!=f)&&(s.value=""+f):s.value!==""+f&&(s.value=""+f);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}l.hasOwnProperty("value")?Bt(s,l.type,f):l.hasOwnProperty("defaultValue")&&Bt(s,l.type,xe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(s.defaultChecked=!!l.defaultChecked)}function Sr(s,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var m=l.type;if(!(m!=="submit"&&m!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+s._wrapperState.initialValue,f||l===s.value||(s.value=l),s.defaultValue=l}f=s.name,f!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,f!==""&&(s.name=f)}function Bt(s,l,f){(l!=="number"||et(s.ownerDocument)!==s)&&(f==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+f&&(s.defaultValue=""+f))}var Rr=Array.isArray;function lr(s,l,f,m){if(s=s.options,l){l={};for(var w=0;w<f.length;w++)l["$"+f[w]]=!0;for(f=0;f<s.length;f++)w=l.hasOwnProperty("$"+s[f].value),s[f].selected!==w&&(s[f].selected=w),w&&m&&(s[f].defaultSelected=!0)}else{for(f=""+xe(f),l=null,w=0;w<s.length;w++){if(s[w].value===f){s[w].selected=!0,m&&(s[w].defaultSelected=!0);return}l!==null||s[w].disabled||(l=s[w])}l!==null&&(l.selected=!0)}}function _t(s,l){if(l.dangerouslySetInnerHTML!=null)throw Error(r(91));return q({},l,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function kr(s,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(r(92));if(Rr(f)){if(1<f.length)throw Error(r(93));f=f[0]}l=f}l==null&&(l=""),f=l}s._wrapperState={initialValue:xe(f)}}function Ir(s,l){var f=xe(l.value),m=xe(l.defaultValue);f!=null&&(f=""+f,f!==s.value&&(s.value=f),l.defaultValue==null&&s.defaultValue!==f&&(s.defaultValue=f)),m!=null&&(s.defaultValue=""+m)}function ni(s){var l=s.textContent;l===s._wrapperState.initialValue&&l!==""&&l!==null&&(s.value=l)}function Ur(s){switch(s){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 ii(s,l){return s==null||s==="http://www.w3.org/1999/xhtml"?Ur(l):s==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var ai,aa=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,m,w){MSApp.execUnsafeLocalFunction(function(){return s(l,f,m,w)})}:s})(function(s,l){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=l;else{for(ai=ai||document.createElement("div"),ai.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=ai.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;l.firstChild;)s.appendChild(l.firstChild)}});function qr(s,l){if(l){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=l;return}}s.textContent=l}var oi={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},si=["Webkit","ms","Moz","O"];Object.keys(oi).forEach(function(s){si.forEach(function(l){l=l+s.charAt(0).toUpperCase()+s.substring(1),oi[l]=oi[s]})});function Fo(s,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||oi.hasOwnProperty(s)&&oi[s]?(""+l).trim():l+"px"}function Ka(s,l){s=s.style;for(var f in l)if(l.hasOwnProperty(f)){var m=f.indexOf("--")===0,w=Fo(f,l[f],m);f==="float"&&(f="cssFloat"),m?s.setProperty(f,w):s[f]=w}}var Ho=q({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 oa(s,l){if(l){if(Ho[s]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(r(137,s));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(r(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(r(61))}if(l.style!=null&&typeof l.style!="object")throw Error(r(62))}}function Va(s,l){if(s.indexOf("-")===-1)return typeof l.is=="string";switch(s){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 Nn=null;function $r(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var sa=null,li=null,hn=null;function pn(s){if(s=Wl(s)){if(typeof sa!="function")throw Error(r(280));var l=s.stateNode;l&&(l=cd(l),sa(s.stateNode,s.type,l))}}function $(s){li?hn?hn.push(s):hn=[s]:li=s}function ne(){if(li){var s=li,l=hn;if(hn=li=null,pn(s),l)for(s=0;s<l.length;s++)pn(l[s])}}function de(s,l){return s(l)}function Re(){}var ht=!1;function Ke(s,l,f){if(ht)return s(l,f);ht=!0;try{return de(s,l,f)}finally{ht=!1,(li!==null||hn!==null)&&(Re(),ne())}}function ye(s,l){var f=s.stateNode;if(f===null)return null;var m=cd(f);if(m===null)return null;f=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(r(231,l,typeof f));return f}var we=!1;if(c)try{var Ce={};Object.defineProperty(Ce,"passive",{get:function(){we=!0}}),window.addEventListener("test",Ce,Ce),window.removeEventListener("test",Ce,Ce)}catch{we=!1}function ct(s,l,f,m,w,S,P,D,H){var re=Array.prototype.slice.call(arguments,3);try{l.apply(f,re)}catch(ue){this.onError(ue)}}var gt=!1,cr=null,Oi=!1,Xa=null,Rp={onError:function(s){gt=!0,cr=s}};function El(s,l,f,m,w,S,P,D,H){gt=!1,cr=null,ct.apply(Rp,arguments)}function Ip(s,l,f,m,w,S,P,D,H){if(El.apply(this,arguments),gt){if(gt){var re=cr;gt=!1,cr=null}else throw Error(r(198));Oi||(Oi=!0,Xa=re)}}function Ai(s){var l=s,f=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(f=l.return),s=l.return;while(s)}return l.tag===3?f:null}function Uu(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function Ol(s){if(Ai(s)!==s)throw Error(r(188))}function Wo(s){var l=s.alternate;if(!l){if(l=Ai(s),l===null)throw Error(r(188));return l!==s?null:s}for(var f=s,m=l;;){var w=f.return;if(w===null)break;var S=w.alternate;if(S===null){if(m=w.return,m!==null){f=m;continue}break}if(w.child===S.child){for(S=w.child;S;){if(S===f)return Ol(w),s;if(S===m)return Ol(w),l;S=S.sibling}throw Error(r(188))}if(f.return!==m.return)f=w,m=S;else{for(var P=!1,D=w.child;D;){if(D===f){P=!0,f=w,m=S;break}if(D===m){P=!0,m=w,f=S;break}D=D.sibling}if(!P){for(D=S.child;D;){if(D===f){P=!0,f=S,m=w;break}if(D===m){P=!0,m=S,f=w;break}D=D.sibling}if(!P)throw Error(r(189))}}if(f.alternate!==m)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?s:l}function qu(s){return s=Wo(s),s!==null?Fu(s):null}function Fu(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var l=Fu(s);if(l!==null)return l;s=s.sibling}return null}var Hu=e.unstable_scheduleCallback,Rn=e.unstable_cancelCallback,Wu=e.unstable_shouldYield,Gu=e.unstable_requestPaint,Mt=e.unstable_now,$p=e.unstable_getCurrentPriorityLevel,Al=e.unstable_ImmediatePriority,Ya=e.unstable_UserBlockingPriority,Go=e.unstable_NormalPriority,he=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Ve=null,Ze=null;function Wt(s){if(Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(Ve,s,void 0,(s.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:Mr,ci=Math.log,Ko=Math.LN2;function Mr(s){return s>>>=0,s===0?32:31-(ci(s)/Ko|0)|0}var Lr=64,Ja=4194304;function la(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Za(s,l){var f=s.pendingLanes;if(f===0)return 0;var m=0,w=s.suspendedLanes,S=s.pingedLanes,P=f&268435455;if(P!==0){var D=P&~w;D!==0?m=la(D):(S&=P,S!==0&&(m=la(S)))}else P=f&~w,P!==0?m=la(P):S!==0&&(m=la(S));if(m===0)return 0;if(l!==0&&l!==m&&(l&w)===0&&(w=m&-m,S=l&-l,w>=S||w===16&&(S&4194240)!==0))return l;if((m&4)!==0&&(m|=f&16),l=s.entangledLanes,l!==0)for(s=s.entanglements,l&=m;0<l;)f=31-Lt(l),w=1<<f,m|=s[f],l&=~w;return m}function Mp(s,l){switch(s){case 1:case 2:case 4:return l+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 l+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 Lp(s,l){for(var f=s.suspendedLanes,m=s.pingedLanes,w=s.expirationTimes,S=s.pendingLanes;0<S;){var P=31-Lt(S),D=1<<P,H=w[P];H===-1?((D&f)===0||(D&m)!==0)&&(w[P]=Mp(D,l)):H<=l&&(s.expiredLanes|=D),S&=~D}}function Tl(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Ku(){var s=Lr;return Lr<<=1,(Lr&4194240)===0&&(Lr=64),s}function ca(s){for(var l=[],f=0;31>f;f++)l.push(s);return l}function ua(s,l,f){s.pendingLanes|=l,l!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,l=31-Lt(l),s[l]=f}function mn(s,l){var f=s.pendingLanes&~l;s.pendingLanes=l,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=l,s.mutableReadLanes&=l,s.entangledLanes&=l,l=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<f;){var w=31-Lt(f),S=1<<w;l[w]=0,m[w]=-1,s[w]=-1,f&=~S}}function Cl(s,l){var f=s.entangledLanes|=l;for(s=s.entanglements;f;){var m=31-Lt(f),w=1<<m;w&l|s[m]&l&&(s[m]|=l),f&=~w}}var st=0;function Ge(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var jl,Gt,yt,Qa,ui,eo=!1,da=[],me=null,Ee=null,He=null,tt=new Map,Ut=new Map,ur=[],Dp="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 Vu(s,l){switch(s){case"focusin":case"focusout":me=null;break;case"dragenter":case"dragleave":Ee=null;break;case"mouseover":case"mouseout":He=null;break;case"pointerover":case"pointerout":tt.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ut.delete(l.pointerId)}}function Pl(s,l,f,m,w,S){return s===null||s.nativeEvent!==S?(s={blockedOn:l,domEventName:f,eventSystemFlags:m,nativeEvent:S,targetContainers:[w]},l!==null&&(l=Wl(l),l!==null&&Gt(l)),s):(s.eventSystemFlags|=m,l=s.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),s)}function bM(s,l,f,m,w){switch(l){case"focusin":return me=Pl(me,s,l,f,m,w),!0;case"dragenter":return Ee=Pl(Ee,s,l,f,m,w),!0;case"mouseover":return He=Pl(He,s,l,f,m,w),!0;case"pointerover":var S=w.pointerId;return tt.set(S,Pl(tt.get(S)||null,s,l,f,m,w)),!0;case"gotpointercapture":return S=w.pointerId,Ut.set(S,Pl(Ut.get(S)||null,s,l,f,m,w)),!0}return!1}function Y1(s){var l=to(s.target);if(l!==null){var f=Ai(l);if(f!==null){if(l=f.tag,l===13){if(l=Uu(f),l!==null){s.blockedOn=l,ui(s.priority,function(){yt(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Xu(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var f=Bp(s.domEventName,s.eventSystemFlags,l[0],s.nativeEvent);if(f===null){f=s.nativeEvent;var m=new f.constructor(f.type,f);Nn=m,f.target.dispatchEvent(m),Nn=null}else return l=Wl(f),l!==null&&Gt(l),s.blockedOn=f,!1;l.shift()}return!0}function J1(s,l,f){Xu(s)&&f.delete(l)}function xM(){eo=!1,me!==null&&Xu(me)&&(me=null),Ee!==null&&Xu(Ee)&&(Ee=null),He!==null&&Xu(He)&&(He=null),tt.forEach(J1),Ut.forEach(J1)}function Nl(s,l){s.blockedOn===l&&(s.blockedOn=null,eo||(eo=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,xM)))}function Rl(s){function l(w){return Nl(w,s)}if(0<da.length){Nl(da[0],s);for(var f=1;f<da.length;f++){var m=da[f];m.blockedOn===s&&(m.blockedOn=null)}}for(me!==null&&Nl(me,s),Ee!==null&&Nl(Ee,s),He!==null&&Nl(He,s),tt.forEach(l),Ut.forEach(l),f=0;f<ur.length;f++)m=ur[f],m.blockedOn===s&&(m.blockedOn=null);for(;0<ur.length&&(f=ur[0],f.blockedOn===null);)Y1(f),f.blockedOn===null&&ur.shift()}var Vo=A.ReactCurrentBatchConfig,Yu=!0;function wM(s,l,f,m){var w=st,S=Vo.transition;Vo.transition=null;try{st=1,zp(s,l,f,m)}finally{st=w,Vo.transition=S}}function _M(s,l,f,m){var w=st,S=Vo.transition;Vo.transition=null;try{st=4,zp(s,l,f,m)}finally{st=w,Vo.transition=S}}function zp(s,l,f,m){if(Yu){var w=Bp(s,l,f,m);if(w===null)nm(s,l,m,Ju,f),Vu(s,m);else if(bM(w,s,l,f,m))m.stopPropagation();else if(Vu(s,m),l&4&&-1<Dp.indexOf(s)){for(;w!==null;){var S=Wl(w);if(S!==null&&jl(S),S=Bp(s,l,f,m),S===null&&nm(s,l,m,Ju,f),S===w)break;w=S}w!==null&&m.stopPropagation()}else nm(s,l,m,null,f)}}var Ju=null;function Bp(s,l,f,m){if(Ju=null,s=$r(m),s=to(s),s!==null)if(l=Ai(s),l===null)s=null;else if(f=l.tag,f===13){if(s=Uu(l),s!==null)return s;s=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null);return Ju=s,null}function Z1(s){switch(s){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($p()){case Al:return 1;case Ya:return 4;case Go:case he:return 16;case $e:return 536870912;default:return 16}default:return 16}}var fa=null,Up=null,Zu=null;function Q1(){if(Zu)return Zu;var s,l=Up,f=l.length,m,w="value"in fa?fa.value:fa.textContent,S=w.length;for(s=0;s<f&&l[s]===w[s];s++);var P=f-s;for(m=1;m<=P&&l[f-m]===w[S-m];m++);return Zu=w.slice(s,1<m?1-m:void 0)}function Qu(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function ed(){return!0}function e_(){return!1}function Qr(s){function l(f,m,w,S,P){this._reactName=f,this._targetInst=w,this.type=m,this.nativeEvent=S,this.target=P,this.currentTarget=null;for(var D in s)s.hasOwnProperty(D)&&(f=s[D],this[D]=f?f(S):S[D]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?ed:e_,this.isPropagationStopped=e_,this}return q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=ed)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=ed)},persist:function(){},isPersistent:ed}),l}var Xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qp=Qr(Xo),Il=q({},Xo,{view:0,detail:0}),SM=Qr(Il),Fp,Hp,$l,td=q({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==$l&&($l&&s.type==="mousemove"?(Fp=s.screenX-$l.screenX,Hp=s.screenY-$l.screenY):Hp=Fp=0,$l=s),Fp)},movementY:function(s){return"movementY"in s?s.movementY:Hp}}),t_=Qr(td),kM=q({},td,{dataTransfer:0}),EM=Qr(kM),OM=q({},Il,{relatedTarget:0}),Wp=Qr(OM),AM=q({},Xo,{animationName:0,elapsedTime:0,pseudoElement:0}),TM=Qr(AM),CM=q({},Xo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),jM=Qr(CM),PM=q({},Xo,{data:0}),r_=Qr(PM),NM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},RM={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"},IM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $M(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=IM[s])?!!l[s]:!1}function Gp(){return $M}var MM=q({},Il,{key:function(s){if(s.key){var l=NM[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Qu(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?RM[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gp,charCode:function(s){return s.type==="keypress"?Qu(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Qu(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),LM=Qr(MM),DM=q({},td,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),n_=Qr(DM),zM=q({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gp}),BM=Qr(zM),UM=q({},Xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),qM=Qr(UM),FM=q({},td,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),HM=Qr(FM),WM=[9,13,27,32],Kp=c&&"CompositionEvent"in window,Ml=null;c&&"documentMode"in document&&(Ml=document.documentMode);var GM=c&&"TextEvent"in window&&!Ml,i_=c&&(!Kp||Ml&&8<Ml&&11>=Ml),a_=" ",o_=!1;function s_(s,l){switch(s){case"keyup":return WM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function l_(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Yo=!1;function KM(s,l){switch(s){case"compositionend":return l_(l);case"keypress":return l.which!==32?null:(o_=!0,a_);case"textInput":return s=l.data,s===a_&&o_?null:s;default:return null}}function VM(s,l){if(Yo)return s==="compositionend"||!Kp&&s_(s,l)?(s=Q1(),Zu=Up=fa=null,Yo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return i_&&l.locale!=="ko"?null:l.data;default:return null}}var XM={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 c_(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!XM[s.type]:l==="textarea"}function u_(s,l,f,m){$(m),l=od(l,"onChange"),0<l.length&&(f=new qp("onChange","change",null,f,m),s.push({event:f,listeners:l}))}var Ll=null,Dl=null;function YM(s){T_(s,0)}function rd(s){var l=ts(s);if(oe(l))return s}function JM(s,l){if(s==="change")return l}var d_=!1;if(c){var Vp;if(c){var Xp="oninput"in document;if(!Xp){var f_=document.createElement("div");f_.setAttribute("oninput","return;"),Xp=typeof f_.oninput=="function"}Vp=Xp}else Vp=!1;d_=Vp&&(!document.documentMode||9<document.documentMode)}function h_(){Ll&&(Ll.detachEvent("onpropertychange",p_),Dl=Ll=null)}function p_(s){if(s.propertyName==="value"&&rd(Dl)){var l=[];u_(l,Dl,s,$r(s)),Ke(YM,l)}}function ZM(s,l,f){s==="focusin"?(h_(),Ll=l,Dl=f,Ll.attachEvent("onpropertychange",p_)):s==="focusout"&&h_()}function QM(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return rd(Dl)}function e3(s,l){if(s==="click")return rd(l)}function t3(s,l){if(s==="input"||s==="change")return rd(l)}function r3(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var In=typeof Object.is=="function"?Object.is:r3;function zl(s,l){if(In(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var f=Object.keys(s),m=Object.keys(l);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var w=f[m];if(!u.call(l,w)||!In(s[w],l[w]))return!1}return!0}function m_(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function g_(s,l){var f=m_(s);s=0;for(var m;f;){if(f.nodeType===3){if(m=s+f.textContent.length,s<=l&&m>=l)return{node:f,offset:l-s};s=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=m_(f)}}function y_(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?y_(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function v_(){for(var s=window,l=et();l instanceof s.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)s=l.contentWindow;else break;l=et(s.document)}return l}function Yp(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}function n3(s){var l=v_(),f=s.focusedElem,m=s.selectionRange;if(l!==f&&f&&f.ownerDocument&&y_(f.ownerDocument.documentElement,f)){if(m!==null&&Yp(f)){if(l=m.start,s=m.end,s===void 0&&(s=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(s,f.value.length);else if(s=(l=f.ownerDocument||document)&&l.defaultView||window,s.getSelection){s=s.getSelection();var w=f.textContent.length,S=Math.min(m.start,w);m=m.end===void 0?S:Math.min(m.end,w),!s.extend&&S>m&&(w=m,m=S,S=w),w=g_(f,S);var P=g_(f,m);w&&P&&(s.rangeCount!==1||s.anchorNode!==w.node||s.anchorOffset!==w.offset||s.focusNode!==P.node||s.focusOffset!==P.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),s.removeAllRanges(),S>m?(s.addRange(l),s.extend(P.node,P.offset)):(l.setEnd(P.node,P.offset),s.addRange(l)))}}for(l=[],s=f;s=s.parentNode;)s.nodeType===1&&l.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)s=l[f],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var i3=c&&"documentMode"in document&&11>=document.documentMode,Jo=null,Jp=null,Bl=null,Zp=!1;function b_(s,l,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Zp||Jo==null||Jo!==et(m)||(m=Jo,"selectionStart"in m&&Yp(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Bl&&zl(Bl,m)||(Bl=m,m=od(Jp,"onSelect"),0<m.length&&(l=new qp("onSelect","select",null,l,f),s.push({event:l,listeners:m}),l.target=Jo)))}function nd(s,l){var f={};return f[s.toLowerCase()]=l.toLowerCase(),f["Webkit"+s]="webkit"+l,f["Moz"+s]="moz"+l,f}var Zo={animationend:nd("Animation","AnimationEnd"),animationiteration:nd("Animation","AnimationIteration"),animationstart:nd("Animation","AnimationStart"),transitionend:nd("Transition","TransitionEnd")},Qp={},x_={};c&&(x_=document.createElement("div").style,"AnimationEvent"in window||(delete Zo.animationend.animation,delete Zo.animationiteration.animation,delete Zo.animationstart.animation),"TransitionEvent"in window||delete Zo.transitionend.transition);function id(s){if(Qp[s])return Qp[s];if(!Zo[s])return s;var l=Zo[s],f;for(f in l)if(l.hasOwnProperty(f)&&f in x_)return Qp[s]=l[f];return s}var w_=id("animationend"),__=id("animationiteration"),S_=id("animationstart"),k_=id("transitionend"),E_=new Map,O_="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 ha(s,l){E_.set(s,l),a(l,[s])}for(var em=0;em<O_.length;em++){var tm=O_[em],a3=tm.toLowerCase(),o3=tm[0].toUpperCase()+tm.slice(1);ha(a3,"on"+o3)}ha(w_,"onAnimationEnd"),ha(__,"onAnimationIteration"),ha(S_,"onAnimationStart"),ha("dblclick","onDoubleClick"),ha("focusin","onFocus"),ha("focusout","onBlur"),ha(k_,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ul="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(" "),s3=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ul));function A_(s,l,f){var m=s.type||"unknown-event";s.currentTarget=f,Ip(m,l,void 0,s),s.currentTarget=null}function T_(s,l){l=(l&4)!==0;for(var f=0;f<s.length;f++){var m=s[f],w=m.event;m=m.listeners;e:{var S=void 0;if(l)for(var P=m.length-1;0<=P;P--){var D=m[P],H=D.instance,re=D.currentTarget;if(D=D.listener,H!==S&&w.isPropagationStopped())break e;A_(w,D,re),S=H}else for(P=0;P<m.length;P++){if(D=m[P],H=D.instance,re=D.currentTarget,D=D.listener,H!==S&&w.isPropagationStopped())break e;A_(w,D,re),S=H}}}if(Oi)throw s=Xa,Oi=!1,Xa=null,s}function Ct(s,l){var f=l[cm];f===void 0&&(f=l[cm]=new Set);var m=s+"__bubble";f.has(m)||(C_(l,s,2,!1),f.add(m))}function rm(s,l,f){var m=0;l&&(m|=4),C_(f,s,m,l)}var ad="_reactListening"+Math.random().toString(36).slice(2);function ql(s){if(!s[ad]){s[ad]=!0,n.forEach(function(f){f!=="selectionchange"&&(s3.has(f)||rm(f,!1,s),rm(f,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[ad]||(l[ad]=!0,rm("selectionchange",!1,l))}}function C_(s,l,f,m){switch(Z1(l)){case 1:var w=wM;break;case 4:w=_M;break;default:w=zp}f=w.bind(null,l,f,s),w=void 0,!we||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),m?w!==void 0?s.addEventListener(l,f,{capture:!0,passive:w}):s.addEventListener(l,f,!0):w!==void 0?s.addEventListener(l,f,{passive:w}):s.addEventListener(l,f,!1)}function nm(s,l,f,m,w){var S=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var P=m.tag;if(P===3||P===4){var D=m.stateNode.containerInfo;if(D===w||D.nodeType===8&&D.parentNode===w)break;if(P===4)for(P=m.return;P!==null;){var H=P.tag;if((H===3||H===4)&&(H=P.stateNode.containerInfo,H===w||H.nodeType===8&&H.parentNode===w))return;P=P.return}for(;D!==null;){if(P=to(D),P===null)return;if(H=P.tag,H===5||H===6){m=S=P;continue e}D=D.parentNode}}m=m.return}Ke(function(){var re=S,ue=$r(f),fe=[];e:{var ce=E_.get(s);if(ce!==void 0){var _e=qp,je=s;switch(s){case"keypress":if(Qu(f)===0)break e;case"keydown":case"keyup":_e=LM;break;case"focusin":je="focus",_e=Wp;break;case"focusout":je="blur",_e=Wp;break;case"beforeblur":case"afterblur":_e=Wp;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=t_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=EM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=BM;break;case w_:case __:case S_:_e=TM;break;case k_:_e=qM;break;case"scroll":_e=SM;break;case"wheel":_e=HM;break;case"copy":case"cut":case"paste":_e=jM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=n_}var Ne=(l&4)!==0,Kt=!Ne&&s==="scroll",Q=Ne?ce!==null?ce+"Capture":null:ce;Ne=[];for(var V=re,ee;V!==null;){ee=V;var pe=ee.stateNode;if(ee.tag===5&&pe!==null&&(ee=pe,Q!==null&&(pe=ye(V,Q),pe!=null&&Ne.push(Fl(V,pe,ee)))),Kt)break;V=V.return}0<Ne.length&&(ce=new _e(ce,je,null,f,ue),fe.push({event:ce,listeners:Ne}))}}if((l&7)===0){e:{if(ce=s==="mouseover"||s==="pointerover",_e=s==="mouseout"||s==="pointerout",ce&&f!==Nn&&(je=f.relatedTarget||f.fromElement)&&(to(je)||je[Ti]))break e;if((_e||ce)&&(ce=ue.window===ue?ue:(ce=ue.ownerDocument)?ce.defaultView||ce.parentWindow:window,_e?(je=f.relatedTarget||f.toElement,_e=re,je=je?to(je):null,je!==null&&(Kt=Ai(je),je!==Kt||je.tag!==5&&je.tag!==6)&&(je=null)):(_e=null,je=re),_e!==je)){if(Ne=t_,pe="onMouseLeave",Q="onMouseEnter",V="mouse",(s==="pointerout"||s==="pointerover")&&(Ne=n_,pe="onPointerLeave",Q="onPointerEnter",V="pointer"),Kt=_e==null?ce:ts(_e),ee=je==null?ce:ts(je),ce=new Ne(pe,V+"leave",_e,f,ue),ce.target=Kt,ce.relatedTarget=ee,pe=null,to(ue)===re&&(Ne=new Ne(Q,V+"enter",je,f,ue),Ne.target=ee,Ne.relatedTarget=Kt,pe=Ne),Kt=pe,_e&&je)t:{for(Ne=_e,Q=je,V=0,ee=Ne;ee;ee=Qo(ee))V++;for(ee=0,pe=Q;pe;pe=Qo(pe))ee++;for(;0<V-ee;)Ne=Qo(Ne),V--;for(;0<ee-V;)Q=Qo(Q),ee--;for(;V--;){if(Ne===Q||Q!==null&&Ne===Q.alternate)break t;Ne=Qo(Ne),Q=Qo(Q)}Ne=null}else Ne=null;_e!==null&&j_(fe,ce,_e,Ne,!1),je!==null&&Kt!==null&&j_(fe,Kt,je,Ne,!0)}}e:{if(ce=re?ts(re):window,_e=ce.nodeName&&ce.nodeName.toLowerCase(),_e==="select"||_e==="input"&&ce.type==="file")var Ie=JM;else if(c_(ce))if(d_)Ie=t3;else{Ie=QM;var Le=ZM}else(_e=ce.nodeName)&&_e.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ie=e3);if(Ie&&(Ie=Ie(s,re))){u_(fe,Ie,f,ue);break e}Le&&Le(s,ce,re),s==="focusout"&&(Le=ce._wrapperState)&&Le.controlled&&ce.type==="number"&&Bt(ce,"number",ce.value)}switch(Le=re?ts(re):window,s){case"focusin":(c_(Le)||Le.contentEditable==="true")&&(Jo=Le,Jp=re,Bl=null);break;case"focusout":Bl=Jp=Jo=null;break;case"mousedown":Zp=!0;break;case"contextmenu":case"mouseup":case"dragend":Zp=!1,b_(fe,f,ue);break;case"selectionchange":if(i3)break;case"keydown":case"keyup":b_(fe,f,ue)}var De;if(Kp)e:{switch(s){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Yo?s_(s,f)&&(We="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(We="onCompositionStart");We&&(i_&&f.locale!=="ko"&&(Yo||We!=="onCompositionStart"?We==="onCompositionEnd"&&Yo&&(De=Q1()):(fa=ue,Up="value"in fa?fa.value:fa.textContent,Yo=!0)),Le=od(re,We),0<Le.length&&(We=new r_(We,s,null,f,ue),fe.push({event:We,listeners:Le}),De?We.data=De:(De=l_(f),De!==null&&(We.data=De)))),(De=GM?KM(s,f):VM(s,f))&&(re=od(re,"onBeforeInput"),0<re.length&&(ue=new r_("onBeforeInput","beforeinput",null,f,ue),fe.push({event:ue,listeners:re}),ue.data=De))}T_(fe,l)})}function Fl(s,l,f){return{instance:s,listener:l,currentTarget:f}}function od(s,l){for(var f=l+"Capture",m=[];s!==null;){var w=s,S=w.stateNode;w.tag===5&&S!==null&&(w=S,S=ye(s,f),S!=null&&m.unshift(Fl(s,S,w)),S=ye(s,l),S!=null&&m.push(Fl(s,S,w))),s=s.return}return m}function Qo(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function j_(s,l,f,m,w){for(var S=l._reactName,P=[];f!==null&&f!==m;){var D=f,H=D.alternate,re=D.stateNode;if(H!==null&&H===m)break;D.tag===5&&re!==null&&(D=re,w?(H=ye(f,S),H!=null&&P.unshift(Fl(f,H,D))):w||(H=ye(f,S),H!=null&&P.push(Fl(f,H,D)))),f=f.return}P.length!==0&&s.push({event:l,listeners:P})}var l3=/\r\n?/g,c3=/\u0000|\uFFFD/g;function P_(s){return(typeof s=="string"?s:""+s).replace(l3,`
|
|
38
|
-
`).replace(c3,"")}function sd(s,l,f){if(l=P_(l),P_(s)!==l&&f)throw Error(r(425))}function ld(){}var im=null,am=null;function om(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var sm=typeof setTimeout=="function"?setTimeout:void 0,u3=typeof clearTimeout=="function"?clearTimeout:void 0,N_=typeof Promise=="function"?Promise:void 0,d3=typeof queueMicrotask=="function"?queueMicrotask:typeof N_<"u"?function(s){return N_.resolve(null).then(s).catch(f3)}:sm;function f3(s){setTimeout(function(){throw s})}function lm(s,l){var f=l,m=0;do{var w=f.nextSibling;if(s.removeChild(f),w&&w.nodeType===8)if(f=w.data,f==="/$"){if(m===0){s.removeChild(w),Rl(l);return}m--}else f!=="$"&&f!=="$?"&&f!=="$!"||m++;f=w}while(f);Rl(l)}function pa(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return s}function R_(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return s;l--}else f==="/$"&&l++}s=s.previousSibling}return null}var es=Math.random().toString(36).slice(2),di="__reactFiber$"+es,Hl="__reactProps$"+es,Ti="__reactContainer$"+es,cm="__reactEvents$"+es,h3="__reactListeners$"+es,p3="__reactHandles$"+es;function to(s){var l=s[di];if(l)return l;for(var f=s.parentNode;f;){if(l=f[Ti]||f[di]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(s=R_(s);s!==null;){if(f=s[di])return f;s=R_(s)}return l}s=f,f=s.parentNode}return null}function Wl(s){return s=s[di]||s[Ti],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function ts(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function cd(s){return s[Hl]||null}var um=[],rs=-1;function ma(s){return{current:s}}function jt(s){0>rs||(s.current=um[rs],um[rs]=null,rs--)}function Ot(s,l){rs++,um[rs]=s.current,s.current=l}var ga={},Er=ma(ga),Fr=ma(!1),ro=ga;function ns(s,l){var f=s.type.contextTypes;if(!f)return ga;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===l)return m.__reactInternalMemoizedMaskedChildContext;var w={},S;for(S in f)w[S]=l[S];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=l,s.__reactInternalMemoizedMaskedChildContext=w),w}function Hr(s){return s=s.childContextTypes,s!=null}function ud(){jt(Fr),jt(Er)}function I_(s,l,f){if(Er.current!==ga)throw Error(r(168));Ot(Er,l),Ot(Fr,f)}function $_(s,l,f){var m=s.stateNode;if(l=l.childContextTypes,typeof m.getChildContext!="function")return f;m=m.getChildContext();for(var w in m)if(!(w in l))throw Error(r(108,qe(s)||"Unknown",w));return q({},f,m)}function dd(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ga,ro=Er.current,Ot(Er,s),Ot(Fr,Fr.current),!0}function M_(s,l,f){var m=s.stateNode;if(!m)throw Error(r(169));f?(s=$_(s,l,ro),m.__reactInternalMemoizedMergedChildContext=s,jt(Fr),jt(Er),Ot(Er,s)):jt(Fr),Ot(Fr,f)}var Ci=null,fd=!1,dm=!1;function L_(s){Ci===null?Ci=[s]:Ci.push(s)}function m3(s){fd=!0,L_(s)}function ya(){if(!dm&&Ci!==null){dm=!0;var s=0,l=st;try{var f=Ci;for(st=1;s<f.length;s++){var m=f[s];do m=m(!0);while(m!==null)}Ci=null,fd=!1}catch(w){throw Ci!==null&&(Ci=Ci.slice(s+1)),Hu(Al,ya),w}finally{st=l,dm=!1}}return null}var is=[],as=0,hd=null,pd=0,gn=[],yn=0,no=null,ji=1,Pi="";function io(s,l){is[as++]=pd,is[as++]=hd,hd=s,pd=l}function D_(s,l,f){gn[yn++]=ji,gn[yn++]=Pi,gn[yn++]=no,no=s;var m=ji;s=Pi;var w=32-Lt(m)-1;m&=~(1<<w),f+=1;var S=32-Lt(l)+w;if(30<S){var P=w-w%5;S=(m&(1<<P)-1).toString(32),m>>=P,w-=P,ji=1<<32-Lt(l)+w|f<<w|m,Pi=S+s}else ji=1<<S|f<<w|m,Pi=s}function fm(s){s.return!==null&&(io(s,1),D_(s,1,0))}function hm(s){for(;s===hd;)hd=is[--as],is[as]=null,pd=is[--as],is[as]=null;for(;s===no;)no=gn[--yn],gn[yn]=null,Pi=gn[--yn],gn[yn]=null,ji=gn[--yn],gn[yn]=null}var en=null,tn=null,Nt=!1,$n=null;function z_(s,l){var f=wn(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=s,l=s.deletions,l===null?(s.deletions=[f],s.flags|=16):l.push(f)}function B_(s,l){switch(s.tag){case 5:var f=s.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(s.stateNode=l,en=s,tn=pa(l.firstChild),!0):!1;case 6:return l=s.pendingProps===""||l.nodeType!==3?null:l,l!==null?(s.stateNode=l,en=s,tn=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=no!==null?{id:ji,overflow:Pi}:null,s.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=wn(18,null,null,0),f.stateNode=l,f.return=s,s.child=f,en=s,tn=null,!0):!1;default:return!1}}function pm(s){return(s.mode&1)!==0&&(s.flags&128)===0}function mm(s){if(Nt){var l=tn;if(l){var f=l;if(!B_(s,l)){if(pm(s))throw Error(r(418));l=pa(f.nextSibling);var m=en;l&&B_(s,l)?z_(m,f):(s.flags=s.flags&-4097|2,Nt=!1,en=s)}}else{if(pm(s))throw Error(r(418));s.flags=s.flags&-4097|2,Nt=!1,en=s}}}function U_(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;en=s}function md(s){if(s!==en)return!1;if(!Nt)return U_(s),Nt=!0,!1;var l;if((l=s.tag!==3)&&!(l=s.tag!==5)&&(l=s.type,l=l!=="head"&&l!=="body"&&!om(s.type,s.memoizedProps)),l&&(l=tn)){if(pm(s))throw q_(),Error(r(418));for(;l;)z_(s,l),l=pa(l.nextSibling)}if(U_(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,l=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"){if(l===0){tn=pa(s.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}s=s.nextSibling}tn=null}}else tn=en?pa(s.stateNode.nextSibling):null;return!0}function q_(){for(var s=tn;s;)s=pa(s.nextSibling)}function os(){tn=en=null,Nt=!1}function gm(s){$n===null?$n=[s]:$n.push(s)}var g3=A.ReactCurrentBatchConfig;function Gl(s,l,f){if(s=f.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(r(309));var m=f.stateNode}if(!m)throw Error(r(147,s));var w=m,S=""+s;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===S?l.ref:(l=function(P){var D=w.refs;P===null?delete D[S]:D[S]=P},l._stringRef=S,l)}if(typeof s!="string")throw Error(r(284));if(!f._owner)throw Error(r(290,s))}return s}function gd(s,l){throw s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s))}function F_(s){var l=s._init;return l(s._payload)}function H_(s){function l(Q,V){if(s){var ee=Q.deletions;ee===null?(Q.deletions=[V],Q.flags|=16):ee.push(V)}}function f(Q,V){if(!s)return null;for(;V!==null;)l(Q,V),V=V.sibling;return null}function m(Q,V){for(Q=new Map;V!==null;)V.key!==null?Q.set(V.key,V):Q.set(V.index,V),V=V.sibling;return Q}function w(Q,V){return Q=Ea(Q,V),Q.index=0,Q.sibling=null,Q}function S(Q,V,ee){return Q.index=ee,s?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<V?(Q.flags|=2,V):ee):(Q.flags|=2,V)):(Q.flags|=1048576,V)}function P(Q){return s&&Q.alternate===null&&(Q.flags|=2),Q}function D(Q,V,ee,pe){return V===null||V.tag!==6?(V=sg(ee,Q.mode,pe),V.return=Q,V):(V=w(V,ee),V.return=Q,V)}function H(Q,V,ee,pe){var Ie=ee.type;return Ie===j?ue(Q,V,ee.props.children,pe,ee.key):V!==null&&(V.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===G&&F_(Ie)===V.type)?(pe=w(V,ee.props),pe.ref=Gl(Q,V,ee),pe.return=Q,pe):(pe=Bd(ee.type,ee.key,ee.props,null,Q.mode,pe),pe.ref=Gl(Q,V,ee),pe.return=Q,pe)}function re(Q,V,ee,pe){return V===null||V.tag!==4||V.stateNode.containerInfo!==ee.containerInfo||V.stateNode.implementation!==ee.implementation?(V=lg(ee,Q.mode,pe),V.return=Q,V):(V=w(V,ee.children||[]),V.return=Q,V)}function ue(Q,V,ee,pe,Ie){return V===null||V.tag!==7?(V=ho(ee,Q.mode,pe,Ie),V.return=Q,V):(V=w(V,ee),V.return=Q,V)}function fe(Q,V,ee){if(typeof V=="string"&&V!==""||typeof V=="number")return V=sg(""+V,Q.mode,ee),V.return=Q,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case T:return ee=Bd(V.type,V.key,V.props,null,Q.mode,ee),ee.ref=Gl(Q,null,V),ee.return=Q,ee;case C:return V=lg(V,Q.mode,ee),V.return=Q,V;case G:var pe=V._init;return fe(Q,pe(V._payload),ee)}if(Rr(V)||te(V))return V=ho(V,Q.mode,ee,null),V.return=Q,V;gd(Q,V)}return null}function ce(Q,V,ee,pe){var Ie=V!==null?V.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ie!==null?null:D(Q,V,""+ee,pe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case T:return ee.key===Ie?H(Q,V,ee,pe):null;case C:return ee.key===Ie?re(Q,V,ee,pe):null;case G:return Ie=ee._init,ce(Q,V,Ie(ee._payload),pe)}if(Rr(ee)||te(ee))return Ie!==null?null:ue(Q,V,ee,pe,null);gd(Q,ee)}return null}function _e(Q,V,ee,pe,Ie){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return Q=Q.get(ee)||null,D(V,Q,""+pe,Ie);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case T:return Q=Q.get(pe.key===null?ee:pe.key)||null,H(V,Q,pe,Ie);case C:return Q=Q.get(pe.key===null?ee:pe.key)||null,re(V,Q,pe,Ie);case G:var Le=pe._init;return _e(Q,V,ee,Le(pe._payload),Ie)}if(Rr(pe)||te(pe))return Q=Q.get(ee)||null,ue(V,Q,pe,Ie,null);gd(V,pe)}return null}function je(Q,V,ee,pe){for(var Ie=null,Le=null,De=V,We=V=0,hr=null;De!==null&&We<ee.length;We++){De.index>We?(hr=De,De=null):hr=De.sibling;var ut=ce(Q,De,ee[We],pe);if(ut===null){De===null&&(De=hr);break}s&&De&&ut.alternate===null&&l(Q,De),V=S(ut,V,We),Le===null?Ie=ut:Le.sibling=ut,Le=ut,De=hr}if(We===ee.length)return f(Q,De),Nt&&io(Q,We),Ie;if(De===null){for(;We<ee.length;We++)De=fe(Q,ee[We],pe),De!==null&&(V=S(De,V,We),Le===null?Ie=De:Le.sibling=De,Le=De);return Nt&&io(Q,We),Ie}for(De=m(Q,De);We<ee.length;We++)hr=_e(De,Q,We,ee[We],pe),hr!==null&&(s&&hr.alternate!==null&&De.delete(hr.key===null?We:hr.key),V=S(hr,V,We),Le===null?Ie=hr:Le.sibling=hr,Le=hr);return s&&De.forEach(function(Oa){return l(Q,Oa)}),Nt&&io(Q,We),Ie}function Ne(Q,V,ee,pe){var Ie=te(ee);if(typeof Ie!="function")throw Error(r(150));if(ee=Ie.call(ee),ee==null)throw Error(r(151));for(var Le=Ie=null,De=V,We=V=0,hr=null,ut=ee.next();De!==null&&!ut.done;We++,ut=ee.next()){De.index>We?(hr=De,De=null):hr=De.sibling;var Oa=ce(Q,De,ut.value,pe);if(Oa===null){De===null&&(De=hr);break}s&&De&&Oa.alternate===null&&l(Q,De),V=S(Oa,V,We),Le===null?Ie=Oa:Le.sibling=Oa,Le=Oa,De=hr}if(ut.done)return f(Q,De),Nt&&io(Q,We),Ie;if(De===null){for(;!ut.done;We++,ut=ee.next())ut=fe(Q,ut.value,pe),ut!==null&&(V=S(ut,V,We),Le===null?Ie=ut:Le.sibling=ut,Le=ut);return Nt&&io(Q,We),Ie}for(De=m(Q,De);!ut.done;We++,ut=ee.next())ut=_e(De,Q,We,ut.value,pe),ut!==null&&(s&&ut.alternate!==null&&De.delete(ut.key===null?We:ut.key),V=S(ut,V,We),Le===null?Ie=ut:Le.sibling=ut,Le=ut);return s&&De.forEach(function(X3){return l(Q,X3)}),Nt&&io(Q,We),Ie}function Kt(Q,V,ee,pe){if(typeof ee=="object"&&ee!==null&&ee.type===j&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case T:e:{for(var Ie=ee.key,Le=V;Le!==null;){if(Le.key===Ie){if(Ie=ee.type,Ie===j){if(Le.tag===7){f(Q,Le.sibling),V=w(Le,ee.props.children),V.return=Q,Q=V;break e}}else if(Le.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===G&&F_(Ie)===Le.type){f(Q,Le.sibling),V=w(Le,ee.props),V.ref=Gl(Q,Le,ee),V.return=Q,Q=V;break e}f(Q,Le);break}else l(Q,Le);Le=Le.sibling}ee.type===j?(V=ho(ee.props.children,Q.mode,pe,ee.key),V.return=Q,Q=V):(pe=Bd(ee.type,ee.key,ee.props,null,Q.mode,pe),pe.ref=Gl(Q,V,ee),pe.return=Q,Q=pe)}return P(Q);case C:e:{for(Le=ee.key;V!==null;){if(V.key===Le)if(V.tag===4&&V.stateNode.containerInfo===ee.containerInfo&&V.stateNode.implementation===ee.implementation){f(Q,V.sibling),V=w(V,ee.children||[]),V.return=Q,Q=V;break e}else{f(Q,V);break}else l(Q,V);V=V.sibling}V=lg(ee,Q.mode,pe),V.return=Q,Q=V}return P(Q);case G:return Le=ee._init,Kt(Q,V,Le(ee._payload),pe)}if(Rr(ee))return je(Q,V,ee,pe);if(te(ee))return Ne(Q,V,ee,pe);gd(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,V!==null&&V.tag===6?(f(Q,V.sibling),V=w(V,ee),V.return=Q,Q=V):(f(Q,V),V=sg(ee,Q.mode,pe),V.return=Q,Q=V),P(Q)):f(Q,V)}return Kt}var ss=H_(!0),W_=H_(!1),yd=ma(null),vd=null,ls=null,ym=null;function vm(){ym=ls=vd=null}function bm(s){var l=yd.current;jt(yd),s._currentValue=l}function xm(s,l,f){for(;s!==null;){var m=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),s===f)break;s=s.return}}function cs(s,l){vd=s,ym=ls=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&l)!==0&&(Wr=!0),s.firstContext=null)}function vn(s){var l=s._currentValue;if(ym!==s)if(s={context:s,memoizedValue:l,next:null},ls===null){if(vd===null)throw Error(r(308));ls=s,vd.dependencies={lanes:0,firstContext:s}}else ls=ls.next=s;return l}var ao=null;function wm(s){ao===null?ao=[s]:ao.push(s)}function G_(s,l,f,m){var w=l.interleaved;return w===null?(f.next=f,wm(l)):(f.next=w.next,w.next=f),l.interleaved=f,Ni(s,m)}function Ni(s,l){s.lanes|=l;var f=s.alternate;for(f!==null&&(f.lanes|=l),f=s,s=s.return;s!==null;)s.childLanes|=l,f=s.alternate,f!==null&&(f.childLanes|=l),f=s,s=s.return;return f.tag===3?f.stateNode:null}var va=!1;function _m(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K_(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Ri(s,l){return{eventTime:s,lane:l,tag:0,payload:null,callback:null,next:null}}function ba(s,l,f){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(lt&2)!==0){var w=m.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),m.pending=l,Ni(s,f)}return w=m.interleaved,w===null?(l.next=l,wm(m)):(l.next=w.next,w.next=l),m.interleaved=l,Ni(s,f)}function bd(s,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var m=l.lanes;m&=s.pendingLanes,f|=m,l.lanes=f,Cl(s,f)}}function V_(s,l){var f=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var w=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var P={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};S===null?w=S=P:S=S.next=P,f=f.next}while(f!==null);S===null?w=S=l:S=S.next=l}else w=S=l;f={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:S,shared:m.shared,effects:m.effects},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=l:s.next=l,f.lastBaseUpdate=l}function xd(s,l,f,m){var w=s.updateQueue;va=!1;var S=w.firstBaseUpdate,P=w.lastBaseUpdate,D=w.shared.pending;if(D!==null){w.shared.pending=null;var H=D,re=H.next;H.next=null,P===null?S=re:P.next=re,P=H;var ue=s.alternate;ue!==null&&(ue=ue.updateQueue,D=ue.lastBaseUpdate,D!==P&&(D===null?ue.firstBaseUpdate=re:D.next=re,ue.lastBaseUpdate=H))}if(S!==null){var fe=w.baseState;P=0,ue=re=H=null,D=S;do{var ce=D.lane,_e=D.eventTime;if((m&ce)===ce){ue!==null&&(ue=ue.next={eventTime:_e,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var je=s,Ne=D;switch(ce=l,_e=f,Ne.tag){case 1:if(je=Ne.payload,typeof je=="function"){fe=je.call(_e,fe,ce);break e}fe=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Ne.payload,ce=typeof je=="function"?je.call(_e,fe,ce):je,ce==null)break e;fe=q({},fe,ce);break e;case 2:va=!0}}D.callback!==null&&D.lane!==0&&(s.flags|=64,ce=w.effects,ce===null?w.effects=[D]:ce.push(D))}else _e={eventTime:_e,lane:ce,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ue===null?(re=ue=_e,H=fe):ue=ue.next=_e,P|=ce;if(D=D.next,D===null){if(D=w.shared.pending,D===null)break;ce=D,D=ce.next,ce.next=null,w.lastBaseUpdate=ce,w.shared.pending=null}}while(!0);if(ue===null&&(H=fe),w.baseState=H,w.firstBaseUpdate=re,w.lastBaseUpdate=ue,l=w.shared.interleaved,l!==null){w=l;do P|=w.lane,w=w.next;while(w!==l)}else S===null&&(w.shared.lanes=0);lo|=P,s.lanes=P,s.memoizedState=fe}}function X_(s,l,f){if(s=l.effects,l.effects=null,s!==null)for(l=0;l<s.length;l++){var m=s[l],w=m.callback;if(w!==null){if(m.callback=null,m=f,typeof w!="function")throw Error(r(191,w));w.call(m)}}}var Kl={},fi=ma(Kl),Vl=ma(Kl),Xl=ma(Kl);function oo(s){if(s===Kl)throw Error(r(174));return s}function Sm(s,l){switch(Ot(Xl,l),Ot(Vl,s),Ot(fi,Kl),s=l.nodeType,s){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:ii(null,"");break;default:s=s===8?l.parentNode:l,l=s.namespaceURI||null,s=s.tagName,l=ii(l,s)}jt(fi),Ot(fi,l)}function us(){jt(fi),jt(Vl),jt(Xl)}function Y_(s){oo(Xl.current);var l=oo(fi.current),f=ii(l,s.type);l!==f&&(Ot(Vl,s),Ot(fi,f))}function km(s){Vl.current===s&&(jt(fi),jt(Vl))}var Dt=ma(0);function wd(s){for(var l=s;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Em=[];function Om(){for(var s=0;s<Em.length;s++)Em[s]._workInProgressVersionPrimary=null;Em.length=0}var _d=A.ReactCurrentDispatcher,Am=A.ReactCurrentBatchConfig,so=0,zt=null,tr=null,dr=null,Sd=!1,Yl=!1,Jl=0,y3=0;function Or(){throw Error(r(321))}function Tm(s,l){if(l===null)return!1;for(var f=0;f<l.length&&f<s.length;f++)if(!In(s[f],l[f]))return!1;return!0}function Cm(s,l,f,m,w,S){if(so=S,zt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,_d.current=s===null||s.memoizedState===null?w3:_3,s=f(m,w),Yl){S=0;do{if(Yl=!1,Jl=0,25<=S)throw Error(r(301));S+=1,dr=tr=null,l.updateQueue=null,_d.current=S3,s=f(m,w)}while(Yl)}if(_d.current=Od,l=tr!==null&&tr.next!==null,so=0,dr=tr=zt=null,Sd=!1,l)throw Error(r(300));return s}function jm(){var s=Jl!==0;return Jl=0,s}function hi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dr===null?zt.memoizedState=dr=s:dr=dr.next=s,dr}function bn(){if(tr===null){var s=zt.alternate;s=s!==null?s.memoizedState:null}else s=tr.next;var l=dr===null?zt.memoizedState:dr.next;if(l!==null)dr=l,tr=s;else{if(s===null)throw Error(r(310));tr=s,s={memoizedState:tr.memoizedState,baseState:tr.baseState,baseQueue:tr.baseQueue,queue:tr.queue,next:null},dr===null?zt.memoizedState=dr=s:dr=dr.next=s}return dr}function Zl(s,l){return typeof l=="function"?l(s):l}function Pm(s){var l=bn(),f=l.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=s;var m=tr,w=m.baseQueue,S=f.pending;if(S!==null){if(w!==null){var P=w.next;w.next=S.next,S.next=P}m.baseQueue=w=S,f.pending=null}if(w!==null){S=w.next,m=m.baseState;var D=P=null,H=null,re=S;do{var ue=re.lane;if((so&ue)===ue)H!==null&&(H=H.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),m=re.hasEagerState?re.eagerState:s(m,re.action);else{var fe={lane:ue,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};H===null?(D=H=fe,P=m):H=H.next=fe,zt.lanes|=ue,lo|=ue}re=re.next}while(re!==null&&re!==S);H===null?P=m:H.next=D,In(m,l.memoizedState)||(Wr=!0),l.memoizedState=m,l.baseState=P,l.baseQueue=H,f.lastRenderedState=m}if(s=f.interleaved,s!==null){w=s;do S=w.lane,zt.lanes|=S,lo|=S,w=w.next;while(w!==s)}else w===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function Nm(s){var l=bn(),f=l.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=s;var m=f.dispatch,w=f.pending,S=l.memoizedState;if(w!==null){f.pending=null;var P=w=w.next;do S=s(S,P.action),P=P.next;while(P!==w);In(S,l.memoizedState)||(Wr=!0),l.memoizedState=S,l.baseQueue===null&&(l.baseState=S),f.lastRenderedState=S}return[S,m]}function J_(){}function Z_(s,l){var f=zt,m=bn(),w=l(),S=!In(m.memoizedState,w);if(S&&(m.memoizedState=w,Wr=!0),m=m.queue,Rm(tS.bind(null,f,m,s),[s]),m.getSnapshot!==l||S||dr!==null&&dr.memoizedState.tag&1){if(f.flags|=2048,Ql(9,eS.bind(null,f,m,w,l),void 0,null),fr===null)throw Error(r(349));(so&30)!==0||Q_(f,l,w)}return w}function Q_(s,l,f){s.flags|=16384,s={getSnapshot:l,value:f},l=zt.updateQueue,l===null?(l={lastEffect:null,stores:null},zt.updateQueue=l,l.stores=[s]):(f=l.stores,f===null?l.stores=[s]:f.push(s))}function eS(s,l,f,m){l.value=f,l.getSnapshot=m,rS(l)&&nS(s)}function tS(s,l,f){return f(function(){rS(l)&&nS(s)})}function rS(s){var l=s.getSnapshot;s=s.value;try{var f=l();return!In(s,f)}catch{return!0}}function nS(s){var l=Ni(s,1);l!==null&&zn(l,s,1,-1)}function iS(s){var l=hi();return typeof s=="function"&&(s=s()),l.memoizedState=l.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Zl,lastRenderedState:s},l.queue=s,s=s.dispatch=x3.bind(null,zt,s),[l.memoizedState,s]}function Ql(s,l,f,m){return s={tag:s,create:l,destroy:f,deps:m,next:null},l=zt.updateQueue,l===null?(l={lastEffect:null,stores:null},zt.updateQueue=l,l.lastEffect=s.next=s):(f=l.lastEffect,f===null?l.lastEffect=s.next=s:(m=f.next,f.next=s,s.next=m,l.lastEffect=s)),s}function aS(){return bn().memoizedState}function kd(s,l,f,m){var w=hi();zt.flags|=s,w.memoizedState=Ql(1|l,f,void 0,m===void 0?null:m)}function Ed(s,l,f,m){var w=bn();m=m===void 0?null:m;var S=void 0;if(tr!==null){var P=tr.memoizedState;if(S=P.destroy,m!==null&&Tm(m,P.deps)){w.memoizedState=Ql(l,f,S,m);return}}zt.flags|=s,w.memoizedState=Ql(1|l,f,S,m)}function oS(s,l){return kd(8390656,8,s,l)}function Rm(s,l){return Ed(2048,8,s,l)}function sS(s,l){return Ed(4,2,s,l)}function lS(s,l){return Ed(4,4,s,l)}function cS(s,l){if(typeof l=="function")return s=s(),l(s),function(){l(null)};if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function uS(s,l,f){return f=f!=null?f.concat([s]):null,Ed(4,4,cS.bind(null,l,s),f)}function Im(){}function dS(s,l){var f=bn();l=l===void 0?null:l;var m=f.memoizedState;return m!==null&&l!==null&&Tm(l,m[1])?m[0]:(f.memoizedState=[s,l],s)}function fS(s,l){var f=bn();l=l===void 0?null:l;var m=f.memoizedState;return m!==null&&l!==null&&Tm(l,m[1])?m[0]:(s=s(),f.memoizedState=[s,l],s)}function hS(s,l,f){return(so&21)===0?(s.baseState&&(s.baseState=!1,Wr=!0),s.memoizedState=f):(In(f,l)||(f=Ku(),zt.lanes|=f,lo|=f,s.baseState=!0),l)}function v3(s,l){var f=st;st=f!==0&&4>f?f:4,s(!0);var m=Am.transition;Am.transition={};try{s(!1),l()}finally{st=f,Am.transition=m}}function pS(){return bn().memoizedState}function b3(s,l,f){var m=Sa(s);if(f={lane:m,action:f,hasEagerState:!1,eagerState:null,next:null},mS(s))gS(l,f);else if(f=G_(s,l,f,m),f!==null){var w=zr();zn(f,s,m,w),yS(f,l,m)}}function x3(s,l,f){var m=Sa(s),w={lane:m,action:f,hasEagerState:!1,eagerState:null,next:null};if(mS(s))gS(l,w);else{var S=s.alternate;if(s.lanes===0&&(S===null||S.lanes===0)&&(S=l.lastRenderedReducer,S!==null))try{var P=l.lastRenderedState,D=S(P,f);if(w.hasEagerState=!0,w.eagerState=D,In(D,P)){var H=l.interleaved;H===null?(w.next=w,wm(l)):(w.next=H.next,H.next=w),l.interleaved=w;return}}catch{}finally{}f=G_(s,l,w,m),f!==null&&(w=zr(),zn(f,s,m,w),yS(f,l,m))}}function mS(s){var l=s.alternate;return s===zt||l!==null&&l===zt}function gS(s,l){Yl=Sd=!0;var f=s.pending;f===null?l.next=l:(l.next=f.next,f.next=l),s.pending=l}function yS(s,l,f){if((f&4194240)!==0){var m=l.lanes;m&=s.pendingLanes,f|=m,l.lanes=f,Cl(s,f)}}var Od={readContext:vn,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useInsertionEffect:Or,useLayoutEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useMutableSource:Or,useSyncExternalStore:Or,useId:Or,unstable_isNewReconciler:!1},w3={readContext:vn,useCallback:function(s,l){return hi().memoizedState=[s,l===void 0?null:l],s},useContext:vn,useEffect:oS,useImperativeHandle:function(s,l,f){return f=f!=null?f.concat([s]):null,kd(4194308,4,cS.bind(null,l,s),f)},useLayoutEffect:function(s,l){return kd(4194308,4,s,l)},useInsertionEffect:function(s,l){return kd(4,2,s,l)},useMemo:function(s,l){var f=hi();return l=l===void 0?null:l,s=s(),f.memoizedState=[s,l],s},useReducer:function(s,l,f){var m=hi();return l=f!==void 0?f(l):l,m.memoizedState=m.baseState=l,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:l},m.queue=s,s=s.dispatch=b3.bind(null,zt,s),[m.memoizedState,s]},useRef:function(s){var l=hi();return s={current:s},l.memoizedState=s},useState:iS,useDebugValue:Im,useDeferredValue:function(s){return hi().memoizedState=s},useTransition:function(){var s=iS(!1),l=s[0];return s=v3.bind(null,s[1]),hi().memoizedState=s,[l,s]},useMutableSource:function(){},useSyncExternalStore:function(s,l,f){var m=zt,w=hi();if(Nt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=l(),fr===null)throw Error(r(349));(so&30)!==0||Q_(m,l,f)}w.memoizedState=f;var S={value:f,getSnapshot:l};return w.queue=S,oS(tS.bind(null,m,S,s),[s]),m.flags|=2048,Ql(9,eS.bind(null,m,S,f,l),void 0,null),f},useId:function(){var s=hi(),l=fr.identifierPrefix;if(Nt){var f=Pi,m=ji;f=(m&~(1<<32-Lt(m)-1)).toString(32)+f,l=":"+l+"R"+f,f=Jl++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=y3++,l=":"+l+"r"+f.toString(32)+":";return s.memoizedState=l},unstable_isNewReconciler:!1},_3={readContext:vn,useCallback:dS,useContext:vn,useEffect:Rm,useImperativeHandle:uS,useInsertionEffect:sS,useLayoutEffect:lS,useMemo:fS,useReducer:Pm,useRef:aS,useState:function(){return Pm(Zl)},useDebugValue:Im,useDeferredValue:function(s){var l=bn();return hS(l,tr.memoizedState,s)},useTransition:function(){var s=Pm(Zl)[0],l=bn().memoizedState;return[s,l]},useMutableSource:J_,useSyncExternalStore:Z_,useId:pS,unstable_isNewReconciler:!1},S3={readContext:vn,useCallback:dS,useContext:vn,useEffect:Rm,useImperativeHandle:uS,useInsertionEffect:sS,useLayoutEffect:lS,useMemo:fS,useReducer:Nm,useRef:aS,useState:function(){return Nm(Zl)},useDebugValue:Im,useDeferredValue:function(s){var l=bn();return tr===null?l.memoizedState=s:hS(l,tr.memoizedState,s)},useTransition:function(){var s=Nm(Zl)[0],l=bn().memoizedState;return[s,l]},useMutableSource:J_,useSyncExternalStore:Z_,useId:pS,unstable_isNewReconciler:!1};function Mn(s,l){if(s&&s.defaultProps){l=q({},l),s=s.defaultProps;for(var f in s)l[f]===void 0&&(l[f]=s[f]);return l}return l}function $m(s,l,f,m){l=s.memoizedState,f=f(m,l),f=f==null?l:q({},l,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var Ad={isMounted:function(s){return(s=s._reactInternals)?Ai(s)===s:!1},enqueueSetState:function(s,l,f){s=s._reactInternals;var m=zr(),w=Sa(s),S=Ri(m,w);S.payload=l,f!=null&&(S.callback=f),l=ba(s,S,w),l!==null&&(zn(l,s,w,m),bd(l,s,w))},enqueueReplaceState:function(s,l,f){s=s._reactInternals;var m=zr(),w=Sa(s),S=Ri(m,w);S.tag=1,S.payload=l,f!=null&&(S.callback=f),l=ba(s,S,w),l!==null&&(zn(l,s,w,m),bd(l,s,w))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var f=zr(),m=Sa(s),w=Ri(f,m);w.tag=2,l!=null&&(w.callback=l),l=ba(s,w,m),l!==null&&(zn(l,s,m,f),bd(l,s,m))}};function vS(s,l,f,m,w,S,P){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,S,P):l.prototype&&l.prototype.isPureReactComponent?!zl(f,m)||!zl(w,S):!0}function bS(s,l,f){var m=!1,w=ga,S=l.contextType;return typeof S=="object"&&S!==null?S=vn(S):(w=Hr(l)?ro:Er.current,m=l.contextTypes,S=(m=m!=null)?ns(s,w):ga),l=new l(f,S),s.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Ad,s.stateNode=l,l._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=w,s.__reactInternalMemoizedMaskedChildContext=S),l}function xS(s,l,f,m){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,m),l.state!==s&&Ad.enqueueReplaceState(l,l.state,null)}function Mm(s,l,f,m){var w=s.stateNode;w.props=f,w.state=s.memoizedState,w.refs={},_m(s);var S=l.contextType;typeof S=="object"&&S!==null?w.context=vn(S):(S=Hr(l)?ro:Er.current,w.context=ns(s,S)),w.state=s.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&($m(s,l,S,f),w.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(l=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),l!==w.state&&Ad.enqueueReplaceState(w,w.state,null),xd(s,f,w,m),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308)}function ds(s,l){try{var f="",m=l;do f+=le(m),m=m.return;while(m);var w=f}catch(S){w=`
|
|
39
|
-
Error generating stack: `+S.message+`
|
|
40
|
-
`+S.stack}return{value:s,source:l,stack:w,digest:null}}function Lm(s,l,f){return{value:s,source:null,stack:f??null,digest:l??null}}function Dm(s,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var k3=typeof WeakMap=="function"?WeakMap:Map;function wS(s,l,f){f=Ri(-1,f),f.tag=3,f.payload={element:null};var m=l.value;return f.callback=function(){Id||(Id=!0,Qm=m),Dm(s,l)},f}function _S(s,l,f){f=Ri(-1,f),f.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var w=l.value;f.payload=function(){return m(w)},f.callback=function(){Dm(s,l)}}var S=s.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(f.callback=function(){Dm(s,l),typeof m!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})}),f}function SS(s,l,f){var m=s.pingCache;if(m===null){m=s.pingCache=new k3;var w=new Set;m.set(l,w)}else w=m.get(l),w===void 0&&(w=new Set,m.set(l,w));w.has(f)||(w.add(f),s=D3.bind(null,s,l,f),l.then(s,s))}function kS(s){do{var l;if((l=s.tag===13)&&(l=s.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return s;s=s.return}while(s!==null);return null}function ES(s,l,f,m,w){return(s.mode&1)===0?(s===l?s.flags|=65536:(s.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Ri(-1,1),l.tag=2,ba(f,l,1))),f.lanes|=1),s):(s.flags|=65536,s.lanes=w,s)}var E3=A.ReactCurrentOwner,Wr=!1;function Dr(s,l,f,m){l.child=s===null?W_(l,null,f,m):ss(l,s.child,f,m)}function OS(s,l,f,m,w){f=f.render;var S=l.ref;return cs(l,w),m=Cm(s,l,f,m,S,w),f=jm(),s!==null&&!Wr?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~w,Ii(s,l,w)):(Nt&&f&&fm(l),l.flags|=1,Dr(s,l,m,w),l.child)}function AS(s,l,f,m,w){if(s===null){var S=f.type;return typeof S=="function"&&!og(S)&&S.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=S,TS(s,l,S,m,w)):(s=Bd(f.type,null,m,l,l.mode,w),s.ref=l.ref,s.return=l,l.child=s)}if(S=s.child,(s.lanes&w)===0){var P=S.memoizedProps;if(f=f.compare,f=f!==null?f:zl,f(P,m)&&s.ref===l.ref)return Ii(s,l,w)}return l.flags|=1,s=Ea(S,m),s.ref=l.ref,s.return=l,l.child=s}function TS(s,l,f,m,w){if(s!==null){var S=s.memoizedProps;if(zl(S,m)&&s.ref===l.ref)if(Wr=!1,l.pendingProps=m=S,(s.lanes&w)!==0)(s.flags&131072)!==0&&(Wr=!0);else return l.lanes=s.lanes,Ii(s,l,w)}return zm(s,l,f,m,w)}function CS(s,l,f){var m=l.pendingProps,w=m.children,S=s!==null?s.memoizedState:null;if(m.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(hs,rn),rn|=f;else{if((f&1073741824)===0)return s=S!==null?S.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:s,cachePool:null,transitions:null},l.updateQueue=null,Ot(hs,rn),rn|=s,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=S!==null?S.baseLanes:f,Ot(hs,rn),rn|=m}else S!==null?(m=S.baseLanes|f,l.memoizedState=null):m=f,Ot(hs,rn),rn|=m;return Dr(s,l,w,f),l.child}function jS(s,l){var f=l.ref;(s===null&&f!==null||s!==null&&s.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function zm(s,l,f,m,w){var S=Hr(f)?ro:Er.current;return S=ns(l,S),cs(l,w),f=Cm(s,l,f,m,S,w),m=jm(),s!==null&&!Wr?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~w,Ii(s,l,w)):(Nt&&m&&fm(l),l.flags|=1,Dr(s,l,f,w),l.child)}function PS(s,l,f,m,w){if(Hr(f)){var S=!0;dd(l)}else S=!1;if(cs(l,w),l.stateNode===null)Cd(s,l),bS(l,f,m),Mm(l,f,m,w),m=!0;else if(s===null){var P=l.stateNode,D=l.memoizedProps;P.props=D;var H=P.context,re=f.contextType;typeof re=="object"&&re!==null?re=vn(re):(re=Hr(f)?ro:Er.current,re=ns(l,re));var ue=f.getDerivedStateFromProps,fe=typeof ue=="function"||typeof P.getSnapshotBeforeUpdate=="function";fe||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(D!==m||H!==re)&&xS(l,P,m,re),va=!1;var ce=l.memoizedState;P.state=ce,xd(l,m,P,w),H=l.memoizedState,D!==m||ce!==H||Fr.current||va?(typeof ue=="function"&&($m(l,f,ue,m),H=l.memoizedState),(D=va||vS(l,f,D,m,ce,H,re))?(fe||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(l.flags|=4194308)):(typeof P.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=H),P.props=m,P.state=H,P.context=re,m=D):(typeof P.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{P=l.stateNode,K_(s,l),D=l.memoizedProps,re=l.type===l.elementType?D:Mn(l.type,D),P.props=re,fe=l.pendingProps,ce=P.context,H=f.contextType,typeof H=="object"&&H!==null?H=vn(H):(H=Hr(f)?ro:Er.current,H=ns(l,H));var _e=f.getDerivedStateFromProps;(ue=typeof _e=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(D!==fe||ce!==H)&&xS(l,P,m,H),va=!1,ce=l.memoizedState,P.state=ce,xd(l,m,P,w);var je=l.memoizedState;D!==fe||ce!==je||Fr.current||va?(typeof _e=="function"&&($m(l,f,_e,m),je=l.memoizedState),(re=va||vS(l,f,re,m,ce,je,H)||!1)?(ue||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(m,je,H),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(m,je,H)),typeof P.componentDidUpdate=="function"&&(l.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof P.componentDidUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=je),P.props=m,P.state=je,P.context=H,m=re):(typeof P.componentDidUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),m=!1)}return Bm(s,l,f,m,S,w)}function Bm(s,l,f,m,w,S){jS(s,l);var P=(l.flags&128)!==0;if(!m&&!P)return w&&M_(l,f,!1),Ii(s,l,S);m=l.stateNode,E3.current=l;var D=P&&typeof f.getDerivedStateFromError!="function"?null:m.render();return l.flags|=1,s!==null&&P?(l.child=ss(l,s.child,null,S),l.child=ss(l,null,D,S)):Dr(s,l,D,S),l.memoizedState=m.state,w&&M_(l,f,!0),l.child}function NS(s){var l=s.stateNode;l.pendingContext?I_(s,l.pendingContext,l.pendingContext!==l.context):l.context&&I_(s,l.context,!1),Sm(s,l.containerInfo)}function RS(s,l,f,m,w){return os(),gm(w),l.flags|=256,Dr(s,l,f,m),l.child}var Um={dehydrated:null,treeContext:null,retryLane:0};function qm(s){return{baseLanes:s,cachePool:null,transitions:null}}function IS(s,l,f){var m=l.pendingProps,w=Dt.current,S=!1,P=(l.flags&128)!==0,D;if((D=P)||(D=s!==null&&s.memoizedState===null?!1:(w&2)!==0),D?(S=!0,l.flags&=-129):(s===null||s.memoizedState!==null)&&(w|=1),Ot(Dt,w&1),s===null)return mm(l),s=l.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((l.mode&1)===0?l.lanes=1:s.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(P=m.children,s=m.fallback,S?(m=l.mode,S=l.child,P={mode:"hidden",children:P},(m&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=P):S=Ud(P,m,0,null),s=ho(s,m,f,null),S.return=l,s.return=l,S.sibling=s,l.child=S,l.child.memoizedState=qm(f),l.memoizedState=Um,s):Fm(l,P));if(w=s.memoizedState,w!==null&&(D=w.dehydrated,D!==null))return O3(s,l,P,m,D,w,f);if(S){S=m.fallback,P=l.mode,w=s.child,D=w.sibling;var H={mode:"hidden",children:m.children};return(P&1)===0&&l.child!==w?(m=l.child,m.childLanes=0,m.pendingProps=H,l.deletions=null):(m=Ea(w,H),m.subtreeFlags=w.subtreeFlags&14680064),D!==null?S=Ea(D,S):(S=ho(S,P,f,null),S.flags|=2),S.return=l,m.return=l,m.sibling=S,l.child=m,m=S,S=l.child,P=s.child.memoizedState,P=P===null?qm(f):{baseLanes:P.baseLanes|f,cachePool:null,transitions:P.transitions},S.memoizedState=P,S.childLanes=s.childLanes&~f,l.memoizedState=Um,m}return S=s.child,s=S.sibling,m=Ea(S,{mode:"visible",children:m.children}),(l.mode&1)===0&&(m.lanes=f),m.return=l,m.sibling=null,s!==null&&(f=l.deletions,f===null?(l.deletions=[s],l.flags|=16):f.push(s)),l.child=m,l.memoizedState=null,m}function Fm(s,l){return l=Ud({mode:"visible",children:l},s.mode,0,null),l.return=s,s.child=l}function Td(s,l,f,m){return m!==null&&gm(m),ss(l,s.child,null,f),s=Fm(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function O3(s,l,f,m,w,S,P){if(f)return l.flags&256?(l.flags&=-257,m=Lm(Error(r(422))),Td(s,l,P,m)):l.memoizedState!==null?(l.child=s.child,l.flags|=128,null):(S=m.fallback,w=l.mode,m=Ud({mode:"visible",children:m.children},w,0,null),S=ho(S,w,P,null),S.flags|=2,m.return=l,S.return=l,m.sibling=S,l.child=m,(l.mode&1)!==0&&ss(l,s.child,null,P),l.child.memoizedState=qm(P),l.memoizedState=Um,S);if((l.mode&1)===0)return Td(s,l,P,null);if(w.data==="$!"){if(m=w.nextSibling&&w.nextSibling.dataset,m)var D=m.dgst;return m=D,S=Error(r(419)),m=Lm(S,m,void 0),Td(s,l,P,m)}if(D=(P&s.childLanes)!==0,Wr||D){if(m=fr,m!==null){switch(P&-P){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(m.suspendedLanes|P))!==0?0:w,w!==0&&w!==S.retryLane&&(S.retryLane=w,Ni(s,w),zn(m,s,w,-1))}return ag(),m=Lm(Error(r(421))),Td(s,l,P,m)}return w.data==="$?"?(l.flags|=128,l.child=s.child,l=z3.bind(null,s),w._reactRetry=l,null):(s=S.treeContext,tn=pa(w.nextSibling),en=l,Nt=!0,$n=null,s!==null&&(gn[yn++]=ji,gn[yn++]=Pi,gn[yn++]=no,ji=s.id,Pi=s.overflow,no=l),l=Fm(l,m.children),l.flags|=4096,l)}function $S(s,l,f){s.lanes|=l;var m=s.alternate;m!==null&&(m.lanes|=l),xm(s.return,l,f)}function Hm(s,l,f,m,w){var S=s.memoizedState;S===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:w}:(S.isBackwards=l,S.rendering=null,S.renderingStartTime=0,S.last=m,S.tail=f,S.tailMode=w)}function MS(s,l,f){var m=l.pendingProps,w=m.revealOrder,S=m.tail;if(Dr(s,l,m.children,f),m=Dt.current,(m&2)!==0)m=m&1|2,l.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&$S(s,f,l);else if(s.tag===19)$S(s,f,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(Ot(Dt,m),(l.mode&1)===0)l.memoizedState=null;else switch(w){case"forwards":for(f=l.child,w=null;f!==null;)s=f.alternate,s!==null&&wd(s)===null&&(w=f),f=f.sibling;f=w,f===null?(w=l.child,l.child=null):(w=f.sibling,f.sibling=null),Hm(l,!1,w,f,S);break;case"backwards":for(f=null,w=l.child,l.child=null;w!==null;){if(s=w.alternate,s!==null&&wd(s)===null){l.child=w;break}s=w.sibling,w.sibling=f,f=w,w=s}Hm(l,!0,f,null,S);break;case"together":Hm(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Cd(s,l){(l.mode&1)===0&&s!==null&&(s.alternate=null,l.alternate=null,l.flags|=2)}function Ii(s,l,f){if(s!==null&&(l.dependencies=s.dependencies),lo|=l.lanes,(f&l.childLanes)===0)return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,f=Ea(s,s.pendingProps),l.child=f,f.return=l;s.sibling!==null;)s=s.sibling,f=f.sibling=Ea(s,s.pendingProps),f.return=l;f.sibling=null}return l.child}function A3(s,l,f){switch(l.tag){case 3:NS(l),os();break;case 5:Y_(l);break;case 1:Hr(l.type)&&dd(l);break;case 4:Sm(l,l.stateNode.containerInfo);break;case 10:var m=l.type._context,w=l.memoizedProps.value;Ot(yd,m._currentValue),m._currentValue=w;break;case 13:if(m=l.memoizedState,m!==null)return m.dehydrated!==null?(Ot(Dt,Dt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?IS(s,l,f):(Ot(Dt,Dt.current&1),s=Ii(s,l,f),s!==null?s.sibling:null);Ot(Dt,Dt.current&1);break;case 19:if(m=(f&l.childLanes)!==0,(s.flags&128)!==0){if(m)return MS(s,l,f);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Ot(Dt,Dt.current),m)break;return null;case 22:case 23:return l.lanes=0,CS(s,l,f)}return Ii(s,l,f)}var LS,Wm,DS,zS;LS=function(s,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)s.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Wm=function(){},DS=function(s,l,f,m){var w=s.memoizedProps;if(w!==m){s=l.stateNode,oo(fi.current);var S=null;switch(f){case"input":w=Fe(s,w),m=Fe(s,m),S=[];break;case"select":w=q({},w,{value:void 0}),m=q({},m,{value:void 0}),S=[];break;case"textarea":w=_t(s,w),m=_t(s,m),S=[];break;default:typeof w.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=ld)}oa(f,m);var P;f=null;for(re in w)if(!m.hasOwnProperty(re)&&w.hasOwnProperty(re)&&w[re]!=null)if(re==="style"){var D=w[re];for(P in D)D.hasOwnProperty(P)&&(f||(f={}),f[P]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(i.hasOwnProperty(re)?S||(S=[]):(S=S||[]).push(re,null));for(re in m){var H=m[re];if(D=w!=null?w[re]:void 0,m.hasOwnProperty(re)&&H!==D&&(H!=null||D!=null))if(re==="style")if(D){for(P in D)!D.hasOwnProperty(P)||H&&H.hasOwnProperty(P)||(f||(f={}),f[P]="");for(P in H)H.hasOwnProperty(P)&&D[P]!==H[P]&&(f||(f={}),f[P]=H[P])}else f||(S||(S=[]),S.push(re,f)),f=H;else re==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,D=D?D.__html:void 0,H!=null&&D!==H&&(S=S||[]).push(re,H)):re==="children"?typeof H!="string"&&typeof H!="number"||(S=S||[]).push(re,""+H):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(i.hasOwnProperty(re)?(H!=null&&re==="onScroll"&&Ct("scroll",s),S||D===H||(S=[])):(S=S||[]).push(re,H))}f&&(S=S||[]).push("style",f);var re=S;(l.updateQueue=re)&&(l.flags|=4)}},zS=function(s,l,f,m){f!==m&&(l.flags|=4)};function ec(s,l){if(!Nt)switch(s.tailMode){case"hidden":l=s.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function Ar(s){var l=s.alternate!==null&&s.alternate.child===s.child,f=0,m=0;if(l)for(var w=s.child;w!==null;)f|=w.lanes|w.childLanes,m|=w.subtreeFlags&14680064,m|=w.flags&14680064,w.return=s,w=w.sibling;else for(w=s.child;w!==null;)f|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=m,s.childLanes=f,l}function T3(s,l,f){var m=l.pendingProps;switch(hm(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ar(l),null;case 1:return Hr(l.type)&&ud(),Ar(l),null;case 3:return m=l.stateNode,us(),jt(Fr),jt(Er),Om(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(md(l)?l.flags|=4:s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,$n!==null&&(rg($n),$n=null))),Wm(s,l),Ar(l),null;case 5:km(l);var w=oo(Xl.current);if(f=l.type,s!==null&&l.stateNode!=null)DS(s,l,f,m,w),s.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!m){if(l.stateNode===null)throw Error(r(166));return Ar(l),null}if(s=oo(fi.current),md(l)){m=l.stateNode,f=l.type;var S=l.memoizedProps;switch(m[di]=l,m[Hl]=S,s=(l.mode&1)!==0,f){case"dialog":Ct("cancel",m),Ct("close",m);break;case"iframe":case"object":case"embed":Ct("load",m);break;case"video":case"audio":for(w=0;w<Ul.length;w++)Ct(Ul[w],m);break;case"source":Ct("error",m);break;case"img":case"image":case"link":Ct("error",m),Ct("load",m);break;case"details":Ct("toggle",m);break;case"input":kt(m,S),Ct("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!S.multiple},Ct("invalid",m);break;case"textarea":kr(m,S),Ct("invalid",m)}oa(f,S),w=null;for(var P in S)if(S.hasOwnProperty(P)){var D=S[P];P==="children"?typeof D=="string"?m.textContent!==D&&(S.suppressHydrationWarning!==!0&&sd(m.textContent,D,s),w=["children",D]):typeof D=="number"&&m.textContent!==""+D&&(S.suppressHydrationWarning!==!0&&sd(m.textContent,D,s),w=["children",""+D]):i.hasOwnProperty(P)&&D!=null&&P==="onScroll"&&Ct("scroll",m)}switch(f){case"input":Me(m),Sr(m,S,!0);break;case"textarea":Me(m),ni(m);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(m.onclick=ld)}m=w,l.updateQueue=m,m!==null&&(l.flags|=4)}else{P=w.nodeType===9?w:w.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ur(f)),s==="http://www.w3.org/1999/xhtml"?f==="script"?(s=P.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=P.createElement(f,{is:m.is}):(s=P.createElement(f),f==="select"&&(P=s,m.multiple?P.multiple=!0:m.size&&(P.size=m.size))):s=P.createElementNS(s,f),s[di]=l,s[Hl]=m,LS(s,l,!1,!1),l.stateNode=s;e:{switch(P=Va(f,m),f){case"dialog":Ct("cancel",s),Ct("close",s),w=m;break;case"iframe":case"object":case"embed":Ct("load",s),w=m;break;case"video":case"audio":for(w=0;w<Ul.length;w++)Ct(Ul[w],s);w=m;break;case"source":Ct("error",s),w=m;break;case"img":case"image":case"link":Ct("error",s),Ct("load",s),w=m;break;case"details":Ct("toggle",s),w=m;break;case"input":kt(s,m),w=Fe(s,m),Ct("invalid",s);break;case"option":w=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},w=q({},m,{value:void 0}),Ct("invalid",s);break;case"textarea":kr(s,m),w=_t(s,m),Ct("invalid",s);break;default:w=m}oa(f,w),D=w;for(S in D)if(D.hasOwnProperty(S)){var H=D[S];S==="style"?Ka(s,H):S==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&aa(s,H)):S==="children"?typeof H=="string"?(f!=="textarea"||H!=="")&&qr(s,H):typeof H=="number"&&qr(s,""+H):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(i.hasOwnProperty(S)?H!=null&&S==="onScroll"&&Ct("scroll",s):H!=null&&O(s,S,H,P))}switch(f){case"input":Me(s),Sr(s,m,!1);break;case"textarea":Me(s),ni(s);break;case"option":m.value!=null&&s.setAttribute("value",""+xe(m.value));break;case"select":s.multiple=!!m.multiple,S=m.value,S!=null?lr(s,!!m.multiple,S,!1):m.defaultValue!=null&&lr(s,!!m.multiple,m.defaultValue,!0);break;default:typeof w.onClick=="function"&&(s.onclick=ld)}switch(f){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Ar(l),null;case 6:if(s&&l.stateNode!=null)zS(s,l,s.memoizedProps,m);else{if(typeof m!="string"&&l.stateNode===null)throw Error(r(166));if(f=oo(Xl.current),oo(fi.current),md(l)){if(m=l.stateNode,f=l.memoizedProps,m[di]=l,(S=m.nodeValue!==f)&&(s=en,s!==null))switch(s.tag){case 3:sd(m.nodeValue,f,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&sd(m.nodeValue,f,(s.mode&1)!==0)}S&&(l.flags|=4)}else m=(f.nodeType===9?f:f.ownerDocument).createTextNode(m),m[di]=l,l.stateNode=m}return Ar(l),null;case 13:if(jt(Dt),m=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Nt&&tn!==null&&(l.mode&1)!==0&&(l.flags&128)===0)q_(),os(),l.flags|=98560,S=!1;else if(S=md(l),m!==null&&m.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=l.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[di]=l}else os(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ar(l),S=!1}else $n!==null&&(rg($n),$n=null),S=!0;if(!S)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(l.child.flags|=8192,(l.mode&1)!==0&&(s===null||(Dt.current&1)!==0?rr===0&&(rr=3):ag())),l.updateQueue!==null&&(l.flags|=4),Ar(l),null);case 4:return us(),Wm(s,l),s===null&&ql(l.stateNode.containerInfo),Ar(l),null;case 10:return bm(l.type._context),Ar(l),null;case 17:return Hr(l.type)&&ud(),Ar(l),null;case 19:if(jt(Dt),S=l.memoizedState,S===null)return Ar(l),null;if(m=(l.flags&128)!==0,P=S.rendering,P===null)if(m)ec(S,!1);else{if(rr!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(P=wd(s),P!==null){for(l.flags|=128,ec(S,!1),m=P.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),l.subtreeFlags=0,m=f,f=l.child;f!==null;)S=f,s=m,S.flags&=14680066,P=S.alternate,P===null?(S.childLanes=0,S.lanes=s,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=P.childLanes,S.lanes=P.lanes,S.child=P.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=P.memoizedProps,S.memoizedState=P.memoizedState,S.updateQueue=P.updateQueue,S.type=P.type,s=P.dependencies,S.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),f=f.sibling;return Ot(Dt,Dt.current&1|2),l.child}s=s.sibling}S.tail!==null&&Mt()>ps&&(l.flags|=128,m=!0,ec(S,!1),l.lanes=4194304)}else{if(!m)if(s=wd(P),s!==null){if(l.flags|=128,m=!0,f=s.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),ec(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!Nt)return Ar(l),null}else 2*Mt()-S.renderingStartTime>ps&&f!==1073741824&&(l.flags|=128,m=!0,ec(S,!1),l.lanes=4194304);S.isBackwards?(P.sibling=l.child,l.child=P):(f=S.last,f!==null?f.sibling=P:l.child=P,S.last=P)}return S.tail!==null?(l=S.tail,S.rendering=l,S.tail=l.sibling,S.renderingStartTime=Mt(),l.sibling=null,f=Dt.current,Ot(Dt,m?f&1|2:f&1),l):(Ar(l),null);case 22:case 23:return ig(),m=l.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(l.flags|=8192),m&&(l.mode&1)!==0?(rn&1073741824)!==0&&(Ar(l),l.subtreeFlags&6&&(l.flags|=8192)):Ar(l),null;case 24:return null;case 25:return null}throw Error(r(156,l.tag))}function C3(s,l){switch(hm(l),l.tag){case 1:return Hr(l.type)&&ud(),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return us(),jt(Fr),jt(Er),Om(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 5:return km(l),null;case 13:if(jt(Dt),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));os()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return jt(Dt),null;case 4:return us(),null;case 10:return bm(l.type._context),null;case 22:case 23:return ig(),null;case 24:return null;default:return null}}var jd=!1,Tr=!1,j3=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function fs(s,l){var f=s.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(m){qt(s,l,m)}else f.current=null}function Gm(s,l,f){try{f()}catch(m){qt(s,l,m)}}var BS=!1;function P3(s,l){if(im=Yu,s=v_(),Yp(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var w=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var P=0,D=-1,H=-1,re=0,ue=0,fe=s,ce=null;t:for(;;){for(var _e;fe!==f||w!==0&&fe.nodeType!==3||(D=P+w),fe!==S||m!==0&&fe.nodeType!==3||(H=P+m),fe.nodeType===3&&(P+=fe.nodeValue.length),(_e=fe.firstChild)!==null;)ce=fe,fe=_e;for(;;){if(fe===s)break t;if(ce===f&&++re===w&&(D=P),ce===S&&++ue===m&&(H=P),(_e=fe.nextSibling)!==null)break;fe=ce,ce=fe.parentNode}fe=_e}f=D===-1||H===-1?null:{start:D,end:H}}else f=null}f=f||{start:0,end:0}}else f=null;for(am={focusedElem:s,selectionRange:f},Yu=!1,Oe=l;Oe!==null;)if(l=Oe,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Oe=s;else for(;Oe!==null;){l=Oe;try{var je=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(je!==null){var Ne=je.memoizedProps,Kt=je.memoizedState,Q=l.stateNode,V=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Ne:Mn(l.type,Ne),Kt);Q.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var ee=l.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(pe){qt(l,l.return,pe)}if(s=l.sibling,s!==null){s.return=l.return,Oe=s;break}Oe=l.return}return je=BS,BS=!1,je}function tc(s,l,f){var m=l.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var w=m=m.next;do{if((w.tag&s)===s){var S=w.destroy;w.destroy=void 0,S!==void 0&&Gm(l,f,S)}w=w.next}while(w!==m)}}function Pd(s,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&s)===s){var m=f.create;f.destroy=m()}f=f.next}while(f!==l)}}function Km(s){var l=s.ref;if(l!==null){var f=s.stateNode;switch(s.tag){case 5:s=f;break;default:s=f}typeof l=="function"?l(s):l.current=s}}function US(s){var l=s.alternate;l!==null&&(s.alternate=null,US(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&(delete l[di],delete l[Hl],delete l[cm],delete l[h3],delete l[p3])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function qS(s){return s.tag===5||s.tag===3||s.tag===4}function FS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||qS(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Vm(s,l,f){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(s,l):f.insertBefore(s,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(s,f)):(l=f,l.appendChild(s)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=ld));else if(m!==4&&(s=s.child,s!==null))for(Vm(s,l,f),s=s.sibling;s!==null;)Vm(s,l,f),s=s.sibling}function Xm(s,l,f){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?f.insertBefore(s,l):f.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(Xm(s,l,f),s=s.sibling;s!==null;)Xm(s,l,f),s=s.sibling}var yr=null,Ln=!1;function xa(s,l,f){for(f=f.child;f!==null;)HS(s,l,f),f=f.sibling}function HS(s,l,f){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(Ve,f)}catch{}switch(f.tag){case 5:Tr||fs(f,l);case 6:var m=yr,w=Ln;yr=null,xa(s,l,f),yr=m,Ln=w,yr!==null&&(Ln?(s=yr,f=f.stateNode,s.nodeType===8?s.parentNode.removeChild(f):s.removeChild(f)):yr.removeChild(f.stateNode));break;case 18:yr!==null&&(Ln?(s=yr,f=f.stateNode,s.nodeType===8?lm(s.parentNode,f):s.nodeType===1&&lm(s,f),Rl(s)):lm(yr,f.stateNode));break;case 4:m=yr,w=Ln,yr=f.stateNode.containerInfo,Ln=!0,xa(s,l,f),yr=m,Ln=w;break;case 0:case 11:case 14:case 15:if(!Tr&&(m=f.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){w=m=m.next;do{var S=w,P=S.destroy;S=S.tag,P!==void 0&&((S&2)!==0||(S&4)!==0)&&Gm(f,l,P),w=w.next}while(w!==m)}xa(s,l,f);break;case 1:if(!Tr&&(fs(f,l),m=f.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=f.memoizedProps,m.state=f.memoizedState,m.componentWillUnmount()}catch(D){qt(f,l,D)}xa(s,l,f);break;case 21:xa(s,l,f);break;case 22:f.mode&1?(Tr=(m=Tr)||f.memoizedState!==null,xa(s,l,f),Tr=m):xa(s,l,f);break;default:xa(s,l,f)}}function WS(s){var l=s.updateQueue;if(l!==null){s.updateQueue=null;var f=s.stateNode;f===null&&(f=s.stateNode=new j3),l.forEach(function(m){var w=B3.bind(null,s,m);f.has(m)||(f.add(m),m.then(w,w))})}}function Dn(s,l){var f=l.deletions;if(f!==null)for(var m=0;m<f.length;m++){var w=f[m];try{var S=s,P=l,D=P;e:for(;D!==null;){switch(D.tag){case 5:yr=D.stateNode,Ln=!1;break e;case 3:yr=D.stateNode.containerInfo,Ln=!0;break e;case 4:yr=D.stateNode.containerInfo,Ln=!0;break e}D=D.return}if(yr===null)throw Error(r(160));HS(S,P,w),yr=null,Ln=!1;var H=w.alternate;H!==null&&(H.return=null),w.return=null}catch(re){qt(w,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)GS(l,s),l=l.sibling}function GS(s,l){var f=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Dn(l,s),pi(s),m&4){try{tc(3,s,s.return),Pd(3,s)}catch(Ne){qt(s,s.return,Ne)}try{tc(5,s,s.return)}catch(Ne){qt(s,s.return,Ne)}}break;case 1:Dn(l,s),pi(s),m&512&&f!==null&&fs(f,f.return);break;case 5:if(Dn(l,s),pi(s),m&512&&f!==null&&fs(f,f.return),s.flags&32){var w=s.stateNode;try{qr(w,"")}catch(Ne){qt(s,s.return,Ne)}}if(m&4&&(w=s.stateNode,w!=null)){var S=s.memoizedProps,P=f!==null?f.memoizedProps:S,D=s.type,H=s.updateQueue;if(s.updateQueue=null,H!==null)try{D==="input"&&S.type==="radio"&&S.name!=null&&wt(w,S),Va(D,P);var re=Va(D,S);for(P=0;P<H.length;P+=2){var ue=H[P],fe=H[P+1];ue==="style"?Ka(w,fe):ue==="dangerouslySetInnerHTML"?aa(w,fe):ue==="children"?qr(w,fe):O(w,ue,fe,re)}switch(D){case"input":Et(w,S);break;case"textarea":Ir(w,S);break;case"select":var ce=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!S.multiple;var _e=S.value;_e!=null?lr(w,!!S.multiple,_e,!1):ce!==!!S.multiple&&(S.defaultValue!=null?lr(w,!!S.multiple,S.defaultValue,!0):lr(w,!!S.multiple,S.multiple?[]:"",!1))}w[Hl]=S}catch(Ne){qt(s,s.return,Ne)}}break;case 6:if(Dn(l,s),pi(s),m&4){if(s.stateNode===null)throw Error(r(162));w=s.stateNode,S=s.memoizedProps;try{w.nodeValue=S}catch(Ne){qt(s,s.return,Ne)}}break;case 3:if(Dn(l,s),pi(s),m&4&&f!==null&&f.memoizedState.isDehydrated)try{Rl(l.containerInfo)}catch(Ne){qt(s,s.return,Ne)}break;case 4:Dn(l,s),pi(s);break;case 13:Dn(l,s),pi(s),w=s.child,w.flags&8192&&(S=w.memoizedState!==null,w.stateNode.isHidden=S,!S||w.alternate!==null&&w.alternate.memoizedState!==null||(Zm=Mt())),m&4&&WS(s);break;case 22:if(ue=f!==null&&f.memoizedState!==null,s.mode&1?(Tr=(re=Tr)||ue,Dn(l,s),Tr=re):Dn(l,s),pi(s),m&8192){if(re=s.memoizedState!==null,(s.stateNode.isHidden=re)&&!ue&&(s.mode&1)!==0)for(Oe=s,ue=s.child;ue!==null;){for(fe=Oe=ue;Oe!==null;){switch(ce=Oe,_e=ce.child,ce.tag){case 0:case 11:case 14:case 15:tc(4,ce,ce.return);break;case 1:fs(ce,ce.return);var je=ce.stateNode;if(typeof je.componentWillUnmount=="function"){m=ce,f=ce.return;try{l=m,je.props=l.memoizedProps,je.state=l.memoizedState,je.componentWillUnmount()}catch(Ne){qt(m,f,Ne)}}break;case 5:fs(ce,ce.return);break;case 22:if(ce.memoizedState!==null){XS(fe);continue}}_e!==null?(_e.return=ce,Oe=_e):XS(fe)}ue=ue.sibling}e:for(ue=null,fe=s;;){if(fe.tag===5){if(ue===null){ue=fe;try{w=fe.stateNode,re?(S=w.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(D=fe.stateNode,H=fe.memoizedProps.style,P=H!=null&&H.hasOwnProperty("display")?H.display:null,D.style.display=Fo("display",P))}catch(Ne){qt(s,s.return,Ne)}}}else if(fe.tag===6){if(ue===null)try{fe.stateNode.nodeValue=re?"":fe.memoizedProps}catch(Ne){qt(s,s.return,Ne)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===s)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===s)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===s)break e;ue===fe&&(ue=null),fe=fe.return}ue===fe&&(ue=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Dn(l,s),pi(s),m&4&&WS(s);break;case 21:break;default:Dn(l,s),pi(s)}}function pi(s){var l=s.flags;if(l&2){try{e:{for(var f=s.return;f!==null;){if(qS(f)){var m=f;break e}f=f.return}throw Error(r(160))}switch(m.tag){case 5:var w=m.stateNode;m.flags&32&&(qr(w,""),m.flags&=-33);var S=FS(s);Xm(s,S,w);break;case 3:case 4:var P=m.stateNode.containerInfo,D=FS(s);Vm(s,D,P);break;default:throw Error(r(161))}}catch(H){qt(s,s.return,H)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function N3(s,l,f){Oe=s,KS(s)}function KS(s,l,f){for(var m=(s.mode&1)!==0;Oe!==null;){var w=Oe,S=w.child;if(w.tag===22&&m){var P=w.memoizedState!==null||jd;if(!P){var D=w.alternate,H=D!==null&&D.memoizedState!==null||Tr;D=jd;var re=Tr;if(jd=P,(Tr=H)&&!re)for(Oe=w;Oe!==null;)P=Oe,H=P.child,P.tag===22&&P.memoizedState!==null?YS(w):H!==null?(H.return=P,Oe=H):YS(w);for(;S!==null;)Oe=S,KS(S),S=S.sibling;Oe=w,jd=D,Tr=re}VS(s)}else(w.subtreeFlags&8772)!==0&&S!==null?(S.return=w,Oe=S):VS(s)}}function VS(s){for(;Oe!==null;){var l=Oe;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Tr||Pd(5,l);break;case 1:var m=l.stateNode;if(l.flags&4&&!Tr)if(f===null)m.componentDidMount();else{var w=l.elementType===l.type?f.memoizedProps:Mn(l.type,f.memoizedProps);m.componentDidUpdate(w,f.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var S=l.updateQueue;S!==null&&X_(l,S,m);break;case 3:var P=l.updateQueue;if(P!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}X_(l,P,f)}break;case 5:var D=l.stateNode;if(f===null&&l.flags&4){f=D;var H=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&f.focus();break;case"img":H.src&&(f.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var ue=re.memoizedState;if(ue!==null){var fe=ue.dehydrated;fe!==null&&Rl(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Tr||l.flags&512&&Km(l)}catch(ce){qt(l,l.return,ce)}}if(l===s){Oe=null;break}if(f=l.sibling,f!==null){f.return=l.return,Oe=f;break}Oe=l.return}}function XS(s){for(;Oe!==null;){var l=Oe;if(l===s){Oe=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Oe=f;break}Oe=l.return}}function YS(s){for(;Oe!==null;){var l=Oe;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{Pd(4,l)}catch(H){qt(l,f,H)}break;case 1:var m=l.stateNode;if(typeof m.componentDidMount=="function"){var w=l.return;try{m.componentDidMount()}catch(H){qt(l,w,H)}}var S=l.return;try{Km(l)}catch(H){qt(l,S,H)}break;case 5:var P=l.return;try{Km(l)}catch(H){qt(l,P,H)}}}catch(H){qt(l,l.return,H)}if(l===s){Oe=null;break}var D=l.sibling;if(D!==null){D.return=l.return,Oe=D;break}Oe=l.return}}var R3=Math.ceil,Nd=A.ReactCurrentDispatcher,Ym=A.ReactCurrentOwner,xn=A.ReactCurrentBatchConfig,lt=0,fr=null,Yt=null,vr=0,rn=0,hs=ma(0),rr=0,rc=null,lo=0,Rd=0,Jm=0,nc=null,Gr=null,Zm=0,ps=1/0,$i=null,Id=!1,Qm=null,wa=null,$d=!1,_a=null,Md=0,ic=0,eg=null,Ld=-1,Dd=0;function zr(){return(lt&6)!==0?Mt():Ld!==-1?Ld:Ld=Mt()}function Sa(s){return(s.mode&1)===0?1:(lt&2)!==0&&vr!==0?vr&-vr:g3.transition!==null?(Dd===0&&(Dd=Ku()),Dd):(s=st,s!==0||(s=window.event,s=s===void 0?16:Z1(s.type)),s)}function zn(s,l,f,m){if(50<ic)throw ic=0,eg=null,Error(r(185));ua(s,f,m),((lt&2)===0||s!==fr)&&(s===fr&&((lt&2)===0&&(Rd|=f),rr===4&&ka(s,vr)),Kr(s,m),f===1&<===0&&(l.mode&1)===0&&(ps=Mt()+500,fd&&ya()))}function Kr(s,l){var f=s.callbackNode;Lp(s,l);var m=Za(s,s===fr?vr:0);if(m===0)f!==null&&Rn(f),s.callbackNode=null,s.callbackPriority=0;else if(l=m&-m,s.callbackPriority!==l){if(f!=null&&Rn(f),l===1)s.tag===0?m3(ZS.bind(null,s)):L_(ZS.bind(null,s)),d3(function(){(lt&6)===0&&ya()}),f=null;else{switch(Ge(m)){case 1:f=Al;break;case 4:f=Ya;break;case 16:f=Go;break;case 536870912:f=$e;break;default:f=Go}f=ok(f,JS.bind(null,s))}s.callbackPriority=l,s.callbackNode=f}}function JS(s,l){if(Ld=-1,Dd=0,(lt&6)!==0)throw Error(r(327));var f=s.callbackNode;if(ms()&&s.callbackNode!==f)return null;var m=Za(s,s===fr?vr:0);if(m===0)return null;if((m&30)!==0||(m&s.expiredLanes)!==0||l)l=zd(s,m);else{l=m;var w=lt;lt|=2;var S=ek();(fr!==s||vr!==l)&&($i=null,ps=Mt()+500,uo(s,l));do try{M3();break}catch(D){QS(s,D)}while(!0);vm(),Nd.current=S,lt=w,Yt!==null?l=0:(fr=null,vr=0,l=rr)}if(l!==0){if(l===2&&(w=Tl(s),w!==0&&(m=w,l=tg(s,w))),l===1)throw f=rc,uo(s,0),ka(s,m),Kr(s,Mt()),f;if(l===6)ka(s,m);else{if(w=s.current.alternate,(m&30)===0&&!I3(w)&&(l=zd(s,m),l===2&&(S=Tl(s),S!==0&&(m=S,l=tg(s,S))),l===1))throw f=rc,uo(s,0),ka(s,m),Kr(s,Mt()),f;switch(s.finishedWork=w,s.finishedLanes=m,l){case 0:case 1:throw Error(r(345));case 2:fo(s,Gr,$i);break;case 3:if(ka(s,m),(m&130023424)===m&&(l=Zm+500-Mt(),10<l)){if(Za(s,0)!==0)break;if(w=s.suspendedLanes,(w&m)!==m){zr(),s.pingedLanes|=s.suspendedLanes&w;break}s.timeoutHandle=sm(fo.bind(null,s,Gr,$i),l);break}fo(s,Gr,$i);break;case 4:if(ka(s,m),(m&4194240)===m)break;for(l=s.eventTimes,w=-1;0<m;){var P=31-Lt(m);S=1<<P,P=l[P],P>w&&(w=P),m&=~S}if(m=w,m=Mt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*R3(m/1960))-m,10<m){s.timeoutHandle=sm(fo.bind(null,s,Gr,$i),m);break}fo(s,Gr,$i);break;case 5:fo(s,Gr,$i);break;default:throw Error(r(329))}}}return Kr(s,Mt()),s.callbackNode===f?JS.bind(null,s):null}function tg(s,l){var f=nc;return s.current.memoizedState.isDehydrated&&(uo(s,l).flags|=256),s=zd(s,l),s!==2&&(l=Gr,Gr=f,l!==null&&rg(l)),s}function rg(s){Gr===null?Gr=s:Gr.push.apply(Gr,s)}function I3(s){for(var l=s;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var m=0;m<f.length;m++){var w=f[m],S=w.getSnapshot;w=w.value;try{if(!In(S(),w))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ka(s,l){for(l&=~Jm,l&=~Rd,s.suspendedLanes|=l,s.pingedLanes&=~l,s=s.expirationTimes;0<l;){var f=31-Lt(l),m=1<<f;s[f]=-1,l&=~m}}function ZS(s){if((lt&6)!==0)throw Error(r(327));ms();var l=Za(s,0);if((l&1)===0)return Kr(s,Mt()),null;var f=zd(s,l);if(s.tag!==0&&f===2){var m=Tl(s);m!==0&&(l=m,f=tg(s,m))}if(f===1)throw f=rc,uo(s,0),ka(s,l),Kr(s,Mt()),f;if(f===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=l,fo(s,Gr,$i),Kr(s,Mt()),null}function ng(s,l){var f=lt;lt|=1;try{return s(l)}finally{lt=f,lt===0&&(ps=Mt()+500,fd&&ya())}}function co(s){_a!==null&&_a.tag===0&&(lt&6)===0&&ms();var l=lt;lt|=1;var f=xn.transition,m=st;try{if(xn.transition=null,st=1,s)return s()}finally{st=m,xn.transition=f,lt=l,(lt&6)===0&&ya()}}function ig(){rn=hs.current,jt(hs)}function uo(s,l){s.finishedWork=null,s.finishedLanes=0;var f=s.timeoutHandle;if(f!==-1&&(s.timeoutHandle=-1,u3(f)),Yt!==null)for(f=Yt.return;f!==null;){var m=f;switch(hm(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&ud();break;case 3:us(),jt(Fr),jt(Er),Om();break;case 5:km(m);break;case 4:us();break;case 13:jt(Dt);break;case 19:jt(Dt);break;case 10:bm(m.type._context);break;case 22:case 23:ig()}f=f.return}if(fr=s,Yt=s=Ea(s.current,null),vr=rn=l,rr=0,rc=null,Jm=Rd=lo=0,Gr=nc=null,ao!==null){for(l=0;l<ao.length;l++)if(f=ao[l],m=f.interleaved,m!==null){f.interleaved=null;var w=m.next,S=f.pending;if(S!==null){var P=S.next;S.next=w,m.next=P}f.pending=m}ao=null}return s}function QS(s,l){do{var f=Yt;try{if(vm(),_d.current=Od,Sd){for(var m=zt.memoizedState;m!==null;){var w=m.queue;w!==null&&(w.pending=null),m=m.next}Sd=!1}if(so=0,dr=tr=zt=null,Yl=!1,Jl=0,Ym.current=null,f===null||f.return===null){rr=1,rc=l,Yt=null;break}e:{var S=s,P=f.return,D=f,H=l;if(l=vr,D.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var re=H,ue=D,fe=ue.tag;if((ue.mode&1)===0&&(fe===0||fe===11||fe===15)){var ce=ue.alternate;ce?(ue.updateQueue=ce.updateQueue,ue.memoizedState=ce.memoizedState,ue.lanes=ce.lanes):(ue.updateQueue=null,ue.memoizedState=null)}var _e=kS(P);if(_e!==null){_e.flags&=-257,ES(_e,P,D,S,l),_e.mode&1&&SS(S,re,l),l=_e,H=re;var je=l.updateQueue;if(je===null){var Ne=new Set;Ne.add(H),l.updateQueue=Ne}else je.add(H);break e}else{if((l&1)===0){SS(S,re,l),ag();break e}H=Error(r(426))}}else if(Nt&&D.mode&1){var Kt=kS(P);if(Kt!==null){(Kt.flags&65536)===0&&(Kt.flags|=256),ES(Kt,P,D,S,l),gm(ds(H,D));break e}}S=H=ds(H,D),rr!==4&&(rr=2),nc===null?nc=[S]:nc.push(S),S=P;do{switch(S.tag){case 3:S.flags|=65536,l&=-l,S.lanes|=l;var Q=wS(S,H,l);V_(S,Q);break e;case 1:D=H;var V=S.type,ee=S.stateNode;if((S.flags&128)===0&&(typeof V.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(wa===null||!wa.has(ee)))){S.flags|=65536,l&=-l,S.lanes|=l;var pe=_S(S,D,l);V_(S,pe);break e}}S=S.return}while(S!==null)}rk(f)}catch(Ie){l=Ie,Yt===f&&f!==null&&(Yt=f=f.return);continue}break}while(!0)}function ek(){var s=Nd.current;return Nd.current=Od,s===null?Od:s}function ag(){(rr===0||rr===3||rr===2)&&(rr=4),fr===null||(lo&268435455)===0&&(Rd&268435455)===0||ka(fr,vr)}function zd(s,l){var f=lt;lt|=2;var m=ek();(fr!==s||vr!==l)&&($i=null,uo(s,l));do try{$3();break}catch(w){QS(s,w)}while(!0);if(vm(),lt=f,Nd.current=m,Yt!==null)throw Error(r(261));return fr=null,vr=0,rr}function $3(){for(;Yt!==null;)tk(Yt)}function M3(){for(;Yt!==null&&!Wu();)tk(Yt)}function tk(s){var l=ak(s.alternate,s,rn);s.memoizedProps=s.pendingProps,l===null?rk(s):Yt=l,Ym.current=null}function rk(s){var l=s;do{var f=l.alternate;if(s=l.return,(l.flags&32768)===0){if(f=T3(f,l,rn),f!==null){Yt=f;return}}else{if(f=C3(f,l),f!==null){f.flags&=32767,Yt=f;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{rr=6,Yt=null;return}}if(l=l.sibling,l!==null){Yt=l;return}Yt=l=s}while(l!==null);rr===0&&(rr=5)}function fo(s,l,f){var m=st,w=xn.transition;try{xn.transition=null,st=1,L3(s,l,f,m)}finally{xn.transition=w,st=m}return null}function L3(s,l,f,m){do ms();while(_a!==null);if((lt&6)!==0)throw Error(r(327));f=s.finishedWork;var w=s.finishedLanes;if(f===null)return null;if(s.finishedWork=null,s.finishedLanes=0,f===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var S=f.lanes|f.childLanes;if(mn(s,S),s===fr&&(Yt=fr=null,vr=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||$d||($d=!0,ok(Go,function(){return ms(),null})),S=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||S){S=xn.transition,xn.transition=null;var P=st;st=1;var D=lt;lt|=4,Ym.current=null,P3(s,f),GS(f,s),n3(am),Yu=!!im,am=im=null,s.current=f,N3(f),Gu(),lt=D,st=P,xn.transition=S}else s.current=f;if($d&&($d=!1,_a=s,Md=w),S=s.pendingLanes,S===0&&(wa=null),Wt(f.stateNode),Kr(s,Mt()),l!==null)for(m=s.onRecoverableError,f=0;f<l.length;f++)w=l[f],m(w.value,{componentStack:w.stack,digest:w.digest});if(Id)throw Id=!1,s=Qm,Qm=null,s;return(Md&1)!==0&&s.tag!==0&&ms(),S=s.pendingLanes,(S&1)!==0?s===eg?ic++:(ic=0,eg=s):ic=0,ya(),null}function ms(){if(_a!==null){var s=Ge(Md),l=xn.transition,f=st;try{if(xn.transition=null,st=16>s?16:s,_a===null)var m=!1;else{if(s=_a,_a=null,Md=0,(lt&6)!==0)throw Error(r(331));var w=lt;for(lt|=4,Oe=s.current;Oe!==null;){var S=Oe,P=S.child;if((Oe.flags&16)!==0){var D=S.deletions;if(D!==null){for(var H=0;H<D.length;H++){var re=D[H];for(Oe=re;Oe!==null;){var ue=Oe;switch(ue.tag){case 0:case 11:case 15:tc(8,ue,S)}var fe=ue.child;if(fe!==null)fe.return=ue,Oe=fe;else for(;Oe!==null;){ue=Oe;var ce=ue.sibling,_e=ue.return;if(US(ue),ue===re){Oe=null;break}if(ce!==null){ce.return=_e,Oe=ce;break}Oe=_e}}}var je=S.alternate;if(je!==null){var Ne=je.child;if(Ne!==null){je.child=null;do{var Kt=Ne.sibling;Ne.sibling=null,Ne=Kt}while(Ne!==null)}}Oe=S}}if((S.subtreeFlags&2064)!==0&&P!==null)P.return=S,Oe=P;else e:for(;Oe!==null;){if(S=Oe,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:tc(9,S,S.return)}var Q=S.sibling;if(Q!==null){Q.return=S.return,Oe=Q;break e}Oe=S.return}}var V=s.current;for(Oe=V;Oe!==null;){P=Oe;var ee=P.child;if((P.subtreeFlags&2064)!==0&&ee!==null)ee.return=P,Oe=ee;else e:for(P=V;Oe!==null;){if(D=Oe,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Pd(9,D)}}catch(Ie){qt(D,D.return,Ie)}if(D===P){Oe=null;break e}var pe=D.sibling;if(pe!==null){pe.return=D.return,Oe=pe;break e}Oe=D.return}}if(lt=w,ya(),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(Ve,s)}catch{}m=!0}return m}finally{st=f,xn.transition=l}}return!1}function nk(s,l,f){l=ds(f,l),l=wS(s,l,1),s=ba(s,l,1),l=zr(),s!==null&&(ua(s,1,l),Kr(s,l))}function qt(s,l,f){if(s.tag===3)nk(s,s,f);else for(;l!==null;){if(l.tag===3){nk(l,s,f);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(wa===null||!wa.has(m))){s=ds(f,s),s=_S(l,s,1),l=ba(l,s,1),s=zr(),l!==null&&(ua(l,1,s),Kr(l,s));break}}l=l.return}}function D3(s,l,f){var m=s.pingCache;m!==null&&m.delete(l),l=zr(),s.pingedLanes|=s.suspendedLanes&f,fr===s&&(vr&f)===f&&(rr===4||rr===3&&(vr&130023424)===vr&&500>Mt()-Zm?uo(s,0):Jm|=f),Kr(s,l)}function ik(s,l){l===0&&((s.mode&1)===0?l=1:(l=Ja,Ja<<=1,(Ja&130023424)===0&&(Ja=4194304)));var f=zr();s=Ni(s,l),s!==null&&(ua(s,l,f),Kr(s,f))}function z3(s){var l=s.memoizedState,f=0;l!==null&&(f=l.retryLane),ik(s,f)}function B3(s,l){var f=0;switch(s.tag){case 13:var m=s.stateNode,w=s.memoizedState;w!==null&&(f=w.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(r(314))}m!==null&&m.delete(l),ik(s,f)}var ak;ak=function(s,l,f){if(s!==null)if(s.memoizedProps!==l.pendingProps||Fr.current)Wr=!0;else{if((s.lanes&f)===0&&(l.flags&128)===0)return Wr=!1,A3(s,l,f);Wr=(s.flags&131072)!==0}else Wr=!1,Nt&&(l.flags&1048576)!==0&&D_(l,pd,l.index);switch(l.lanes=0,l.tag){case 2:var m=l.type;Cd(s,l),s=l.pendingProps;var w=ns(l,Er.current);cs(l,f),w=Cm(null,l,m,s,w,f);var S=jm();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Hr(m)?(S=!0,dd(l)):S=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,_m(l),w.updater=Ad,l.stateNode=w,w._reactInternals=l,Mm(l,m,s,f),l=Bm(null,l,m,!0,S,f)):(l.tag=0,Nt&&S&&fm(l),Dr(null,l,w,f),l=l.child),l;case 16:m=l.elementType;e:{switch(Cd(s,l),s=l.pendingProps,w=m._init,m=w(m._payload),l.type=m,w=l.tag=q3(m),s=Mn(m,s),w){case 0:l=zm(null,l,m,s,f);break e;case 1:l=PS(null,l,m,s,f);break e;case 11:l=OS(null,l,m,s,f);break e;case 14:l=AS(null,l,m,Mn(m.type,s),f);break e}throw Error(r(306,m,""))}return l;case 0:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Mn(m,w),zm(s,l,m,w,f);case 1:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Mn(m,w),PS(s,l,m,w,f);case 3:e:{if(NS(l),s===null)throw Error(r(387));m=l.pendingProps,S=l.memoizedState,w=S.element,K_(s,l),xd(l,m,null,f);var P=l.memoizedState;if(m=P.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},l.updateQueue.baseState=S,l.memoizedState=S,l.flags&256){w=ds(Error(r(423)),l),l=RS(s,l,m,f,w);break e}else if(m!==w){w=ds(Error(r(424)),l),l=RS(s,l,m,f,w);break e}else for(tn=pa(l.stateNode.containerInfo.firstChild),en=l,Nt=!0,$n=null,f=W_(l,null,m,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(os(),m===w){l=Ii(s,l,f);break e}Dr(s,l,m,f)}l=l.child}return l;case 5:return Y_(l),s===null&&mm(l),m=l.type,w=l.pendingProps,S=s!==null?s.memoizedProps:null,P=w.children,om(m,w)?P=null:S!==null&&om(m,S)&&(l.flags|=32),jS(s,l),Dr(s,l,P,f),l.child;case 6:return s===null&&mm(l),null;case 13:return IS(s,l,f);case 4:return Sm(l,l.stateNode.containerInfo),m=l.pendingProps,s===null?l.child=ss(l,null,m,f):Dr(s,l,m,f),l.child;case 11:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Mn(m,w),OS(s,l,m,w,f);case 7:return Dr(s,l,l.pendingProps,f),l.child;case 8:return Dr(s,l,l.pendingProps.children,f),l.child;case 12:return Dr(s,l,l.pendingProps.children,f),l.child;case 10:e:{if(m=l.type._context,w=l.pendingProps,S=l.memoizedProps,P=w.value,Ot(yd,m._currentValue),m._currentValue=P,S!==null)if(In(S.value,P)){if(S.children===w.children&&!Fr.current){l=Ii(s,l,f);break e}}else for(S=l.child,S!==null&&(S.return=l);S!==null;){var D=S.dependencies;if(D!==null){P=S.child;for(var H=D.firstContext;H!==null;){if(H.context===m){if(S.tag===1){H=Ri(-1,f&-f),H.tag=2;var re=S.updateQueue;if(re!==null){re=re.shared;var ue=re.pending;ue===null?H.next=H:(H.next=ue.next,ue.next=H),re.pending=H}}S.lanes|=f,H=S.alternate,H!==null&&(H.lanes|=f),xm(S.return,f,l),D.lanes|=f;break}H=H.next}}else if(S.tag===10)P=S.type===l.type?null:S.child;else if(S.tag===18){if(P=S.return,P===null)throw Error(r(341));P.lanes|=f,D=P.alternate,D!==null&&(D.lanes|=f),xm(P,f,l),P=S.sibling}else P=S.child;if(P!==null)P.return=S;else for(P=S;P!==null;){if(P===l){P=null;break}if(S=P.sibling,S!==null){S.return=P.return,P=S;break}P=P.return}S=P}Dr(s,l,w.children,f),l=l.child}return l;case 9:return w=l.type,m=l.pendingProps.children,cs(l,f),w=vn(w),m=m(w),l.flags|=1,Dr(s,l,m,f),l.child;case 14:return m=l.type,w=Mn(m,l.pendingProps),w=Mn(m.type,w),AS(s,l,m,w,f);case 15:return TS(s,l,l.type,l.pendingProps,f);case 17:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Mn(m,w),Cd(s,l),l.tag=1,Hr(m)?(s=!0,dd(l)):s=!1,cs(l,f),bS(l,m,w),Mm(l,m,w,f),Bm(null,l,m,!0,s,f);case 19:return MS(s,l,f);case 22:return CS(s,l,f)}throw Error(r(156,l.tag))};function ok(s,l){return Hu(s,l)}function U3(s,l,f,m){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(s,l,f,m){return new U3(s,l,f,m)}function og(s){return s=s.prototype,!(!s||!s.isReactComponent)}function q3(s){if(typeof s=="function")return og(s)?1:0;if(s!=null){if(s=s.$$typeof,s===B)return 11;if(s===U)return 14}return 2}function Ea(s,l){var f=s.alternate;return f===null?(f=wn(s.tag,l,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=l,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&14680064,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,l=s.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f}function Bd(s,l,f,m,w,S){var P=2;if(m=s,typeof s=="function")og(s)&&(P=1);else if(typeof s=="string")P=5;else e:switch(s){case j:return ho(f.children,w,S,l);case R:P=8,w|=8;break;case M:return s=wn(12,f,l,w|2),s.elementType=M,s.lanes=S,s;case X:return s=wn(13,f,l,w),s.elementType=X,s.lanes=S,s;case K:return s=wn(19,f,l,w),s.elementType=K,s.lanes=S,s;case J:return Ud(f,w,S,l);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case Y:P=10;break e;case W:P=9;break e;case B:P=11;break e;case U:P=14;break e;case G:P=16,m=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return l=wn(P,f,l,w),l.elementType=s,l.type=m,l.lanes=S,l}function ho(s,l,f,m){return s=wn(7,s,m,l),s.lanes=f,s}function Ud(s,l,f,m){return s=wn(22,s,m,l),s.elementType=J,s.lanes=f,s.stateNode={isHidden:!1},s}function sg(s,l,f){return s=wn(6,s,null,l),s.lanes=f,s}function lg(s,l,f){return l=wn(4,s.children!==null?s.children:[],s.key,l),l.lanes=f,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}function F3(s,l,f,m,w){this.tag=l,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ca(0),this.expirationTimes=ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ca(0),this.identifierPrefix=m,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function cg(s,l,f,m,w,S,P,D,H){return s=new F3(s,l,f,D,H),l===1?(l=1,S===!0&&(l|=8)):l=0,S=wn(3,null,null,l),s.current=S,S.stateNode=s,S.memoizedState={element:m,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},_m(S),s}function H3(s,l,f){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:C,key:m==null?null:""+m,children:s,containerInfo:l,implementation:f}}function sk(s){if(!s)return ga;s=s._reactInternals;e:{if(Ai(s)!==s||s.tag!==1)throw Error(r(170));var l=s;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Hr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(r(171))}if(s.tag===1){var f=s.type;if(Hr(f))return $_(s,f,l)}return l}function lk(s,l,f,m,w,S,P,D,H){return s=cg(f,m,!0,s,w,S,P,D,H),s.context=sk(null),f=s.current,m=zr(),w=Sa(f),S=Ri(m,w),S.callback=l??null,ba(f,S,w),s.current.lanes=w,ua(s,w,m),Kr(s,m),s}function qd(s,l,f,m){var w=l.current,S=zr(),P=Sa(w);return f=sk(f),l.context===null?l.context=f:l.pendingContext=f,l=Ri(S,P),l.payload={element:s},m=m===void 0?null:m,m!==null&&(l.callback=m),s=ba(w,l,P),s!==null&&(zn(s,w,P,S),bd(s,w,P)),P}function Fd(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function ck(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<l?f:l}}function ug(s,l){ck(s,l),(s=s.alternate)&&ck(s,l)}function W3(){return null}var uk=typeof reportError=="function"?reportError:function(s){console.error(s)};function dg(s){this._internalRoot=s}Hd.prototype.render=dg.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));qd(s,l,null,null)},Hd.prototype.unmount=dg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;co(function(){qd(null,s,null,null)}),l[Ti]=null}};function Hd(s){this._internalRoot=s}Hd.prototype.unstable_scheduleHydration=function(s){if(s){var l=Qa();s={blockedOn:null,target:s,priority:l};for(var f=0;f<ur.length&&l!==0&&l<ur[f].priority;f++);ur.splice(f,0,s),f===0&&Y1(s)}};function fg(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Wd(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function dk(){}function G3(s,l,f,m,w){if(w){if(typeof m=="function"){var S=m;m=function(){var re=Fd(P);S.call(re)}}var P=lk(l,m,s,0,null,!1,!1,"",dk);return s._reactRootContainer=P,s[Ti]=P.current,ql(s.nodeType===8?s.parentNode:s),co(),P}for(;w=s.lastChild;)s.removeChild(w);if(typeof m=="function"){var D=m;m=function(){var re=Fd(H);D.call(re)}}var H=cg(s,0,!1,null,null,!1,!1,"",dk);return s._reactRootContainer=H,s[Ti]=H.current,ql(s.nodeType===8?s.parentNode:s),co(function(){qd(l,H,f,m)}),H}function Gd(s,l,f,m,w){var S=f._reactRootContainer;if(S){var P=S;if(typeof w=="function"){var D=w;w=function(){var H=Fd(P);D.call(H)}}qd(l,P,s,w)}else P=G3(f,l,s,w,m);return Fd(P)}jl=function(s){switch(s.tag){case 3:var l=s.stateNode;if(l.current.memoizedState.isDehydrated){var f=la(l.pendingLanes);f!==0&&(Cl(l,f|1),Kr(l,Mt()),(lt&6)===0&&(ps=Mt()+500,ya()))}break;case 13:co(function(){var m=Ni(s,1);if(m!==null){var w=zr();zn(m,s,1,w)}}),ug(s,1)}},Gt=function(s){if(s.tag===13){var l=Ni(s,134217728);if(l!==null){var f=zr();zn(l,s,134217728,f)}ug(s,134217728)}},yt=function(s){if(s.tag===13){var l=Sa(s),f=Ni(s,l);if(f!==null){var m=zr();zn(f,s,l,m)}ug(s,l)}},Qa=function(){return st},ui=function(s,l){var f=st;try{return st=s,l()}finally{st=f}},sa=function(s,l,f){switch(l){case"input":if(Et(s,f),l=f.name,f.type==="radio"&&l!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var m=f[l];if(m!==s&&m.form===s.form){var w=cd(m);if(!w)throw Error(r(90));oe(m),Et(m,w)}}}break;case"textarea":Ir(s,f);break;case"select":l=f.value,l!=null&&lr(s,!!f.multiple,l,!1)}},de=ng,Re=co;var K3={usingClientEntryPoint:!1,Events:[Wl,ts,cd,$,ne,ng]},ac={findFiberByHostInstance:to,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},V3={bundleType:ac.bundleType,version:ac.version,rendererPackageName:ac.rendererPackageName,rendererConfig:ac.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=qu(s),s===null?null:s.stateNode},findFiberByHostInstance:ac.findFiberByHostInstance||W3,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 Kd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kd.isDisabled&&Kd.supportsFiber)try{Ve=Kd.inject(V3),Ze=Kd}catch{}}return Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K3,Vr.createPortal=function(s,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fg(l))throw Error(r(200));return H3(s,l,null,f)},Vr.createRoot=function(s,l){if(!fg(s))throw Error(r(299));var f=!1,m="",w=uk;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=cg(s,1,!1,null,null,f,!1,m,w),s[Ti]=l.current,ql(s.nodeType===8?s.parentNode:s),new dg(l)},Vr.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=qu(l),s=s===null?null:s.stateNode,s},Vr.flushSync=function(s){return co(s)},Vr.hydrate=function(s,l,f){if(!Wd(l))throw Error(r(200));return Gd(null,s,l,!0,f)},Vr.hydrateRoot=function(s,l,f){if(!fg(s))throw Error(r(405));var m=f!=null&&f.hydratedSources||null,w=!1,S="",P=uk;if(f!=null&&(f.unstable_strictMode===!0&&(w=!0),f.identifierPrefix!==void 0&&(S=f.identifierPrefix),f.onRecoverableError!==void 0&&(P=f.onRecoverableError)),l=lk(l,null,s,1,f??null,w,!1,S,P),s[Ti]=l.current,ql(s),m)for(s=0;s<m.length;s++)f=m[s],w=f._getVersion,w=w(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,w]:l.mutableSourceEagerHydrationData.push(f,w);return new Hd(l)},Vr.render=function(s,l,f){if(!Wd(l))throw Error(r(200));return Gd(null,s,l,!1,f)},Vr.unmountComponentAtNode=function(s){if(!Wd(s))throw Error(r(40));return s._reactRootContainer?(co(function(){Gd(null,null,s,!1,function(){s._reactRootContainer=null,s[Ti]=null})}),!0):!1},Vr.unstable_batchedUpdates=ng,Vr.unstable_renderSubtreeIntoContainer=function(s,l,f,m){if(!Wd(f))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return Gd(s,l,f,!1,m)},Vr.version="18.3.1-next-f1338f8080-20240426",Vr}var bk;function mP(){if(bk)return mg.exports;bk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),mg.exports=nL(),mg.exports}var xk;function iL(){if(xk)return Xd;xk=1;var t=mP();return Xd.createRoot=t.createRoot,Xd.hydrateRoot=t.hydrateRoot,Xd}var aL=iL();/**
|
|
41
|
-
* react-router v7.16.0
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/var wk="popstate";function _k(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function oL(t={}){function e(n,i){var d;let a=(d=i.state)==null?void 0:d.masked,{pathname:o,search:c,hash:u}=a||n.location;return jb("",{pathname:o,search:c,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,i){return typeof i=="string"?i:Mc(i)}return lL(e,r,null,t)}function $t(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ei(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function sL(){return Math.random().toString(36).substring(2,10)}function Sk(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function jb(t,e,r=null,n,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?dl(e):e,state:r,key:e&&e.key||n||sL(),mask:i}}function Mc({pathname:t="/",search:e="",hash:r=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function dl(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substring(r),t=t.substring(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substring(n),t=t.substring(0,n)),t&&(e.pathname=t)}return e}function lL(t,e,r,n={}){let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,c="POP",u=null,d=p();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function p(){return(o.state||{idx:null}).idx}function h(){c="POP";let b=p(),k=b==null?null:b-d;d=b,u&&u({action:c,location:_.location,delta:k})}function g(b,k){c="PUSH";let E=_k(b)?b:jb(_.location,b,k);d=p()+1;let O=Sk(E,d),A=_.createHref(E.mask||E);try{o.pushState(O,"",A)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(A)}a&&u&&u({action:c,location:_.location,delta:1})}function v(b,k){c="REPLACE";let E=_k(b)?b:jb(_.location,b,k);d=p();let O=Sk(E,d),A=_.createHref(E.mask||E);o.replaceState(O,"",A),a&&u&&u({action:c,location:_.location,delta:0})}function x(b){return cL(i,b)}let _={get action(){return c},get location(){return t(i,o)},listen(b){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(wk,h),u=b,()=>{i.removeEventListener(wk,h),u=null}},createHref(b){return e(i,b)},createURL:x,encodeLocation(b){let k=x(b);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:g,replace:v,go(b){return o.go(b)}};return _}function cL(t,e,r=!1){let n="http://localhost";t&&(n=t.location.origin!=="null"?t.location.origin:t.location.href),$t(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Mc(e);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function gP(t,e,r="/"){return uL(t,e,r,!1)}function uL(t,e,r,n,i){let a=typeof e=="string"?dl(e):e,o=Xi(a.pathname||"/",r);if(o==null)return null;let c=dL(t),u=null,d=SL(o);for(let p=0;u==null&&p<c.length;++p)u=wL(c[p],d,n);return u}function dL(t){let e=yP(t);return fL(e),e}function yP(t,e=[],r=[],n="",i=!1){let a=(o,c,u=i,d)=>{let p={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&u)return;$t(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let h=Qn([n,p.relativePath]),g=r.concat(p);o.children&&o.children.length>0&&($t(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),yP(o.children,e,g,h,u)),!(o.path==null&&!o.index)&&e.push({path:h,score:bL(h,o.index),routesMeta:g})};return t.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,c);else for(let d of vP(o.path))a(o,c,!0,d)}),e}function vP(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=vP(n.join("/")),c=[];return c.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&c.push(...o),c.map(u=>t.startsWith("/")&&u===""?"/":u)}function fL(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:xL(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var hL=/^:[\w-]+$/,pL=3,mL=2,gL=1,yL=10,vL=-2,kk=t=>t==="*";function bL(t,e){let r=t.split("/"),n=r.length;return r.some(kk)&&(n+=vL),e&&(n+=mL),r.filter(i=>!kk(i)).reduce((i,a)=>i+(hL.test(a)?pL:a===""?gL:yL),n)}function xL(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function wL(t,e,r=!1){let{routesMeta:n}=t,i={},a="/",o=[];for(let c=0;c<n.length;++c){let u=n[c],d=c===n.length-1,p=a==="/"?e:e.slice(a.length)||"/",h=Af({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},p),g=u.route;if(!h&&d&&r&&!n[n.length-1].route.index&&(h=Af({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!h)return null;Object.assign(i,h.params),o.push({params:i,pathname:Qn([a,h.pathname]),pathnameBase:AL(Qn([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=Qn([a,h.pathnameBase]))}return o}function Af(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=_L(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:n.reduce((d,{paramName:p,isOptional:h},g)=>{if(p==="*"){let x=c[g]||"";o=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const v=c[g];return h&&!v?d[p]=void 0:d[p]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:t}}function _L(t,e=!1,r=!0){ei(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 n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,u,d,p)=>{if(n.push({paramName:c,isOptional:u!=null}),u){let h=p.charAt(d+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function SL(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ei(!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 Xi(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}var kL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function EL(t,e="/"){let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?dl(t):t,a;return r?(r=bP(r),r.startsWith("/")?a=Ek(r.substring(1),"/"):a=Ek(r,e)):a=e,{pathname:a,search:TL(n),hash:CL(i)}}function Ek(t,e){let r=Tf(e).split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function vg(t,e,r,n){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function OL(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function ww(t){let e=OL(t);return e.map((r,n)=>n===e.length-1?r.pathname:r.pathnameBase)}function Fh(t,e,r,n=!1){let i;typeof t=="string"?i=dl(t):(i={...t},$t(!i.pathname||!i.pathname.includes("?"),vg("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),vg("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),vg("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,c;if(o==null)c=r;else{let h=e.length-1;if(!n&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),h-=1;i.pathname=g.join("/")}c=h>=0?e[h]:"/"}let u=EL(i,c),d=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||p)&&(u.pathname+="/"),u}var bP=t=>t.replace(/\/\/+/g,"/"),Qn=t=>bP(t.join("/")),Tf=t=>t.replace(/\/+$/,""),AL=t=>Tf(t).replace(/^\/*/,"/"),TL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,CL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,jL=class{constructor(t,e,r,n=!1){this.status=t,this.statusText=e||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function PL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function NL(t){let e=t.map(r=>r.route.path).filter(Boolean);return Qn(e)||"/"}var xP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function wP(t,e){let r=t;if(typeof r!="string"||!kL.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(xP)try{let a=new URL(window.location.href),o=r.startsWith("//")?new URL(a.protocol+r):new URL(r),c=Xi(o.pathname,e);o.origin===a.origin&&c!=null?r=c+o.search+o.hash:i=!0}catch{ei(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:i,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _P=["POST","PUT","PATCH","DELETE"];new Set(_P);var RL=["GET",..._P];new Set(RL);var fl=N.createContext(null);fl.displayName="DataRouter";var Hh=N.createContext(null);Hh.displayName="DataRouterState";var SP=N.createContext(!1);function IL(){return N.useContext(SP)}var kP=N.createContext({isTransitioning:!1});kP.displayName="ViewTransition";var $L=N.createContext(new Map);$L.displayName="Fetchers";var ML=N.createContext(null);ML.displayName="Await";var fn=N.createContext(null);fn.displayName="Navigation";var Eu=N.createContext(null);Eu.displayName="Location";var jn=N.createContext({outlet:null,matches:[],isDataRoute:!1});jn.displayName="Route";var _w=N.createContext(null);_w.displayName="RouteError";var EP="REACT_ROUTER_ERROR",LL="REDIRECT",DL="ROUTE_ERROR_RESPONSE";function zL(t){if(t.startsWith(`${EP}:${LL}:{`))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 BL(t){if(t.startsWith(`${EP}:${DL}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new jL(e.status,e.statusText,e.data)}catch{}}function UL(t,{relative:e}={}){$t(hl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=N.useContext(fn),{hash:i,pathname:a,search:o}=Au(t,{relative:e}),c=a;return r!=="/"&&(c=a==="/"?r:Qn([r,a])),n.createHref({pathname:c,search:o,hash:i})}function hl(){return N.useContext(Eu)!=null}function ti(){return $t(hl(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Eu).location}var OP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function AP(t){N.useContext(fn).static||N.useLayoutEffect(t)}function Ou(){let{isDataRoute:t}=N.useContext(jn);return t?nD():qL()}function qL(){$t(hl(),"useNavigate() may be used only in the context of a <Router> component.");let t=N.useContext(fl),{basename:e,navigator:r}=N.useContext(fn),{matches:n}=N.useContext(jn),{pathname:i}=ti(),a=JSON.stringify(ww(n)),o=N.useRef(!1);return AP(()=>{o.current=!0}),N.useCallback((u,d={})=>{if(ei(o.current,OP),!o.current)return;if(typeof u=="number"){r.go(u);return}let p=Fh(u,JSON.parse(a),i,d.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:Qn([e,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[e,r,a,i,t])}var FL=N.createContext(null);function HL(t){let e=N.useContext(jn).outlet;return N.useMemo(()=>e&&N.createElement(FL.Provider,{value:t},e),[e,t])}function WL(){let{matches:t}=N.useContext(jn),e=t[t.length-1];return(e==null?void 0:e.params)??{}}function Au(t,{relative:e}={}){let{matches:r}=N.useContext(jn),{pathname:n}=ti(),i=JSON.stringify(ww(r));return N.useMemo(()=>Fh(t,JSON.parse(i),n,e==="path"),[t,i,n,e])}function GL(t,e){return TP(t,e)}function TP(t,e,r){var b;$t(hl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=N.useContext(fn),{matches:i}=N.useContext(jn),a=i[i.length-1],o=a?a.params:{},c=a?a.pathname:"/",u=a?a.pathnameBase:"/",d=a&&a.route;{let k=d&&d.path||"";jP(c,!d||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
-
|
|
51
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=ti(),h;if(e){let k=typeof e=="string"?dl(e):e;$t(u==="/"||((b=k.pathname)==null?void 0:b.startsWith(u)),`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 "${u}" but pathname "${k.pathname}" was given in the \`location\` prop.`),h=k}else h=p;let g=h.pathname||"/",v=g;if(u!=="/"){let k=u.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(k.length).join("/")}let x=r&&r.state.matches.length?r.state.matches.map(k=>Object.assign(k,{route:r.manifest[k.route.id]||k.route})):gP(t,{pathname:v});ei(d||x!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),ei(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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 _=JL(x&&x.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:Qn([u,n.encodeLocation?n.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?u:Qn([u,n.encodeLocation?n.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),i,r);return e&&_?N.createElement(Eu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},_):_}function KL(){let t=rD(),e=PL(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:a},"ErrorBoundary")," or"," ",N.createElement("code",{style:a},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},e),r?N.createElement("pre",{style:i},r):null,o)}var VL=N.createElement(KL,null),CP=class extends N.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 r=BL(t.digest);r&&(t=r)}let e=t!==void 0?N.createElement(jn.Provider,{value:this.props.routeContext},N.createElement(_w.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?N.createElement(XL,{error:t},e):e}};CP.contextType=SP;var bg=new WeakMap;function XL({children:t,error:e}){let{basename:r}=N.useContext(fn);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=zL(e.digest);if(n){let i=bg.get(e);if(i)throw i;let a=wP(n.location,r);if(xP&&!bg.get(e))if(a.isExternal||n.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:n.replace}));throw bg.set(e,o),o}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return t}function YL({routeContext:t,match:e,children:r}){let n=N.useContext(fl);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),N.createElement(jn.Provider,{value:t},r)}function JL(t,e=[],r){let n=r==null?void 0:r.state;if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,a=n==null?void 0:n.errors;if(a!=null){let p=i.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);$t(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,p+1))}let o=!1,c=-1;if(r&&n){o=n.renderFallback;for(let p=0;p<i.length;p++){let h=i[p];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(c=p),h.route.id){let{loaderData:g,errors:v}=n,x=h.route.loader&&!g.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||x){r.isStatic&&(o=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let u=r==null?void 0:r.onError,d=n&&u?(p,h)=>{var g,v;u(p,{location:n.location,params:((v=(g=n.matches)==null?void 0:g[0])==null?void 0:v.params)??{},pattern:NL(n.matches),errorInfo:h})}:void 0;return i.reduceRight((p,h,g)=>{let v,x=!1,_=null,b=null;n&&(v=a&&h.route.id?a[h.route.id]:void 0,_=h.route.errorElement||VL,o&&(c<0&&g===0?(jP("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,b=null):c===g&&(x=!0,b=h.route.hydrateFallbackElement||null)));let k=e.concat(i.slice(0,g+1)),E=()=>{let O;return v?O=_:x?O=b:h.route.Component?O=N.createElement(h.route.Component,null):h.route.element?O=h.route.element:O=p,N.createElement(YL,{match:h,routeContext:{outlet:p,matches:k,isDataRoute:n!=null},children:O})};return n&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?N.createElement(CP,{location:n.location,revalidation:n.revalidation,component:_,error:v,children:E(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):E()},null)}function Sw(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZL(t){let e=N.useContext(fl);return $t(e,Sw(t)),e}function QL(t){let e=N.useContext(Hh);return $t(e,Sw(t)),e}function eD(t){let e=N.useContext(jn);return $t(e,Sw(t)),e}function kw(t){let e=eD(t),r=e.matches[e.matches.length-1];return $t(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function tD(){return kw("useRouteId")}function rD(){var n;let t=N.useContext(_w),e=QL("useRouteError"),r=kw("useRouteError");return t!==void 0?t:(n=e.errors)==null?void 0:n[r]}function nD(){let{router:t}=ZL("useNavigate"),e=kw("useNavigate"),r=N.useRef(!1);return AP(()=>{r.current=!0}),N.useCallback(async(i,a={})=>{ei(r.current,OP),r.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...a}))},[t,e])}var Ok={};function jP(t,e,r){!e&&!Ok[t]&&(Ok[t]=!0,ei(!1,r))}N.memo(iD);function iD({routes:t,manifest:e,future:r,state:n,isStatic:i,onError:a}){return TP(t,void 0,{manifest:e,state:n,isStatic:i,onError:a})}function aD({to:t,replace:e,state:r,relative:n}){$t(hl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=N.useContext(fn);ei(!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:a}=N.useContext(jn),{pathname:o}=ti(),c=Ou(),u=Fh(t,ww(a),o,n==="path"),d=JSON.stringify(u);return N.useEffect(()=>{c(JSON.parse(d),{replace:e,state:r,relative:n})},[c,d,n,e,r]),null}function oD(t){return HL(t.context)}function nn(t){$t(!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 sD({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:i,static:a=!1,useTransitions:o}){$t(!hl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=N.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:o,future:{}}),[c,i,a,o]);typeof r=="string"&&(r=dl(r));let{pathname:d="/",search:p="",hash:h="",state:g=null,key:v="default",mask:x}=r,_=N.useMemo(()=>{let b=Xi(d,c);return b==null?null:{location:{pathname:b,search:p,hash:h,state:g,key:v,mask:x},navigationType:n}},[c,d,p,h,g,v,n,x]);return ei(_!=null,`<Router basename="${c}"> is not able to match the URL "${d}${p}${h}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:N.createElement(fn.Provider,{value:u},N.createElement(Eu.Provider,{children:e,value:_}))}function lD({children:t,location:e}){return GL(Pb(t),e)}function Pb(t,e=[]){let r=[];return N.Children.forEach(t,(n,i)=>{if(!N.isValidElement(n))return;let a=[...e,i];if(n.type===N.Fragment){r.push.apply(r,Pb(n.props.children,a));return}$t(n.type===nn,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$t(!n.props.index||!n.props.children,"An index route cannot have child routes.");let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Pb(n.props.children,a)),r.push(o)}),r}var kf="get",Ef="application/x-www-form-urlencoded";function Wh(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function cD(t){return Wh(t)&&t.tagName.toLowerCase()==="button"}function uD(t){return Wh(t)&&t.tagName.toLowerCase()==="form"}function dD(t){return Wh(t)&&t.tagName.toLowerCase()==="input"}function fD(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function hD(t,e){return t.button===0&&(!e||e==="_self")&&!fD(t)}var Yd=null;function pD(){if(Yd===null)try{new FormData(document.createElement("form"),0),Yd=!1}catch{Yd=!0}return Yd}var mD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xg(t){return t!=null&&!mD.has(t)?(ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ef}"`),null):t}function gD(t,e){let r,n,i,a,o;if(uD(t)){let c=t.getAttribute("action");n=c?Xi(c,e):null,r=t.getAttribute("method")||kf,i=xg(t.getAttribute("enctype"))||Ef,a=new FormData(t)}else if(cD(t)||dD(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||c.getAttribute("action");if(n=u?Xi(u,e):null,r=t.getAttribute("formmethod")||c.getAttribute("method")||kf,i=xg(t.getAttribute("formenctype"))||xg(c.getAttribute("enctype"))||Ef,a=new FormData(c,t),!pD()){let{name:d,type:p,value:h}=t;if(p==="image"){let g=d?`${d}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else d&&a.append(d,h)}}else{if(Wh(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=kf,n=null,i=Ef,o=t}return a&&i==="text/plain"&&(o=a,a=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ew(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function PP(t,e,r,n){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${n}`:i.pathname=`${i.pathname}.${n}`:i.pathname==="/"?i.pathname=`_root.${n}`:e&&Xi(i.pathname,e)==="/"?i.pathname=`${Tf(e)}/_root.${n}`:i.pathname=`${Tf(i.pathname)}.${n}`,i}async function yD(t,e){if(t.id in e)return e[t.id];try{let r=await import(t.module);return e[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vD(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 bD(t,e,r){let n=await Promise.all(t.map(async i=>{let a=e.routes[i.route.id];if(a){let o=await yD(a,r);return o.links?o.links():[]}return[]}));return SD(n.flat(1).filter(vD).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Ak(t,e,r,n,i,a){let o=(u,d)=>r[d]?u.route.id!==r[d].route.id:!0,c=(u,d)=>{var p;return r[d].pathname!==u.pathname||((p=r[d].route.path)==null?void 0:p.endsWith("*"))&&r[d].params["*"]!==u.params["*"]};return a==="assets"?e.filter((u,d)=>o(u,d)||c(u,d)):a==="data"?e.filter((u,d)=>{var h;let p=n.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(o(u,d)||c(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((h=r[0])==null?void 0:h.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function xD(t,e,{includeHydrateFallback:r}={}){return wD(t.map(n=>{let i=e.routes[n.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function wD(t){return[...new Set(t)]}function _D(t){let e={},r=Object.keys(t).sort();for(let n of r)e[n]=t[n];return e}function SD(t,e){let r=new Set;return new Set(e),t.reduce((n,i)=>{let a=JSON.stringify(_D(i));return r.has(a)||(r.add(a),n.push({key:a,link:i})),n},[])}function Ow(){let t=N.useContext(fl);return Ew(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function kD(){let t=N.useContext(Hh);return Ew(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Aw=N.createContext(void 0);Aw.displayName="FrameworkContext";function Tw(){let t=N.useContext(Aw);return Ew(t,"You must render this element inside a <HydratedRouter> element"),t}function ED(t,e){let r=N.useContext(Aw),[n,i]=N.useState(!1),[a,o]=N.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:p,onTouchStart:h}=e,g=N.useRef(null);N.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let _=k=>{k.forEach(E=>{o(E.isIntersecting)})},b=new IntersectionObserver(_,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[t]),N.useEffect(()=>{if(n){let _=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(_)}}},[n]);let v=()=>{i(!0)},x=()=>{i(!1),o(!1)};return r?t!=="intent"?[a,g,{}]:[a,g,{onFocus:sc(c,v),onBlur:sc(u,x),onMouseEnter:sc(d,v),onMouseLeave:sc(p,x),onTouchStart:sc(h,v)}]:[!1,g,{}]}function sc(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function OD({page:t,...e}){let r=IL(),{router:n}=Ow(),i=N.useMemo(()=>gP(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?r?N.createElement(TD,{page:t,matches:i,...e}):N.createElement(CD,{page:t,matches:i,...e}):null}function AD(t){let{manifest:e,routeModules:r}=Tw(),[n,i]=N.useState([]);return N.useEffect(()=>{let a=!1;return bD(t,e,r).then(o=>{a||i(o)}),()=>{a=!0}},[t,e,r]),n}function TD({page:t,matches:e,...r}){let n=ti(),{future:i}=Tw(),{basename:a}=Ow(),o=N.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let c=PP(t,a,i.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let p of e)typeof p.route.shouldRevalidate=="function"?u=!0:d.push(p.route.id);return u&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[a,i.v8_trailingSlashAwareDataRequests,t,n,e]);return N.createElement(N.Fragment,null,o.map(c=>N.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function CD({page:t,matches:e,...r}){let n=ti(),{future:i,manifest:a,routeModules:o}=Tw(),{basename:c}=Ow(),{loaderData:u,matches:d}=kD(),p=N.useMemo(()=>Ak(t,e,d,a,n,"data"),[t,e,d,a,n]),h=N.useMemo(()=>Ak(t,e,d,a,n,"assets"),[t,e,d,a,n]),g=N.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let _=new Set,b=!1;if(e.forEach(E=>{var A;let O=a.routes[E.route.id];!O||!O.hasLoader||(!p.some(T=>T.route.id===E.route.id)&&E.route.id in u&&((A=o[E.route.id])!=null&&A.shouldRevalidate)||O.hasClientLoader?b=!0:_.add(E.route.id))}),_.size===0)return[];let k=PP(t,c,i.v8_trailingSlashAwareDataRequests,"data");return b&&_.size>0&&k.searchParams.set("_routes",e.filter(E=>_.has(E.route.id)).map(E=>E.route.id).join(",")),[k.pathname+k.search]},[c,i.v8_trailingSlashAwareDataRequests,u,n,a,p,e,t,o]),v=N.useMemo(()=>xD(h,a),[h,a]),x=AD(h);return N.createElement(N.Fragment,null,g.map(_=>N.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...r})),v.map(_=>N.createElement("link",{key:_,rel:"modulepreload",href:_,...r})),x.map(({key:_,link:b})=>N.createElement("link",{key:_,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function jD(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var PD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PD&&(window.__reactRouterVersion="7.16.0")}catch{}function ND({basename:t,children:e,useTransitions:r,window:n}){let i=N.useRef();i.current==null&&(i.current=oL({window:n,v5Compat:!0}));let a=i.current,[o,c]=N.useState({action:a.action,location:a.location}),u=N.useCallback(d=>{r===!1?c(d):N.startTransition(()=>c(d))},[r]);return N.useLayoutEffect(()=>a.listen(u),[a,u]),N.createElement(sD,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:a,useTransitions:r})}var NP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RP=N.forwardRef(function({onClick:e,discover:r="render",prefetch:n="none",relative:i,reloadDocument:a,replace:o,mask:c,state:u,target:d,to:p,preventScrollReset:h,viewTransition:g,defaultShouldRevalidate:v,...x},_){let{basename:b,navigator:k,useTransitions:E}=N.useContext(fn),O=typeof p=="string"&&NP.test(p),A=wP(p,b);p=A.to;let T=UL(p,{relative:i}),C=ti(),j=null;if(c){let U=Fh(c,[],C.mask?C.mask.pathname:"/",!0);b!=="/"&&(U.pathname=U.pathname==="/"?b:Qn([b,U.pathname])),j=k.createHref(U)}let[R,M,Y]=ED(n,x),W=$D(p,{replace:o,mask:c,state:u,target:d,preventScrollReset:h,relative:i,viewTransition:g,defaultShouldRevalidate:v,useTransitions:E});function B(U){e&&e(U),U.defaultPrevented||W(U)}let X=!(A.isExternal||a),K=N.createElement("a",{...x,...Y,href:(X?j:void 0)||A.absoluteURL||T,onClick:X?B:e,ref:jD(_,M),target:d,"data-discover":!O&&r==="render"?"true":void 0});return R&&!O?N.createElement(N.Fragment,null,K,N.createElement(OD,{page:T})):K});RP.displayName="Link";var IP=N.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:n="",end:i=!1,style:a,to:o,viewTransition:c,children:u,...d},p){let h=Au(o,{relative:d.relative}),g=ti(),v=N.useContext(Hh),{navigator:x,basename:_}=N.useContext(fn),b=v!=null&&BD(h)&&c===!0,k=x.encodeLocation?x.encodeLocation(h).pathname:h.pathname,E=g.pathname,O=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(E=E.toLowerCase(),O=O?O.toLowerCase():null,k=k.toLowerCase()),O&&_&&(O=Xi(O,_)||O);const A=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let T=E===k||!i&&E.startsWith(k)&&E.charAt(A)==="/",C=O!=null&&(O===k||!i&&O.startsWith(k)&&O.charAt(k.length)==="/"),j={isActive:T,isPending:C,isTransitioning:b},R=T?e:void 0,M;typeof n=="function"?M=n(j):M=[n,T?"active":null,C?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let Y=typeof a=="function"?a(j):a;return N.createElement(RP,{...d,"aria-current":R,className:M,ref:p,style:Y,to:o,viewTransition:c},typeof u=="function"?u(j):u)});IP.displayName="NavLink";var RD=N.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:i,state:a,method:o=kf,action:c,onSubmit:u,relative:d,preventScrollReset:p,viewTransition:h,defaultShouldRevalidate:g,...v},x)=>{let{useTransitions:_}=N.useContext(fn),b=DD(),k=zD(c,{relative:d}),E=o.toLowerCase()==="get"?"get":"post",O=typeof c=="string"&&NP.test(c),A=T=>{if(u&&u(T),T.defaultPrevented)return;T.preventDefault();let C=T.nativeEvent.submitter,j=(C==null?void 0:C.getAttribute("formmethod"))||o,R=()=>b(C||T.currentTarget,{fetcherKey:e,method:j,navigate:r,replace:i,state:a,relative:d,preventScrollReset:p,viewTransition:h,defaultShouldRevalidate:g});_&&r!==!1?N.startTransition(()=>R()):R()};return N.createElement("form",{ref:x,method:E,action:k,onSubmit:n?u:A,...v,"data-discover":!O&&t==="render"?"true":void 0})});RD.displayName="Form";function ID(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $P(t){let e=N.useContext(fl);return $t(e,ID(t)),e}function $D(t,{target:e,replace:r,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let p=Ou(),h=ti(),g=Au(t,{relative:o});return N.useCallback(v=>{if(hD(v,e)){v.preventDefault();let x=r!==void 0?r:Mc(h)===Mc(g),_=()=>p(t,{replace:x,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u});d?N.startTransition(()=>_()):_()}},[h,p,g,r,n,i,e,t,a,o,c,u,d])}var MD=0,LD=()=>`__${String(++MD)}__`;function DD(){let{router:t}=$P("useSubmit"),{basename:e}=N.useContext(fn),r=tD(),n=t.fetch,i=t.navigate;return N.useCallback(async(a,o={})=>{let{action:c,method:u,encType:d,formData:p,body:h}=gD(a,e);if(o.navigate===!1){let g=o.fetcherKey||LD();await n(g,r,o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:h,formMethod:o.method||u,formEncType:o.encType||d,flushSync:o.flushSync})}else await i(o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:h,formMethod:o.method||u,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,i,e,r])}function zD(t,{relative:e}={}){let{basename:r}=N.useContext(fn),n=N.useContext(jn);$t(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),a={...Au(t||".",{relative:e})},o=ti();if(t==null){a.search=o.search;let c=new URLSearchParams(a.search),u=c.getAll("index");if(u.some(p=>p==="")){c.delete("index"),u.filter(h=>h).forEach(h=>c.append("index",h));let p=c.toString();a.search=p?`?${p}`:""}}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:Qn([r,a.pathname])),Mc(a)}function BD(t,{relative:e}={}){let r=N.useContext(kP);$t(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=$P("useViewTransitionState"),i=Au(t,{relative:e});if(!r.isTransitioning)return!1;let a=Xi(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Xi(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Af(i.pathname,o)!=null||Af(i.pathname,a)!=null}var UD=mP();const qD=vt(UD);function FD(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const HD=t=>{switch(t){case"success":return KD;case"info":return XD;case"warning":return VD;case"error":return YD;default:return null}},WD=Array(12).fill(0),GD=({visible:t,className:e})=>I.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},I.createElement("div",{className:"sonner-spinner"},WD.map((r,n)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),KD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),VD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),XD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),YD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),JD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ZD=()=>{const[t,e]=I.useState(document.hidden);return I.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let Nb=1;class QD{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...i}=e,a=typeof(e==null?void 0:e.id)=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:Nb++,o=this.toasts.find(u=>u.id===a),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:c,title:n}):u):this.addToast({title:n,...i,dismissible:c,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let a=n!==void 0,o;const c=i.then(async d=>{if(o=["resolve",d],I.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(t5(d)&&!d.ok){a=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,x=typeof h=="object"&&!I.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:g,...x})}else if(d instanceof Error){a=!1;const h=typeof r.error=="function"?await r.error(d):r.error,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof h=="object"&&!I.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:g,...x})}else if(r.success!==void 0){a=!1;const h=typeof r.success=="function"?await r.success(d):r.success,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof h=="object"&&!I.isValidElement(h)?h:{message:h};this.create({id:n,type:"success",description:g,...x})}}).catch(async d=>{if(o=["reject",d],r.error!==void 0){a=!1;const p=typeof r.error=="function"?await r.error(d):r.error,h=typeof r.description=="function"?await r.description(d):r.description,v=typeof p=="object"&&!I.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:h,...v})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),u=()=>new Promise((d,p)=>c.then(()=>o[0]==="reject"?p(o[1]):d(o[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,r)=>{const n=(r==null?void 0:r.id)||Nb++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Yr=new QD,e5=(t,e)=>{const r=(e==null?void 0:e.id)||Nb++;return Yr.addToast({title:t,...e,id:r}),r},t5=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",r5=e5,n5=()=>Yr.toasts,i5=()=>Yr.getActiveToasts(),ft=Object.assign(r5,{success:Yr.success,info:Yr.info,warning:Yr.warning,error:Yr.error,custom:Yr.custom,message:Yr.message,promise:Yr.promise,dismiss:Yr.dismiss,loading:Yr.loading},{getHistory:n5,getToasts:i5});FD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Jd(t){return t.label!==void 0}const a5=3,o5="24px",s5="16px",Tk=4e3,l5=356,c5=14,u5=45,d5=200;function mi(...t){return t.filter(Boolean).join(" ")}function f5(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const h5=t=>{var e,r,n,i,a,o,c,u,d;const{invert:p,toast:h,unstyled:g,interacting:v,setHeights:x,visibleToasts:_,heights:b,index:k,toasts:E,expanded:O,removeToast:A,defaultRichColors:T,closeButton:C,style:j,cancelButtonStyle:R,actionButtonStyle:M,className:Y="",descriptionClassName:W="",duration:B,position:X,gap:K,expandByDefault:U,classNames:G,icons:J,closeButtonAriaLabel:F="Close toast"}=t,[te,q]=I.useState(null),[z,L]=I.useState(null),[Z,se]=I.useState(!1),[le,ve]=I.useState(!1),[qe,xe]=I.useState(!1),[ae,Se]=I.useState(!1),[Me,oe]=I.useState(!1),[et,Fe]=I.useState(0),[kt,wt]=I.useState(0),Et=I.useRef(h.duration||B||Tk),Sr=I.useRef(null),Bt=I.useRef(null),Rr=k===0,lr=k+1<=_,_t=h.type,kr=h.dismissible!==!1,Ir=h.className||"",ni=h.descriptionClassName||"",Ur=I.useMemo(()=>b.findIndex($=>$.toastId===h.id)||0,[b,h.id]),ii=I.useMemo(()=>{var $;return($=h.closeButton)!=null?$:C},[h.closeButton,C]),ai=I.useMemo(()=>h.duration||B||Tk,[h.duration,B]),aa=I.useRef(0),qr=I.useRef(0),oi=I.useRef(0),si=I.useRef(null),[Fo,Ka]=X.split("-"),Ho=I.useMemo(()=>b.reduce(($,ne,de)=>de>=Ur?$:$+ne.height,0),[b,Ur]),oa=ZD(),Va=h.invert||p,Nn=_t==="loading";qr.current=I.useMemo(()=>Ur*K+Ho,[Ur,Ho]),I.useEffect(()=>{Et.current=ai},[ai]),I.useEffect(()=>{se(!0)},[]),I.useEffect(()=>{const $=Bt.current;if($){const ne=$.getBoundingClientRect().height;return wt(ne),x(de=>[{toastId:h.id,height:ne,position:h.position},...de]),()=>x(de=>de.filter(Re=>Re.toastId!==h.id))}},[x,h.id]),I.useLayoutEffect(()=>{if(!Z)return;const $=Bt.current,ne=$.style.height;$.style.height="auto";const de=$.getBoundingClientRect().height;$.style.height=ne,wt(de),x(Re=>Re.find(Ke=>Ke.toastId===h.id)?Re.map(Ke=>Ke.toastId===h.id?{...Ke,height:de}:Ke):[{toastId:h.id,height:de,position:h.position},...Re])},[Z,h.title,h.description,x,h.id,h.jsx,h.action,h.cancel]);const $r=I.useCallback(()=>{ve(!0),Fe(qr.current),x($=>$.filter(ne=>ne.toastId!==h.id)),setTimeout(()=>{A(h)},d5)},[h,A,x,qr]);I.useEffect(()=>{if(h.promise&&_t==="loading"||h.duration===1/0||h.type==="loading")return;let $;return O||v||oa?(()=>{if(oi.current<aa.current){const Re=new Date().getTime()-aa.current;Et.current=Et.current-Re}oi.current=new Date().getTime()})():(()=>{Et.current!==1/0&&(aa.current=new Date().getTime(),$=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),$r()},Et.current))})(),()=>clearTimeout($)},[O,v,h,_t,oa,$r]),I.useEffect(()=>{h.delete&&($r(),h.onDismiss==null||h.onDismiss.call(h,h))},[$r,h.delete]);function sa(){var $;if(J!=null&&J.loading){var ne;return I.createElement("div",{className:mi(G==null?void 0:G.loader,h==null||(ne=h.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":_t==="loading"},J.loading)}return I.createElement(GD,{className:mi(G==null?void 0:G.loader,h==null||($=h.classNames)==null?void 0:$.loader),visible:_t==="loading"})}const li=h.icon||(J==null?void 0:J[_t])||HD(_t);var hn,pn;return I.createElement("li",{tabIndex:0,ref:Bt,className:mi(Y,Ir,G==null?void 0:G.toast,h==null||(e=h.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[_t],h==null||(r=h.classNames)==null?void 0:r[_t]),"data-sonner-toast":"","data-rich-colors":(hn=h.richColors)!=null?hn:T,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":Z,"data-promise":!!h.promise,"data-swiped":Me,"data-removed":le,"data-visible":lr,"data-y-position":Fo,"data-x-position":Ka,"data-index":k,"data-front":Rr,"data-swiping":qe,"data-dismissible":kr,"data-type":_t,"data-invert":Va,"data-swipe-out":ae,"data-swipe-direction":z,"data-expanded":!!(O||U&&Z),"data-testid":h.testId,style:{"--index":k,"--toasts-before":k,"--z-index":E.length-k,"--offset":`${le?et:qr.current}px`,"--initial-height":U?"auto":`${kt}px`,...j,...h.style},onDragEnd:()=>{xe(!1),q(null),si.current=null},onPointerDown:$=>{$.button!==2&&(Nn||!kr||(Sr.current=new Date,Fe(qr.current),$.target.setPointerCapture($.pointerId),$.target.tagName!=="BUTTON"&&(xe(!0),si.current={x:$.clientX,y:$.clientY})))},onPointerUp:()=>{var $,ne,de;if(ae||!kr)return;si.current=null;const Re=Number((($=Bt.current)==null?void 0:$.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ht=Number(((ne=Bt.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ke=new Date().getTime()-((de=Sr.current)==null?void 0:de.getTime()),ye=te==="x"?Re:ht,we=Math.abs(ye)/Ke;if(Math.abs(ye)>=u5||we>.11){Fe(qr.current),h.onDismiss==null||h.onDismiss.call(h,h),L(te==="x"?Re>0?"right":"left":ht>0?"down":"up"),$r(),Se(!0);return}else{var Ce,ct;(Ce=Bt.current)==null||Ce.style.setProperty("--swipe-amount-x","0px"),(ct=Bt.current)==null||ct.style.setProperty("--swipe-amount-y","0px")}oe(!1),xe(!1),q(null)},onPointerMove:$=>{var ne,de,Re;if(!si.current||!kr||((ne=window.getSelection())==null?void 0:ne.toString().length)>0)return;const Ke=$.clientY-si.current.y,ye=$.clientX-si.current.x;var we;const Ce=(we=t.swipeDirections)!=null?we:f5(X);!te&&(Math.abs(ye)>1||Math.abs(Ke)>1)&&q(Math.abs(ye)>Math.abs(Ke)?"x":"y");let ct={x:0,y:0};const gt=cr=>1/(1.5+Math.abs(cr)/20);if(te==="y"){if(Ce.includes("top")||Ce.includes("bottom"))if(Ce.includes("top")&&Ke<0||Ce.includes("bottom")&&Ke>0)ct.y=Ke;else{const cr=Ke*gt(Ke);ct.y=Math.abs(cr)<Math.abs(Ke)?cr:Ke}}else if(te==="x"&&(Ce.includes("left")||Ce.includes("right")))if(Ce.includes("left")&&ye<0||Ce.includes("right")&&ye>0)ct.x=ye;else{const cr=ye*gt(ye);ct.x=Math.abs(cr)<Math.abs(ye)?cr:ye}(Math.abs(ct.x)>0||Math.abs(ct.y)>0)&&oe(!0),(de=Bt.current)==null||de.style.setProperty("--swipe-amount-x",`${ct.x}px`),(Re=Bt.current)==null||Re.style.setProperty("--swipe-amount-y",`${ct.y}px`)}},ii&&!h.jsx&&_t!=="loading"?I.createElement("button",{"aria-label":F,"data-disabled":Nn,"data-close-button":!0,onClick:Nn||!kr?()=>{}:()=>{$r(),h.onDismiss==null||h.onDismiss.call(h,h)},className:mi(G==null?void 0:G.closeButton,h==null||(n=h.classNames)==null?void 0:n.closeButton)},(pn=J==null?void 0:J.close)!=null?pn:JD):null,(_t||h.icon||h.promise)&&h.icon!==null&&((J==null?void 0:J[_t])!==null||h.icon)?I.createElement("div",{"data-icon":"",className:mi(G==null?void 0:G.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||sa():null,h.type!=="loading"?li:null):null,I.createElement("div",{"data-content":"",className:mi(G==null?void 0:G.content,h==null||(a=h.classNames)==null?void 0:a.content)},I.createElement("div",{"data-title":"",className:mi(G==null?void 0:G.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?I.createElement("div",{"data-description":"",className:mi(W,ni,G==null?void 0:G.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),I.isValidElement(h.cancel)?h.cancel:h.cancel&&Jd(h.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:$=>{Jd(h.cancel)&&kr&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,$),$r())},className:mi(G==null?void 0:G.cancelButton,h==null||(u=h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,I.isValidElement(h.action)?h.action:h.action&&Jd(h.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||M,onClick:$=>{Jd(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,$),!$.defaultPrevented&&$r())},className:mi(G==null?void 0:G.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function Ck(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function p5(t,e){const r={};return[t,e].forEach((n,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",c=a?s5:o5;function u(d){["top","right","bottom","left"].forEach(p=>{r[`${o}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=c:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):u(c)}),r}const m5=I.forwardRef(function(e,r){const{id:n,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:c,closeButton:u,className:d,offset:p,mobileOffset:h,theme:g="light",richColors:v,duration:x,style:_,visibleToasts:b=a5,toastOptions:k,dir:E=Ck(),gap:O=c5,icons:A,containerAriaLabel:T="Notifications"}=e,[C,j]=I.useState([]),R=I.useMemo(()=>n?C.filter(Z=>Z.toasterId===n):C.filter(Z=>!Z.toasterId),[C,n]),M=I.useMemo(()=>Array.from(new Set([a].concat(R.filter(Z=>Z.position).map(Z=>Z.position)))),[R,a]),[Y,W]=I.useState([]),[B,X]=I.useState(!1),[K,U]=I.useState(!1),[G,J]=I.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=I.useRef(null),te=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=I.useRef(null),z=I.useRef(!1),L=I.useCallback(Z=>{j(se=>{var le;return(le=se.find(ve=>ve.id===Z.id))!=null&&le.delete||Yr.dismiss(Z.id),se.filter(({id:ve})=>ve!==Z.id)})},[]);return I.useEffect(()=>Yr.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{j(se=>se.map(le=>le.id===Z.id?{...le,delete:!0}:le))});return}setTimeout(()=>{qD.flushSync(()=>{j(se=>{const le=se.findIndex(ve=>ve.id===Z.id);return le!==-1?[...se.slice(0,le),{...se[le],...Z},...se.slice(le+1)]:[Z,...se]})})})}),[C]),I.useEffect(()=>{if(g!=="system"){J(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:se})=>{J(se?"dark":"light")})}catch{Z.addListener(({matches:le})=>{try{J(le?"dark":"light")}catch(ve){console.error(ve)}})}},[g]),I.useEffect(()=>{C.length<=1&&X(!1)},[C]),I.useEffect(()=>{const Z=se=>{var le;if(o.every(xe=>se[xe]||se.code===xe)){var qe;X(!0),(qe=F.current)==null||qe.focus()}se.code==="Escape"&&(document.activeElement===F.current||(le=F.current)!=null&&le.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[o]),I.useEffect(()=>{if(F.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,z.current=!1)}},[F.current]),I.createElement("section",{ref:r,"aria-label":`${T} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((Z,se)=>{var le;const[ve,qe]=Z.split("-");return R.length?I.createElement("ol",{key:Z,dir:E==="auto"?Ck():E,tabIndex:-1,ref:F,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":ve,"data-x-position":qe,style:{"--front-toast-height":`${((le=Y[0])==null?void 0:le.height)||0}px`,"--width":`${l5}px`,"--gap":`${O}px`,..._,...p5(p,h)},onBlur:xe=>{z.current&&!xe.currentTarget.contains(xe.relatedTarget)&&(z.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||z.current||(z.current=!0,q.current=xe.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{K||X(!1)},onDragEnd:()=>X(!1),onPointerDown:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},R.filter(xe=>!xe.position&&se===0||xe.position===Z).map((xe,ae)=>{var Se,Me;return I.createElement(h5,{key:xe.id,icons:A,index:ae,toast:xe,defaultRichColors:v,duration:(Se=k==null?void 0:k.duration)!=null?Se:x,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:i,visibleToasts:b,closeButton:(Me=k==null?void 0:k.closeButton)!=null?Me:u,interacting:K,position:Z,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:L,toasts:R.filter(oe=>oe.position==xe.position),heights:Y.filter(oe=>oe.position==xe.position),setHeights:W,expandByDefault:c,gap:O,expanded:B,swipeDirections:e.swipeDirections})})):null}))}),g5="M147.692 55C178.28 55.0001 203.077 79.7968 203.077 110.385C203.077 140.089 179.692 164.331 150.327 165.706C126.508 171.901 108.924 193.549 108.924 219.308C108.924 222.879 109.261 226.372 109.907 229.755C109.903 229.756 109.898 229.755 109.894 229.756C110.468 232.955 110.77 236.25 110.77 239.615C110.77 242.98 110.468 246.274 109.894 249.474C109.898 249.474 109.903 249.475 109.907 249.476C109.261 252.859 108.924 256.351 108.924 259.923C108.924 285.68 126.507 307.329 150.325 313.524C179.691 314.899 203.077 339.14 203.077 368.846C203.077 399.434 178.28 424.23 147.692 424.23C117.104 424.23 92.3076 399.434 92.3076 368.846C92.3076 364.539 92.7986 360.348 93.7285 356.324C94.007 354.075 94.1543 351.785 94.1543 349.461C94.1541 321.662 73.6718 298.647 46.9756 294.682C46.9934 294.579 47.0138 294.477 47.0322 294.374C20.4072 290.347 2.80541e-05 267.364 0 239.615C0 211.866 20.4071 188.883 47.0322 184.855C47.0139 184.753 46.9934 184.651 46.9756 184.549C73.6719 180.584 94.1542 157.569 94.1543 129.77C94.1543 127.445 94.0063 125.154 93.7275 122.904C92.7979 118.881 92.3076 114.69 92.3076 110.385C92.3076 79.7967 117.104 55 147.692 55ZM332.308 55C362.896 55 387.692 79.7967 387.692 110.385C387.692 115.136 387.093 119.747 385.968 124.147C385.781 125.996 385.683 127.872 385.683 129.77C385.683 157.569 406.165 180.584 432.861 184.549C432.845 184.643 432.826 184.738 432.809 184.832C459.511 188.792 480 211.811 480 239.615C480 267.419 459.511 290.438 432.809 294.397C432.826 294.492 432.845 294.587 432.861 294.682C406.165 298.647 385.683 321.661 385.683 349.461C385.683 351.358 385.781 353.233 385.968 355.081C387.093 359.482 387.692 364.094 387.692 368.846C387.692 399.434 362.896 424.23 332.308 424.23C301.72 424.23 276.923 399.434 276.923 368.846C276.923 364.537 277.414 360.344 278.345 356.318C278.622 354.071 278.77 351.783 278.77 349.461C278.769 321.661 258.287 298.647 231.591 294.682C231.609 294.579 231.629 294.477 231.647 294.374C205.022 290.347 184.615 267.364 184.615 239.615C184.615 209.027 209.412 184.23 240 184.23C270.588 184.231 295.385 209.027 295.385 239.615C295.385 242.98 295.084 246.274 294.509 249.474C294.513 249.474 294.518 249.475 294.522 249.476C293.877 252.859 293.539 256.351 293.539 259.923C293.539 284.692 309.798 305.661 332.226 312.744C354.653 305.661 370.913 284.692 370.913 259.923C370.913 256.351 370.576 252.859 369.93 249.476C369.987 249.467 370.044 249.46 370.102 249.451C369.529 246.259 369.23 242.972 369.23 239.615C369.23 236.259 369.528 232.971 370.101 229.779C370.044 229.771 369.986 229.764 369.93 229.756C370.576 226.372 370.913 222.879 370.913 219.308C370.913 193.537 353.312 171.881 329.476 165.697C300.204 164.223 276.923 140.023 276.923 110.385C276.923 79.7967 301.72 55 332.308 55Z";function Ra({height:t=32}){const e=Math.round(t*1);return y.jsxs("svg",{width:e,height:t,viewBox:"0 0 480 480",fill:"none","aria-hidden":!0,children:[y.jsx("path",{d:g5,fill:"url(#io-grad)"}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"io-grad",x1:"0",x2:"450.529",y1:"402",y2:"69.3087",gradientUnits:"userSpaceOnUse",children:[y.jsx("stop",{stopColor:"#D83333"}),y.jsx("stop",{offset:"0.515",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"1",stopColor:"#F041FF"})]})})]})}/**
|
|
52
|
-
* @license lucide-react v0.487.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const y5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),v5=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),jk=t=>{const e=v5(t);return e.charAt(0).toUpperCase()+e.slice(1)},MP=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/**
|
|
57
|
-
* @license lucide-react v0.487.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/var b5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
62
|
-
* @license lucide-react v0.487.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const x5=N.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...c},u)=>N.createElement("svg",{ref:u,...b5,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:MP("lucide",i),...c},[...o.map(([d,p])=>N.createElement(d,p)),...Array.isArray(a)?a:[a]]));/**
|
|
67
|
-
* @license lucide-react v0.487.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const Ue=(t,e)=>{const r=N.forwardRef(({className:n,...i},a)=>N.createElement(x5,{ref:a,iconNode:e,className:MP(`lucide-${y5(jk(t))}`,`lucide-${t}`,n),...i}));return r.displayName=jk(t),r};/**
|
|
72
|
-
* @license lucide-react v0.487.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const w5=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Gh=Ue("activity",w5);/**
|
|
77
|
-
* @license lucide-react v0.487.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const _5=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],S5=Ue("bell",_5);/**
|
|
82
|
-
* @license lucide-react v0.487.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const k5=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],LP=Ue("book-open",k5);/**
|
|
87
|
-
* @license lucide-react v0.487.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const E5=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],DP=Ue("bot",E5);/**
|
|
92
|
-
* @license lucide-react v0.487.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const O5=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],A5=Ue("bug",O5);/**
|
|
97
|
-
* @license lucide-react v0.487.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const T5=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],C5=Ue("calendar",T5);/**
|
|
102
|
-
* @license lucide-react v0.487.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const j5=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],P5=Ue("chart-no-axes-column",j5);/**
|
|
107
|
-
* @license lucide-react v0.487.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const N5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],R5=Ue("chevron-down",N5);/**
|
|
112
|
-
* @license lucide-react v0.487.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const I5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Tu=Ue("chevron-left",I5);/**
|
|
117
|
-
* @license lucide-react v0.487.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const $5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cw=Ue("chevron-right",$5);/**
|
|
122
|
-
* @license lucide-react v0.487.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const M5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],L5=Ue("circle-check-big",M5);/**
|
|
127
|
-
* @license lucide-react v0.487.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const D5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],z5=Ue("circle-x",D5);/**
|
|
132
|
-
* @license lucide-react v0.487.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const B5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],U5=Ue("clock",B5);/**
|
|
137
|
-
* @license lucide-react v0.487.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const q5=[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]],F5=Ue("cpu",q5);/**
|
|
142
|
-
* @license lucide-react v0.487.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const H5=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],zP=Ue("crown",H5);/**
|
|
147
|
-
* @license lucide-react v0.487.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const W5=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],G5=Ue("download",W5);/**
|
|
152
|
-
* @license lucide-react v0.487.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const K5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],BP=Ue("external-link",K5);/**
|
|
157
|
-
* @license lucide-react v0.487.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const V5=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],X5=Ue("eye-off",V5);/**
|
|
162
|
-
* @license lucide-react v0.487.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const Y5=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Rb=Ue("eye",Y5);/**
|
|
167
|
-
* @license lucide-react v0.487.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const J5=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Z5=Ue("file-text",J5);/**
|
|
172
|
-
* @license lucide-react v0.487.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const Q5=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],e4=Ue("folder-open",Q5);/**
|
|
177
|
-
* @license lucide-react v0.487.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const t4=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],r4=Ue("folder",t4);/**
|
|
182
|
-
* @license lucide-react v0.487.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const n4=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],i4=Ue("github",n4);/**
|
|
187
|
-
* @license lucide-react v0.487.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const a4=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],o4=Ue("hash",a4);/**
|
|
192
|
-
* @license lucide-react v0.487.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const s4=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Ib=Ue("inbox",s4);/**
|
|
197
|
-
* @license lucide-react v0.487.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const l4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],c4=Ue("info",l4);/**
|
|
202
|
-
* @license lucide-react v0.487.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const u4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Os=Ue("loader-circle",u4);/**
|
|
207
|
-
* @license lucide-react v0.487.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const d4=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],UP=Ue("loader",d4);/**
|
|
212
|
-
* @license lucide-react v0.487.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const f4=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],h4=Ue("log-out",f4);/**
|
|
217
|
-
* @license lucide-react v0.487.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const p4=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],m4=Ue("message-circle",p4);/**
|
|
222
|
-
* @license lucide-react v0.487.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const g4=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],qP=Ue("message-square",g4);/**
|
|
227
|
-
* @license lucide-react v0.487.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const y4=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],FP=Ue("paperclip",y4);/**
|
|
232
|
-
* @license lucide-react v0.487.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const v4=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],b4=Ue("pause",v4);/**
|
|
237
|
-
* @license lucide-react v0.487.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const x4=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],w4=Ue("pen",x4);/**
|
|
242
|
-
* @license lucide-react v0.487.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const _4=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],$b=Ue("pencil",_4);/**
|
|
247
|
-
* @license lucide-react v0.487.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const S4=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],k4=Ue("play",S4);/**
|
|
252
|
-
* @license lucide-react v0.487.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const E4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],HP=Ue("plus",E4);/**
|
|
257
|
-
* @license lucide-react v0.487.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const O4=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],jw=Ue("save",O4);/**
|
|
262
|
-
* @license lucide-react v0.487.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const A4=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],T4=Ue("scroll-text",A4);/**
|
|
267
|
-
* @license lucide-react v0.487.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const C4=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],WP=Ue("search",C4);/**
|
|
272
|
-
* @license lucide-react v0.487.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const j4=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],GP=Ue("send",j4);/**
|
|
277
|
-
* @license lucide-react v0.487.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const P4=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],N4=Ue("settings",P4);/**
|
|
282
|
-
* @license lucide-react v0.487.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const R4=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],I4=Ue("sparkles",R4);/**
|
|
287
|
-
* @license lucide-react v0.487.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const $4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Kh=Ue("square",$4);/**
|
|
292
|
-
* @license lucide-react v0.487.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const M4=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],L4=Ue("terminal",M4);/**
|
|
297
|
-
* @license lucide-react v0.487.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const D4=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],$s=Ue("trash-2",D4);/**
|
|
302
|
-
* @license lucide-react v0.487.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const z4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],B4=Ue("triangle-alert",z4);/**
|
|
307
|
-
* @license lucide-react v0.487.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const U4=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Vh=Ue("users",U4);/**
|
|
312
|
-
* @license lucide-react v0.487.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const q4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],KP=Ue("x",q4);/**
|
|
317
|
-
* @license lucide-react v0.487.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const F4=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Mb=Ue("zap",F4);let Cf=[];const jf=new Set;function H4(t){Cf=[t,...Cf].slice(0,50);for(const e of jf)e()}function W4(){Cf=[];for(const t of jf)t()}function G4(){const[,t]=N.useState(0);return N.useEffect(()=>{const e=()=>t(r=>r+1);return jf.add(e),()=>{jf.delete(e)}},[]),Cf}function K4(){const[t,e]=N.useState(!1),r=G4(),n=N.useRef(null),[i,a]=N.useState(0),o=r.length-i;N.useEffect(()=>{function u(d){n.current&&!n.current.contains(d.target)&&e(!1)}if(t)return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[t]);function c(){e(!t),t||a(r.length)}return y.jsxs("div",{className:"relative",ref:n,children:[y.jsxs("button",{type:"button",onClick:c,className:"relative p-2 rounded-xl hover:bg-white/[0.05] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",title:"Notifications",children:[y.jsx(S5,{className:"w-3.5 h-3.5"}),o>0&&y.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-[#E43A9C]"})]}),t&&y.jsxs("div",{className:"absolute right-0 top-full mt-2 w-80 max-h-96 overflow-y-auto rounded-xl border border-white/[0.07] bg-[#1a1a1a] shadow-2xl z-50",children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.07]",children:[y.jsx("span",{className:"text-xs font-mono text-zinc-300",children:"Notifications"}),r.length>0&&y.jsx("button",{type:"button",onClick:W4,className:"text-[10px] font-mono text-zinc-500 hover:text-zinc-300 cursor-pointer",children:"Clear all"})]}),r.length===0?y.jsx("div",{className:"px-4 py-8 text-center text-zinc-600 text-xs font-mono",children:"No notifications yet"}):y.jsx("div",{className:"divide-y divide-white/[0.04]",children:r.map(u=>y.jsxs("div",{className:"px-4 py-3 hover:bg-white/[0.03]",children:[y.jsx("p",{className:"text-xs text-zinc-300 leading-relaxed",children:u.message}),y.jsx("p",{className:"text-[10px] text-zinc-600 font-mono mt-1",children:new Date(u.timestamp).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:"America/Chicago"})})]},u.id))})]})]})}const V4="/api";let Ao=null;function X4(t){Ao=t}function VP(){return(Ao==null?void 0:Ao())??null}async function lc(t,e){const r=Ao==null?void 0:Ao(),n={"Content-Type":"application/json",...e==null?void 0:e.headers};r&&(n.Authorization=`Bearer ${r}`);const i=await fetch(`${V4}${t}`,{...e,headers:n});if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText}));throw new Error(a.error??`Request failed: ${i.status}`)}return i.json()}const rt={get:t=>lc(t),post:(t,e)=>lc(t,{method:"POST",body:e?JSON.stringify(e):void 0}),patch:(t,e)=>lc(t,{method:"PATCH",body:JSON.stringify(e)}),put:(t,e)=>lc(t,{method:"PUT",body:JSON.stringify(e)}),delete:t=>lc(t,{method:"DELETE"})},Y4=10,J4=1e3,Z4=3e4;function Q4(t={}){const[e,r]=N.useState(!1),[n,i]=N.useState(null),[a,o]=N.useState("connecting"),c=N.useRef(null),u=N.useRef(t),d=N.useRef(0),p=N.useRef(null),h=N.useRef(!0),g=N.useRef(!1);u.current=t,N.useEffect(()=>{let _=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;const b=VP();b&&(_+=`?token=${encodeURIComponent(b)}`);const k=()=>{if(!h.current)return;o(d.current>0?"reconnecting":"connecting");const E=new WebSocket(_);c.current=E,E.onopen=()=>{const O=d.current>0||g.current;d.current=0,g.current=!1,r(!0),o("connected"),O&&console.info("WebSocket reconnected")},E.onmessage=O=>{var A,T,C,j,R,M,Y,W;try{const B=JSON.parse(O.data);switch(B.type){case"connected":i(B.connectionId??null);break;case"delta":(T=(A=u.current).onDelta)==null||T.call(A,B.content??"");break;case"message":(j=(C=u.current).onMessage)==null||j.call(C,B.content??"");break;case"event":(M=(R=u.current).onEvent)==null||M.call(R,B);break;case"error":(W=(Y=u.current).onError)==null||W.call(Y,B.content??"Unknown error");break}}catch{}},E.onclose=()=>{if(c.current=null,r(!1),i(null),!h.current)return;if(g.current||(g.current=!0,console.warn("WebSocket disconnected; attempting to reconnect")),d.current>=Y4){o("disconnected");return}const O=Math.min(J4*2**d.current,Z4);d.current+=1,o("reconnecting"),p.current=setTimeout(k,O)},E.onerror=()=>{E.close()}};return k(),()=>{var E;h.current=!1,p.current&&clearTimeout(p.current),(E=c.current)==null||E.close()}},[]);const v=N.useCallback((x,_="web")=>{var b;((b=c.current)==null?void 0:b.readyState)===WebSocket.OPEN&&c.current.send(JSON.stringify({type:"message",content:x,source:_}))},[]);return{connected:e,connectionId:n,connectionState:a,sendMessage:v}}const XP=N.createContext(null);function ez({children:t}){const[e,r]=N.useState([]),[n,i]=N.useState(""),[a,o]=N.useState(!1),[c,u]=N.useState(!1),d=N.useRef(!1);N.useEffect(()=>{d.current||(d.current=!0,rt.get("/conversations?limit=50").then(O=>{r(O.messages.map(A=>({...A,timestamp:A.timestamp})))}).catch(()=>{}))},[]);const p=N.useCallback(O=>{u(!1),o(!0),i(O)},[]),h=N.useCallback(O=>{u(!1),o(!1),i(""),r(A=>[...A,{id:crypto.randomUUID(),role:"assistant",content:O,timestamp:new Date().toISOString()}])},[]),g=N.useCallback(O=>{var A,T,C;O.notification&&H4({id:((A=O.event)==null?void 0:A.id)??crypto.randomUUID(),message:O.notification,timestamp:((T=O.event)==null?void 0:T.timestamp)??new Date().toISOString(),eventType:((C=O.event)==null?void 0:C.type)??"unknown"})},[]),v=N.useCallback(()=>{u(!1),o(!1),i("")},[]),{connected:x,sendMessage:_}=Q4({onDelta:p,onMessage:h,onEvent:g,onError:v}),b=N.useCallback(O=>{u(!0),_(O)},[_]),k=N.useCallback(O=>{r(A=>[...A,O])},[]),E=N.useCallback(async(O,A)=>{const T=new FormData;T.append("file",O),T.append("messageId",A);const C=VP();if(!(await fetch("/api/attachments",{method:"POST",body:T,headers:C?{Authorization:`Bearer ${C}`}:void 0})).ok)throw new Error("Failed to upload attachment")},[]);return y.jsx(XP.Provider,{value:{messages:e,streaming:n,isStreaming:a,isThinking:c,connected:x,sendChatMessage:b,addUserMessage:k,uploadAttachment:E},children:t})}function YP(){const t=N.useContext(XP);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function Pw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lo=Pw();function JP(t){Lo=t}var wo={exec:()=>null};function gs(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),i=e[n];return i||(i=t(n),e[n]=i),i}}function ot(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Nr.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var tz=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Nr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:gs(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:gs(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:gs(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:gs(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:gs(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:gs(t=>new RegExp(`^ {0,${t}}>`))},rz=/^(?:[ \t]*(?:\n|$))+/,nz=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,iz=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Cu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,az=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Nw=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ZP=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,QP=ot(ZP).replace(/bull/g,Nw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),oz=ot(ZP).replace(/bull/g,Nw).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Rw=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,sz=/^[^\n]+/,Iw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lz=ot(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Iw).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cz=ot(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Nw).getRegex(),Xh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",$w=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,uz=ot("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",$w).replace("tag",Xh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eN=ot(Rw).replace("hr",Cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xh).getRegex(),dz=ot(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",eN).getRegex(),Mw={blockquote:dz,code:nz,def:lz,fences:iz,heading:az,hr:Cu,html:uz,lheading:QP,list:cz,newline:rz,paragraph:eN,table:wo,text:sz},Pk=ot("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xh).getRegex(),fz={...Mw,lheading:oz,table:Pk,paragraph:ot(Rw).replace("hr",Cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pk).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xh).getRegex()},hz={...Mw,html:ot(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$w).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ot(Rw).replace("hr",Cu).replace("heading",` *#{1,6} *[^
|
|
322
|
-
]`).replace("lheading",QP).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},pz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,mz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tN=/^( {2,}|\\)\n(?!\s*$)/,gz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pl=/[\p{P}\p{S}]/u,Yh=/[\s\p{P}\p{S}]/u,Lw=/[^\s\p{P}\p{S}]/u,yz=ot(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yh).getRegex(),rN=/(?!~)[\p{P}\p{S}]/u,vz=/(?!~)[\s\p{P}\p{S}]/u,bz=/(?:[^\s\p{P}\p{S}]|~)/u,xz=ot(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",tz?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),nN=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,wz=ot(nN,"u").replace(/punct/g,pl).getRegex(),_z=ot(nN,"u").replace(/punct/g,rN).getRegex(),iN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Sz=ot(iN,"gu").replace(/notPunctSpace/g,Lw).replace(/punctSpace/g,Yh).replace(/punct/g,pl).getRegex(),kz=ot(iN,"gu").replace(/notPunctSpace/g,bz).replace(/punctSpace/g,vz).replace(/punct/g,rN).getRegex(),Ez=ot("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Lw).replace(/punctSpace/g,Yh).replace(/punct/g,pl).getRegex(),Oz=ot(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,pl).getRegex(),Az="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Tz=ot(Az,"gu").replace(/notPunctSpace/g,Lw).replace(/punctSpace/g,Yh).replace(/punct/g,pl).getRegex(),Cz=ot(/\\(punct)/,"gu").replace(/punct/g,pl).getRegex(),jz=ot(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Pz=ot($w).replace("(?:-->|$)","-->").getRegex(),Nz=ot("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Pz).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Pf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Rz=ot(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Pf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),aN=ot(/^!?\[(label)\]\[(ref)\]/).replace("label",Pf).replace("ref",Iw).getRegex(),oN=ot(/^!?\[(ref)\](?:\[\])?/).replace("ref",Iw).getRegex(),Iz=ot("reflink|nolink(?!\\()","g").replace("reflink",aN).replace("nolink",oN).getRegex(),Nk=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Dw={_backpedal:wo,anyPunctuation:Cz,autolink:jz,blockSkip:xz,br:tN,code:mz,del:wo,delLDelim:wo,delRDelim:wo,emStrongLDelim:wz,emStrongRDelimAst:Sz,emStrongRDelimUnd:Ez,escape:pz,link:Rz,nolink:oN,punctuation:yz,reflink:aN,reflinkSearch:Iz,tag:Nz,text:gz,url:wo},$z={...Dw,link:ot(/^!?\[(label)\]\((.*?)\)/).replace("label",Pf).getRegex(),reflink:ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Pf).getRegex()},Lb={...Dw,emStrongRDelimAst:kz,emStrongLDelim:_z,delLDelim:Oz,delRDelim:Tz,url:ot(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Nk).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ot(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Nk).getRegex()},Mz={...Lb,br:ot(tN).replace("{2,}","*").getRegex(),text:ot(Lb.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Zd={normal:Mw,gfm:fz,pedantic:hz},cc={normal:Dw,gfm:Lb,breaks:Mz,pedantic:$z},Lz={"&":"&","<":"<",">":">",'"':""","'":"'"},Rk=t=>Lz[t];function vi(t,e){if(e){if(Nr.escapeTest.test(t))return t.replace(Nr.escapeReplace,Rk)}else if(Nr.escapeTestNoEncode.test(t))return t.replace(Nr.escapeReplaceNoEncode,Rk);return t}function Ik(t){try{t=encodeURI(t).replace(Nr.percentDecode,"%")}catch{return null}return t}function $k(t,e){var a;let r=t.replace(Nr.findPipe,(o,c,u)=>{let d=!1,p=c;for(;--p>=0&&u[p]==="\\";)d=!d;return d?"|":" |"}),n=r.split(Nr.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(Nr.slashPipe,"|");return n}function Aa(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n&&t.charAt(n-i-1)===e;)i++;return t.slice(0,n-i)}function Mk(t){let e=t.split(`
|
|
323
|
-
`),r=e.length-1;for(;r>=0&&Nr.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
|
|
324
|
-
`)}function Dz(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function zz(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let a=4-r%4;n+=" ".repeat(a),r+=a}else n+=i,r++;return n}function Lk(t,e,r,n,i){let a=e.href,o=e.title||null,c=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:c,tokens:n.inlineTokens(c)};return n.state.inLink=!1,u}function Bz(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
|
|
325
|
-
`).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[c]=o;return c.length>=i.length?a.slice(i.length):a}).join(`
|
|
326
|
-
`)}var Nf=class{constructor(t){bt(this,"options");bt(this,"rules");bt(this,"lexer");this.options=t||Lo}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:Mk(e[0]),n=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],n=Bz(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=Aa(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:Aa(e[0],`
|
|
327
|
-
`),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Aa(e[0],`
|
|
328
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=Aa(e[0],`
|
|
329
|
-
`).split(`
|
|
330
|
-
`),n="",i="",a=[];for(;r.length>0;){let o=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),o=!0;else if(!o)c.push(r[u]);else break;r=r.slice(u);let d=c.join(`
|
|
331
|
-
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
332
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
333
|
-
${d}`:d,i=i?`${i}
|
|
334
|
-
${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=h,r.length===0)break;let g=a.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){let v=g,x=v.raw+`
|
|
335
|
-
`+r.join(`
|
|
336
|
-
`),_=this.blockquote(x);a[a.length-1]=_,n=n.substring(0,n.length-v.raw.length)+_.raw,i=i.substring(0,i.length-v.text.length)+_.text;break}else if((g==null?void 0:g.type)==="list"){let v=g,x=v.raw+`
|
|
337
|
-
`+r.join(`
|
|
338
|
-
`),_=this.list(x);a[a.length-1]=_,n=n.substring(0,n.length-g.raw.length)+_.raw,i=i.substring(0,i.length-v.raw.length)+_.raw,r=x.substring(a.at(-1).raw.length).split(`
|
|
339
|
-
`);continue}}return{type:"blockquote",raw:n,tokens:a,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let u=!1,d="",p="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let h=zz(e[2].split(`
|
|
340
|
-
`,1)[0],e[1].length),g=t.split(`
|
|
341
|
-
`,1)[0],v=!h.trim(),x=0;if(this.options.pedantic?(x=2,p=h.trimStart()):v?x=e[1].length+1:(x=h.search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=h.slice(x),x+=e[1].length),v&&this.rules.other.blankLine.test(g)&&(d+=g+`
|
|
342
|
-
`,t=t.substring(g.length+1),u=!0),!u){let _=this.rules.other.nextBulletRegex(x),b=this.rules.other.hrRegex(x),k=this.rules.other.fencesBeginRegex(x),E=this.rules.other.headingBeginRegex(x),O=this.rules.other.htmlBeginRegex(x),A=this.rules.other.blockquoteBeginRegex(x);for(;t;){let T=t.split(`
|
|
343
|
-
`,1)[0],C;if(g=T,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),C=g):C=g.replace(this.rules.other.tabCharGlobal," "),k.test(g)||E.test(g)||O.test(g)||A.test(g)||_.test(g)||b.test(g))break;if(C.search(this.rules.other.nonSpaceChar)>=x||!g.trim())p+=`
|
|
344
|
-
`+C.slice(x);else{if(v||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(h)||E.test(h)||b.test(h))break;p+=`
|
|
345
|
-
`+g}v=!g.trim(),d+=T+`
|
|
346
|
-
`,t=t.substring(T.length+1),h=C.slice(x)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),i.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=d}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let d=u.tokens[0];if(u.task&&((d==null?void 0:d.type)==="text"||(d==null?void 0:d.type)==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(u.raw);if(p){let h={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};u.checked=h.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=h.raw+u.tokens[0].raw,u.tokens[0].text=h.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(h)):u.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):u.tokens.unshift(h)}}else u.task&&(u.task=!1);if(!i.loose){let p=u.tokens.filter(g=>g.type==="space"),h=p.length>0&&p.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=h}}if(i.loose)for(let u of i.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=Mk(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:Aa(e[0],`
|
|
347
|
-
`),href:n,title:i}}}table(t){var o;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=$k(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
348
|
-
`):[],a={type:"table",raw:Aa(e[0],`
|
|
349
|
-
`),header:[],align:[],rows:[]};if(r.length===n.length){for(let c of n)this.rules.other.tableAlignRight.test(c)?a.align.push("right"):this.rules.other.tableAlignCenter.test(c)?a.align.push("center"):this.rules.other.tableAlignLeft.test(c)?a.align.push("left"):a.align.push(null);for(let c=0;c<r.length;c++)a.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:a.align[c]});for(let c of i)a.rows.push($k(c,a.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[d]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:Aa(e[0],`
|
|
350
|
-
`),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
351
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=Aa(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=Dz(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let n=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Lk(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[n.toLowerCase()];if(!i){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return Lk(r,i,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,a,o,c=i,u=0,d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(n=d.exec(e))!==null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(o=[...a].length,n[3]||n[4]){c+=o;continue}else if((n[5]||n[6])&&i%3&&!((i+o)%3)){u+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+u);let p=[...n[0]][0].length,h=t.slice(0,i+n.index+p+o);if(Math.min(i,o)%2){let v=h.slice(1,-1);return{type:"em",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}let g=h.slice(2,-2);return{type:"strong",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,a,o,c=i,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*t.length+i);(n=u.exec(e))!==null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a||(o=[...a].length,o!==i))continue;if(n[3]||n[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let d=[...n[0]][0].length,p=t.slice(0,i+n.index+d+o),h=p.slice(i,-i);return{type:"del",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let a;do a=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(a!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Gn=class Db{constructor(e){bt(this,"tokens");bt(this,"options");bt(this,"state");bt(this,"inlineQueue");bt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Lo,this.options.tokenizer=this.options.tokenizer||new Nf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Nr,block:Zd.normal,inline:cc.normal};this.options.pedantic?(r.block=Zd.pedantic,r.inline=cc.pedantic):this.options.gfm&&(r.block=Zd.gfm,this.options.breaks?r.inline=cc.breaks:r.inline=cc.gfm),this.tokenizer.rules=r}static get rules(){return{block:Zd,inline:cc}}static lex(e,r){return new Db(r).lex(e)}static lexInline(e,r){return new Db(r).inlineTokens(e)}lex(e){e=e.replace(Nr.carriageReturn,`
|
|
352
|
-
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var a,o,c;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Nr.tabCharGlobal," ").replace(Nr.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let u;if((o=(a=this.options.extensions)==null?void 0:a.block)!=null&&o.some(p=>(u=p.call({lexer:this},e,r))?(e=e.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.space(e)){e=e.substring(u.raw.length);let p=r.at(-1);u.raw.length===1&&p!==void 0?p.raw+=`
|
|
353
|
-
`:r.push(u);continue}if(u=this.tokenizer.code(e)){e=e.substring(u.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
354
|
-
`)?"":`
|
|
355
|
-
`)+u.raw,p.text+=`
|
|
356
|
-
`+u.text,this.inlineQueue.at(-1).src=p.text):r.push(u);continue}if(u=this.tokenizer.fences(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.heading(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.hr(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.blockquote(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.list(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.html(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.def(e)){e=e.substring(u.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
357
|
-
`)?"":`
|
|
358
|
-
`)+u.raw,p.text+=`
|
|
359
|
-
`+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},r.push(u));continue}if(u=this.tokenizer.table(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.lheading(e)){e=e.substring(u.raw.length),r.push(u);continue}let d=e;if((c=this.options.extensions)!=null&&c.startBlock){let p=1/0,h=e.slice(1),g;this.options.extensions.startBlock.forEach(v=>{g=v.call({lexer:this},h),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(d=e.substring(0,p+1))}if(this.state.top&&(u=this.tokenizer.paragraph(d))){let p=r.at(-1);n&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
|
|
360
|
-
`)?"":`
|
|
361
|
-
`)+u.raw,p.text+=`
|
|
362
|
-
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(u),n=d.length!==e.length,e=e.substring(u.raw.length);continue}if(u=this.tokenizer.text(e)){e=e.substring(u.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
363
|
-
`)?"":`
|
|
364
|
-
`)+u.raw,p.text+=`
|
|
365
|
-
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(u);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var d,p,h,g,v;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let x=Object.keys(this.tokens.links);if(x.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)x.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((p=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:p.call({lexer:this},n))??n;let o=!1,c="",u=1/0;for(;e;){if(e.length<u)u=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}o||(c=""),o=!1;let x;if((g=(h=this.options.extensions)==null?void 0:h.inline)!=null&&g.some(b=>(x=b.call({lexer:this},e,r))?(e=e.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(x.raw.length);let b=r.at(-1);x.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=x.raw,b.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(e,n,c)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(e,n,c)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(e)){e=e.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(e))){e=e.substring(x.raw.length),r.push(x);continue}let _=e;if((v=this.options.extensions)!=null&&v.startInline){let b=1/0,k=e.slice(1),E;this.options.extensions.startInline.forEach(O=>{E=O.call({lexer:this},k),typeof E=="number"&&E>=0&&(b=Math.min(b,E))}),b<1/0&&b>=0&&(_=e.substring(0,b+1))}if(x=this.tokenizer.inlineText(_)){e=e.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(c=x.raw.slice(-1)),o=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=x.raw,b.text+=x.text):r.push(x);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw new Error(r)}},Rf=class{constructor(e){bt(this,"options");bt(this,"parser");this.options=e||Lo}space(e){return""}code({text:e,lang:r,escaped:n}){var o;let i=(o=(r||"").match(Nr.notSpaceStart))==null?void 0:o[0],a=e.replace(Nr.endingNewline,"")+`
|
|
366
|
-
`;return i?'<pre><code class="language-'+vi(i)+'">'+(n?a:vi(a,!0))+`</code></pre>
|
|
367
|
-
`:"<pre><code>"+(n?a:vi(a,!0))+`</code></pre>
|
|
368
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
369
|
-
${this.parser.parse(e)}</blockquote>
|
|
370
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
|
|
371
|
-
`}hr(e){return`<hr>
|
|
372
|
-
`}list(e){let r=e.ordered,n=e.start,i="";for(let c=0;c<e.items.length;c++){let u=e.items[c];i+=this.listitem(u)}let a=r?"ol":"ul",o=r&&n!==1?' start="'+n+'"':"";return"<"+a+o+`>
|
|
373
|
-
`+i+"</"+a+`>
|
|
374
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
375
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
376
|
-
`}table(e){let r="",n="";for(let a=0;a<e.header.length;a++)n+=this.tablecell(e.header[a]);r+=this.tablerow({text:n});let i="";for(let a=0;a<e.rows.length;a++){let o=e.rows[a];n="";for(let c=0;c<o.length;c++)n+=this.tablecell(o[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
377
|
-
<thead>
|
|
378
|
-
`+r+`</thead>
|
|
379
|
-
`+i+`</table>
|
|
380
|
-
`}tablerow({text:e}){return`<tr>
|
|
381
|
-
${e}</tr>
|
|
382
|
-
`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
|
|
383
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${vi(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=Ik(e);if(a===null)return i;e=a;let o='<a href="'+e+'"';return r&&(o+=' title="'+vi(r)+'"'),o+=">"+i+"</a>",o}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Ik(e);if(a===null)return vi(n);e=a;let o=`<img src="${e}" alt="${vi(n)}"`;return r&&(o+=` title="${vi(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:vi(e.text)}},zw=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Kn=class zb{constructor(e){bt(this,"options");bt(this,"renderer");bt(this,"textRenderer");this.options=e||Lo,this.options.renderer=this.options.renderer||new Rf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new zw}static parse(e,r){return new zb(r).parse(e)}static parseInline(e,r){return new zb(r).parseInline(e)}parse(e){var n,i;this.renderer.parser=this;let r="";for(let a=0;a<e.length;a++){let o=e[a];if((i=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&i[o.type]){let u=o,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){r+=d||"";continue}}let c=o;switch(c.type){case"space":{r+=this.renderer.space(c);break}case"hr":{r+=this.renderer.hr(c);break}case"heading":{r+=this.renderer.heading(c);break}case"code":{r+=this.renderer.code(c);break}case"table":{r+=this.renderer.table(c);break}case"blockquote":{r+=this.renderer.blockquote(c);break}case"list":{r+=this.renderer.list(c);break}case"checkbox":{r+=this.renderer.checkbox(c);break}case"html":{r+=this.renderer.html(c);break}case"def":{r+=this.renderer.def(c);break}case"paragraph":{r+=this.renderer.paragraph(c);break}case"text":{r+=this.renderer.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,r=this.renderer){var i,a;this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let c=e[o];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){n+=d||"";continue}}let u=c;switch(u.type){case"escape":{n+=r.text(u);break}case"html":{n+=r.html(u);break}case"link":{n+=r.link(u);break}case"image":{n+=r.image(u);break}case"checkbox":{n+=r.checkbox(u);break}case"strong":{n+=r.strong(u);break}case"em":{n+=r.em(u);break}case"codespan":{n+=r.codespan(u);break}case"br":{n+=r.br(u);break}case"del":{n+=r.del(u);break}case"text":{n+=r.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},Sf,wc=(Sf=class{constructor(e){bt(this,"options");bt(this,"block");this.options=e||Lo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Gn.lex:Gn.lexInline}provideParser(e=this.block){return e?Kn.parse:Kn.parseInline}},bt(Sf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),bt(Sf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Sf),Uz=class{constructor(...t){bt(this,"defaults",Pw());bt(this,"options",this.setOptions);bt(this,"parse",this.parseMarkdown(!0));bt(this,"parseInline",this.parseMarkdown(!1));bt(this,"Parser",Kn);bt(this,"Renderer",Rf);bt(this,"TextRenderer",zw);bt(this,"Lexer",Gn);bt(this,"Tokenizer",Nf);bt(this,"Hooks",wc);this.use(...t)}walkTokens(t,e){var n,i;let r=[];for(let a of t)switch(r=r.concat(e.call(this,a)),a.type){case"table":{let o=a;for(let c of o.header)r=r.concat(this.walkTokens(c.tokens,e));for(let c of o.rows)for(let u of c)r=r.concat(this.walkTokens(u.tokens,e));break}case"list":{let o=a;r=r.concat(this.walkTokens(o.items,e));break}default:{let o=a;(i=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(c=>{let u=o[c].flat(1/0);r=r.concat(this.walkTokens(u,e))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=e.renderers[i.name];a?e.renderers[i.name]=function(...o){let c=i.renderer.apply(this,o);return c===!1&&(c=a.apply(this,o)),c}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),n.extensions=e),r.renderer){let i=this.defaults.renderer||new Rf(this.defaults);for(let a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,c=r.renderer[o],u=i[o];i[o]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new Nf(this.defaults);for(let a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,c=r.tokenizer[o],u=i[o];i[o]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new wc;for(let a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,c=r.hooks[o],u=i[o];wc.passThroughHooks.has(a)?i[o]=d=>{if(this.defaults.async&&wc.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await c.call(i,d);return u.call(i,h)})();let p=c.call(i,d);return u.call(i,p)}:i[o]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await c.apply(i,d);return h===!1&&(h=await u.apply(i,d)),h})();let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(o){let c=[];return c.push(a.call(this,o)),i&&(c=c.concat(i.call(this,o))),c}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Gn.lex(t,e??this.defaults)}parser(t,e){return Kn.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,c=await(i.hooks?await i.hooks.provideLexer(t):t?Gn.lex:Gn.lexInline)(o,i),u=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(t):t?Kn.parse:Kn.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?Gn.lex:Gn.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(t):t?Kn.parse:Kn.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(t,e){return r=>{if(r.message+=`
|
|
384
|
-
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+vi(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Po=new Uz;function nt(t,e){return Po.parse(t,e)}nt.options=nt.setOptions=function(t){return Po.setOptions(t),nt.defaults=Po.defaults,JP(nt.defaults),nt};nt.getDefaults=Pw;nt.defaults=Lo;nt.use=function(...t){return Po.use(...t),nt.defaults=Po.defaults,JP(nt.defaults),nt};nt.walkTokens=function(t,e){return Po.walkTokens(t,e)};nt.parseInline=Po.parseInline;nt.Parser=Kn;nt.parser=Kn.parse;nt.Renderer=Rf;nt.TextRenderer=zw;nt.Lexer=Gn;nt.lexer=Gn.lex;nt.Tokenizer=Nf;nt.Hooks=wc;nt.parse=nt;nt.options;nt.setOptions;nt.use;nt.walkTokens;nt.parseInline;Kn.parse;Gn.lex;function qz(){const[t,e]=N.useState(!1),[r,n]=N.useState(""),[i,a]=N.useState(null),o=N.useRef(null),c=N.useRef(null),u=N.useRef(null),{messages:d,streaming:p,isStreaming:h,connected:g,sendChatMessage:v,addUserMessage:x,uploadAttachment:_}=YP(),b=N.useMemo(()=>d.slice(-10),[d]);N.useLayoutEffect(()=>{const A=o.current;A&&(A.scrollTop=A.scrollHeight)},[b,p,h,t]);async function k(){const A=r.trim();if(!A&&!i||h)return;const T=crypto.randomUUID(),C=i==null?void 0:i.name,j=[A,C?`Attachment: ${C}`:""].filter(Boolean).join(`
|
|
385
|
-
|
|
386
|
-
`);x({id:T,role:"user",content:A,timestamp:new Date().toISOString(),attachmentName:C}),n(""),a(null),u.current&&(u.current.value=""),c.current&&(c.current.style.height="auto");try{i&&await _(i,T),v(j),e(!0)}catch{}}function E(A){n(A.target.value),c.current&&(c.current.style.height="auto",c.current.style.height=`${Math.min(c.current.scrollHeight,96)}px`)}function O(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),k())}return y.jsxs("div",{className:"fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3",children:[t&&y.jsxs("div",{className:"w-[340px] h-[460px] rounded-2xl border border-white/[0.09] shadow-2xl overflow-hidden flex flex-col",style:{background:"#1c1c1c"},children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.07] flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(216,51,51,0.18) 0%, rgba(240,65,255,0.10) 100%)"},children:[y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx(Ra,{height:20}),y.jsx("span",{className:"text-xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:"quick chat"})]}),y.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1 rounded-lg hover:bg-white/[0.07] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:y.jsx(KP,{className:"w-3.5 h-3.5"})})]}),y.jsxs("div",{ref:o,className:"flex-1 overflow-y-auto p-3 space-y-2",children:[b.length===0&&!h?y.jsx("div",{className:"h-full flex items-center justify-center text-center px-6",children:y.jsx("p",{className:"text-xs text-zinc-500",children:"Ask IO anything without leaving this page."})}):b.map(A=>y.jsx("div",{className:`flex ${A.role==="user"?"justify-end":"justify-start"}`,title:A.timestamp,children:y.jsxs("div",{className:`max-w-[85%] ${A.role==="user"?"ml-8":"mr-8"}`,children:[A.attachmentName&&y.jsx("div",{className:"mb-1 rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:A.attachmentName}),A.content&&y.jsx("div",{className:A.role==="user"?"bg-gradient-to-br from-[#E43A9C] to-[#D83333] rounded-xl px-3 py-2 text-xs text-white whitespace-pre-wrap":"bg-[#2a2a2a] rounded-xl px-3 py-2 text-xs text-zinc-200",children:A.role==="user"?A.content:y.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:nt.parse(A.content)}})})]})},A.id)),h&&y.jsx("div",{className:"flex justify-start",children:y.jsx("div",{className:"max-w-[85%] mr-8 bg-[#2a2a2a] rounded-xl px-3 py-2 text-xs text-zinc-200",children:p?y.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:nt.parse(p)}}):y.jsx("div",{className:"flex items-center gap-1.5 py-1",children:[0,120,240].map(A=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${A}ms`}},A))})})})]}),y.jsx("div",{className:"p-2.5 border-t border-white/[0.06]",children:y.jsxs("div",{className:"bg-[#252525] border border-white/[0.08] rounded-xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[y.jsx("input",{ref:u,type:"file",className:"hidden",onChange:A=>{var T;return a(((T=A.target.files)==null?void 0:T[0])??null)}}),i&&y.jsxs("div",{className:"px-3 pt-2 text-[10px] font-mono text-zinc-400",children:["Attached: ",i.name]}),y.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-2",children:[y.jsx("button",{type:"button",onClick:()=>{var A;return(A=u.current)==null?void 0:A.click()},className:"p-1 rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.06] transition-colors flex-shrink-0 cursor-pointer",children:y.jsx(FP,{className:"w-3.5 h-3.5"})}),y.jsx("textarea",{ref:c,value:r,onChange:E,onKeyDown:O,placeholder:"Message IO…",rows:1,className:"flex-1 bg-transparent text-xs text-zinc-200 placeholder:text-zinc-700 resize-none focus:outline-none leading-relaxed",style:{minHeight:"18px",maxHeight:"96px",fontFamily:"Inter, sans-serif"}}),y.jsx("button",{type:"button",onClick:()=>void k(),disabled:!r.trim()&&!i||!g&&!h,className:"p-1.5 rounded-lg text-white disabled:opacity-25 disabled:cursor-not-allowed transition-opacity hover:opacity-90 flex-shrink-0 cursor-pointer",style:{background:"linear-gradient(135deg, #D83333, #E43A9C)"},children:h?y.jsx(Kh,{className:"w-3 h-3"}):y.jsx(GP,{className:"w-3 h-3"})})]})]})})]}),y.jsx("button",{type:"button",onClick:()=>e(A=>!A),className:"w-12 h-12 rounded-full primary-btn shadow-lg text-white flex items-center justify-center hover:opacity-95 transition-opacity","aria-label":t?"Close quick chat":"Open quick chat",children:y.jsx(m4,{className:"w-5 h-5"})})]})}function sN(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=sN(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function at(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=sN(t))&&(n&&(n+=" "),n+=e);return n}const Fz=(t,e)=>{const r=new Array(t.length+e.length);for(let n=0;n<t.length;n++)r[n]=t[n];for(let n=0;n<e.length;n++)r[t.length+n]=e[n];return r},Hz=(t,e)=>({classGroupId:t,validator:e}),lN=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),If="-",Dk=[],Wz="arbitrary..",Gz=t=>{const e=Vz(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Kz(o);const c=o.split(If),u=c[0]===""&&c.length>1?1:0;return cN(c,u,e)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=n[o],d=r[o];return u?d?Fz(d,u):u:d||Dk}return r[o]||Dk}}},cN=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const i=t[e],a=r.nextPart.get(i);if(a){const d=cN(t,e+1,a);if(d)return d}const o=r.validators;if(o===null)return;const c=e===0?t.join(If):t.slice(e).join(If),u=o.length;for(let d=0;d<u;d++){const p=o[d];if(p.validator(c))return p.classGroupId}},Kz=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),r=e.indexOf(":"),n=e.slice(0,r);return n?Wz+n:void 0})(),Vz=t=>{const{theme:e,classGroups:r}=t;return Xz(r,e)},Xz=(t,e)=>{const r=lN();for(const n in t){const i=t[n];Bw(i,r,n,e)}return r},Bw=(t,e,r,n)=>{const i=t.length;for(let a=0;a<i;a++){const o=t[a];Yz(o,e,r,n)}},Yz=(t,e,r,n)=>{if(typeof t=="string"){Jz(t,e,r);return}if(typeof t=="function"){Zz(t,e,r,n);return}Qz(t,e,r,n)},Jz=(t,e,r)=>{const n=t===""?e:uN(e,t);n.classGroupId=r},Zz=(t,e,r,n)=>{if(eB(t)){Bw(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(Hz(r,t))},Qz=(t,e,r,n)=>{const i=Object.entries(t),a=i.length;for(let o=0;o<a;o++){const[c,u]=i[o];Bw(u,uN(e,c),r,n)}},uN=(t,e)=>{let r=t;const n=e.split(If),i=n.length;for(let a=0;a<i;a++){const o=n[a];let c=r.nextPart.get(o);c||(c=lN(),r.nextPart.set(o,c)),r=c}return r},eB=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,tB=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=Object.create(null),n=Object.create(null);const i=(a,o)=>{r[a]=o,e++,e>t&&(e=0,n=r,r=Object.create(null))};return{get(a){let o=r[a];if(o!==void 0)return o;if((o=n[a])!==void 0)return i(a,o),o},set(a,o){a in r?r[a]=o:i(a,o)}}},Bb="!",zk=":",rB=[],Bk=(t,e,r,n,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),nB=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=i=>{const a=[];let o=0,c=0,u=0,d;const p=i.length;for(let _=0;_<p;_++){const b=i[_];if(o===0&&c===0){if(b===zk){a.push(i.slice(u,_)),u=_+1;continue}if(b==="/"){d=_;continue}}b==="["?o++:b==="]"?o--:b==="("?c++:b===")"&&c--}const h=a.length===0?i:i.slice(u);let g=h,v=!1;h.endsWith(Bb)?(g=h.slice(0,-1),v=!0):h.startsWith(Bb)&&(g=h.slice(1),v=!0);const x=d&&d>u?d-u:void 0;return Bk(a,v,g,x)};if(e){const i=e+zk,a=n;n=o=>o.startsWith(i)?a(o.slice(i.length)):Bk(rB,!1,o,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},iB=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((r,n)=>{e.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let a=0;a<r.length;a++){const o=r[a],c=o[0]==="[",u=e.has(o);c||u?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(o)):i.push(o)}return i.length>0&&(i.sort(),n.push(...i)),n}},aB=t=>({cache:tB(t.cacheSize),parseClassName:nB(t),sortModifiers:iB(t),postfixLookupClassGroupIds:oB(t),...Gz(t)}),oB=t=>{const e=Object.create(null),r=t.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)e[r[n]]=!0;return e},sB=/\s+/,lB=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=e,c=[],u=t.trim().split(sB);let d="";for(let p=u.length-1;p>=0;p-=1){const h=u[p],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:b}=r(h);if(g){d=h+(d.length>0?" "+d:d);continue}let k=!!b,E;if(k){const j=_.substring(0,b);E=n(j);const R=E&&o[E]?n(_):void 0;R&&R!==E&&(E=R,k=!1)}else E=n(_);if(!E){if(!k){d=h+(d.length>0?" "+d:d);continue}if(E=n(_),!E){d=h+(d.length>0?" "+d:d);continue}k=!1}const O=v.length===0?"":v.length===1?v[0]:a(v).join(":"),A=x?O+Bb:O,T=A+E;if(c.indexOf(T)>-1)continue;c.push(T);const C=i(E,k);for(let j=0;j<C.length;++j){const R=C[j];c.push(A+R)}d=h+(d.length>0?" "+d:d)}return d},cB=(...t)=>{let e=0,r,n,i="";for(;e<t.length;)(r=t[e++])&&(n=dN(r))&&(i&&(i+=" "),i+=n);return i},dN=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=dN(t[n]))&&(r&&(r+=" "),r+=e);return r},uB=(t,...e)=>{let r,n,i,a;const o=u=>{const d=e.reduce((p,h)=>h(p),t());return r=aB(d),n=r.cache.get,i=r.cache.set,a=c,c(u)},c=u=>{const d=n(u);if(d)return d;const p=lB(u,r);return i(u,p),p};return a=o,(...u)=>a(cB(...u))},dB=[],nr=t=>{const e=r=>r[t]||dB;return e.isThemeGetter=!0,e},fN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fB=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,hB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ta=t=>fB.test(t),Xe=t=>!!t&&!Number.isNaN(Number(t)),gi=t=>!!t&&Number.isInteger(Number(t)),wg=t=>t.endsWith("%")&&Xe(t.slice(0,-1)),Mi=t=>hB.test(t),pN=()=>!0,vB=t=>pB.test(t)&&!mB.test(t),Uw=()=>!1,bB=t=>gB.test(t),xB=t=>yB.test(t),wB=t=>!ke(t)&&!Ae(t),_B=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),SB=t=>Ua(t,yN,Uw),ke=t=>fN.test(t),po=t=>Ua(t,vN,vB),Uk=t=>Ua(t,PB,Xe),kB=t=>Ua(t,xN,pN),EB=t=>Ua(t,bN,Uw),qk=t=>Ua(t,mN,Uw),OB=t=>Ua(t,gN,xB),Qd=t=>Ua(t,wN,bB),Ae=t=>hN.test(t),uc=t=>Do(t,vN),AB=t=>Do(t,bN),Fk=t=>Do(t,mN),TB=t=>Do(t,yN),CB=t=>Do(t,gN),ef=t=>Do(t,wN,!0),jB=t=>Do(t,xN,!0),Ua=(t,e,r)=>{const n=fN.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},Do=(t,e,r=!1)=>{const n=hN.exec(t);return n?n[1]?e(n[1]):r:!1},mN=t=>t==="position"||t==="percentage",gN=t=>t==="image"||t==="url",yN=t=>t==="length"||t==="size"||t==="bg-size",vN=t=>t==="length",PB=t=>t==="number",bN=t=>t==="family-name",xN=t=>t==="number"||t==="weight",wN=t=>t==="shadow",NB=()=>{const t=nr("color"),e=nr("font"),r=nr("text"),n=nr("font-weight"),i=nr("tracking"),a=nr("leading"),o=nr("breakpoint"),c=nr("container"),u=nr("spacing"),d=nr("radius"),p=nr("shadow"),h=nr("inset-shadow"),g=nr("text-shadow"),v=nr("drop-shadow"),x=nr("blur"),_=nr("perspective"),b=nr("aspect"),k=nr("ease"),E=nr("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...A(),Ae,ke],C=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],R=()=>[Ae,ke,u],M=()=>[Ta,"full","auto",...R()],Y=()=>[gi,"none","subgrid",Ae,ke],W=()=>["auto",{span:["full",gi,Ae,ke]},gi,Ae,ke],B=()=>[gi,"auto",Ae,ke],X=()=>["auto","min","max","fr",Ae,ke],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...R()],J=()=>[Ta,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],F=()=>[Ta,"screen","full","dvw","lvw","svw","min","max","fit",...R()],te=()=>[Ta,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],q=()=>[t,Ae,ke],z=()=>[...A(),Fk,qk,{position:[Ae,ke]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",TB,SB,{size:[Ae,ke]}],se=()=>[wg,uc,po],le=()=>["","none","full",d,Ae,ke],ve=()=>["",Xe,uc,po],qe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[Xe,wg,Fk,qk],Se=()=>["","none",x,Ae,ke],Me=()=>["none",Xe,Ae,ke],oe=()=>["none",Xe,Ae,ke],et=()=>[Xe,Ae,ke],Fe=()=>[Ta,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mi],breakpoint:[Mi],color:[pN],container:[Mi],"drop-shadow":[Mi],ease:["in","out","in-out"],font:[wB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mi],shadow:[Mi],spacing:["px",Xe],text:[Mi],"text-shadow":[Mi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ta,ke,Ae,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Ae,ke]}],"container-named":[_B],columns:[{columns:[Xe,ke,Ae,c]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[gi,"auto",Ae,ke]}],basis:[{basis:[Ta,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Ta,"auto","initial","none",ke]}],grow:[{grow:["",Xe,Ae,ke]}],shrink:[{shrink:["",Xe,Ae,ke]}],order:[{order:[gi,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":Y()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":Y()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",r,uc,po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,jB,kB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wg,ke]}],"font-family":[{font:[AB,EB,e]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ae,ke]}],"line-clamp":[{"line-clamp":[Xe,"none",Ae,Uk]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...qe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Ae,po]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Xe,"auto",Ae,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[gi,Ae,ke]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gi,Ae,ke],radial:["",Ae,ke],conic:[gi,Ae,ke]},CB,OB]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...qe(),"hidden","none"]}],"divide-style":[{divide:[...qe(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...qe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Ae,ke]}],"outline-w":[{outline:["",Xe,uc,po]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",p,ef,Qd]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",h,ef,Qd]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Xe,po]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",g,ef,Qd]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[Xe,Ae,ke]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Ae,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:Se()}],brightness:[{brightness:[Xe,Ae,ke]}],contrast:[{contrast:[Xe,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",v,ef,Qd]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",Xe,Ae,ke]}],"hue-rotate":[{"hue-rotate":[Xe,Ae,ke]}],invert:[{invert:["",Xe,Ae,ke]}],saturate:[{saturate:[Xe,Ae,ke]}],sepia:[{sepia:["",Xe,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Ae,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Ae,ke]}],ease:[{ease:["linear","initial",k,Ae,ke]}],delay:[{delay:[Xe,Ae,ke]}],animate:[{animate:["none",E,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ae,ke]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],zoom:[{zoom:[gi,Ae,ke]}],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":q()}],"scrollbar-track-color":[{"scrollbar-track":q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,ke]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Xe,uc,po,Uk]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},RB=uB(NB);function _c(...t){return RB(at(t))}function IB({status:t}){const e={connected:"bg-green-500",idle:"bg-green-500",disconnected:"bg-zinc-600",error:"bg-red-500",working:"bg-amber-400",reviewing:"bg-blue-400"}[t],r=t==="connected"||t==="working";return y.jsxs("span",{className:"relative inline-flex items-center justify-center w-2 h-2",children:[r&&y.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full ${e} opacity-40 animate-ping`}),y.jsx("span",{className:`relative inline-flex rounded-full h-2 w-2 ${e}`})]})}function Vt({children:t,variant:e="muted",className:r=""}){const n={default:"bg-[#E43A9C]/15 text-[#F041FF] border-[#E43A9C]/20",success:"bg-green-500/15 text-green-400 border-green-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",error:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-blue-500/15 text-blue-400 border-blue-500/20",muted:"bg-white/5 text-zinc-400 border-white/10"}[e];return y.jsx("span",{className:`inline-flex items-center px-2 py-px rounded-full text-[10px] font-mono border ${n} ${r}`,children:t})}function $B({name:t,color:e}){return e?y.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${e}15`,color:e,borderColor:`${e}30`},children:t}):y.jsx(Vt,{variant:"muted",children:t})}function Da({children:t,onClick:e,className:r="",type:n="button",disabled:i=!1}){return y.jsx("button",{type:n,onClick:e,disabled:i,className:`flex items-center gap-1.5 font-mono text-[11px] text-white rounded-lg active:opacity-80 primary-btn cursor-pointer disabled:opacity-50 ${r}`,children:t})}function Wi({children:t,onClick:e,className:r=""}){return y.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-[#2e2e2e] hover:text-zinc-100 transition-colors cursor-pointer ${r}`,children:t})}function qw({children:t,onClick:e,className:r=""}){return y.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-red-500/10 hover:text-red-400 transition-colors cursor-pointer ${r}`,children:t})}function MB({children:t,onClick:e,className:r=""}){return y.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-amber-500/10 hover:text-amber-400 transition-colors cursor-pointer ${r}`,children:t})}function To(t){return t==="connected"||t==="idle"?"success":t==="active"||t==="working"?"warning":t==="reviewing"||t==="in meeting"||t==="planning"||t==="meeting"?"info":t==="error"||t==="failed"?"error":"muted"}function Jh(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function LB(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function c(p){try{d(n.next(p))}catch(h){o(h)}}function u(p){try{d(n.throw(p))}catch(h){o(h)}}function d(p){p.done?a(p.value):i(p.value).then(c,u)}d((n=n.apply(t,e||[])).next())})}const DB=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Fw extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class zB extends Fw{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Hk extends Fw{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Wk extends Fw{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Ub;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Ub||(Ub={}));class BB{constructor(e,{headers:r={},customFetch:n,region:i=Ub.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=DB(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return LB(this,arguments,void 0,function*(r,n={}){var i;let a,o;try{const{headers:c,method:u,body:d,signal:p,timeout:h}=n;let g={},{region:v}=n;v||(v=this.region);const x=new URL(`${this.url}/${r}`);v&&v!=="any"&&(g["x-region"]=v,x.searchParams.set("forceFunctionRegion",v));let _;d&&(c&&!Object.prototype.hasOwnProperty.call(c,"Content-Type")||!c)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(g["Content-Type"]="application/octet-stream",_=d):typeof d=="string"?(g["Content-Type"]="text/plain",_=d):typeof FormData<"u"&&d instanceof FormData?_=d:(g["Content-Type"]="application/json",_=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?_=JSON.stringify(d):_=d;let b=p;h&&(o=new AbortController,a=setTimeout(()=>o.abort(),h),p?(b=o.signal,p.addEventListener("abort",()=>o.abort())):b=o.signal);const k=yield this.fetch(x.toString(),{method:u||"POST",headers:Object.assign(Object.assign(Object.assign({},g),this.headers),c),body:_,signal:b}).catch(T=>{throw new zB(T)}),E=k.headers.get("x-relay-error");if(E&&E==="true")throw new Hk(k);if(!k.ok)throw new Wk(k);let O=((i=k.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),A;return O==="application/json"?A=yield k.json():O==="application/octet-stream"||O==="application/pdf"?A=yield k.blob():O==="text/event-stream"?A=k:O==="multipart/form-data"?A=yield k.formData():A=yield k.text(),{data:A,error:null,response:k}}catch(c){return{data:null,error:c,response:c instanceof Wk||c instanceof Hk?c.context:void 0}}finally{a&&clearTimeout(a)}})}}const _N=3,Gk=t=>Math.min(1e3*2**t,3e4),UB=[520,503],SN=["GET","HEAD","OPTIONS"];var qB=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Kk(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",i),r()},t);function i(){clearTimeout(n),r()}e==null||e.addEventListener("abort",i)})}function FB(t,e,r,n){return!(!n||r>=_N||!SN.includes(t)||!UB.includes(e))}var HB=class{constructor(t){var e,r,n,i,a;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(i=t.urlLengthLimit)!==null&&i!==void 0?i:8e3,this.retryEnabled=(a=t.retry)!==null&&a!==void 0?a:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let a=(async()=>{let o=0;for(;;){const d=new Headers(r.headers);o>0&&d.set("X-Retry-Count",String(o));let p;try{p=await n(r.url.toString(),{method:r.method,headers:d,body:JSON.stringify(r.body,(h,g)=>typeof g=="bigint"?g.toString():g),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!SN.includes(r.method))throw h;if(r.retryEnabled&&o<_N){const g=Gk(o);o++,await Kk(g,r.signal);continue}throw h}if(FB(r.method,p.status,o,r.retryEnabled)){var c,u;const h=(c=(u=p.headers)===null||u===void 0?void 0:u.get("Retry-After"))!==null&&c!==void 0?c:null,g=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:Gk(o);await p.text(),o++,await Kk(g,r.signal);continue}return await r.processResponse(p)}})();return this.shouldThrowOnError||(a=a.catch(o=>{var c;let u="",d="",p="";const h=o==null?void 0:o.cause;if(h){var g,v,x,_;const E=(g=h==null?void 0:h.message)!==null&&g!==void 0?g:"",O=(v=h==null?void 0:h.code)!==null&&v!==void 0?v:"";u=`${(x=o==null?void 0:o.name)!==null&&x!==void 0?x:"FetchError"}: ${o==null?void 0:o.message}`,u+=`
|
|
387
|
-
|
|
388
|
-
Caused by: ${(_=h==null?void 0:h.name)!==null&&_!==void 0?_:"Error"}: ${E}`,O&&(u+=` (${O})`),h!=null&&h.stack&&(u+=`
|
|
389
|
-
${h.stack}`)}else{var b;u=(b=o==null?void 0:o.stack)!==null&&b!==void 0?b:""}const k=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(p="",d="Request was aborted (timeout or manual cancellation)",k>this.urlLengthLimit&&(d+=`. Note: Your request URL is ${k} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(p="",d="HTTP headers exceeded server limits (typically 16KB)",k>this.urlLengthLimit&&(d+=`. Your request URL is ${k} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(c=o==null?void 0:o.name)!==null&&c!==void 0?c:"FetchError"}: ${o==null?void 0:o.message}`,details:u,hint:d,code:p},data:null,count:null,status:0,statusText:""}})),a.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,i=null,a=t.status,o=t.statusText;if(t.ok){var c,u;if(e.method!=="HEAD"){var d;const g=await t.text();g===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((d=e.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text"))?n=g:n=JSON.parse(g))}const p=(c=e.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),h=(u=t.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");p&&h&&h.length>1&&(i=parseInt(h[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,i=null,a=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const p=await t.text();try{r=JSON.parse(p),Array.isArray(r)&&t.status===404&&(n=[],r=null,a=200,o="OK")}catch{t.status===404&&p===""?(a=204,o="No Content"):r={message:p}}if(r&&e.shouldThrowOnError)throw new qB(r)}return{success:r===null,error:r,data:n,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},WB=class extends HB{select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){const a=i?`${i}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"offset":`${n}.offset`,a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(a,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:a="text"}={}){var o;const c=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),u=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${u}"; options=${c};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Vk=new RegExp("[,()]");var As=class extends WB{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Vk.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Vk.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let i="";n==="plain"?i="pl":n==="phrase"?i="ph":n==="websearch"&&(i="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${i}fts${a}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},GB=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:i=8e3,retry:a}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},i=r?"HEAD":"GET";let a=!1;const o=(t??"*").split("").map(d=>/\s/.test(d)&&!a?"":(d==='"'&&(a=!a),d)).join(""),{url:c,headers:u}=this.cloneRequestState();return c.searchParams.set("select",o),n&&u.append("Prefer",`count=${n}`),new As({method:i,url:c,headers:u,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const i="POST",{url:a,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),r||o.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(c.length>0){const u=[...new Set(c)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new As({method:i,url:a,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var a;const o="POST",{url:c,headers:u}=this.cloneRequestState();if(u.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&c.searchParams.set("on_conflict",e),n&&u.append("Prefer",`count=${n}`),i||u.append("Prefer","missing=default"),Array.isArray(t)){const d=t.reduce((p,h)=>p.concat(Object.keys(h)),[]);if(d.length>0){const p=[...new Set(d)].map(h=>`"${h}"`);c.searchParams.set("columns",p.join(","))}}return new As({method:o,url:c,headers:u,schema:this.schema,body:t,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:i,headers:a}=this.cloneRequestState();return e&&a.append("Prefer",`count=${e}`),new As({method:n,url:i,headers:a,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new As({method:r,url:n,headers:i,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Lc(t){"@babel/helpers - typeof";return Lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lc(t)}function KB(t,e){if(Lc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Lc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VB(t){var e=KB(t,"string");return Lc(e)=="symbol"?e:e+""}function XB(t,e,r){return(e=VB(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function tf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xk(Object(r),!0).forEach(function(n){XB(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var YB=class kN{constructor(e,{headers:r={},schema:n,fetch:i,timeout:a,urlLengthLimit:o=8e3,retry:c}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const u=i??globalThis.fetch;a!==void 0&&a>0?this.fetch=(d,p)=>{const h=new AbortController,g=setTimeout(()=>h.abort(),a),v=p==null?void 0:p.signal;if(v){if(v.aborted)return clearTimeout(g),u(d,p);const x=()=>{clearTimeout(g),h.abort()};return v.addEventListener("abort",x,{once:!0}),u(d,tf(tf({},p),{},{signal:h.signal})).finally(()=>{clearTimeout(g),v.removeEventListener("abort",x)})}return u(d,tf(tf({},p),{},{signal:h.signal})).finally(()=>clearTimeout(g))}:this.fetch=u,this.retry=c}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new GB(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new kN(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:i=!1,count:a}={}){var o;let c;const u=new URL(`${this.url}/rpc/${e}`);let d;const p=v=>v!==null&&typeof v=="object"&&(!Array.isArray(v)||v.some(p)),h=n&&Object.values(r).some(p);h?(c="POST",d=r):n||i?(c=n?"HEAD":"GET",Object.entries(r).filter(([v,x])=>x!==void 0).map(([v,x])=>[v,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([v,x])=>{u.searchParams.append(v,x)})):(c="POST",d=r);const g=new Headers(this.headers);return h?g.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&g.set("Prefer",`count=${a}`),new As({method:c,url:u,headers:g,schema:this.schemaName,body:d,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class JB{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const i=globalThis.process;if(i){const a=i.versions;if(a&&a.node){const o=a.node,c=parseInt(o.replace(/^v/,"").split(".")[0]);return c>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${c} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${c} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
390
|
-
import ws from "ws"
|
|
391
|
-
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
|
|
392
|
-
|
|
393
|
-
Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const ZB="2.106.2",QB=`realtime-js/${ZB}`,e8="1.0.0",EN="2.0.0",t8=EN,r8=1e4,n8=100,ja={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ON={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},qb={connecting:"connecting",closing:"closing",closed:"closed"};class i8{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,r,n){var i,a;const o=e.topic,c=(i=e.ref)!==null&&i!==void 0?i:"",u=(a=e.join_ref)!==null&&a!==void 0?a:"",d=e.payload.event,p=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(p).length===0?"":JSON.stringify(p);if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`ref length ${c.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const g=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+c.length+o.length+d.length+h.length,v=new ArrayBuffer(this.HEADER_LENGTH+g);let x=new DataView(v),_=0;x.setUint8(_++,this.KINDS.userBroadcastPush),x.setUint8(_++,u.length),x.setUint8(_++,c.length),x.setUint8(_++,o.length),x.setUint8(_++,d.length),x.setUint8(_++,h.length),x.setUint8(_++,r),Array.from(u,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(c,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(o,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(d,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(h,k=>x.setUint8(_++,k.charCodeAt(0)));var b=new Uint8Array(v.byteLength+n.byteLength);return b.set(new Uint8Array(v),0),b.set(new Uint8Array(n),v.byteLength),b.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[i,a,o,c,u]=n;return r({join_ref:i,ref:a,topic:o,event:c,payload:u})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,i)}}_decodeUserBroadcast(e,r,n){const i=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),c=r.getUint8(4);let u=this.HEADER_LENGTH+4;const d=n.decode(e.slice(u,u+i));u=u+i;const p=n.decode(e.slice(u,u+a));u=u+a;const h=n.decode(e.slice(u,u+o));u=u+o;const g=e.slice(u,e.byteLength),v=c===this.JSON_ENCODING?JSON.parse(n.decode(g)):g,x={type:this.BROADCAST_EVENT,event:p,payload:v};return o>0&&(x.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var At;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(At||(At={}));const Yk=(t,e,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((a,o)=>(a[o]=a8(o,t,e,i),a),{}):{}},a8=(t,e,r,n)=>{const i=e.find(c=>c.name===t),a=i==null?void 0:i.type,o=r[t];return a&&!n.includes(a)?AN(a,o):Fb(o)},AN=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return c8(e,r)}switch(t){case At.bool:return o8(e);case At.float4:case At.float8:case At.int2:case At.int4:case At.int8:case At.numeric:case At.oid:return s8(e);case At.json:case At.jsonb:return l8(e);case At.timestamp:return u8(e);case At.abstime:case At.date:case At.daterange:case At.int4range:case At.int8range:case At.money:case At.reltime:case At.text:case At.time:case At.timestamptz:case At.timetz:case At.tsrange:case At.tstzrange:return Fb(e);default:return Fb(e)}},Fb=t=>t,o8=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},s8=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},l8=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},c8=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let a;const o=t.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(c=>AN(e,c))}return t},u8=t=>typeof t=="string"?t.replace(" ","T"):t,TN=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var Tc=t=>typeof t=="function"?t:function(){return t},d8=typeof self<"u"?self:null,Ts=typeof window<"u"?window:null,bi=d8||Ts||globalThis,f8="2.0.0",h8=1e4,p8=1e3,xi={connecting:0,open:1,closing:2,closed:3},Xr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},zi={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Hb={longpoll:"longpoll",websocket:"websocket"},m8={complete:4},Wb="base64url.bearer.phx.",rf=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},CN=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},g8=class{constructor(t,e,r){this.state=Xr.closed,this.topic=t,this.params=Tc(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new rf(this,zi.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new CN(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Xr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Xr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Xr.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Xr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new rf(this,zi.leave,Tc({}),this.timeout).send(),this.state=Xr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(zi.reply,(n,i)=>{this.trigger(this.replyEventName(i),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Xr.closed,this.bindings=[]}onClose(t){this.on(zi.close,t)}onError(t){return this.on(zi.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new rf(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Xr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(zi.close,"leave")},r=new rf(this,zi.leave,Tc({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Xr.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let i=this.onMessage(t,e,r,n);if(e&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(o=>o.event===t&&this.filterBindings(o,e,r));for(let o=0;o<a.length;o++)a[o].callback(i,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Xr.closed}isErrored(){return this.state===Xr.errored}isJoined(){return this.state===Xr.joined}isJoining(){return this.state===Xr.joining}isLeaving(){return this.state===Xr.leaving}},$f=class{static request(t,e,r,n,i,a,o){if(bi.XDomainRequest){let c=new bi.XDomainRequest;return this.xdomainRequest(c,t,e,n,i,a,o)}else if(bi.XMLHttpRequest){let c=new bi.XMLHttpRequest;return this.xhrRequest(c,t,e,r,n,i,a,o)}else{if(bi.fetch&&bi.AbortController)return this.fetchRequest(t,e,r,n,i,a,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,i,a,o){let c={method:t,headers:r,body:n},u=null;return i&&(u=new AbortController,setTimeout(()=>u.abort(),i),c.signal=u.signal),bi.fetch(e,c).then(d=>d.text()).then(d=>this.parseJSON(d)).then(d=>o&&o(d)).catch(d=>{d.name==="AbortError"&&a?a():o&&o(null)}),u}static xdomainRequest(t,e,r,n,i,a,o){return t.timeout=i,t.open(e,r),t.onload=()=>{let c=this.parseJSON(t.responseText);o&&o(c)},a&&(t.ontimeout=a),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,i,a,o,c){t.open(e,r,!0),t.timeout=a;for(let[u,d]of Object.entries(n))t.setRequestHeader(u,d);return t.onerror=()=>c&&c(null),t.onreadystatechange=()=>{if(t.readyState===m8.complete&&c){let u=this.parseJSON(t.responseText);c(u)}},o&&(t.ontimeout=o),t.send(i),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=e?`${e}[${n}]`:n,a=t[n];typeof a=="object"?r.push(this.serialize(a,i)):r.push(encodeURIComponent(i)+"="+encodeURIComponent(a))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},y8=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return btoa(e)},ys=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Wb)&&(this.authToken=atob(e[1].slice(Wb.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=xi.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Hb.websocket),"$1/"+Hb.longpoll)}endpointURL(){return $f.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=xi.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===xi.open||this.readyState===xi.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:i}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:i.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=xi.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=y8(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
|
|
394
|
-
`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let i of this.reqs)i.abort();this.readyState=xi.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,i){let a,o=()=>{this.reqs.delete(a),n()};a=$f.request(t,this.endpointURL(),e,r,this.timeout,o,c=>{this.reqs.delete(a),this.isActive()&&i(c)}),this.reqs.add(a)}},v8=class Sc{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,i=>{let{onJoin:a,onLeave:o,onSync:c}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Sc.syncState(this.state,i,a,o),this.pendingDiffs.forEach(u=>{this.state=Sc.syncDiff(this.state,u,a,o)}),this.pendingDiffs=[],c()}),this.channel.on(n.diff,i=>{let{onJoin:a,onLeave:o,onSync:c}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Sc.syncDiff(this.state,i,a,o),c())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Sc.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,i){let a=this.clone(e),o={},c={};return this.map(a,(u,d)=>{r[u]||(c[u]=d)}),this.map(r,(u,d)=>{let p=a[u];if(p){let h=d.metas.map(_=>_.phx_ref),g=p.metas.map(_=>_.phx_ref),v=d.metas.filter(_=>g.indexOf(_.phx_ref)<0),x=p.metas.filter(_=>h.indexOf(_.phx_ref)<0);v.length>0&&(o[u]=d,o[u].metas=v),x.length>0&&(c[u]=this.clone(p),c[u].metas=x)}else o[u]=d}),this.syncDiff(a,{joins:o,leaves:c},n,i)}static syncDiff(e,r,n,i){let{joins:a,leaves:o}=this.clone(r);return n||(n=function(){}),i||(i=function(){}),this.map(a,(c,u)=>{let d=e[c];if(e[c]=this.clone(u),d){let p=e[c].metas.map(g=>g.phx_ref),h=d.metas.filter(g=>p.indexOf(g.phx_ref)<0);e[c].metas.unshift(...h)}n(c,d,u)}),this.map(o,(c,u)=>{let d=e[c];if(!d)return;let p=u.metas.map(h=>h.phx_ref);d.metas=d.metas.filter(h=>p.indexOf(h.phx_ref)<0),i(c,d,u),d.metas.length===0&&delete e[c]}),e}static list(e,r){return r||(r=function(n,i){return i}),this.map(e,(n,i)=>r(n,i))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},nf={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,i,a,o]=JSON.parse(t);return e({join_ref:r,ref:n,topic:i,event:a,payload:o})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:i,payload:a}=t,o=this.META_LENGTH+e.length+r.length+i.length+n.length,c=new ArrayBuffer(this.HEADER_LENGTH+o),u=new DataView(c),d=0;u.setUint8(d++,this.KINDS.push),u.setUint8(d++,e.length),u.setUint8(d++,r.length),u.setUint8(d++,i.length),u.setUint8(d++,n.length),Array.from(e,h=>u.setUint8(d++,h.charCodeAt(0))),Array.from(r,h=>u.setUint8(d++,h.charCodeAt(0))),Array.from(i,h=>u.setUint8(d++,h.charCodeAt(0))),Array.from(n,h=>u.setUint8(d++,h.charCodeAt(0)));var p=new Uint8Array(c.byteLength+a.byteLength);return p.set(new Uint8Array(c),0),p.set(new Uint8Array(a),c.byteLength),p.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,c=r.decode(t.slice(o,o+n));o=o+n;let u=r.decode(t.slice(o,o+i));o=o+i;let d=r.decode(t.slice(o,o+a));o=o+a;let p=t.slice(o,t.byteLength);return{join_ref:c,ref:null,topic:u,event:d,payload:p}},decodeReply(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=e.getUint8(3),o=e.getUint8(4),c=this.HEADER_LENGTH+this.META_LENGTH,u=r.decode(t.slice(c,c+n));c=c+n;let d=r.decode(t.slice(c,c+i));c=c+i;let p=r.decode(t.slice(c,c+a));c=c+a;let h=r.decode(t.slice(c,c+o));c=c+o;let g=t.slice(c,t.byteLength),v={status:h,response:g};return{join_ref:u,ref:d,topic:p,event:zi.reply,payload:v}},decodeBroadcast(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=this.HEADER_LENGTH+2,o=r.decode(t.slice(a,a+n));a=a+n;let c=r.decode(t.slice(a,a+i));a=a+i;let u=t.slice(a,t.byteLength);return{join_ref:null,ref:null,topic:o,event:c,payload:u}}},b8=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||h8,this.transport=e.transport||bi.WebSocket||ys,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=bi&&bi.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=nf.encode.bind(nf),this.defaultDecoder=nf.decode.bind(nf),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==ys?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Ts&&Ts.addEventListener&&(Ts.addEventListener("pagehide",i=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Ts.addEventListener("pageshow",i=>{n===this.connectClock&&(n=null,this.connect())}),Ts.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=i=>e.rejoinAfterMs?e.rejoinAfterMs(i):[1e3,2e3,5e3][i-1]||1e4,this.reconnectAfterMs=i=>e.reconnectAfterMs?e.reconnectAfterMs(i):[10,50,100,150,200,250,500,1e3,2e3][i-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(i,a,o)=>{console.log(`${i}: ${a}`,o)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Tc(e.params||{}),this.endPoint=`${t}/${Hb.websocket}`,this.vsn=e.vsn||f8,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new CN(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return ys}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=$f.appendParams($f.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Tc(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==ys?this.connectWithFallback(ys,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(i=>{i.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case ys:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Wb}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,i,a,o=this.transportName(t),c=u=>{this.log("transport",`falling back to ${o}...`,u),this.off([i,a]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return c("memorized");this.fallbackTimer=setTimeout(c,e),a=this.onError(u=>{this.log("transport","error",u),n&&!r&&(clearTimeout(this.fallbackTimer),c(u))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let u=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${u}`,"true"),this.log("transport",`established ${u} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(c,e),this.ping(u=>{this.log("transport","connected to primary after",u),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),p8,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===xi.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(zi.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case xi.connecting:return"connecting";case xi.open:return"open";case xi.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new g8(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:i,join_ref:a}=t;this.log("push",`${e} ${r} (${a}, ${i})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:i,ref:a,join_ref:o}=e;if(a&&a===this.pendingHeartbeatRef){const c=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",c)}catch(u){this.log("error","error in heartbeat callback",u)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${i.status||""} ${r} ${n} ${a&&"("+a+")"||""}`.trim(),i);for(let c=0;c<this.channels.length;c++){const u=this.channels[c];u.isMember(r,n,i,o)&&u.trigger(n,i,a,o)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class Cc{constructor(e,r){const n=w8(r);this.presence=new v8(e.getChannel(),n),this.presence.onJoin((i,a,o)=>{const c=Cc.onJoinPayload(i,a,o);e.getChannel().trigger("presence",c)}),this.presence.onLeave((i,a,o)=>{const c=Cc.onLeavePayload(i,a,o);e.getChannel().trigger("presence",c)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return Cc.transformState(this.presence.state)}static transformState(e){return e=x8(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const i=e[n];return r[n]=Of(i),r},{})}static onJoinPayload(e,r,n){const i=Jk(r),a=Of(n);return{event:"join",key:e,currentPresences:i,newPresences:a}}static onLeavePayload(e,r,n){const i=Jk(r),a=Of(n);return{event:"leave",key:e,currentPresences:i,leftPresences:a}}}function Of(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function x8(t){return JSON.parse(JSON.stringify(t))}function w8(t){return(t==null?void 0:t.events)&&{events:t.events}}function Jk(t){return t!=null&&t.metas?Of(t):[]}var Zk;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Zk||(Zk={}));class _8{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new Cc(this.channel.channelAdapter,r)}}function S8(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class k8{constructor(e,r,n){const i=E8(n);this.channel=e.getSocket().channel(r,i),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let i;try{i=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>n8){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return i}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===ja.joined}isJoined(){return this.state===ja.joined}isJoining(){return this.state===ja.joining}isClosed(){return this.state===ja.closed}isLeaving(){return this.state===ja.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function E8(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Qk;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Qk||(Qk={}));var Ps;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Ps||(Ps={}));var Bi;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Bi||(Bi={}));class jc{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var i,a;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new k8(this.socket.socketAdapter,e,this.params),this.presence=new _8(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=TN(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,i,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:c,private:u}}=this.params,d=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(v=>v.filter))!==null&&i!==void 0?i:[],p=!!this.bindings[Ps.PRESENCE]&&this.bindings[Ps.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},g={broadcast:o,presence:Object.assign(Object.assign({},c),{enabled:p}),postgres_changes:d,private:u};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(v=>{e==null||e(Bi.CHANNEL_ERROR,S8(v))}),this._onClose(()=>e==null?void 0:e(Bi.CLOSED)),this.updateJoinPayload(Object.assign({config:g},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:v})=>{if(this.socket._isManualToken()||this.socket.setAuth(),v===void 0){e==null||e(Bi.SUBSCRIBED);return}this._updatePostgresBindings(v,e)}).receive("error",v=>{this.state=ja.errored;const x=Object.values(v).join(", ")||"error";e==null||e(Bi.CHANNEL_ERROR,new Error(x,{cause:v}))}).receive("timeout",()=>{e==null||e(Bi.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const i=this.bindings.postgres_changes,a=(n=i==null?void 0:i.length)!==null&&n!==void 0?n:0,o=[];for(let c=0;c<a;c++){const u=i[c],{filter:{event:d,schema:p,table:h,filter:g}}=u,v=e&&e[c];if(v&&v.event===d&&jc.isFilterValueEqual(v.schema,p)&&jc.isFilterValueEqual(v.table,h)&&jc.isFilterValueEqual(v.filter,g))o.push(Object.assign(Object.assign({},u),{id:v.id}));else{this.unsubscribe(),this.state=ja.errored,r==null||r(Bi.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=ja.errored&&r&&r(Bi.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),a=e===Ps.PRESENCE||e===Ps.POSTGRES_CHANGES;if(i&&a)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var i;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},c=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(c.status===202)return{success:!0};let u=c.statusText;try{const d=await c.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(e,r={}){var n,i;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=e,c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=d.body)===null||i===void 0?void 0:i.cancel()),d.ok?"ok":"error"}catch(d){return d instanceof Error&&d.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,c,u;const d=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((u=(c=(o=this.params)===null||o===void 0?void 0:o.config)===null||c===void 0?void 0:c.broadcast)===null||u===void 0)&&u.ack)&&a("ok"),d.receive("ok",()=>a("ok")),d.receive("error",()=>a("error")),d.receive("timeout",()=>a("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const i=new AbortController,a=setTimeout(()=>i.abort(),n),o=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(a),o}_on(e,r,n){const i=e.toLocaleLowerCase(),a=this.channelAdapter.on(e,n),o={type:i,filter:r,callback:n,ref:a};return this.bindings[i]?this.bindings[i].push(o):this.bindings[i]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var i,a,o,c,u,d,p;const h=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,n))return!1;const g=(i=this.bindings[h])===null||i===void 0?void 0:i.find(v=>v.ref===e.ref);if(!g)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in g){const v=g.id,x=(a=g.filter)===null||a===void 0?void 0:a.event;return v&&((o=r.ids)===null||o===void 0?void 0:o.includes(v))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((c=r.data)===null||c===void 0?void 0:c.type.toLocaleLowerCase()))}else{const v=(d=(u=g==null?void 0:g.filter)===null||u===void 0?void 0:u.event)===null||d===void 0?void 0:d.toLocaleLowerCase();return v==="*"||v===((p=r==null?void 0:r.event)===null||p===void 0?void 0:p.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===h})}_notThisChannelEvent(e,r){const{close:n,error:i,leave:a,join:o}=ON;return r&&[n,i,a,o].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const i=r.data,{schema:a,table:o,commit_timestamp:c,type:u,errors:d}=i;return Object.assign(Object.assign({},{schema:a,table:o,commit_timestamp:c,eventType:u,new:{},old:{},errors:d}),this._getPayloadRecords(i))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Yk(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Yk(e.columns,e.old_record)),r}}class O8{constructor(e,r){this.socket=new b8(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,i=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),i),this.socket.disconnect(()=>{e(),a("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==qb.connecting}isDisconnecting(){return this.socket.connectionState()==qb.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const eE={HEARTBEAT_INTERVAL:25e3},A8=[1e3,2e3,5e3,1e4],T8=1e4;function C8(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function j8(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return C8()}const P8=`
|
|
395
|
-
addEventListener("message", (e) => {
|
|
396
|
-
if (e.data.event === "start") {
|
|
397
|
-
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
398
|
-
}
|
|
399
|
-
});`;class N8{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new i8,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=a=>a?(...o)=>a(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const i=this._initializeOptions(r);this.socketAdapter=new O8(e,i),this.httpEndpoint=TN(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}
|
|
400
|
-
|
|
401
|
-
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
402
|
-
|
|
403
|
-
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
404
|
-
Option 2: Install and provide the "ws" package:
|
|
405
|
-
|
|
406
|
-
npm install ws
|
|
407
|
-
|
|
408
|
-
import ws from "ws"
|
|
409
|
-
const client = new RealtimeClient(url, {
|
|
410
|
-
...options,
|
|
411
|
-
transport: ws
|
|
412
|
-
})`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const i=await n.unsubscribe();return n.teardown(),i}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||qb.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,i=this.getChannels().find(a=>a.topic===n);if(i)return i;{const a=new jc(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(a),a}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(i=>{const a={access_token:r,version:QB};r&&i.updateJoinPayload(a),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(ON.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([P8],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,i,a,o,c,u,d,p,h,g,v;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const x={};x.timeout=(i=e==null?void 0:e.timeout)!==null&&i!==void 0?i:r8,x.heartbeatIntervalMs=(a=e==null?void 0:e.heartbeatIntervalMs)!==null&&a!==void 0?a:eE.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((c=e==null?void 0:e.heartbeatIntervalMs)!==null&&c!==void 0?c:eE.HEARTBEAT_INTERVAL),x.transport=(u=e==null?void 0:e.transport)!==null&&u!==void 0?u:JB.getWebSocketConstructor(),x.params=e==null?void 0:e.params,x.logger=e==null?void 0:e.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),x.sessionStorage=(d=e==null?void 0:e.sessionStorage)!==null&&d!==void 0?d:j8(),x.reconnectAfterMs=(p=e==null?void 0:e.reconnectAfterMs)!==null&&p!==void 0?p:(E=>A8[E-1]||T8);let _,b;const k=(h=e==null?void 0:e.vsn)!==null&&h!==void 0?h:t8;switch(k){case e8:_=(E,O)=>O(JSON.stringify(E)),b=(E,O)=>O(JSON.parse(E));break;case EN:_=this.serializer.encode.bind(this.serializer),b=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=k,x.encode=(g=e==null?void 0:e.encode)!==null&&g!==void 0?g:_,x.decode=(v=e==null?void 0:e.decode)!==null&&v!==void 0?v:b,x.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,x.params=Object.assign(Object.assign({},x.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Dc=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function R8(t,e,r){const n=new URL(e,t);if(r)for(const[i,a]of Object.entries(r))a!==void 0&&n.searchParams.set(i,a);return n.toString()}async function I8(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function $8(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:a,headers:o}){const c=R8(t.baseUrl,n,i),u=await I8(t.auth),d=await e(c,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...u,...o},body:a?JSON.stringify(a):void 0}),p=await d.text(),h=(d.headers.get("content-type")||"").includes("application/json"),g=h&&p?JSON.parse(p):p;if(!d.ok){const v=h?g:void 0,x=v==null?void 0:v.error;throw new Dc((x==null?void 0:x.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:v})}return{status:d.status,headers:d.headers,data:g}}}}function af(t){return t.join("")}var M8=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:af(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${af(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${af(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${af(t.namespace)}`}),!0}catch(e){if(e instanceof Dc&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof Dc&&r.status===409)return;throw r}}};function vs(t){return t.join("")}var L8=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${vs(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${vs(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${vs(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${vs(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${vs(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${vs(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof Dc&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof Dc&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},D8=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=$8({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new M8(this.client,e),this.tableOps=new L8(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function zc(t){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zc(t)}function z8(t,e){if(zc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(zc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function B8(t){var e=z8(t,"string");return zc(e)=="symbol"?e:e+""}function U8(t,e,r){return(e=B8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tE(Object(r),!0).forEach(function(n){U8(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Zh=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Qh(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Gb=class extends Zh{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return Be({},super.toJSON())}},jN=class extends Zh{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Mf(t,e,r){const n=Be({},t),i=e.toLowerCase();for(const a of Object.keys(n))a.toLowerCase()===i&&delete n[a];return n[i]=r,n}function q8(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const F8=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),H8=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Kb=t=>{if(Array.isArray(t))return t.map(r=>Kb(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));e[i]=Kb(n)}),e},W8=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),rE=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},G8=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const i=t;let a=parseInt(String(i.status),10);Number.isFinite(a)||(a=500),i.json().then(o=>{const c=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";e(new Gb(rE(o),a,c,n))}).catch(()=>{const o=a+"";e(new Gb(i.statusText||`HTTP ${a} error`,a,o,n))})}else e(new jN(rE(t),t,n))},K8=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return Be(Be({},i),r);if(H8(n)){var a;const o=(e==null?void 0:e.headers)||{};let c;for(const[u,d]of Object.entries(o))u.toLowerCase()==="content-type"&&(c=d);i.headers=Mf(o,"Content-Type",(a=c)!==null&&a!==void 0?a:"application/json"),i.body=JSON.stringify(n)}else i.body=n;return e!=null&&e.duplex&&(i.duplex=e.duplex),Be(Be({},i),r)};async function dc(t,e,r,n,i,a,o){return new Promise((c,u)=>{t(r,K8(e,n,i,a)).then(d=>{if(!d.ok)throw d;if(n!=null&&n.noResolveJson)return d;if(o==="vectors"){const p=d.headers.get("content-type");if(d.headers.get("content-length")==="0"||d.status===204)return{};if(!p||!p.includes("application/json"))return{}}return d.json()}).then(d=>c(d)).catch(d=>G8(d,u,n,o))})}function PN(t="storage"){return{get:async(e,r,n,i)=>dc(e,"GET",r,n,i,void 0,t),post:async(e,r,n,i,a)=>dc(e,"POST",r,i,a,n,t),put:async(e,r,n,i,a)=>dc(e,"PUT",r,i,a,n,t),head:async(e,r,n,i)=>dc(e,"HEAD",r,Be(Be({},n),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,r,n,i,a)=>dc(e,"DELETE",r,i,a,n,t)}}const V8=PN("storage"),{get:Bc,post:Fn,put:Vb,head:X8,remove:Hw}=V8,cn=PN("vectors");var ml=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=q8(e),this.fetch=F8(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Mf(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Qh(r))return{data:null,error:r};throw r}}};let NN;NN=Symbol.toStringTag;var Y8=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[NN]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Qh(e))return{data:null,error:e};throw e}}};let RN;RN=Symbol.toStringTag;var J8=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[RN]="BlobDownloadBuilder",this.promise=null}asStream(){return new Y8(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Qh(e))return{data:null,error:e};throw e}}};const Z8={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nE={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Q8=class extends ml{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var i=this;return i.handleOperation(async()=>{let a;const o=Be(Be({},nE),n);let c=Be(Be({},i.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const u=o.metadata;if(typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),u&&a.append("metadata",i.encodeMetadata(u)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),u&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(u))):(a=r,c["cache-control"]=`max-age=${o.cacheControl}`,c["content-type"]=o.contentType,u&&(c["x-metadata"]=i.toBase64(i.encodeMetadata(u))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers)for(const[g,v]of Object.entries(n.headers))c=Mf(c,g,v);const d=i._removeEmptyFolders(e),p=i._getFinalPath(d),h=await(t=="PUT"?Vb:Fn)(i.fetch,`${i.url}/object/${p}`,a,Be({headers:c},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:d,id:h.Id,fullPath:h.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var i=this;const a=i._removeEmptyFolders(t),o=i._getFinalPath(a),c=new URL(i.url+`/object/upload/sign/${o}`);return c.searchParams.set("token",e),i.handleOperation(async()=>{let u;const d=Be(Be({},nE),n);let p=Be(Be({},i.headers),{"x-upsert":String(d.upsert)});const h=d.metadata;if(typeof Blob<"u"&&r instanceof Blob?(u=new FormData,u.append("cacheControl",d.cacheControl),h&&u.append("metadata",i.encodeMetadata(h)),u.append("",r)):typeof FormData<"u"&&r instanceof FormData?(u=r,u.has("cacheControl")||u.append("cacheControl",d.cacheControl),h&&!u.has("metadata")&&u.append("metadata",i.encodeMetadata(h))):(u=r,p["cache-control"]=`max-age=${d.cacheControl}`,p["content-type"]=d.contentType,h&&(p["x-metadata"]=i.toBase64(i.encodeMetadata(h))),(typeof ReadableStream<"u"&&u instanceof ReadableStream||u&&typeof u=="object"&&"pipe"in u&&typeof u.pipe=="function")&&!d.duplex&&(d.duplex="half")),n!=null&&n.headers)for(const[g,v]of Object.entries(n.headers))p=Mf(p,g,v);return{path:a,fullPath:(await Vb(i.fetch,c.toString(),u,Be({headers:p},d!=null&&d.duplex?{duplex:d.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const i=Be({},r.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const a=await Fn(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(r.url+a.url),c=o.searchParams.get("token");if(!c)throw new Zh("No token returned by API");return{signedUrl:o.toString(),path:t,token:c}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Fn(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Fn(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(t);const a=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await Fn(n.fetch,`${n.url}/object/sign/${i}`,Be({expiresIn:e},a?{transform:r.transform}:{}),{headers:n.headers});const c=new URLSearchParams;r!=null&&r.download&&c.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&c.set("cacheNonce",String(r.cacheNonce));const u=c.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${u?`&${u}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const i=await Fn(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const o=a.toString();return i.map(c=>Be(Be({},c),{},{signedUrl:c.signedURL?encodeURI(`${n.url}${c.signedURL}${o?`&${o}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",i=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(i,e.transform),(e==null?void 0:e.cacheNonce)!=null&&i.set("cacheNonce",String(e.cacheNonce));const a=i.toString(),o=this._getFinalPath(t),c=()=>Bc(this.fetch,`${this.url}/${n}/${o}${a?`?${a}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new J8(c,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>Kb(await Bc(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await X8(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(i){if(e.shouldThrowOnError)throw i;if(Qh(i)){var n;const a=i instanceof Gb?i.status:i instanceof jN?(n=i.originalError)===null||n===void 0?void 0:n.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:i}}throw i}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const i=n.toString(),a=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}`)+(i?`?${i}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await Hw(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const i=Be(Be(Be({},Z8),e),{},{prefix:t||""});return await Fn(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=Be({},t);return await Fn(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const e6="2.106.2",ju={"X-Client-Info":`storage-js/${e6}`};var t6=class extends ml{constructor(t,e={},r,n){const i=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const a=i.href.replace(/\/$/,""),o=Be(Be({},ju),e);super(a,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await Bc(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Bc(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Fn(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await Vb(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Fn(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Hw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},r6=class extends ml{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},ju),e);super(n,i,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Fn(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),i=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await Bc(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Hw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!W8(t))throw new Zh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new D8({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,a){const o=i[a];return typeof o!="function"?o:async(...c)=>{try{return{data:await o.apply(i,c),error:null}}catch(u){if(n)throw u;return{data:null,error:u}}}}})}},n6=class extends ml{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},ju),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await cn.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await cn.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},i6=class extends ml{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},ju),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},a6=class extends ml{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},ju),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},o6=class extends a6{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new s6(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},s6=class extends n6{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new l6(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},l6=class extends i6{constructor(t,e,r,n,i){super(t,e,i),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},c6=class extends t6{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new Q8(this.url,this.headers,t,this.fetch)}get vectors(){return new o6(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new r6(this.url+"/iceberg",this.headers,this.fetch)}};const IN="2.106.2",Cs=30*1e3,Xb=3,_g=Xb*Cs,u6="http://localhost:9999",d6="supabase.auth.token",f6={"X-Client-Info":`gotrue-js/${IN}`},Yb="X-Supabase-Api-Version",$N={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},h6=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,p6=600*1e3;class qs extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function be(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class m6 extends qs{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function g6(t){return be(t)&&t.name==="AuthApiError"}class Xn extends qs{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class ta extends qs{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}}class pr extends ta{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function of(t){return be(t)&&t.name==="AuthSessionMissingError"}class bs extends ta{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class sf extends ta{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class lf extends ta{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function y6(t){return be(t)&&t.name==="AuthImplicitGrantRedirectError"}class iE extends ta{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class v6 extends ta{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Jb extends ta{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Sg(t){return be(t)&&t.name==="AuthRetryableFetchError"}class aE extends ta{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Zb extends ta{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Lf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),oE=`
|
|
413
|
-
\r=`.split(""),b6=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<oE.length;e+=1)t[oE[e].charCodeAt(0)]=-2;for(let e=0;e<Lf.length;e+=1)t[Lf[e].charCodeAt(0)]=e;return t})();function sE(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Lf[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Lf[n]),e.queuedBits-=6}}function MN(t,e,r){const n=b6[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function lE(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{_6(o,n,r)};for(let o=0;o<t.length;o+=1)MN(t.charCodeAt(o),i,a);return e.join("")}function x6(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function w6(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const i=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}x6(n,e)}}function _6(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if((t>>7-n&1)===0){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Ms(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)MN(t.charCodeAt(i),r,n);return new Uint8Array(e)}function S6(t){const e=[];return w6(t,r=>e.push(r)),new Uint8Array(e)}function _o(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};return t.forEach(i=>sE(i,r,n)),sE(null,r,n),e.join("")}function k6(t){return Math.round(Date.now()/1e3)+t}function E6(){return Symbol("auth-callback")}const xr=()=>typeof window<"u"&&typeof document<"u",mo={tested:!1,writable:!1},LN=()=>{if(!xr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(mo.tested)return mo.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),mo.tested=!0,mo.writable=!0}catch{mo.tested=!0,mo.writable=!1}return mo.writable};function O6(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,a)=>{e[a]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}const DN=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),A6=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",js=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},go=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},br=async(t,e)=>{await t.removeItem(e)};class ep{constructor(){this.promise=new ep.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}ep.promiseConstructor=Promise;function cf(t){const e=t.split(".");if(e.length!==3)throw new Zb("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!h6.test(e[n]))throw new Zb("JWT not in base64url format");return{header:JSON.parse(lE(e[0])),payload:JSON.parse(lE(e[1])),signature:Ms(e[2]),raw:{header:e[0],payload:e[1]}}}async function T6(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function C6(t,e){return new Promise((n,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await t(a);if(!e(a,null,o)){n(o);return}}catch(o){if(!e(a,o)){i(o);return}}})()})}function j6(t){return("0"+t.toString(16)).substr(-2)}function P6(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let a=0;a<56;a++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,j6).join("")}async function N6(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function R6(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await N6(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function xs(t,e,r=!1){const n=P6();let i=n;r&&(i+="/recovery"),await js(t,`${e}-code-verifier`,i);const a=await R6(n);return[a,n===a?"plain":"s256"]}const I6=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function $6(t){const e=t.headers.get(Yb);if(!e||!e.match(I6))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function M6(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function L6(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const D6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Li(t){if(!D6.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function qn(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function kg(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function z6(t,e){return new Proxy(t,{get:(r,n,i)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,i)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,i)}})}function cE(t){return JSON.parse(JSON.stringify(t))}const vo=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},B6=[502,503,504,520,521,522,523,524,530];async function uE(t){var e;if(!A6(t))throw new Jb(vo(t),0);if(B6.includes(t.status))throw new Jb(vo(t),t.status);let r;try{r=await t.json()}catch(a){throw new Xn(vo(a),a)}let n;const i=$6(t);if(i&&i.getTime()>=$N["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new aE(vo(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new pr}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new aE(vo(r),t.status,r.weak_password.reasons);throw new m6(vo(r),t.status||500,n)}const U6=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function Pe(t,e,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[Yb]||(a[Yb]=$N["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const o=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const c=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",u=await q6(t,e,r+c,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(u):{data:Object.assign({},u),error:null}}async function q6(t,e,r,n,i,a){const o=U6(e,n,i,a);let c;try{c=await t(r,Object.assign({},o))}catch(u){throw console.error(u),new Jb(vo(u),0)}if(c.ok||await uE(c),n!=null&&n.noResolveJson)return c;try{return await c.json()}catch(u){await uE(u)}}function En(t){var e;let r=null;W6(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=k6(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:r,user:n},error:null}}function dE(t){const e=En(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Pa(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function F6(t){return{data:t,error:null}}function H6(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=t,o=Jh(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),c={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},u=Object.assign({},o);return{data:{properties:c,user:u},error:null}}function fE(t){return t}function W6(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const Eg=["global","local","others"];class G6{_encodePathSegment(e){if(e==="."||e==="..")throw new qs("Invalid path segment");return encodeURIComponent(e)}constructor({url:e="",headers:r={},fetch:n,experimental:i}){this.url=e,this.headers=r,this.fetch=DN(n),this.experimental=i??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,r=Eg[0]){if(Eg.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Eg.join(", ")}`);try{return await Pe(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(be(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await Pe(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Pa})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=Jh(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n==null?void 0:n.newEmail,delete i.newEmail),await Pe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:H6,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(be(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await Pe(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Pa})}catch(r){if(be(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,a,o,c,u;try{const d={nextPage:null,lastPage:0,total:0},p=await Pe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:fE});if(p.error)throw p.error;const h=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(c=p.headers.get("link"))===null||c===void 0?void 0:c.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);d[`${b}Page`]=_}),d.total=parseInt(g)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(be(d))return{data:{users:[]},error:d};throw d}}async getUserById(e){Li(e);try{return await Pe(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Pa})}catch(r){if(be(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Li(e);try{return await Pe(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Pa})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Li(e);try{return await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Pa})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Li(e.userId);try{const{data:r,error:n}=await Pe(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Li(e.userId),Li(e.id);try{return{data:await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,i,a,o,c,u;try{const d={nextPage:null,lastPage:0,total:0},p=await Pe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:fE});if(p.error)throw p.error;const h=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(c=p.headers.get("link"))===null||c===void 0?void 0:c.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);d[`${b}Page`]=_}),d.total=parseInt(g)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(be(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(e){try{return await Pe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{const n=this._encodePathSegment(e);return await Pe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(be(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${r}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await Pe(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var i;return{data:{providers:(i=n==null?void 0:n.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(r){if(be(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await Pe(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"GET",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{const n=this._encodePathSegment(e);return await Pe(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(be(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){qn(this.experimental),Li(e.userId);try{return await Pe(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){qn(this.experimental),Li(e.userId),Li(e.passkeyId);try{return await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}}function hE(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const yi={debug:!!(globalThis&&LN()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class zN extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class pE extends zN{}async function K6(t,e,r){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let i;e>0&&(i=setTimeout(()=>{n.abort(),yi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async a=>{if(a){clearTimeout(i),yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,a.name);try{return await r()}finally{yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,a.name)}}else{if(e===0)throw yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new pE(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(yi.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(i),await r()}})}catch(a){if(e>0&&clearTimeout(i),a!==null&&typeof a=="object"&&"name"in a&&a.name==="AbortError"&&e>0){if(n.signal.aborted)return yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async o=>{if(o){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await r()}finally{yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new pE(`Lock "${t}" was released because another request stole it`)}throw a}}function V6(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function BN(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function X6(t){return parseInt(t,16)}function Y6(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function J6(t){var e;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:c,requestId:u,resources:d,scheme:p,uri:h,version:g}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(g!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${g}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
|
|
414
|
-
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const v=BN(t.address),x=p?`${p}://${n}`:n,_=t.statement?`${t.statement}
|
|
415
|
-
`:"",b=`${x} wants you to sign in with your Ethereum account:
|
|
416
|
-
${v}
|
|
417
|
-
|
|
418
|
-
${_}`;let k=`URI: ${h}
|
|
419
|
-
Version: ${g}
|
|
420
|
-
Chain ID: ${r}${o?`
|
|
421
|
-
Nonce: ${o}`:""}
|
|
422
|
-
Issued At: ${a.toISOString()}`;if(i&&(k+=`
|
|
423
|
-
Expiration Time: ${i.toISOString()}`),c&&(k+=`
|
|
424
|
-
Not Before: ${c.toISOString()}`),u&&(k+=`
|
|
425
|
-
Request ID: ${u}`),d){let E=`
|
|
426
|
-
Resources:`;for(const O of d){if(!O||typeof O!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${O}`);E+=`
|
|
427
|
-
- ${O}`}k+=E}return`${b}
|
|
428
|
-
${k}`}class Zt extends Error{constructor({message:e,code:r,cause:n,name:i}){var a;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=i??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Df extends Zt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function Z6({error:t,options:e}){var r,n,i;const{publicKey:a}=e;if(!a)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Zt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Zt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Zt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Zt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Zt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Zt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return a.pubKeyCredParams.filter(c=>c.type==="public-key").length===0?new Zt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Zt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(UN(o)){if(a.rp.id!==o)return new Zt({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Zt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new Zt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Zt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Zt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Q6({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Zt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Zt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(UN(n)){if(r.rpId!==n)return new Zt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Zt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Zt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Zt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class eU{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Qb=new eU;function mE(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,i=Jh(t,["challenge","user","excludeCredentials"]),a=Ms(e).buffer,o=Object.assign(Object.assign({},r),{id:Ms(r.id).buffer}),c=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){c.excludeCredentials=new Array(n.length);for(let u=0;u<n.length;u++){const d=n[u];c.excludeCredentials[u]=Object.assign(Object.assign({},d),{id:Ms(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return c}function gE(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=Jh(t,["challenge","allowCredentials"]),i=Ms(e).buffer,a=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const c=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},c),{id:Ms(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function yE(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:_o(new Uint8Array(t.response.attestationObject)),clientDataJSON:_o(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function vE(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:_o(new Uint8Array(i.authenticatorData)),clientDataJSON:_o(new Uint8Array(i.clientDataJSON)),signature:_o(new Uint8Array(i.signature)),userHandle:i.userHandle?_o(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function UN(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function zf(){var t,e;return!!(xr()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function qN(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Df("Browser returned unexpected credential type",e)}:{data:null,error:new Df("Empty credential response",e)}}catch(e){return{data:null,error:Z6({error:e,options:t})}}}async function FN(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Df("Browser returned unexpected credential type",e)}:{data:null,error:new Df("Empty credential response",e)}}catch(e){return{data:null,error:Q6({error:e,options:t})}}}const tU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},rU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Bf(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(const i of t)if(i)for(const a in i){const o=i[a];if(o!==void 0)if(Array.isArray(o))n[a]=o;else if(r(o))n[a]=o;else if(e(o)){const c=n[a];e(c)?n[a]=Bf(c,o):n[a]=Bf(o)}else n[a]=o}return n}function nU(t,e){return Bf(tU,t,e||{})}function iU(t,e){return Bf(rU,t,e||{})}class aU{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:i},a){var o;try{const{data:c,error:u}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!c)return{data:null,error:u};const d=i??Qb.createNewAbortSignal();if(c.webauthn.type==="create"){const{user:p}=c.webauthn.credential_options.publicKey;if(!p.name){const h=n;if(h)p.name=`${p.id}:${h}`;else{const v=(await this.client.getUser()).data.user,x=((o=v==null?void 0:v.user_metadata)===null||o===void 0?void 0:o.name)||(v==null?void 0:v.email)||(v==null?void 0:v.id)||"User";p.name=`${p.id}:${x}`}}p.displayName||(p.displayName=p.name)}switch(c.webauthn.type){case"create":{const p=nU(c.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:h,error:g}=await qN({publicKey:p,signal:d});return h?{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:h}},error:null}:{data:null,error:g}}case"request":{const p=iU(c.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:h,error:g}=await FN(Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:p,signal:d}));return h?{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:h}},error:null}:{data:null,error:g}}}}catch(c){return be(c)?{data:null,error:c}:{data:null,error:new Xn("Unexpected error in challenge",c)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new qs("rpId is required for WebAuthn authentication")};try{if(!zf())return{data:null,error:new Xn("Browser does not support WebAuthn",null)};const{data:o,error:c}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:c};const{webauthn:u}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:u.type,rpId:r,rpOrigins:n,credential_response:u.credential_response}})}catch(o){return be(o)?{data:null,error:o}:{data:null,error:new Xn("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new qs("rpId is required for WebAuthn registration")};try{if(!zf())return{data:null,error:new Xn("Browser does not support WebAuthn",null)};const{data:o,error:c}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(p=>{var h;return(h=p.data)===null||h===void 0?void 0:h.all.find(g=>g.factor_type==="webauthn"&&g.friendly_name===e&&g.status!=="unverified")}).then(p=>p?this.client.mfa.unenroll({factorId:p==null?void 0:p.id}):void 0),{data:null,error:c};const{data:u,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:a});return u?this._verify({factorId:o.id,challengeId:u.challengeId,webauthn:{rpId:r,rpOrigins:n,type:u.webauthn.type,credential_response:u.webauthn.credential_response}}):{data:null,error:d}}catch(o){return be(o)?{data:null,error:o}:{data:null,error:new Xn("Unexpected error in register",o)}}}}V6();const oU={url:u6,storageKey:d6,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:f6,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function bE(t,e,r){return await r()}const ws={};class Uc{get jwks(){var e,r;return(r=(e=ws[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){ws[this.storageKey]=Object.assign(Object.assign({},ws[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=ws[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){ws[this.storageKey]=Object.assign(Object.assign({},ws[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,i,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},oU),e);if(this.storageKey=o.storageKey,this.instanceID=(r=Uc.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Uc.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&xr()){const c=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(c),this.logDebugMessages&&console.trace(c)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(n=o.experimental)!==null&&n!==void 0?n:{},this.admin=new G6({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=DN(o.fetch),this.lock=o.lock||bE,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&xr()&&(!((i=globalThis==null?void 0:globalThis.navigator)===null||i===void 0)&&i.locks)?this.lock=K6:this.lock=bE,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new aU(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:LN()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=hE(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=hE(this.memoryStorage)),xr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(c){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",c)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async c=>{this._debug("received broadcast notification from other tab or client",c);try{await this._notifyAllSubscribers(c.data.event,c.data.session,!1)}catch(u){this._debug("#broadcastChannel","error",u)}})}o.skipAutoInitialize||this.initialize().catch(c=>{this._debug("#initialize()","error",c)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${IN}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(xr()&&(r=O6(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),xr()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),y6(a)){const u=(e=a.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:o,redirectType:c}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",c),await this._saveSession(o),setTimeout(async()=>{c==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return be(r)?this._returnResult({error:r}):this._returnResult({error:new Xn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{const a=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:En}),{data:o,error:c}=a;if(c||!o)return this._returnResult({data:{user:null,session:null},error:c});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(a){if(be(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(e){var r,n,i;try{let a;if("email"in e){const{email:p,password:h,options:g}=e;let v=null,x=null;this.flowType==="pkce"&&([v,x]=await xs(this.storage,this.storageKey)),a=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:g==null?void 0:g.emailRedirectTo,body:{email:p,password:h,data:(r=g==null?void 0:g.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken},code_challenge:v,code_challenge_method:x},xform:En})}else if("phone"in e){const{phone:p,password:h,options:g}=e;a=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:h,data:(n=g==null?void 0:g.data)!==null&&n!==void 0?n:{},channel:(i=g==null?void 0:g.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken}},xform:En})}else throw new sf("You must provide either an email or phone number and a password");const{data:o,error:c}=a;if(c||!o)return await br(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:c});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(a){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(e){try{let r;if("email"in e){const{email:a,password:o,options:c}=e;r=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},xform:dE})}else if("phone"in e){const{phone:a,password:o,options:c}=e;r=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},xform:dE})}else throw new sf("You must provide either an email or phone number and a password");const{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){const a=new bs;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,i,a;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=e.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,i,a,o,c,u,d,p,h,g;let v,x;if("message"in e)v=e.message,x=e.signature;else{const{chain:_,wallet:b,statement:k,options:E}=e;let O;if(xr())if(typeof b=="object")O=b;else{const M=window;if("ethereum"in M&&typeof M.ethereum=="object"&&"request"in M.ethereum&&typeof M.ethereum.request=="function")O=M.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(E!=null&&E.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=b}const A=new URL((r=E==null?void 0:E.url)!==null&&r!==void 0?r:window.location.href),T=await O.request({method:"eth_requestAccounts"}).then(M=>M).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!T||T.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=BN(T[0]);let j=(n=E==null?void 0:E.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!j){const M=await O.request({method:"eth_chainId"});j=X6(M)}const R={domain:A.host,address:C,statement:k,uri:A.href,version:"1",chainId:j,nonce:(i=E==null?void 0:E.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=E==null?void 0:E.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(c=E==null?void 0:E.signInWithEthereum)===null||c===void 0?void 0:c.expirationTime,notBefore:(u=E==null?void 0:E.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(d=E==null?void 0:E.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(p=E==null?void 0:E.signInWithEthereum)===null||p===void 0?void 0:p.resources};v=J6(R),x=await O.request({method:"personal_sign",params:[Y6(v),C]})}try{const{data:_,error:b}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:x},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:En});if(b)throw b;if(!_||!_.session||!_.user){const k=new bs;return this._returnResult({data:{user:null,session:null},error:k})}return _.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),this._returnResult({data:Object.assign({},_),error:b})}catch(_){if(be(_))return this._returnResult({data:{user:null,session:null},error:_});throw _}}async signInWithSolana(e){var r,n,i,a,o,c,u,d,p,h,g,v;let x,_;if("message"in e)x=e.message,_=e.signature;else{const{chain:b,wallet:k,statement:E,options:O}=e;let A;if(xr())if(typeof k=="object")A=k;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))A=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(O!=null&&O.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");A=k}const T=new URL((r=O==null?void 0:O.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in A&&A.signIn){const C=await A.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},O==null?void 0:O.signInWithSolana),{version:"1",domain:T.host,uri:T.href}),E?{statement:E}:null));let j;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")j=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)j=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in j&&"signature"in j&&(typeof j.signedMessage=="string"||j.signedMessage instanceof Uint8Array)&&j.signature instanceof Uint8Array)x=typeof j.signedMessage=="string"?j.signedMessage:new TextDecoder().decode(j.signedMessage),_=j.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in A)||typeof A.signMessage!="function"||!("publicKey"in A)||typeof A!="object"||!A.publicKey||!("toBase58"in A.publicKey)||typeof A.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${T.host} wants you to sign in with your Solana account:`,A.publicKey.toBase58(),...E?["",E,""]:[""],"Version: 1",`URI: ${T.href}`,`Issued At: ${(i=(n=O==null?void 0:O.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=O==null?void 0:O.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${O.signInWithSolana.notBefore}`]:[],...!((o=O==null?void 0:O.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${O.signInWithSolana.expirationTime}`]:[],...!((c=O==null?void 0:O.signInWithSolana)===null||c===void 0)&&c.chainId?[`Chain ID: ${O.signInWithSolana.chainId}`]:[],...!((u=O==null?void 0:O.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${O.signInWithSolana.nonce}`]:[],...!((d=O==null?void 0:O.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${O.signInWithSolana.requestId}`]:[],...!((h=(p=O==null?void 0:O.signInWithSolana)===null||p===void 0?void 0:p.resources)===null||h===void 0)&&h.length?["Resources",...O.signInWithSolana.resources.map(j=>`- ${j}`)]:[]].join(`
|
|
429
|
-
`);const C=await A.signMessage(new TextEncoder().encode(x),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");_=C}}try{const{data:b,error:k}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:_o(_)},!((g=e.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(v=e.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:En});if(k)throw k;if(!b||!b.session||!b.user){const E=new bs;return this._returnResult({data:{user:null,session:null},error:E})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:k})}catch(b){if(be(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await go(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new v6;const{data:a,error:o}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:En});if(await br(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const c=new bs;return this._returnResult({data:{user:null,session:null,redirectType:null},error:c})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers(i==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(e){try{const{options:r,provider:n,token:i,access_token:a,nonce:o}=e,c=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:En}),{data:u,error:d}=c;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!u||!u.session||!u.user){const p=new bs;return this._returnResult({data:{user:null,session:null},error:p})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:d})}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,i,a,o;try{if("email"in e){const{email:c,options:u}=e;let d=null,p=null;this.flowType==="pkce"&&([d,p]=await xs(this.storage,this.storageKey));const{error:h}=await Pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:c,data:(r=u==null?void 0:u.data)!==null&&r!==void 0?r:{},create_user:(n=u==null?void 0:u.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:d,code_challenge_method:p},redirectTo:u==null?void 0:u.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:c,options:u}=e,{data:d,error:p}=await Pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:c,data:(i=u==null?void 0:u.data)!==null&&i!==void 0?i:{},create_user:(a=u==null?void 0:u.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(o=u==null?void 0:u.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:p})}throw new sf("You must provide either an email or phone number.")}catch(c){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async verifyOtp(e){var r,n;try{let i,a;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,a=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:c}=await Pe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:En});if(c)throw c;if(!o)throw new Error("An error occurred on token verification.");const u=o.session,d=o.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(i){if(be(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var r,n,i,a,o;try{let c=null,u=null;this.flowType==="pkce"&&([c,u]=await xs(this.storage,this.storageKey));const d=await Pe(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:c,code_challenge_method:u}),headers:this.headers,xform:F6});return!((a=d.data)===null||a===void 0)&&a.url&&xr()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(c){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(c))return this._returnResult({data:null,error:c});throw c}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new pr;const{error:i}=await Pe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(be(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:i,options:a}=e,{error:o}=await Pe(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:n,type:i,options:a}=e,{data:o,error:c}=await Pe(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:c})}throw new sf("You must provide either an email or phone number and a type")}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await go(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<_g:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await go(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=kg()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=z6(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await Pe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Pa}):await this._useSession(async r=>{var n,i,a;const{data:o,error:c}=r;if(c)throw c;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new pr}:await Pe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:Pa})})}catch(r){if(be(r))return of(r)&&(await this._removeSession(),await br(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:i,error:a}=n;if(a)throw a;if(!i.session)throw new pr;const o=i.session;let c=null,u=null;this.flowType==="pkce"&&e.email!=null&&([c,u]=await xs(this.storage,this.storageKey));const{data:d,error:p}=await Pe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:c,code_challenge_method:u}),jwt:o.access_token,xform:Pa});if(p)throw p;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new pr;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=cf(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:c,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c)return{data:{user:null,session:null},error:null};a=c}else{const{data:c,error:u}=await this._getUser(e.access_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});a={access_token:e.access_token,refresh_token:e.refresh_token,user:c.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(be(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:c}=r;if(c)throw c;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new pr;const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!xr())throw new lf("No browser detected.");if(e.error||e.error_description||e.error_code)throw new lf(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new iE("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new lf("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new iE("No code detected.");const{data:O,error:A}=await this._exchangeCodeForSession(e.code);if(A)throw A;const T=new URL(window.location.href);return T.searchParams.delete("code"),window.history.replaceState(window.history.state,"",T.toString()),{data:{session:O.session,redirectType:(n=O.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:i,provider_refresh_token:a,access_token:o,refresh_token:c,expires_in:u,expires_at:d,token_type:p}=e;if(!o||!u||!c||!p)throw new lf("No session defined in URL");const h=Math.round(Date.now()/1e3),g=parseInt(u);let v=h+g;d&&(v=parseInt(d));const x=v-h;x*1e3<=Cs&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${g}s`);const _=v-g;h-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,v,h):h-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,v,h);const{data:b,error:k}=await this._getUser(o);if(k)throw k;const E={provider_token:i,provider_refresh_token:a,access_token:o,expires_in:g,expires_at:v,refresh_token:c,token_type:p,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:E,redirectType:e.type},error:null})}catch(i){if(be(i))return this._returnResult({data:{session:null,redirectType:null},error:i});throw i}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await go(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a&&!of(a))return this._returnResult({error:a});const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:c}=await this.admin.signOut(o,e);if(c&&!(g6(c)&&(c.status===404||c.status===401||c.status===403)||of(c)))return this._returnResult({error:c})}return e!=="others"&&(await this._removeSession(),await br(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=E6(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{const{data:{session:a},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",e,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",a),of(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await xs(this.storage,this.storageKey,!0));try{return await Pe(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:i}=await this._useSession(async a=>{var o,c,u,d,p;const{data:h,error:g}=a;if(g)throw g;const v=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(c=e.options)===null||c===void 0?void 0:c.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await Pe(this.fetch,"GET",v,{headers:this.headers,jwt:(p=(d=h.session)===null||d===void 0?void 0:d.access_token)!==null&&p!==void 0?p:void 0})});if(i)throw i;return xr()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(be(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:i,data:{session:a}}=r;if(i)throw i;const{options:o,provider:c,token:u,access_token:d,nonce:p}=e,h=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:c,id_token:u,access_token:d,nonce:p,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:En}),{data:g,error:v}=h;return v?this._returnResult({data:{user:null,session:null},error:v}):!g||!g.session||!g.user?this._returnResult({data:{user:null,session:null},error:new bs}):(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("USER_UPDATED",g.session)),this._returnResult({data:g,error:v}))}catch(i){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)throw o;return await Pe(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await C6(async i=>(i>0&&await T6(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await Pe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:En})),(i,a)=>{const o=200*Math.pow(2,i);return a&&Sg(a)&&Date.now()+o-n<Cs})}catch(n){if(this._debug(r,"error",n),be(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),xr()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const i=await go(this.storage,this.storageKey);if(i&&this.userStorage){let o=await go(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await js(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:kg()}else if(i&&!i.user&&!i.user){const o=await go(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await br(this.storage,this.storageKey+"-user"),await js(this.storage,this.storageKey,i)):i.user=kg()}if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}const a=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<_g;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${_g}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),Sg(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:c}=await this._getUser(i.access_token);!c&&(o!=null&&o.user)?(i.user=o.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new pr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new ep;const{data:a,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!a.session)throw new pr;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const c={data:a.session,error:null};return this.refreshingDeferred.resolve(c),c}catch(a){if(this._debug(i,"error",a),be(a)){const o={data:null,error:a};return Sg(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async c=>{try{await c.callback(e,r)}catch(u){a.push(u)}});if(await Promise.all(o),a.length>0){for(let c=0;c<a.length;c+=1)console.error(a[c]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await br(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await js(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=cE(i);await js(this.storage,this.storageKey,a)}else{const i=cE(r);await js(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await br(this.storage,this.storageKey),await br(this.storage,this.storageKey+"-code-verifier"),await br(this.storage,this.storageKey+"-user"),this.userStorage&&await br(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&xr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Cs);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-e)/Cs);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Cs}ms, refresh threshold is ${Xb} ticks`),i<=Xb&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof zN)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!xr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,o]=await xs(this.storage,this.storageKey),c=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(c.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);i.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;return a?this._returnResult({data:null,error:a}):await Pe(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)return this._returnResult({data:null,error:o});const c=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:u,error:d}=await Pe(this.fetch,"POST",`${this.url}/factors`,{body:c,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return d?this._returnResult({data:null,error:d}):(e.factorType==="totp"&&u.type==="totp"&&(!((i=u==null?void 0:u.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?yE(e.webauthn.credential_response):vE(e.webauthn.credential_response)})}:{code:e.code}),{data:c,error:u}=await Pe(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:u}))})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=await Pe(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:c}=o;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:mE(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:gE(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,i,a;if(e)try{const{payload:v}=cf(e);let x=null;v.aal&&(x=v.aal);let _=x;const{data:{user:b},error:k}=await this.getUser(e);if(k)return this._returnResult({data:null,error:k});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(A=>A.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(_="aal2");const O=v.amr||[];return{data:{currentLevel:x,nextLevel:_,currentAuthenticationMethods:O},error:null}}catch(v){if(be(v))return this._returnResult({data:null,error:v});throw v}const{data:{session:o},error:c}=await this.getSession();if(c)return this._returnResult({data:null,error:c});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:u}=cf(o.access_token);let d=null;u.aal&&(d=u.aal);let p=d;((a=(i=o.user.factors)===null||i===void 0?void 0:i.filter(v=>v.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(p="aal2");const g=u.amr||[];return{data:{currentLevel:d,nextLevel:p,currentAuthenticationMethods:g},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await Pe(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new pr})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new pr});const o=await Pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:c=>({data:c,error:null})});return o.data&&o.data.redirect_url&&xr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new pr});const o=await Pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:c=>({data:c,error:null})});return o.data&&o.data.redirect_url&&xr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await Pe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new pr})})}catch(e){if(be(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?(await Pe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new pr})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(c=>c.kid===e);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(c=>c.kid===e),n&&this.jwks_cached_at+p6>i)return n;const{data:a,error:o}=await Pe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=i,n=a.keys.find(c=>c.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:v,error:x}=await this.getSession();if(x||!v.session)return this._returnResult({data:null,error:x});n=v.session.access_token}const{header:i,payload:a,signature:o,raw:{header:c,payload:u}}=cf(n);r!=null&&r.allowExpired||M6(a.exp);const d=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!d){const{error:v}=await this.getUser(n);if(v)throw v;return{data:{claims:a,header:i,signature:o},error:null}}const p=L6(i.alg),h=await crypto.subtle.importKey("jwk",d,p,!0,["verify"]);if(!await crypto.subtle.verify(p,h,o,S6(`${c}.${u}`)))throw new Zb("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,i;qn(this.experimental);try{if(!zf())return this._returnResult({data:null,error:new Xn("Browser does not support WebAuthn",null)});const{data:a,error:o}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}});if(o||!a)return this._returnResult({data:null,error:o});const c=gE(a.options),u=(i=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&i!==void 0?i:Qb.createNewAbortSignal(),{data:d,error:p}=await FN({publicKey:c,signal:u});if(p||!d)return this._returnResult({data:null,error:p??new Xn("WebAuthn ceremony failed",null)});const h=vE(d);return this._verifyPasskeyAuthentication({challengeId:a.challenge_id,credential:h})}catch(a){if(be(a))return this._returnResult({data:null,error:a});throw a}}async registerPasskey(e){var r,n;qn(this.experimental);try{if(!zf())return this._returnResult({data:null,error:new Xn("Browser does not support WebAuthn",null)});const{data:i,error:a}=await this._startPasskeyRegistration();if(a||!i)return this._returnResult({data:null,error:a});const o=mE(i.options),c=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:Qb.createNewAbortSignal(),{data:u,error:d}=await qN({publicKey:o,signal:c});if(d||!u)return this._returnResult({data:null,error:d??new Xn("WebAuthn ceremony failed",null)});const p=yE(u);return this._verifyPasskeyRegistration({challengeId:i.challenge_id,credential:p})}catch(i){if(be(i))return this._returnResult({data:null,error:i});throw i}}async _startPasskeyRegistration(){qn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new pr});const{data:i,error:a}=await Pe(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(be(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){qn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new pr});const{data:a,error:o}=await Pe(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;qn(this.experimental);try{const{data:n,error:i}=await Pe(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:n,error:null})}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){qn(this.experimental);try{const{data:r,error:n}=await Pe(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:En});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){qn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new pr});const{data:i,error:a}=await Pe(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(be(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){qn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new pr});const{data:a,error:o}=await Pe(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){qn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new pr});const{error:a}=await Pe(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return a?this._returnResult({data:null,error:a}):this._returnResult({data:null,error:null})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}}Uc.nextInstanceID={};const sU=Uc,lU="2.106.2";let kc="";typeof Deno<"u"?kc="deno":typeof document<"u"?kc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?kc="react-native":kc="node";const cU={"X-Client-Info":`supabase-js-${kc}/${lU}`},uU={headers:cU},dU={schema:"public"},fU={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},hU={},pU={enabled:!1,respectSamplingDecision:!0};function mU(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function c(p){try{d(n.next(p))}catch(h){o(h)}}function u(p){try{d(n.throw(p))}catch(h){o(h)}}function d(p){p.done?a(p.value):i(p.value).then(c,u)}d((n=n.apply(t,[])).next())})}let Og=null;const gU="@opentelemetry/api";function yU(){return Og===null&&(Og=import(gU).catch(()=>null)),Og}function vU(){return mU(this,void 0,void 0,function*(){try{const t=yield yU();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function bU(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,n,i,a]=e;if(r.length!==2||n.length!==32||i.length!==16||a.length!==2)return null;const o=/^[0-9a-f]+$/i;return!o.test(r)||!o.test(n)||!o.test(i)||!o.test(a)||n==="00000000000000000000000000000000"||i==="0000000000000000"?null:{version:r,traceId:n,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)===1}}function xU(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const n of e)try{if(typeof n=="string"){if(wU(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function wU(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function _U(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function qc(t){"@babel/helpers - typeof";return qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qc(t)}function SU(t,e){if(qc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kU(t){var e=SU(t,"string");return qc(e)=="symbol"?e:e+""}function EU(t,e,r){return(e=kU(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ft(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xE(Object(r),!0).forEach(function(n){EU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const OU=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),AU=()=>Headers,TU=(t,e,r,n,i)=>{const a=OU(n),o=AU(),c=(i==null?void 0:i.enabled)===!0,u=(i==null?void 0:i.respectSamplingDecision)!==!1,d=c?_U(e):null;return async(p,h)=>{var g;const v=(g=await r())!==null&&g!==void 0?g:t;let x=new o(h==null?void 0:h.headers);if(x.has("apikey")||x.set("apikey",t),x.has("Authorization")||x.set("Authorization",`Bearer ${v}`),d){const _=await CU(p,d,u);_&&(_.traceparent&&!x.has("traceparent")&&x.set("traceparent",_.traceparent),_.tracestate&&!x.has("tracestate")&&x.set("tracestate",_.tracestate),_.baggage&&!x.has("baggage")&&x.set("baggage",_.baggage))}return a(p,Ft(Ft({},h),{},{headers:x}))}};async function CU(t,e,r){if(!xU(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await vU();if(!n||!n.traceparent)return null;if(r){const i=bU(n.traceparent);if(i&&!i.isSampled)return null}return n}function wE(t){return typeof t=="boolean"?{enabled:t}:t}function jU(t){return t.endsWith("/")?t:t+"/"}function PU(t,e){var r,n,i,a,o,c;const{db:u,auth:d,realtime:p,global:h}=t,{db:g,auth:v,realtime:x,global:_}=e,b=wE(t.tracePropagation),k=wE(e.tracePropagation),E={db:Ft(Ft({},g),u),auth:Ft(Ft({},v),d),realtime:Ft(Ft({},x),p),storage:{},global:Ft(Ft(Ft({},_),h),{},{headers:Ft(Ft({},(r=_==null?void 0:_.headers)!==null&&r!==void 0?r:{}),(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(i=(a=b==null?void 0:b.enabled)!==null&&a!==void 0?a:k==null?void 0:k.enabled)!==null&&i!==void 0?i:!1,respectSamplingDecision:(o=(c=b==null?void 0:b.respectSamplingDecision)!==null&&c!==void 0?c:k==null?void 0:k.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return t.accessToken?E.accessToken=t.accessToken:delete E.accessToken,E}function NU(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(jU(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var RU=class extends sU{constructor(t){super(t)}},IU=class{constructor(t,e,r){var n,i;this.supabaseUrl=t,this.supabaseKey=e;const a=NU(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,c={db:dU,realtime:hU,auth:Ft(Ft({},fU),{},{storageKey:o}),global:uU,tracePropagation:pU},u=PU(r??{},c);if(this.settings=u,this.storageKey=(n=u.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken)this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(p,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=u.auth)!==null&&d!==void 0?d:{},this.headers,u.global.fetch)}this.fetch=TU(e,t,this._getAccessToken.bind(this),u.global.fetch,u.tracePropagation),this.realtime=this._initRealtimeClient(Ft({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},u.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(p=>this.realtime.setAuth(p)).catch(p=>console.warn("Failed to set initial Realtime auth token:",p)),this.rest=new YB(new URL("rest/v1",a).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch,timeout:u.db.timeout,urlLengthLimit:u.db.urlLengthLimit}),this.storage=new c6(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new BB(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:a,flowType:o,lock:c,debug:u,throwOnError:d,experimental:p,lockAcquireTimeout:h,skipAutoInitialize:g},v,x){const _={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new RU({url:this.authUrl.href,headers:Ft(Ft({},_),v),storageKey:a,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:c,debug:u,throwOnError:d,experimental:p,fetch:x,lockAcquireTimeout:h,skipAutoInitialize:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new N8(this.realtimeUrl.href,Ft(Ft({},t),{},{params:Ft(Ft({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const $U=(t,e,r)=>new IU(t,e,r);function MU(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}MU()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const HN=N.createContext({session:null,supabase:null,loading:!0,signIn:async()=>({error:"Not initialized"}),signOut:async()=>{}});function tp(){return N.useContext(HN)}function LU({children:t}){const[e,r]=N.useState(null),[n,i]=N.useState(null),[a,o]=N.useState(!0),c=N.useRef(null);N.useEffect(()=>{X4(()=>{var p;return((p=c.current)==null?void 0:p.access_token)??null})},[]),N.useEffect(()=>{rt.get("/config").then(({config:p})=>{if(p.supabase.projectUrl&&p.supabase.anonKey){const h=$U(p.supabase.projectUrl,p.supabase.anonKey);r(h),h.auth.getSession().then(({data:v})=>{c.current=v.session,i(v.session),o(!1)});const{data:{subscription:g}}=h.auth.onAuthStateChange((v,x)=>{c.current=x,i(x)});return()=>g.unsubscribe()}o(!1)}).catch(()=>{o(!1)})},[]);async function u(p,h){if(!e)return{error:"Supabase not configured"};const{error:g}=await e.auth.signInWithPassword({email:p,password:h});return{error:(g==null?void 0:g.message)??null}}async function d(){e&&(await e.auth.signOut(),c.current=null,i(null))}return y.jsx(HN.Provider,{value:{session:n,supabase:e,loading:a,signIn:u,signOut:d},children:t})}const DU=[{to:"/squads",icon:Vh,label:"Squads"},{to:"/skills",icon:Mb,label:"Skills"},{to:"/schedules",icon:C5,label:"Schedules"},{to:"/wiki",icon:LP,label:"Wiki"},{to:"/usage",icon:P5,label:"Usage"}],zU=[{to:"/",icon:qP,label:"Chat"},{to:"/feed",icon:Ib,label:"Inbox"},{to:"/settings",icon:N4,label:"Settings"}];function _E({to:t,icon:e,label:r,collapsed:n,badge:i}){return y.jsxs(IP,{to:t,end:t==="/",title:n?r:void 0,className:({isActive:a})=>_c("w-full flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono transition-colors cursor-pointer relative",n?"justify-center":"",a?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"),style:({isActive:a})=>a?{background:"rgba(228,58,156,0.1)"}:void 0,children:[y.jsx(e,{className:"w-3.5 h-3.5 flex-shrink-0"}),!n&&r,i!=null&&i>0&&y.jsx("span",{className:"absolute top-1 right-1 min-w-[14px] h-[14px] flex items-center justify-center rounded-full bg-[#E43A9C] text-[9px] text-white font-mono px-1",children:i>99?"99+":i})]})}function BU(){const[t,e]=N.useState(!1),[r,n]=N.useState("..."),[i,a]=N.useState(0),{supabase:o}=tp();return N.useEffect(()=>{let c=!0;rt.get("/version").then(({version:d})=>{c&&n(d)}).catch(()=>{c&&n("unknown")}),rt.get("/inbox/unread-count").then(({count:d})=>{c&&a(d)}).catch(()=>{});const u=setInterval(()=>{rt.get("/inbox/unread-count").then(({count:d})=>{c&&a(d)}).catch(()=>{})},3e4);return()=>{c=!1,clearInterval(u)}},[]),y.jsxs("div",{className:"flex h-screen overflow-hidden bg-background relative",children:[y.jsxs("div",{className:_c("flex-shrink-0 flex flex-col border-r border-white/[0.06] bg-[#181818] transition-all duration-200",t?"w-[52px]":"w-[210px]"),children:[y.jsx("div",{className:_c("h-[52px] flex items-center border-b border-white/[0.06] flex-shrink-0",t?"justify-center px-3":"justify-between pl-4 pr-3"),children:t?y.jsx(Ra,{height:26}):y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx(Ra,{height:26}),y.jsx("span",{className:"text-2xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"})]})}),y.jsx("nav",{className:"flex-1 py-2 px-1.5 space-y-0.5 overflow-y-auto",children:DU.map(c=>y.jsx(_E,{collapsed:t,...c},c.to))}),y.jsxs("div",{className:"flex-shrink-0 border-t border-white/[0.06]",children:[y.jsx("div",{className:"py-1.5 px-1.5 space-y-0.5",children:zU.map(c=>y.jsx(_E,{collapsed:t,badge:c.to==="/feed"?i:void 0,...c},c.to))}),y.jsxs("div",{className:"border-t border-white/[0.05] py-1.5 px-1.5 space-y-0.5",children:[y.jsxs("a",{href:"https://github.com/michaeljolley/io",target:"_blank",rel:"noreferrer",title:"GitHub",className:_c("flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04] transition-colors cursor-pointer",t&&"justify-center"),children:[y.jsx(i4,{className:"w-3.5 h-3.5 flex-shrink-0"}),!t&&y.jsxs("span",{className:"text-zinc-700",children:["v",r]})]}),y.jsx("button",{type:"button",onClick:()=>e(!t),title:t?"Expand sidebar":"Collapse sidebar",className:_c("w-full flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04] transition-colors cursor-pointer",t&&"justify-center"),children:t?y.jsx(Cw,{className:"w-3.5 h-3.5 flex-shrink-0"}):y.jsx(Tu,{className:"w-3.5 h-3.5 flex-shrink-0"})})]})]})]}),y.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[y.jsxs("div",{className:"h-[52px] flex-shrink-0 flex items-center justify-between px-4 border-b border-white/[0.06] bg-[#181818]",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(IB,{status:"connected"}),y.jsx("span",{className:"text-[11px] font-mono text-green-400",children:"connected"})]}),y.jsxs("div",{className:"flex items-center gap-1.5",children:[y.jsx(K4,{}),o&&y.jsx("button",{type:"button",onClick:()=>o.auth.signOut(),className:"p-2 rounded-xl hover:bg-white/[0.05] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",title:"Sign out",children:y.jsx(h4,{className:"w-3.5 h-3.5"})})]})]}),y.jsxs("main",{className:"flex-1 overflow-hidden flex flex-col min-h-0 relative",children:[y.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",style:{zIndex:0},children:[y.jsx("div",{className:"orb orb-pink"}),y.jsx("div",{className:"orb orb-gray"})]}),y.jsx(oD,{})]})]})]})}function UU(t){return new Date(t).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:"America/Chicago"})}function qU(){const{session:t}=tp(),{messages:e,streaming:r,isStreaming:n,isThinking:i,sendChatMessage:a,addUserMessage:o,uploadAttachment:c}=YP(),[u,d]=N.useState(""),[p,h]=N.useState(null),[g,v]=N.useState(null),x=N.useRef(null),_=N.useRef(null),b=N.useRef(null);N.useLayoutEffect(()=>{const A=x.current;A&&(A.scrollTop=A.scrollHeight)},[e,r,i]);async function k(){const A=u.trim();if(!A&&!p||n||i)return;const T=crypto.randomUUID(),C=p==null?void 0:p.name,j=[A,C?`Attachment: ${C}`:""].filter(Boolean).join(`
|
|
430
|
-
|
|
431
|
-
`);o({id:T,role:"user",content:A,timestamp:new Date().toISOString(),attachmentName:C}),d(""),h(null),b.current&&(b.current.value=""),_.current&&(_.current.style.height="auto");try{p&&await c(p,T),a(j)}catch{}}function E(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),k())}function O(A){d(A.target.value),_.current&&(_.current.style.height="auto",_.current.style.height=`${Math.min(_.current.scrollHeight,160)}px`)}return y.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[y.jsxs("div",{ref:x,className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[e.map(A=>{var T,C;return y.jsxs("div",{className:`flex gap-3 ${A.role==="user"?"flex-row-reverse":""}`,children:[y.jsx("div",{className:`flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center text-[10px] font-mono mt-0.5 ${A.role==="user"?"border border-[#E43A9C]/30 text-[#E43A9C]":"bg-[#282828] border border-white/[0.07] text-zinc-500"}`,style:A.role==="user"?{background:"rgba(228,58,156,0.12)"}:void 0,children:A.role==="user"?((C=(T=t==null?void 0:t.user)==null?void 0:T.email)==null?void 0:C.charAt(0).toUpperCase())??"U":y.jsx(Ra,{height:12})}),y.jsxs("div",{className:`flex flex-col gap-1.5 max-w-[72%] ${A.role==="user"?"items-end":"items-start"}`,children:[A.toolCall&&y.jsxs("button",{type:"button",onClick:()=>v(g===A.id?null:A.id),className:"w-full text-left border border-white/[0.07] bg-[#1e1e1e] rounded-xl px-3 py-2 flex items-center gap-2 hover:border-[#E43A9C]/25 transition-colors",children:[y.jsx(Gh,{className:"w-3 h-3 text-[#E43A9C] flex-shrink-0"}),y.jsx("span",{className:"text-[11px] font-mono text-zinc-400 flex-1",children:A.toolCall.name}),y.jsx(Vt,{variant:A.toolCall.status==="done"?"success":A.toolCall.status==="error"?"error":"warning",children:A.toolCall.status}),y.jsx(R5,{className:`w-3 h-3 text-zinc-600 transition-transform flex-shrink-0 ${g===A.id?"rotate-180":""}`})]}),A.toolCall&&g===A.id&&y.jsx("div",{className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl px-3 py-2",children:y.jsx("p",{className:"text-[11px] font-mono text-zinc-500",children:A.toolCall.result})}),A.attachmentName&&y.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:A.attachmentName}),A.content&&y.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${A.role==="user"?"text-white rounded-tr-sm":"bg-[#222222] border border-white/[0.07] text-zinc-200 rounded-tl-sm"}`,style:A.role==="user"?{background:"linear-gradient(135deg, #D83333 0%, #C0285E 100%)"}:void 0,children:A.role==="user"?y.jsx("p",{className:"whitespace-pre-wrap",children:A.content}):y.jsx("div",{className:"prose-io",dangerouslySetInnerHTML:{__html:nt.parse(A.content)}})}),y.jsx("span",{className:"text-[11px] text-zinc-700 font-mono px-0.5",children:UU(A.timestamp)})]})]},A.id)}),i&&y.jsxs("div",{className:"flex gap-3",children:[y.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:y.jsx(Ra,{height:12})}),y.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-3 flex items-center gap-1.5",children:[0,120,240].map(A=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${A}ms`}},A))})]}),n&&r&&y.jsxs("div",{className:"flex gap-3",children:[y.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:y.jsx(Ra,{height:12})}),y.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-2.5 max-w-[72%]",children:y.jsx("div",{className:"prose-io text-sm",dangerouslySetInnerHTML:{__html:nt.parse(r)}})})]}),n&&!r&&y.jsxs("div",{className:"flex gap-3",children:[y.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:y.jsx(Ra,{height:12})}),y.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-3 flex items-center gap-1.5",children:[0,120,240].map(A=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${A}ms`}},A))})]})]}),y.jsxs("div",{className:"border-t border-white/[0.06] p-4 flex-shrink-0",children:[y.jsxs("div",{className:"bg-[#1e1e1e] border border-white/[0.08] rounded-2xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[y.jsx("input",{ref:b,type:"file",className:"hidden",onChange:A=>{var T;return h(((T=A.target.files)==null?void 0:T[0])??null)}}),p&&y.jsxs("div",{className:"px-4 pt-3 text-[11px] font-mono text-zinc-400",children:["Attached: ",p.name]}),y.jsx("textarea",{ref:_,value:u,onChange:O,onKeyDown:E,placeholder:"Message IO…",rows:1,className:"w-full bg-transparent px-4 pt-3 pb-1 text-sm text-zinc-200 placeholder:text-zinc-700 resize-none focus:outline-none",style:{minHeight:"42px",maxHeight:"160px",fontFamily:"Inter, sans-serif"}}),y.jsxs("div",{className:"flex items-center justify-between px-3 pb-2.5",children:[y.jsx("button",{type:"button",onClick:()=>{var A;return(A=b.current)==null?void 0:A.click()},className:"p-1.5 rounded-lg hover:bg-white/[0.05] text-zinc-700 hover:text-zinc-400 transition-colors",children:y.jsx(FP,{className:"w-4 h-4"})}),y.jsx("div",{className:"flex items-center gap-2",children:n?y.jsxs("button",{type:"button",onClick:()=>{},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-zinc-800 hover:bg-zinc-700 text-[11px] font-mono text-zinc-300 transition-colors",children:[y.jsx(Kh,{className:"w-3 h-3"})," Stop"]}):y.jsx("button",{type:"button",onClick:k,disabled:!u.trim()&&!p||i,className:"p-2 rounded-xl text-white disabled:opacity-30 disabled:cursor-not-allowed transition-opacity hover:opacity-90",style:{background:"linear-gradient(135deg, #D83333, #E43A9C)"},children:y.jsx(GP,{className:"w-3.5 h-3.5"})})})]})]}),y.jsx("p",{className:"text-center text-[11px] text-zinc-800 font-mono mt-2",children:"IO may make mistakes. Verify important outputs."})]})]})}var Ag,SE;function FU(){if(SE)return Ag;SE=1;function t($){return $ instanceof Map?$.clear=$.delete=$.set=function(){throw new Error("map is read-only")}:$ instanceof Set&&($.add=$.clear=$.delete=function(){throw new Error("set is read-only")}),Object.freeze($),Object.getOwnPropertyNames($).forEach(ne=>{const de=$[ne],Re=typeof de;(Re==="object"||Re==="function")&&!Object.isFrozen(de)&&t(de)}),$}class e{constructor(ne){ne.data===void 0&&(ne.data={}),this.data=ne.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function n($,...ne){const de=Object.create(null);for(const Re in $)de[Re]=$[Re];return ne.forEach(function(Re){for(const ht in Re)de[ht]=Re[ht]}),de}const i="</span>",a=$=>!!$.scope,o=($,{prefix:ne})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){const de=$.split(".");return[`${ne}${de.shift()}`,...de.map((Re,ht)=>`${Re}${"_".repeat(ht+1)}`)].join(" ")}return`${ne}${$}`};class c{constructor(ne,de){this.buffer="",this.classPrefix=de.classPrefix,ne.walk(this)}addText(ne){this.buffer+=r(ne)}openNode(ne){if(!a(ne))return;const de=o(ne.scope,{prefix:this.classPrefix});this.span(de)}closeNode(ne){a(ne)&&(this.buffer+=i)}value(){return this.buffer}span(ne){this.buffer+=`<span class="${ne}">`}}const u=($={})=>{const ne={children:[]};return Object.assign(ne,$),ne};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ne){this.top.children.push(ne)}openNode(ne){const de=u({scope:ne});this.add(de),this.stack.push(de)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ne){return this.constructor._walk(ne,this.rootNode)}static _walk(ne,de){return typeof de=="string"?ne.addText(de):de.children&&(ne.openNode(de),de.children.forEach(Re=>this._walk(ne,Re)),ne.closeNode(de)),ne}static _collapse(ne){typeof ne!="string"&&ne.children&&(ne.children.every(de=>typeof de=="string")?ne.children=[ne.children.join("")]:ne.children.forEach(de=>{d._collapse(de)}))}}class p extends d{constructor(ne){super(),this.options=ne}addText(ne){ne!==""&&this.add(ne)}startScope(ne){this.openNode(ne)}endScope(){this.closeNode()}__addSublanguage(ne,de){const Re=ne.root;de&&(Re.scope=`language:${de}`),this.add(Re)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function h($){return $?typeof $=="string"?$:$.source:null}function g($){return _("(?=",$,")")}function v($){return _("(?:",$,")*")}function x($){return _("(?:",$,")?")}function _(...$){return $.map(de=>h(de)).join("")}function b($){const ne=$[$.length-1];return typeof ne=="object"&&ne.constructor===Object?($.splice($.length-1,1),ne):{}}function k(...$){return"("+(b($).capture?"":"?:")+$.map(Re=>h(Re)).join("|")+")"}function E($){return new RegExp($.toString()+"|").exec("").length-1}function O($,ne){const de=$&&$.exec(ne);return de&&de.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function T($,{joinWith:ne}){let de=0;return $.map(Re=>{de+=1;const ht=de;let Ke=h(Re),ye="";for(;Ke.length>0;){const we=A.exec(Ke);if(!we){ye+=Ke;break}ye+=Ke.substring(0,we.index),Ke=Ke.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?ye+="\\"+String(Number(we[1])+ht):(ye+=we[0],we[0]==="("&&de++)}return ye}).map(Re=>`(${Re})`).join(ne)}const C=/\b\B/,j="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",M="\\b\\d+(\\.\\d+)?",Y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",B="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X=($={})=>{const ne=/^#![ ]*\//;return $.binary&&($.begin=_(ne,/.*\b/,$.binary,/\b.*/)),n({scope:"meta",begin:ne,end:/$/,relevance:0,"on:begin":(de,Re)=>{de.index!==0&&Re.ignoreMatch()}},$)},K={begin:"\\\\[\\s\\S]",relevance:0},U={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[K]},G={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[K]},J={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},F=function($,ne,de={}){const Re=n({scope:"comment",begin:$,end:ne,contains:[]},de);Re.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ht=k("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Re.contains.push({begin:_(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Re},te=F("//","$"),q=F("/\\*","\\*/"),z=F("#","$"),L={scope:"number",begin:M,relevance:0},Z={scope:"number",begin:Y,relevance:0},se={scope:"number",begin:W,relevance:0},le={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[K,{begin:/\[/,end:/\]/,relevance:0,contains:[K]}]},ve={scope:"title",begin:j,relevance:0},qe={scope:"title",begin:R,relevance:0},xe={begin:"\\.\\s*"+R,relevance:0};var Se=Object.freeze({__proto__:null,APOS_STRING_MODE:U,BACKSLASH_ESCAPE:K,BINARY_NUMBER_MODE:se,BINARY_NUMBER_RE:W,COMMENT:F,C_BLOCK_COMMENT_MODE:q,C_LINE_COMMENT_MODE:te,C_NUMBER_MODE:Z,C_NUMBER_RE:Y,END_SAME_AS_BEGIN:function($){return Object.assign($,{"on:begin":(ne,de)=>{de.data._beginMatch=ne[1]},"on:end":(ne,de)=>{de.data._beginMatch!==ne[1]&&de.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:j,MATCH_NOTHING_RE:C,METHOD_GUARD:xe,NUMBER_MODE:L,NUMBER_RE:M,PHRASAL_WORDS_MODE:J,QUOTE_STRING_MODE:G,REGEXP_MODE:le,RE_STARTERS_RE:B,SHEBANG:X,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:qe});function Me($,ne){$.input[$.index-1]==="."&&ne.ignoreMatch()}function oe($,ne){$.className!==void 0&&($.scope=$.className,delete $.className)}function et($,ne){ne&&$.beginKeywords&&($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=Me,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0&&($.relevance=0))}function Fe($,ne){Array.isArray($.illegal)&&($.illegal=k(...$.illegal))}function kt($,ne){if($.match){if($.begin||$.end)throw new Error("begin & end are not supported with match");$.begin=$.match,delete $.match}}function wt($,ne){$.relevance===void 0&&($.relevance=1)}const Et=($,ne)=>{if(!$.beforeMatch)return;if($.starts)throw new Error("beforeMatch cannot be used with starts");const de=Object.assign({},$);Object.keys($).forEach(Re=>{delete $[Re]}),$.keywords=de.keywords,$.begin=_(de.beforeMatch,g(de.begin)),$.starts={relevance:0,contains:[Object.assign(de,{endsParent:!0})]},$.relevance=0,delete de.beforeMatch},Sr=["of","and","for","in","not","or","if","then","parent","list","value"],Bt="keyword";function Rr($,ne,de=Bt){const Re=Object.create(null);return typeof $=="string"?ht(de,$.split(" ")):Array.isArray($)?ht(de,$):Object.keys($).forEach(function(Ke){Object.assign(Re,Rr($[Ke],ne,Ke))}),Re;function ht(Ke,ye){ne&&(ye=ye.map(we=>we.toLowerCase())),ye.forEach(function(we){const Ce=we.split("|");Re[Ce[0]]=[Ke,lr(Ce[0],Ce[1])]})}}function lr($,ne){return ne?Number(ne):_t($)?0:1}function _t($){return Sr.includes($.toLowerCase())}const kr={},Ir=$=>{console.error($)},ni=($,...ne)=>{console.log(`WARN: ${$}`,...ne)},Ur=($,ne)=>{kr[`${$}/${ne}`]||(console.log(`Deprecated as of ${$}. ${ne}`),kr[`${$}/${ne}`]=!0)},ii=new Error;function ai($,ne,{key:de}){let Re=0;const ht=$[de],Ke={},ye={};for(let we=1;we<=ne.length;we++)ye[we+Re]=ht[we],Ke[we+Re]=!0,Re+=E(ne[we-1]);$[de]=ye,$[de]._emit=Ke,$[de]._multi=!0}function aa($){if(Array.isArray($.begin)){if($.skip||$.excludeBegin||$.returnBegin)throw Ir("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ii;if(typeof $.beginScope!="object"||$.beginScope===null)throw Ir("beginScope must be object"),ii;ai($,$.begin,{key:"beginScope"}),$.begin=T($.begin,{joinWith:""})}}function qr($){if(Array.isArray($.end)){if($.skip||$.excludeEnd||$.returnEnd)throw Ir("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ii;if(typeof $.endScope!="object"||$.endScope===null)throw Ir("endScope must be object"),ii;ai($,$.end,{key:"endScope"}),$.end=T($.end,{joinWith:""})}}function oi($){$.scope&&typeof $.scope=="object"&&$.scope!==null&&($.beginScope=$.scope,delete $.scope)}function si($){oi($),typeof $.beginScope=="string"&&($.beginScope={_wrap:$.beginScope}),typeof $.endScope=="string"&&($.endScope={_wrap:$.endScope}),aa($),qr($)}function Fo($){function ne(ye,we){return new RegExp(h(ye),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(we?"g":""))}class de{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,Ce){Ce.position=this.position++,this.matchIndexes[this.matchAt]=Ce,this.regexes.push([Ce,we]),this.matchAt+=E(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(Ce=>Ce[1]);this.matcherRe=ne(T(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const Ce=this.matcherRe.exec(we);if(!Ce)return null;const ct=Ce.findIndex((cr,Oi)=>Oi>0&&cr!==void 0),gt=this.matchIndexes[ct];return Ce.splice(0,ct),Object.assign(Ce,gt)}}class Re{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const Ce=new de;return this.rules.slice(we).forEach(([ct,gt])=>Ce.addRule(ct,gt)),Ce.compile(),this.multiRegexes[we]=Ce,Ce}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,Ce){this.rules.push([we,Ce]),Ce.type==="begin"&&this.count++}exec(we){const Ce=this.getMatcher(this.regexIndex);Ce.lastIndex=this.lastIndex;let ct=Ce.exec(we);if(this.resumingScanAtSamePosition()&&!(ct&&ct.index===this.lastIndex)){const gt=this.getMatcher(0);gt.lastIndex=this.lastIndex+1,ct=gt.exec(we)}return ct&&(this.regexIndex+=ct.position+1,this.regexIndex===this.count&&this.considerAll()),ct}}function ht(ye){const we=new Re;return ye.contains.forEach(Ce=>we.addRule(Ce.begin,{rule:Ce,type:"begin"})),ye.terminatorEnd&&we.addRule(ye.terminatorEnd,{type:"end"}),ye.illegal&&we.addRule(ye.illegal,{type:"illegal"}),we}function Ke(ye,we){const Ce=ye;if(ye.isCompiled)return Ce;[oe,kt,si,Et].forEach(gt=>gt(ye,we)),$.compilerExtensions.forEach(gt=>gt(ye,we)),ye.__beforeBegin=null,[et,Fe,wt].forEach(gt=>gt(ye,we)),ye.isCompiled=!0;let ct=null;return typeof ye.keywords=="object"&&ye.keywords.$pattern&&(ye.keywords=Object.assign({},ye.keywords),ct=ye.keywords.$pattern,delete ye.keywords.$pattern),ct=ct||/\w+/,ye.keywords&&(ye.keywords=Rr(ye.keywords,$.case_insensitive)),Ce.keywordPatternRe=ne(ct,!0),we&&(ye.begin||(ye.begin=/\B|\b/),Ce.beginRe=ne(Ce.begin),!ye.end&&!ye.endsWithParent&&(ye.end=/\B|\b/),ye.end&&(Ce.endRe=ne(Ce.end)),Ce.terminatorEnd=h(Ce.end)||"",ye.endsWithParent&&we.terminatorEnd&&(Ce.terminatorEnd+=(ye.end?"|":"")+we.terminatorEnd)),ye.illegal&&(Ce.illegalRe=ne(ye.illegal)),ye.contains||(ye.contains=[]),ye.contains=[].concat(...ye.contains.map(function(gt){return Ho(gt==="self"?ye:gt)})),ye.contains.forEach(function(gt){Ke(gt,Ce)}),ye.starts&&Ke(ye.starts,we),Ce.matcher=ht(Ce),Ce}if($.compilerExtensions||($.compilerExtensions=[]),$.contains&&$.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=n($.classNameAliases||{}),Ke($)}function Ka($){return $?$.endsWithParent||Ka($.starts):!1}function Ho($){return $.variants&&!$.cachedVariants&&($.cachedVariants=$.variants.map(function(ne){return n($,{variants:null},ne)})),$.cachedVariants?$.cachedVariants:Ka($)?n($,{starts:$.starts?n($.starts):null}):Object.isFrozen($)?n($):$}var oa="11.11.1";class Va extends Error{constructor(ne,de){super(ne),this.name="HTMLInjectionError",this.html=de}}const Nn=r,$r=n,sa=Symbol("nomatch"),li=7,hn=function($){const ne=Object.create(null),de=Object.create(null),Re=[];let ht=!0;const Ke="Could not find the language '{}', did you forget to load/include a language module?",ye={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function Ce(he){return we.noHighlightRe.test(he)}function ct(he){let $e=he.className+" ";$e+=he.parentNode?he.parentNode.className:"";const Ve=we.languageDetectRe.exec($e);if(Ve){const Ze=Rn(Ve[1]);return Ze||(ni(Ke.replace("{}",Ve[1])),ni("Falling back to no-highlight mode for this block.",he)),Ze?Ve[1]:"no-highlight"}return $e.split(/\s+/).find(Ze=>Ce(Ze)||Rn(Ze))}function gt(he,$e,Ve){let Ze="",Wt="";typeof $e=="object"?(Ze=he,Ve=$e.ignoreIllegals,Wt=$e.language):(Ur("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ur("10.7.0",`Please use highlight(code, options) instead.
|
|
432
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Wt=he,Ze=$e),Ve===void 0&&(Ve=!0);const Lt={code:Ze,language:Wt};Ya("before:highlight",Lt);const ci=Lt.result?Lt.result:cr(Lt.language,Lt.code,Ve);return ci.code=Lt.code,Ya("after:highlight",ci),ci}function cr(he,$e,Ve,Ze){const Wt=Object.create(null);function Lt(me,Ee){return me.keywords[Ee]}function ci(){if(!Ge.keywords){Gt.addText(yt);return}let me=0;Ge.keywordPatternRe.lastIndex=0;let Ee=Ge.keywordPatternRe.exec(yt),He="";for(;Ee;){He+=yt.substring(me,Ee.index);const tt=mn.case_insensitive?Ee[0].toLowerCase():Ee[0],Ut=Lt(Ge,tt);if(Ut){const[ur,Dp]=Ut;if(Gt.addText(He),He="",Wt[tt]=(Wt[tt]||0)+1,Wt[tt]<=li&&(Qa+=Dp),ur.startsWith("_"))He+=Ee[0];else{const Vu=mn.classNameAliases[ur]||ur;Lr(Ee[0],Vu)}}else He+=Ee[0];me=Ge.keywordPatternRe.lastIndex,Ee=Ge.keywordPatternRe.exec(yt)}He+=yt.substring(me),Gt.addText(He)}function Ko(){if(yt==="")return;let me=null;if(typeof Ge.subLanguage=="string"){if(!ne[Ge.subLanguage]){Gt.addText(yt);return}me=cr(Ge.subLanguage,yt,!0,jl[Ge.subLanguage]),jl[Ge.subLanguage]=me._top}else me=Xa(yt,Ge.subLanguage.length?Ge.subLanguage:null);Ge.relevance>0&&(Qa+=me.relevance),Gt.__addSublanguage(me._emitter,me.language)}function Mr(){Ge.subLanguage!=null?Ko():ci(),yt=""}function Lr(me,Ee){me!==""&&(Gt.startScope(Ee),Gt.addText(me),Gt.endScope())}function Ja(me,Ee){let He=1;const tt=Ee.length-1;for(;He<=tt;){if(!me._emit[He]){He++;continue}const Ut=mn.classNameAliases[me[He]]||me[He],ur=Ee[He];Ut?Lr(ur,Ut):(yt=ur,ci(),yt=""),He++}}function la(me,Ee){return me.scope&&typeof me.scope=="string"&&Gt.openNode(mn.classNameAliases[me.scope]||me.scope),me.beginScope&&(me.beginScope._wrap?(Lr(yt,mn.classNameAliases[me.beginScope._wrap]||me.beginScope._wrap),yt=""):me.beginScope._multi&&(Ja(me.beginScope,Ee),yt="")),Ge=Object.create(me,{parent:{value:Ge}}),Ge}function Za(me,Ee,He){let tt=O(me.endRe,He);if(tt){if(me["on:end"]){const Ut=new e(me);me["on:end"](Ee,Ut),Ut.isMatchIgnored&&(tt=!1)}if(tt){for(;me.endsParent&&me.parent;)me=me.parent;return me}}if(me.endsWithParent)return Za(me.parent,Ee,He)}function Mp(me){return Ge.matcher.regexIndex===0?(yt+=me[0],1):(da=!0,0)}function Lp(me){const Ee=me[0],He=me.rule,tt=new e(He),Ut=[He.__beforeBegin,He["on:begin"]];for(const ur of Ut)if(ur&&(ur(me,tt),tt.isMatchIgnored))return Mp(Ee);return He.skip?yt+=Ee:(He.excludeBegin&&(yt+=Ee),Mr(),!He.returnBegin&&!He.excludeBegin&&(yt=Ee)),la(He,me),He.returnBegin?0:Ee.length}function Tl(me){const Ee=me[0],He=$e.substring(me.index),tt=Za(Ge,me,He);if(!tt)return sa;const Ut=Ge;Ge.endScope&&Ge.endScope._wrap?(Mr(),Lr(Ee,Ge.endScope._wrap)):Ge.endScope&&Ge.endScope._multi?(Mr(),Ja(Ge.endScope,me)):Ut.skip?yt+=Ee:(Ut.returnEnd||Ut.excludeEnd||(yt+=Ee),Mr(),Ut.excludeEnd&&(yt=Ee));do Ge.scope&&Gt.closeNode(),!Ge.skip&&!Ge.subLanguage&&(Qa+=Ge.relevance),Ge=Ge.parent;while(Ge!==tt.parent);return tt.starts&&la(tt.starts,me),Ut.returnEnd?0:Ee.length}function Ku(){const me=[];for(let Ee=Ge;Ee!==mn;Ee=Ee.parent)Ee.scope&&me.unshift(Ee.scope);me.forEach(Ee=>Gt.openNode(Ee))}let ca={};function ua(me,Ee){const He=Ee&&Ee[0];if(yt+=me,He==null)return Mr(),0;if(ca.type==="begin"&&Ee.type==="end"&&ca.index===Ee.index&&He===""){if(yt+=$e.slice(Ee.index,Ee.index+1),!ht){const tt=new Error(`0 width match regex (${he})`);throw tt.languageName=he,tt.badRule=ca.rule,tt}return 1}if(ca=Ee,Ee.type==="begin")return Lp(Ee);if(Ee.type==="illegal"&&!Ve){const tt=new Error('Illegal lexeme "'+He+'" for mode "'+(Ge.scope||"<unnamed>")+'"');throw tt.mode=Ge,tt}else if(Ee.type==="end"){const tt=Tl(Ee);if(tt!==sa)return tt}if(Ee.type==="illegal"&&He==="")return yt+=`
|
|
433
|
-
`,1;if(eo>1e5&&eo>Ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=He,He.length}const mn=Rn(he);if(!mn)throw Ir(Ke.replace("{}",he)),new Error('Unknown language: "'+he+'"');const Cl=Fo(mn);let st="",Ge=Ze||Cl;const jl={},Gt=new we.__emitter(we);Ku();let yt="",Qa=0,ui=0,eo=0,da=!1;try{if(mn.__emitTokens)mn.__emitTokens($e,Gt);else{for(Ge.matcher.considerAll();;){eo++,da?da=!1:Ge.matcher.considerAll(),Ge.matcher.lastIndex=ui;const me=Ge.matcher.exec($e);if(!me)break;const Ee=$e.substring(ui,me.index),He=ua(Ee,me);ui=me.index+He}ua($e.substring(ui))}return Gt.finalize(),st=Gt.toHTML(),{language:he,value:st,relevance:Qa,illegal:!1,_emitter:Gt,_top:Ge}}catch(me){if(me.message&&me.message.includes("Illegal"))return{language:he,value:Nn($e),illegal:!0,relevance:0,_illegalBy:{message:me.message,index:ui,context:$e.slice(ui-100,ui+100),mode:me.mode,resultSoFar:st},_emitter:Gt};if(ht)return{language:he,value:Nn($e),illegal:!1,relevance:0,errorRaised:me,_emitter:Gt,_top:Ge};throw me}}function Oi(he){const $e={value:Nn(he),illegal:!1,relevance:0,_top:ye,_emitter:new we.__emitter(we)};return $e._emitter.addText(he),$e}function Xa(he,$e){$e=$e||we.languages||Object.keys(ne);const Ve=Oi(he),Ze=$e.filter(Rn).filter(Gu).map(Mr=>cr(Mr,he,!1));Ze.unshift(Ve);const Wt=Ze.sort((Mr,Lr)=>{if(Mr.relevance!==Lr.relevance)return Lr.relevance-Mr.relevance;if(Mr.language&&Lr.language){if(Rn(Mr.language).supersetOf===Lr.language)return 1;if(Rn(Lr.language).supersetOf===Mr.language)return-1}return 0}),[Lt,ci]=Wt,Ko=Lt;return Ko.secondBest=ci,Ko}function Rp(he,$e,Ve){const Ze=$e&&de[$e]||Ve;he.classList.add("hljs"),he.classList.add(`language-${Ze}`)}function El(he){let $e=null;const Ve=ct(he);if(Ce(Ve))return;if(Ya("before:highlightElement",{el:he,language:Ve}),he.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",he);return}if(he.children.length>0&&(we.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(he)),we.throwUnescapedHTML))throw new Va("One of your code blocks includes unescaped HTML.",he.innerHTML);$e=he;const Ze=$e.textContent,Wt=Ve?gt(Ze,{language:Ve,ignoreIllegals:!0}):Xa(Ze);he.innerHTML=Wt.value,he.dataset.highlighted="yes",Rp(he,Ve,Wt.language),he.result={language:Wt.language,re:Wt.relevance,relevance:Wt.relevance},Wt.secondBest&&(he.secondBest={language:Wt.secondBest.language,relevance:Wt.secondBest.relevance}),Ya("after:highlightElement",{el:he,result:Wt,text:Ze})}function Ip(he){we=$r(we,he)}const Ai=()=>{Wo(),Ur("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Uu(){Wo(),Ur("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ol=!1;function Wo(){function he(){Wo()}if(document.readyState==="loading"){Ol||window.addEventListener("DOMContentLoaded",he,!1),Ol=!0;return}document.querySelectorAll(we.cssSelector).forEach(El)}function qu(he,$e){let Ve=null;try{Ve=$e($)}catch(Ze){if(Ir("Language definition for '{}' could not be registered.".replace("{}",he)),ht)Ir(Ze);else throw Ze;Ve=ye}Ve.name||(Ve.name=he),ne[he]=Ve,Ve.rawDefinition=$e.bind(null,$),Ve.aliases&&Wu(Ve.aliases,{languageName:he})}function Fu(he){delete ne[he];for(const $e of Object.keys(de))de[$e]===he&&delete de[$e]}function Hu(){return Object.keys(ne)}function Rn(he){return he=(he||"").toLowerCase(),ne[he]||ne[de[he]]}function Wu(he,{languageName:$e}){typeof he=="string"&&(he=[he]),he.forEach(Ve=>{de[Ve.toLowerCase()]=$e})}function Gu(he){const $e=Rn(he);return $e&&!$e.disableAutodetect}function Mt(he){he["before:highlightBlock"]&&!he["before:highlightElement"]&&(he["before:highlightElement"]=$e=>{he["before:highlightBlock"](Object.assign({block:$e.el},$e))}),he["after:highlightBlock"]&&!he["after:highlightElement"]&&(he["after:highlightElement"]=$e=>{he["after:highlightBlock"](Object.assign({block:$e.el},$e))})}function $p(he){Mt(he),Re.push(he)}function Al(he){const $e=Re.indexOf(he);$e!==-1&&Re.splice($e,1)}function Ya(he,$e){const Ve=he;Re.forEach(function(Ze){Ze[Ve]&&Ze[Ve]($e)})}function Go(he){return Ur("10.7.0","highlightBlock will be removed entirely in v12.0"),Ur("10.7.0","Please use highlightElement now."),El(he)}Object.assign($,{highlight:gt,highlightAuto:Xa,highlightAll:Wo,highlightElement:El,highlightBlock:Go,configure:Ip,initHighlighting:Ai,initHighlightingOnLoad:Uu,registerLanguage:qu,unregisterLanguage:Fu,listLanguages:Hu,getLanguage:Rn,registerAliases:Wu,autoDetection:Gu,inherit:$r,addPlugin:$p,removePlugin:Al}),$.debugMode=function(){ht=!1},$.safeMode=function(){ht=!0},$.versionString=oa,$.regex={concat:_,lookahead:g,either:k,optional:x,anyNumberOfTimes:v};for(const he in Se)typeof Se[he]=="object"&&t(Se[he]);return Object.assign($,Se),$},pn=hn({});return pn.newInstance=()=>hn({}),Ag=pn,pn.HighlightJS=pn,pn.default=pn,Ag}var HU=FU();const Qt=vt(HU),WU=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),GU=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],KU=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],VU=[...GU,...KU],XU=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),YU=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),JU=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ZU=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function QU(t){const e=t.regex,r=WU(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",c=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+YU.join("|")+")"},{begin:":(:)?("+JU.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ZU.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:XU.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+VU.join("|")+")\\b"}]}}function eq(t){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}const kE="[A-Za-z$_][0-9A-Za-z$_]*",tq=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],rq=["true","false","null","undefined","NaN","Infinity"],WN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],GN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],KN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nq=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],iq=[].concat(KN,WN,GN);function VN(t){const e=t.regex,r=(F,{after:te})=>{const q="</"+F[0].slice(1);return F.input.indexOf(q,te)!==-1},n=kE,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const q=F[0].length+F.index,z=F.input[q];if(z==="<"||z===","){te.ignoreMatch();return}z===">"&&(r(F,{after:q})||te.ignoreMatch());let L;const Z=F.input.substring(q);if(L=Z.match(/^\s*=/)){te.ignoreMatch();return}if((L=Z.match(/^\s+extends\s+/))&&L.index===0){te.ignoreMatch();return}}},c={$pattern:kE,keyword:tq,literal:rq,built_in:iq,"variable.language":nq},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,{match:/\$\d+/},h];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const A=[].concat(E,g.contains),T=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:T},j={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...WN,...GN]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(F){return e.concat("(?!",F.join("|"),")")}const X={match:e.concat(/\b/,B([...KN,"super","import"].map(F=>`${F}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},G="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",J={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(G)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,E,{match:/\$\d+/},h,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},J,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:G,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},X,W,j,U,{match:/\$[(.]/}]}}function aq(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,r,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function XN(t){const e=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},p={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,p,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",v=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,x=`\\b|${n.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${v}))[eE][+-]?(${g})[jJ]?(?=${x})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${g})[jJ](?=${x})`}]},b={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,_,h,t.HASH_COMMENT_MODE]}]};return d.contains=[h,_,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,b,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,k,h]}]}}function oq(t){const e=t.regex,r=/(r#)?/,n=e.concat(r,t.UNDERSCORE_IDENT_RE),i=e.concat(r,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:p,keyword:c,literal:u,built_in:d},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,n],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,n],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,n,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:p}},{className:"punctuation",begin:"->"},a]}}function Ww(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}const Uf="[A-Za-z$_][0-9A-Za-z$_]*",YN=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],JN=["true","false","null","undefined","NaN","Infinity"],ZN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],QN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],eR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rR=[].concat(eR,ZN,QN);function sq(t){const e=t.regex,r=(F,{after:te})=>{const q="</"+F[0].slice(1);return F.input.indexOf(q,te)!==-1},n=Uf,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const q=F[0].length+F.index,z=F.input[q];if(z==="<"||z===","){te.ignoreMatch();return}z===">"&&(r(F,{after:q})||te.ignoreMatch());let L;const Z=F.input.substring(q);if(L=Z.match(/^\s*=/)){te.ignoreMatch();return}if((L=Z.match(/^\s+extends\s+/))&&L.index===0){te.ignoreMatch();return}}},c={$pattern:Uf,keyword:YN,literal:JN,built_in:rR,"variable.language":tR},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,{match:/\$\d+/},h];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const A=[].concat(E,g.contains),T=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:T},j={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ZN,...QN]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(F){return e.concat("(?!",F.join("|"),")")}const X={match:e.concat(/\b/,B([...eR,"super","import"].map(F=>`${F}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},G="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",J={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(G)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,E,{match:/\$\d+/},h,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},J,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:G,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},X,W,j,U,{match:/\$[(.]/}]}}function nR(t){const e=t.regex,r=sq(t),n=Uf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:Uf,keyword:YN.concat(u),literal:JN,built_in:rR.concat(i),"variable.language":tR},p={className:"meta",begin:"@"+n},h=(_,b,k)=>{const E=_.contains.findIndex(O=>O.label===b);if(E===-1)throw new Error("can not find mode to replace");_.contains.splice(E,1,k)};Object.assign(r.keywords,d),r.exports.PARAMS_CONTAINS.push(p);const g=r.contains.find(_=>_.scope==="attr"),v=Object.assign({},g,{match:e.concat(n,e.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,g,v]),r.contains=r.contains.concat([p,a,o,v]),h(r,"shebang",t.SHEBANG()),h(r,"use_strict",c);const x=r.contains.find(_=>_.label==="func.def");return x.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function iR(t){const e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(a,{begin:/\(/,end:/\)/}),c=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,u,c,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,u,c]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(r,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function aR(t){const e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},c=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},x={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},b=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},g,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},x,_,a,o],k=[...b];return k.pop(),k.push(c),v.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}Qt.registerLanguage("javascript",VN);Qt.registerLanguage("js",VN);Qt.registerLanguage("typescript",nR);Qt.registerLanguage("ts",nR);Qt.registerLanguage("python",XN);Qt.registerLanguage("py",XN);Qt.registerLanguage("rust",oq);Qt.registerLanguage("go",eq);Qt.registerLanguage("json",aq);Qt.registerLanguage("yaml",aR);Qt.registerLanguage("yml",aR);Qt.registerLanguage("shell",Ww);Qt.registerLanguage("bash",Ww);Qt.registerLanguage("sh",Ww);Qt.registerLanguage("html",iR);Qt.registerLanguage("xml",iR);Qt.registerLanguage("css",QU);nt.use({renderer:{heading({tokens:t,depth:e}){const r=t.map(a=>a.raw).join(""),n=`h${e}`;return`<${n} style="font-size:${{1:"2rem",2:"1.625rem",3:"1.375rem",4:"1.125rem"}[e]??"1rem"};font-weight:500;color:#e4e4e7;margin:1.1em 0 0.4em;line-height:1.5;">${r}</${n}>`},code({text:t,lang:e}){let r;return e&&Qt.getLanguage(e)?r=Qt.highlight(t,{language:e}).value:r=Qt.highlightAuto(t).value,`<pre style="background:#161616;border:1px solid rgba(255,255,255,0.07);border-radius:10px;padding:0.9em 1.1em;overflow-x:auto;margin:0.8em 0;"><code class="hljs" style="background:none;border:none;padding:0;color:#d4d4d8;font-size:0.85em;">${r}</code></pre>`}}});function oR({content:t,className:e=""}){const r=N.useMemo(()=>nt.parse(t),[t]);return y.jsx("div",{className:`prose-io ${e}`,style:{color:"#d4d4d8",fontSize:"0.875rem",lineHeight:"1.7"},dangerouslySetInnerHTML:{__html:r}})}const lq={orchestrator:"#E43A9C",io:"#E43A9C"};function EE({name:t}){const e=lq[t.toLowerCase()]??"#a78bfa";return y.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${e}15`,color:e,borderColor:`${e}30`},children:t})}function cq(){const[t,e]=N.useState([]),[r,n]=N.useState(null),[i,a]=N.useState(new Set),[o,c]=N.useState("all");N.useEffect(()=>{rt.get("/inbox").then(E=>e(E.entries)).catch(()=>{})},[]);const u=t.filter(E=>E.status==="unread").length,d=o==="unread"?t.filter(E=>E.status==="unread"):t,p=d.length>0&&d.every(E=>i.has(E.id)),h=i.size>0;function g(E){h||(n(E),E.status==="unread"&&(rt.post(`/inbox/${E.id}/read`).catch(()=>{}),e(O=>O.map(A=>A.id===E.id?{...A,status:"read"}:A))))}function v(E,O){E.stopPropagation(),a(A=>{const T=new Set(A);return T.has(O)?T.delete(O):T.add(O),T})}function x(){a(p?new Set:new Set(d.map(E=>E.id)))}function _(){const E=Array.from(i);rt.post("/inbox/bulk/read",{ids:E}).catch(()=>{}),e(O=>O.map(A=>i.has(A.id)?{...A,status:"read"}:A)),a(new Set)}function b(){const E=Array.from(i);rt.post("/inbox/bulk/delete",{ids:E}).catch(()=>{}),e(O=>O.filter(A=>!i.has(A.id))),r&&i.has(r.id)&&n(null),a(new Set)}function k(E){rt.delete(`/inbox/${E}`).catch(()=>{}),e(O=>O.filter(A=>A.id!==E)),(r==null?void 0:r.id)===E&&n(null)}return y.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[y.jsxs("div",{className:"w-72 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[y.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex-shrink-0 space-y-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-lg tracking-wide text-zinc-200",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Inbox"}),u>0&&y.jsxs(Vt,{variant:"default",children:[u," unread"]})]}),y.jsx("div",{className:"flex gap-1",children:["all","unread"].map(E=>y.jsx("button",{type:"button",onClick:()=>{c(E),a(new Set)},className:`flex-1 py-1 text-[11px] font-mono rounded-lg transition-colors cursor-pointer ${o===E?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300"}`,style:o===E?{background:"rgba(228,58,156,0.12)"}:void 0,children:E},E))})]}),h&&y.jsxs("div",{className:"px-3 py-2 border-b border-white/[0.06] flex items-center gap-1.5 flex-shrink-0",style:{background:"rgba(228,58,156,0.06)"},children:[y.jsxs("span",{className:"text-[10px] font-mono text-zinc-500 flex-1",children:[i.size," selected"]}),y.jsxs("button",{type:"button",onClick:_,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[10px] font-mono text-zinc-400 hover:text-zinc-200 hover:bg-white/[0.06] transition-colors cursor-pointer",children:[y.jsx(Rb,{className:"w-3 h-3"}),"Mark read"]}),y.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[10px] font-mono text-red-400 hover:text-red-300 hover:bg-red-500/10 transition-colors cursor-pointer",children:[y.jsx($s,{className:"w-3 h-3"}),"Delete"]})]}),d.length>0&&y.jsxs("div",{className:"px-4 py-1.5 border-b border-white/[0.04] flex items-center gap-2 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:x,className:`w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${p?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/40"}`,children:p&&y.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:y.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:"Select all"})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto",children:[d.map(E=>{const O=i.has(E.id),A=(r==null?void 0:r.id)===E.id&&!h;return y.jsxs("div",{onClick:()=>g(E),onKeyDown:T=>T.key==="Enter"&&g(E),className:`flex items-start gap-2.5 px-3 py-3 border-b border-white/[0.04] cursor-pointer transition-colors ${A?"border-l-2 border-l-[#E43A9C] pl-2.5":"hover:bg-white/[0.025]"} ${O?"bg-[#E43A9C]/5":""}`,style:A?{background:"rgba(228,58,156,0.05)"}:void 0,children:[y.jsx("button",{type:"button",onClick:T=>v(T,E.id),className:`mt-0.5 w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${O?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/50"}`,children:O&&y.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:y.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[E.status==="unread"&&y.jsx("div",{className:"w-1 h-1 rounded-full bg-[#E43A9C] flex-shrink-0"}),y.jsx(EE,{name:E.squadName??(E.squadId?E.squadId.slice(0,8):"IO")})]}),y.jsx("p",{className:`text-[11px] truncate ${E.status==="unread"?"text-zinc-200":"text-zinc-500"}`,children:E.title}),y.jsx("p",{className:"text-[10px] text-zinc-700 font-mono mt-1",children:new Date(E.createdAt).toLocaleString()})]})]},E.id)}),d.length===0&&y.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[y.jsx(Ib,{size:32,className:"text-zinc-800 mb-2"}),y.jsx("p",{className:"text-[11px] font-mono text-zinc-700",children:o==="unread"?"All caught up":"No items yet"})]})]})]}),y.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:r&&!h?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"px-6 py-4 border-b border-white/[0.06] flex items-start justify-between flex-shrink-0",children:[y.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[y.jsx(EE,{name:r.squadName??(r.squadId?r.squadId.slice(0,8):"IO")}),y.jsx("h3",{className:"text-sm font-mono text-zinc-100 mt-1.5",children:r.title}),y.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:new Date(r.createdAt).toLocaleString()})]}),y.jsxs("button",{type:"button",onClick:()=>k(r.id),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-red-500/10 hover:text-red-400 transition-colors cursor-pointer",children:[y.jsx($s,{className:"w-3 h-3"}),"Delete"]})]}),y.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:y.jsx(oR,{content:r.content})})]}):h?y.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 text-center px-8",children:[y.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center border border-[#E43A9C]/20",style:{background:"rgba(228,58,156,0.08)"},children:y.jsx(Ib,{className:"w-4 h-4 text-[#E43A9C]"})}),y.jsxs("div",{children:[y.jsxs("p",{className:"text-sm font-mono text-zinc-300",children:[i.size," message",i.size!==1?"s":""," selected"]}),y.jsx("p",{className:"text-[11px] text-zinc-600 mt-1",children:"Use the actions above to mark as read or delete"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{type:"button",onClick:_,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-zinc-300 border border-white/[0.1] hover:bg-white/[0.05] transition-colors cursor-pointer",children:[y.jsx(Rb,{className:"w-3 h-3"}),"Mark read"]}),y.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-red-400 border border-red-500/20 hover:bg-red-500/10 transition-colors cursor-pointer",children:[y.jsx($s,{className:"w-3 h-3"}),"Delete selected"]})]})]}):y.jsx("div",{className:"flex-1 flex items-center justify-center text-zinc-700 font-mono text-xs",children:"Select an item to read"})})]})}function uq(){const{signIn:t}=tp(),[e,r]=N.useState(""),[n,i]=N.useState(""),[a,o]=N.useState(null),[c,u]=N.useState(!1);async function d(p){p.preventDefault(),o(null),u(!0);const{error:h}=await t(e,n);h&&o(h),u(!1)}return y.jsxs("div",{className:"min-h-screen bg-[#161616] flex items-center justify-center relative overflow-hidden",children:[y.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"radial-gradient(circle, #E43A9C 1px, transparent 1px)",backgroundSize:"32px 32px"}}),y.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-[60%] w-[400px] h-[300px] rounded-full blur-3xl pointer-events-none",style:{background:"radial-gradient(ellipse, rgba(228,58,156,0.12) 0%, transparent 70%)"}}),y.jsxs("div",{className:"relative z-10 w-full max-w-[360px] mx-4",children:[y.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[y.jsx(Ra,{height:52}),y.jsx("div",{className:"text-center",children:y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 tracking-widest uppercase mt-1",children:"personal ai orchestrator"})})]}),y.jsxs("form",{onSubmit:d,className:"glass-card border border-white/[0.07] rounded-2xl p-6 space-y-4",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Email"}),y.jsx("input",{type:"email",value:e,onChange:p=>r(p.target.value),required:!0,className:"w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2.5 text-sm text-zinc-200 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/15 transition-colors"})]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Password"}),y.jsx("input",{type:"password",value:n,onChange:p=>i(p.target.value),required:!0,placeholder:"••••••••",className:"w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2.5 text-sm text-zinc-200 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/15 transition-colors"})]}),a&&y.jsx("p",{className:"text-[11px] font-mono text-red-400",children:a}),y.jsx("button",{type:"submit",disabled:c,className:"w-full text-white font-mono text-sm rounded-xl py-3 mt-1 transition-opacity hover:opacity-90 disabled:opacity-50 flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, #D83333 0%, #E43A9C 55%, #F041FF 100%)"},children:c?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Authenticating…"]}):"Sign In"})]}),y.jsx("p",{className:"text-center text-[11px] text-zinc-700 font-mono mt-4",children:"Secured by Supabase Auth"})]})]})}const sR="w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/10 transition-colors",Ls="bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/10 transition-colors";function Ui({label:t,hint:e,align:r="center",children:n}){const i=r==="start"?"flex-1 min-w-0":"flex-1 flex justify-end items-center";return y.jsxs("div",{className:`glass-card border border-white/[0.07] rounded-2xl px-4 py-3.5 flex gap-4 ${r==="start"?"items-start":"items-center"}`,children:[y.jsxs("div",{className:"w-[140px] shrink-0",children:[y.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:t}),e&&y.jsxs("span",{className:"text-[10px] font-mono text-zinc-700 ml-1.5",children:["(",e,")"]})]}),y.jsx("div",{className:i,children:n})]})}function dq({onSave:t,onCancel:e,squads:r}){var x;const[n,i]=N.useState("io"),[a,o]=N.useState(((x=r[0])==null?void 0:x.id)??""),[c,u]=N.useState(""),[d,p]=N.useState(""),[h,g]=N.useState(""),v=()=>{!d.trim()||!h.trim()||!c.trim()||t({name:c.trim(),targetType:n==="io"?"orchestrator":"squad",targetId:n==="squad"?a:void 0,cron:d.trim(),prompt:h.trim()})};return y.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-6",style:{background:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)"},children:y.jsxs("div",{className:"glass-card border border-white/[0.09] rounded-2xl w-full max-w-lg shadow-2xl flex flex-col",style:{maxHeight:"90vh"},children:[y.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/[0.06] flex-shrink-0",children:[y.jsx("h3",{className:"text-lg tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"New Schedule"}),y.jsx("button",{type:"button",onClick:e,className:"p-1.5 rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.06] transition-colors cursor-pointer",children:y.jsx(KP,{className:"w-4 h-4"})})]}),y.jsxs("div",{className:"overflow-y-auto flex-1 px-5 py-4 space-y-2",children:[y.jsx(Ui,{label:"Name",children:y.jsx("input",{value:c,onChange:_=>u(_.target.value),placeholder:"Daily triage",className:`${Ls} w-48`})}),y.jsx(Ui,{label:"Type",children:y.jsx("div",{className:"flex gap-2",children:["io","squad"].map(_=>y.jsx("button",{type:"button",onClick:()=>i(_),className:`px-4 py-1.5 rounded-xl text-[11px] font-mono capitalize transition-colors border cursor-pointer ${n===_?"text-[#E43A9C] border-[#E43A9C]/30":"text-zinc-500 border-white/[0.08] hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:n===_?{background:"rgba(228,58,156,0.08)"}:void 0,children:_==="io"?"IO":"Squad"},_))})}),n==="squad"&&y.jsx(Ui,{label:"Squad",children:y.jsx("select",{value:a,onChange:_=>o(_.target.value),className:`${Ls} w-48`,children:r.map(_=>y.jsx("option",{value:_.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:_.name},_.id))})}),y.jsx(Ui,{label:"Cron Expression",children:y.jsx("input",{value:d,onChange:_=>p(_.target.value),placeholder:"0 9 * * 1-5",className:`${Ls} w-40`})}),y.jsx(Ui,{label:"Prompt",hint:"supports Markdown",align:"start",children:y.jsx("textarea",{value:h,onChange:_=>g(_.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",rows:8,className:`${sR} resize-none leading-relaxed`})})]}),y.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-white/[0.06] flex-shrink-0",children:[y.jsx(Wi,{onClick:e,children:"Cancel"}),y.jsxs(Da,{onClick:v,className:"px-4 py-1.5",children:[y.jsx(jw,{className:"w-3 h-3"}),"Create Schedule"]})]})]})})}function fq({sched:t,squads:e,onSave:r,onBack:n}){var x,_;const[i,a]=N.useState(t.name),[o,c]=N.useState(t.cron),[u,d]=N.useState(t.prompt),[p,h]=N.useState(t.targetId??((x=e[0])==null?void 0:x.id)??""),g=()=>{!o.trim()||!u.trim()||!i.trim()||r({name:i.trim(),cron:o.trim(),prompt:u.trim(),targetId:t.targetType==="squad"?p:void 0})},v=t.targetType==="orchestrator"?"IO Schedule":`Squad — ${((_=e.find(b=>b.id===t.targetId))==null?void 0:_.name)??"Unknown"}`;return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6 max-w-3xl",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[y.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-[11px] font-mono text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[y.jsx(Tu,{className:"w-3.5 h-3.5"}),"Schedules"]}),y.jsx("span",{className:"text-zinc-700 text-[11px]",children:"/"}),y.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:"Edit"})]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Edit Schedule"}),y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mt-0.5",children:v})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(Wi,{onClick:n,children:"Cancel"}),y.jsxs(Da,{onClick:g,className:"px-4 py-1.5",children:[y.jsx(jw,{className:"w-3 h-3"}),"Save Changes"]})]})]}),y.jsxs("div",{className:"space-y-3",children:[y.jsx(Ui,{label:"Name",children:y.jsx("input",{value:i,onChange:b=>a(b.target.value),placeholder:"Schedule name",className:`${Ls} w-48`})}),t.targetType==="squad"&&y.jsx(Ui,{label:"Squad",children:y.jsx("select",{value:p,onChange:b=>h(b.target.value),className:`${Ls} w-48`,children:e.map(b=>y.jsx("option",{value:b.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:b.name},b.id))})}),y.jsx(Ui,{label:"Cron Expression",children:y.jsx("input",{value:o,onChange:b=>c(b.target.value),placeholder:"0 9 * * 1-5",className:`${Ls} w-40`})}),y.jsx(Ui,{label:"Prompt",hint:"supports Markdown",align:"start",children:y.jsxs("div",{className:"space-y-1.5",children:[y.jsx("textarea",{value:u,onChange:b=>d(b.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",className:`${sR} leading-relaxed resize-y`,style:{minHeight:"360px"}}),y.jsx("p",{className:"text-[10px] font-mono text-zinc-700",children:"Tip: use # headings and - lists to structure multi-step instructions."})]})})]})]})}function hq(){const[t,e]=N.useState("squad"),[r,n]=N.useState([]),[i,a]=N.useState([]),[o,c]=N.useState(!1),[u,d]=N.useState(null);N.useEffect(()=>{p(),h()},[]);function p(){rt.get("/schedules").then(j=>n(j.schedules)).catch(()=>{})}function h(){rt.get("/squads").then(j=>a(j.squads)).catch(()=>{})}const g=r.filter(j=>j.targetType==="squad"),v=r.filter(j=>j.targetType==="orchestrator"),x=t==="squad"?g:v;async function _(j){try{await rt.post("/schedules",j),ft.success("Schedule created"),c(!1),p()}catch(R){ft.error(R instanceof Error?R.message:"Failed to create")}}async function b(j){if(u)try{await rt.patch(`/schedules/${u.id}`,j),ft.success("Schedule saved"),d(null),p()}catch{ft.error("Failed to save schedule")}}const[k,E]=N.useState(null);async function O(j,R){E(j);try{await rt.patch(`/schedules/${j}`,{enabled:!R}),ft.success(R?"Schedule paused":"Schedule resumed"),p()}catch{ft.error("Failed to toggle schedule")}finally{E(null)}}async function A(j){E(j);try{await rt.post(`/schedules/${j}/run`,{}),ft.success("Schedule triggered")}catch{ft.error("Failed to trigger schedule")}finally{E(null)}}async function T(j){E(j);try{await rt.delete(`/schedules/${j}`),ft.success("Schedule deleted"),p()}catch{ft.error("Failed to delete")}finally{E(null)}}if(u)return y.jsx(fq,{sched:u,squads:i,onSave:b,onBack:()=>d(null)});const C=t==="squad"?["Squad","Name","Cron","Next Run","Status",""]:["Name","Cron","Next Run","Status",""];return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o&&y.jsx(dq,{onSave:_,onCancel:()=>c(!1),squads:i}),y.jsxs("div",{className:"flex items-center justify-between mb-5",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Schedules"}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[r.filter(j=>j.enabled).length," active · ",r.filter(j=>!j.enabled).length," paused"]})]}),y.jsxs(Da,{onClick:()=>c(!0),className:"px-3 py-1.5",children:[y.jsx(HP,{className:"w-3.5 h-3.5"}),"Add Schedule"]})]}),y.jsx("div",{className:"flex gap-1 mb-4",children:[["squad","Squad Schedules"],["io","IO Schedules"]].map(([j,R])=>y.jsx("button",{type:"button",onClick:()=>e(j),className:`px-4 py-2 text-[11px] font-mono rounded-xl transition-colors cursor-pointer ${t===j?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===j?{background:"rgba(228,58,156,0.12)"}:void 0,children:R},j))}),y.jsx("div",{className:"overflow-x-auto rounded-2xl border border-white/[0.07] glass-card",children:x.length===0?y.jsx("div",{className:"px-4 py-12 text-center text-zinc-600 font-mono text-sm",children:"No schedules for this category"}):y.jsxs("table",{className:"w-full text-[11px] font-mono min-w-[640px]",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:C.map(j=>y.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:j},j))})}),y.jsx("tbody",{children:x.map(j=>{var R;return y.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${j.enabled?"":"opacity-50"}`,children:[t==="squad"?y.jsx("td",{className:"px-4 py-3",children:y.jsx($B,{name:((R=i.find(M=>M.id===j.targetId))==null?void 0:R.name)??"Unknown"})}):null,y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:j.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600 text-[10px]",children:j.cron}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(U5,{className:"w-3 h-3"}),j.enabled&&j.nextRun?new Date(j.nextRun).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,month:"short",day:"numeric",timeZone:"America/Chicago"}):"—"]})}),y.jsx("td",{className:"px-4 py-3",children:y.jsx(Vt,{variant:j.enabled?"success":"muted",children:j.enabled?"active":"paused"})}),y.jsx("td",{className:"px-4 py-3",children:y.jsxs("div",{className:`flex items-center gap-1 ${k===j.id?"opacity-50 pointer-events-none":""}`,children:[y.jsxs(Wi,{onClick:()=>A(j.id),children:[y.jsx(k4,{className:"w-3 h-3"}),"Run now"]}),y.jsx(MB,{onClick:()=>O(j.id,j.enabled),children:j.enabled?y.jsxs(y.Fragment,{children:[y.jsx(b4,{className:"w-3 h-3"}),"Pause"]}):y.jsxs(y.Fragment,{children:[y.jsx(Gh,{className:"w-3 h-3"}),"Resume"]})}),y.jsxs(Wi,{onClick:()=>d(j),children:[y.jsx(w4,{className:"w-3 h-3"}),"Edit"]}),y.jsxs(qw,{onClick:()=>T(j.id),children:[y.jsx($s,{className:"w-3 h-3"}),"Delete"]})]})})]},j.id)})})]})})]})}const pq=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"}],gl="rounded-xl border border-white/[0.07] bg-white/[0.04] px-3 py-2 text-sm font-mono text-zinc-300 outline-none focus:border-[#E43A9C]/50",OE=`${gl} w-[72px]`,mq=`${gl} w-[100px]`,AE=`${gl} w-[200px]`,TE=`${gl} w-[320px]`,gq=`${gl} w-[140px] appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2371717a%22%20d%3D%22M3%204.5L6%208l3-3.5H3z%22%2F%3E%3C%2Fsvg%3E')] bg-[position:right_10px_center] bg-no-repeat pr-8`;function yq(){const[t,e]=N.useState(null),[r,n]=N.useState("general");N.useEffect(()=>{rt.get("/config").then(o=>e(o.config)).catch(()=>{})},[]);function i(o){t&&e({...t,...o})}async function a(){if(t)try{const{dataDir:o,...c}=t;await rt.patch("/config",c),ft.success("Settings saved")}catch{ft.error("Failed to save settings")}}return t?y.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:y.jsxs("div",{className:"max-w-3xl",children:[y.jsx("h2",{className:"mb-6 text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Settings"}),y.jsx("div",{className:"mb-6 flex gap-6 border-b border-white/[0.07]",children:pq.map(o=>y.jsx("button",{type:"button",onClick:()=>n(o.id),className:`-mb-px border-b-2 px-1 pb-3 text-[11px] font-mono transition-colors ${r===o.id?"border-[#E43A9C] text-[#E43A9C]":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:o.label},o.id))}),y.jsxs("div",{className:"glass-card rounded-2xl border border-white/[0.07] p-5",children:[r==="general"&&y.jsxs(y.Fragment,{children:[y.jsx(Bn,{label:"Log Level",children:y.jsx("select",{value:t.logLevel,onChange:o=>i({logLevel:o.target.value}),className:gq,children:["trace","debug","info","warn","error","fatal"].map(o=>y.jsx("option",{value:o,children:o},o))})}),y.jsx(Bn,{label:"Default Model",children:y.jsx("input",{type:"text",value:t.defaultModel,onChange:o=>i({defaultModel:o.target.value}),className:AE})}),y.jsx(Bn,{label:"Max Instances",children:y.jsx("input",{type:"number",value:t.maxInstancesPerSquad,onChange:o=>i({maxInstancesPerSquad:Number(o.target.value)}),className:OE,min:1,max:10})}),y.jsx(Bn,{label:"API Port",children:y.jsx("input",{type:"number",value:t.apiPort,onChange:o=>i({apiPort:Number(o.target.value)}),className:OE})}),y.jsx(Bn,{label:"Pricing Refresh (hrs)",children:y.jsx("input",{type:"number",value:t.pricing.refreshIntervalHours,onChange:o=>i({pricing:{refreshIntervalHours:Number(o.target.value)}}),className:mq,min:1})}),y.jsx(Bn,{label:"Data Dir",children:y.jsx("input",{type:"text",value:t.dataDir,readOnly:!0,className:`${TE} cursor-default text-zinc-500`})})]}),r==="telegram"&&y.jsxs(y.Fragment,{children:[y.jsx(Bn,{label:"Bot Token",children:y.jsx(Tg,{value:t.telegram.botToken??"",onChange:o=>i({telegram:{...t.telegram,botToken:o||null}}),size:"lg"})}),y.jsx(Bn,{label:"Allowed Chat IDs",children:y.jsx("input",{type:"text",value:t.telegram.allowedChatIds.join(", "),onChange:o=>i({telegram:{...t.telegram,allowedChatIds:o.target.value.split(",").map(c=>Number(c.trim())).filter(c=>!Number.isNaN(c))}}),className:AE})})]}),r==="auth"&&y.jsxs(y.Fragment,{children:[y.jsx(Bn,{label:"Project URL",children:y.jsx("input",{type:"text",value:t.supabase.projectUrl??"",onChange:o=>i({supabase:{...t.supabase,projectUrl:o.target.value||null}}),className:TE})}),y.jsx(Bn,{label:"Anon Key",children:y.jsx(Tg,{value:t.supabase.anonKey??"",onChange:o=>i({supabase:{...t.supabase,anonKey:o||null}}),size:"lg"})}),y.jsx(Bn,{label:"JWT Secret",children:y.jsx(Tg,{value:t.supabase.jwtSecret??"",onChange:o=>i({supabase:{...t.supabase,jwtSecret:o||null}}),size:"lg"})})]}),y.jsx("div",{className:"flex justify-end pt-6",children:y.jsx(Da,{onClick:a,className:"px-4 py-2.5",children:"Save Settings"})})]})]})}):y.jsx("div",{className:"flex h-full items-center justify-center text-zinc-600",children:"Loading..."})}function Bn({label:t,children:e}){return y.jsxs("div",{className:"flex items-center justify-between gap-6 border-b border-white/[0.07] py-3",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-400 shrink-0",children:t}),y.jsx("div",{className:"flex justify-end",children:e})]})}function Tg({value:t,onChange:e,size:r="lg"}){const[n,i]=N.useState(!1),a=r==="lg"?"w-[320px]":"w-[200px]";return y.jsxs("div",{className:"relative",children:[y.jsx("input",{type:n?"text":"password",value:t,onChange:o=>e(o.target.value),className:`${gl} ${a} pr-9`}),y.jsx("button",{type:"button",onClick:()=>i(o=>!o),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-zinc-600 transition-colors hover:text-zinc-400","aria-label":n?"Hide value":"Show value",children:n?y.jsx(X5,{size:14}):y.jsx(Rb,{size:14})})]})}const vq=[{id:"installed",label:"Installed"},{id:"awesome-copilot",label:"Awesome Copilot"},{id:"skillssh",label:"skills.sh"}];function CE(t){return t==="awesome-copilot"?"Awesome Copilot":"skills.sh"}function jE(t){return t?t>=1e6?`${(t/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${t} installs`:null}function bq(t){const e=t.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);if(!e)return{frontMatter:{},body:t};const r=e[1]??"",n=e[2]??"",i={};let a="",o=null;for(const c of r.split(`
|
|
434
|
-
`)){const u=c.match(/^(\w[\w-]*)\s*:\s*(.*)$/);if(u){a&&o&&(i[a]=o,o=null),a=u[1]??"";const d=(u[2]??"").trim();d===""||d==="[]"?o=[]:d.startsWith("[")&&d.endsWith("]")?i[a]=d.slice(1,-1).split(",").map(p=>p.trim().replace(/^["']|["']$/g,"")):i[a]=d.replace(/^["']|["']$/g,"")}else c.match(/^\s+-\s+(.+)/)&&a&&(o||(o=[]),o.push(c.replace(/^\s+-\s+/,"").trim()))}return a&&o&&(i[a]=o),{frontMatter:i,body:n}}const PE=["name","description","version","author","license","argument_hint","argument-hint","use_when","use-when","enhancements","metadata","tags"];function xq({content:t}){const{frontMatter:e,body:r}=bq(t),n=PE.filter(o=>e[o]!==void 0),i=Object.keys(e).filter(o=>!PE.includes(o)),a=[...n,...i];return y.jsxs("div",{children:[a.length>0&&y.jsxs("div",{className:"border-b border-white/[0.05] pb-4 mb-4",children:[y.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Front Matter"}),y.jsx("div",{className:"space-y-2",children:a.map(o=>{const c=e[o];return c==null||Array.isArray(c)&&c.length===0?null:y.jsxs("div",{className:"flex gap-3 items-start",children:[y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 w-28 flex-shrink-0 pt-0.5",children:o}),y.jsx("div",{className:"flex-1 min-w-0",children:Array.isArray(c)?y.jsx("div",{className:"flex flex-wrap gap-1",children:c.map((u,d)=>y.jsx(Vt,{variant:"muted",children:u},d))}):typeof c=="object"?y.jsx("div",{className:"space-y-0.5",children:Object.entries(c).map(([u,d])=>y.jsxs("p",{className:"text-[11px] font-mono text-zinc-400",children:[y.jsxs("span",{className:"text-zinc-600",children:[u,":"]})," ",d]},u))}):o==="use_when"||o==="use-when"?y.jsx("p",{className:"text-[11px] text-zinc-300 leading-relaxed",children:c}):o==="argument_hint"||o==="argument-hint"?y.jsx("code",{className:"text-[11px] font-mono text-[#E43A9C] bg-[#2d1a24] px-1.5 py-0.5 rounded",children:c}):y.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:c})})]},o)})})]}),r.trim()&&y.jsxs("div",{children:[y.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Body"}),y.jsx(oR,{content:r})]})]})}function wq(){const[t,e]=N.useState("installed"),[r,n]=N.useState([]),[i,a]=N.useState([]),[o,c]=N.useState(null);function u(L){return"url"in L&&L.url?L.url:L.name}const[d,p]=N.useState(null),[h,g]=N.useState(""),[v,x]=N.useState(!1),[_,b]=N.useState(!1),[k,E]=N.useState(!1),[O,A]=N.useState(""),[T,C]=N.useState(null),[j,R]=N.useState(null),M=N.useCallback(async()=>{try{const L=await rt.get("/skills"),Z=new Set(L.skills.map(se=>se.name.toLowerCase()));n(L.skills),a(se=>se.map(le=>({...le,installed:Z.has(le.name.toLowerCase())})))}catch(L){ft.error(L instanceof Error?L.message:"Failed to load skills")}},[]),Y=N.useCallback(async L=>{b(!0);try{const Z=await rt.get(`/skills/${encodeURIComponent(L)}`);p(Z),A(Z.content)}catch(Z){ft.error(Z instanceof Error?Z.message:"Failed to load skill"),p(null)}finally{b(!1)}},[]);N.useEffect(()=>{M()},[M]),N.useEffect(()=>{if(t==="installed"){R(null);return}const L=h.trim();if(t==="skillssh"&&!L){a([]),R(null),x(!1);return}let Z=!1;x(!0);const se=window.setTimeout(async()=>{try{const le=await rt.get(`/skills/discover?source=${t}&q=${encodeURIComponent(L)}`);if(Z)return;a(le.skills),R(null)}catch(le){if(Z)return;a([]),R(le instanceof Error?le.message:"Discovery failed")}finally{Z||x(!1)}},250);return()=>{Z=!0,window.clearTimeout(se)}},[h,t]);const W=N.useMemo(()=>{const L=h.trim().toLowerCase();return L?r.filter(Z=>[Z.name,Z.description,Z.preview].some(se=>se.toLowerCase().includes(L))):r},[r,h]),B=t==="installed"?W:i,X=W.find(L=>L.name===o)??null,K=i.find(L=>u(L)===o)??null,U=(X==null?void 0:X.name)??(K==null?void 0:K.name)??null;N.useEffect(()=>{if(E(!1),!B.length){c(null),t!=="installed"&&p(null);return}if(!o||!B.some(L=>u(L)===o)){const L=B[0];L&&c(u(L))}},[o,t,B]),N.useEffect(()=>{if(t!=="installed"||!U){p(null);return}Y(U)},[Y,U,t]);async function G(L){if(!L.url&&!L.registrySource){ft.error("Install source is not available for this skill yet");return}C(L.name);try{await rt.post("/skills/install",{name:L.name,source:L.source,url:L.url,registrySource:L.registrySource,skillId:L.skillId}),ft.success(`Installed ${L.title||L.name}`),await M(),a(Z=>Z.map(se=>se.name===L.name?{...se,installed:!0}:se))}catch(Z){ft.error(Z instanceof Error?Z.message:"Install failed")}finally{C(null)}}async function J(L){C(L);try{await rt.delete(`/skills/${encodeURIComponent(L)}`),ft.success(`Removed ${L}`),await M(),a(Z=>Z.map(se=>se.name===L?{...se,installed:!1}:se))}catch(Z){ft.error(Z instanceof Error?Z.message:"Failed to remove skill")}finally{C(null)}}async function F(){if(d){C(d.name);try{await rt.put(`/skills/${encodeURIComponent(d.name)}`,{content:O}),ft.success(`Updated ${d.name}`),E(!1),await Promise.all([M(),Y(d.name)])}catch(L){ft.error(L instanceof Error?L.message:"Failed to save skill")}finally{C(null)}}}const te=!!(X!=null&&X.activatedForOrchestrator),q=T===(d==null?void 0:d.name),z=T===(K==null?void 0:K.name);return y.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[y.jsxs("div",{className:"w-64 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[y.jsxs("div",{className:"px-2.5 pt-2.5 pb-2 flex-shrink-0 border-b border-white/[0.06] space-y-2",children:[y.jsxs("div",{className:"relative",children:[y.jsx(WP,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-zinc-700"}),y.jsx("input",{type:"text",value:h,onChange:L=>g(L.target.value),placeholder:"Search skills…",className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl pl-7 pr-2 py-1.5 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/30 transition-colors"})]}),y.jsx("div",{className:"flex flex-col gap-0.5",children:vq.map(L=>y.jsxs("button",{type:"button",onClick:()=>e(L.id),className:`w-full text-left px-2.5 py-1.5 rounded-lg text-[11px] font-mono transition-colors flex items-center justify-between cursor-pointer ${t===L.id?"text-[#E43A9C]":"text-zinc-500 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===L.id?{background:"rgba(228,58,156,0.10)"}:void 0,children:[y.jsx("span",{children:L.label}),L.id==="installed"&&y.jsx("span",{className:"text-[10px] text-zinc-600",children:r.length})]},L.id))})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto py-1.5",children:[v&&t!=="installed"?y.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-white/[0.08] bg-white/[0.03] px-3 py-3 font-mono text-[11px] text-zinc-500",children:[y.jsx(Os,{className:"h-3.5 w-3.5 animate-spin"})," Searching registry..."]}):null,B.map(L=>{const Z=u(L),se=o===Z,le=L.description||("preview"in L?L.preview:"No description available.");return y.jsxs("button",{type:"button",onClick:()=>{E(!1),c(Z)},className:`w-full text-left px-3 py-2.5 border-b border-white/[0.03] transition-colors cursor-pointer ${se?"border-l-2 border-l-[#E43A9C] bg-[#E43A9C]/5":"hover:bg-white/[0.03]"}`,children:[y.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[y.jsx("span",{className:"truncate font-mono text-[11px] text-zinc-200",children:L.name}),"installed"in L&&L.installed?y.jsx(Vt,{variant:"success",children:"installed"}):null]}),y.jsx("p",{className:"line-clamp-2 font-mono text-[10px] leading-relaxed text-zinc-600",children:le})]},`${t}:${Z}`)}),!v&&B.length===0?y.jsx("div",{className:"px-4 py-8",children:y.jsx("p",{className:"font-mono text-[11px] leading-relaxed text-zinc-500",children:j||(t==="skillssh"&&!h.trim()?"Start typing to search the skills.sh registry.":h.trim()?"No skills match your search.":"No skills available in this source.")})}):null]})]}),y.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-5",children:t==="installed"&&X?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[y.jsxs("div",{className:"flex min-w-0 gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(Mb,{className:"h-6 w-6"})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:X.name}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[y.jsx(Vt,{variant:"success",children:"installed"}),te?y.jsx(Vt,{variant:"warning",children:"active"}):y.jsx(Vt,{variant:"muted",children:"inactive"}),y.jsx(Vt,{variant:"muted",children:"local skill"})]}),y.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[y.jsxs("p",{children:["path: ",X.filePath]}),y.jsxs("p",{children:["orchestrator: ",te?"enabled":"disabled"]})]})]})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[k?y.jsxs(Da,{onClick:F,disabled:q||O===(d==null?void 0:d.content),className:"px-3 py-2",children:[q?y.jsx(Os,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx($b,{className:"h-3.5 w-3.5"}),"Save"]}):y.jsxs(Wi,{onClick:()=>E(!0),className:"px-3 py-2",children:[y.jsx($b,{className:"h-3.5 w-3.5"})," Edit"]}),y.jsxs(qw,{onClick:()=>J(X.name),className:"px-3 py-2",children:[q?y.jsx(Os,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx($s,{className:"h-3.5 w-3.5"}),"Remove"]})]})]}),y.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:_&&!d?y.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-zinc-500",children:[y.jsx(Os,{className:"h-3.5 w-3.5 animate-spin"})," Loading skill..."]}):k?y.jsxs("div",{className:"space-y-3",children:[y.jsx("textarea",{value:O,onChange:L=>A(L.target.value),className:"min-h-[440px] w-full rounded-2xl border border-white/[0.08] bg-black/30 p-4 font-mono text-[12px] leading-6 text-zinc-200 outline-none transition-colors focus:border-[#E43A9C]/50"}),y.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-zinc-500",children:[y.jsx("span",{children:"Editing raw SKILL.md"}),y.jsx(Wi,{onClick:()=>{E(!1),A((d==null?void 0:d.content)??"")},className:"px-3 py-2",children:"Cancel"})]})]}):d?y.jsx(xq,{content:d.content}):y.jsx("p",{className:"font-mono text-[11px] text-zinc-500",children:"Select an installed skill to inspect it."})})]}):t!=="installed"&&K?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[y.jsxs("div",{className:"flex min-w-0 gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(I4,{className:"h-6 w-6"})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:K.title||K.name}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[y.jsx(Vt,{variant:K.installed?"success":"default",children:K.installed?"installed":"available"}),y.jsx(Vt,{variant:"muted",children:CE(K.source)}),jE(K.installs)?y.jsx(Vt,{variant:"info",children:jE(K.installs)}):null]}),y.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[y.jsxs("p",{children:["registry: ",CE(K.source)]}),K.registrySource?y.jsxs("p",{children:["source: ",K.registrySource]}):null,K.url?y.jsxs("p",{children:["url: ",K.url]}):null]})]})]}),y.jsx("div",{className:"flex items-center gap-2",children:K.installed?y.jsx(Wi,{onClick:()=>{e("installed"),c(K.name)},className:"px-3 py-2",children:"Open installed"}):y.jsxs(Da,{onClick:()=>G(K),disabled:z||!K.url&&!K.registrySource,className:"px-3 py-2",children:[z?y.jsx(Os,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(G5,{className:"h-3.5 w-3.5"}),"Install"]})})]}),y.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[y.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.02] p-5",children:y.jsx("p",{className:"font-mono text-[12px] leading-7 text-zinc-300",children:K.description||"No registry description is available for this skill yet."})}),y.jsx("div",{className:"mt-4 rounded-2xl border border-dashed border-white/[0.08] bg-black/20 p-4 font-mono text-[11px] leading-6 text-zinc-500",children:"Install will fetch the skill definition from the selected registry source and add it to your local skills library."})]})]}):y.jsx("div",{className:"flex h-full items-center justify-center rounded-2xl border border-dashed border-white/[0.08] bg-white/[0.02] p-8 text-center",children:y.jsxs("div",{children:[y.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(Mb,{className:"h-6 w-6"})}),y.jsx("h3",{className:"text-[28px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Select a Skill"}),y.jsx("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-zinc-500",children:"Choose a skill from the left panel to inspect details, install registry entries, or edit local definitions."})]})})})]})}const qf=["#38bdf8","#a78bfa","#34d399","#f59e0b","#f87171","#E43A9C"];function _q(t){return qf[t%qf.length]}function Cg(){const{name:t,instanceId:e}=WL();return t&&e?y.jsx(Oq,{squadName:t,instanceId:e}):t?y.jsx(Eq,{name:t}):y.jsx(Sq,{})}function Sq(){const[t,e]=N.useState([]),[r,n]=N.useState(null),i=Ou();return N.useEffect(()=>{Promise.all([rt.get("/squads"),rt.get("/config")]).then(([a,o])=>{e(a.squads),n(o.config.maxInstancesPerSquad)}).catch(()=>{})},[]),y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[y.jsx("div",{className:"mb-6",children:y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Squads"}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[t.length," squads · ",t.reduce((a,o)=>a+(o.activeInstances||0),0)," ","active instances"]})]})}),y.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[t.map((a,o)=>{const c=_q(o);return y.jsxs("button",{type:"button",onClick:()=>i(`/squads/${a.name}`),className:"text-left rounded-2xl p-5 transition-all group cursor-pointer",style:{border:`1px solid ${c}30`,background:`${c}08`,backdropFilter:"blur(20px)"},onMouseEnter:u=>{u.currentTarget.style.borderColor=`${c}70`,u.currentTarget.style.background=`${c}12`},onMouseLeave:u=>{u.currentTarget.style.borderColor=`${c}30`,u.currentTarget.style.background=`${c}08`},children:[y.jsxs("div",{className:"flex items-start justify-between mb-1",children:[y.jsx("h3",{className:"text-sm font-mono transition-colors",style:{color:c},children:a.name}),y.jsx(Vt,{variant:To(a.status),children:a.status})]}),y.jsxs("div",{className:"flex items-center justify-between mb-3",children:[y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono",children:a.universe}),y.jsxs("span",{className:"text-[11px] text-zinc-600 font-mono flex items-center gap-1",children:[y.jsx(F5,{className:"w-3 h-3"}),a.activeInstances,"/",r??(a.totalInstances||a.memberCount)]})]}),a.repoUrl&&y.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-zinc-700 font-mono mb-4",children:[y.jsx(BP,{className:"w-3 h-3 flex-shrink-0"}),y.jsx("span",{className:"truncate",children:a.repoUrl.replace("https://github.com/","")})]}),a.recentActivity&&a.recentActivity.length>0&&y.jsxs("div",{className:"border-t pt-3",style:{borderColor:`${c}15`},children:[y.jsx("p",{className:"text-[10px] font-mono uppercase tracking-wider mb-2",style:{color:`${c}80`},children:"Recent Work"}),y.jsx("ul",{className:"space-y-1.5",children:a.recentActivity.map(u=>{const d={className:"w-3.5 h-3.5 flex-shrink-0 mt-px"},p=kq(u.status,d),h=u.objective?u.objective.length>60?`${u.objective.slice(0,60)}…`:u.objective:u.issueRef||"Instance";return y.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] font-mono text-zinc-600",children:[p,y.jsx("span",{className:"truncate",children:h})]},u.id)})})]})]},a.id)}),t.length===0&&y.jsxs("div",{className:"col-span-full text-center py-12 text-zinc-600",children:[y.jsx(Vh,{size:48,className:"mx-auto mb-3 opacity-30"}),y.jsx("p",{className:"text-[11px] font-mono",children:"No squads hired yet. Ask IO to hire a squad for a project."})]})]})]})}function kq(t,e){const r=t.toLowerCase();return r.includes("complete")||r.includes("success")||r.includes("done")?y.jsx(L5,{...e,style:{color:"#34d399"}}):r.includes("warning")||r.includes("review")?y.jsx(B4,{...e,style:{color:"#fbbf24"}}):r.includes("error")||r.includes("fail")?y.jsx(z5,{...e,style:{color:"#f87171"}}):r.includes("working")||r.includes("progress")||r.includes("running")?y.jsx(UP,{...e,style:{color:"#E43A9C"}}):y.jsx(c4,{...e,style:{color:"#60a5fa"}})}function lR(t,e){const r="w-4 h-4",n={color:e},i=t.toLowerCase();return i.includes("lead")||i.includes("pm")||i.includes("technical")?y.jsx(zP,{className:r,style:n}):i.includes("qa")||i.includes("test")?y.jsx(A5,{className:r,style:n}):i.includes("scribe")?y.jsx(T4,{className:r,style:n}):y.jsx(DP,{className:r,style:n})}function Eq({name:t}){const[e,r]=N.useState(null),[n,i]=N.useState("agents"),a=Ou();if(N.useEffect(()=>{rt.get(`/squads/${t}`).then(r).catch(()=>{})},[t]),!e)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const o=qf[0];return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${o}06`},children:[y.jsxs("button",{type:"button",onClick:()=>a("/squads"),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(Tu,{className:"w-3.5 h-3.5"})," All Squads"]}),y.jsxs("div",{className:"flex items-start justify-between mb-5",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-3xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:o},children:e.squad.name}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono",children:[e.squad.universe," · ",e.squad.autonomyTier||"standard"," autonomy"]}),e.squad.repoUrl&&y.jsxs("a",{href:e.squad.repoUrl,target:"_blank",rel:"noreferrer",className:"text-[11px] font-mono text-[#E43A9C] hover:text-[#F041FF] flex items-center gap-1 mt-1 transition-colors",children:[y.jsx(BP,{className:"w-3 h-3"}),e.squad.repoUrl.replace("https://github.com/","")]})]}),y.jsx(Vt,{variant:To(e.squad.status),children:e.squad.status})]}),y.jsx("div",{className:"flex gap-0 mb-5 border-b border-white/[0.06]",children:["agents","instances"].map(c=>y.jsx("button",{type:"button",onClick:()=>i(c),className:`px-4 py-2 text-[11px] font-mono capitalize transition-colors border-b-2 -mb-px ${n===c?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:c},c))}),n==="agents"&&y.jsx("div",{className:"space-y-2",children:e.members.map(c=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3",children:[y.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${o}30`,background:`${o}12`},children:lR(c.roleName||c.role,o)}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-sm font-mono text-zinc-200",children:c.displayName}),y.jsx(Vt,{variant:To(c.status),children:c.status})]}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:c.role}),c.currentTask&&y.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:c.currentTask})]})]},c.id))}),n==="instances"&&y.jsx("div",{className:"space-y-2",children:e.instances.length===0?y.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No active instances"}):e.instances.map(c=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-4",children:[y.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 text-[11px] font-mono",children:[y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"ID"}),y.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:c.id.slice(0,8)})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Branch"}),y.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:c.branch||"—"})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Status"}),y.jsx("p",{className:"text-zinc-300 mt-0.5",children:y.jsx(Vt,{variant:To(c.status),children:c.status})})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Tasks"}),y.jsxs("p",{className:"text-zinc-300 mt-0.5",children:[c.tasksComplete,"/",c.taskCount]})]})]}),y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:()=>a(`/squads/${t}/instances/${c.id}`),title:"View instance agents",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:o},children:y.jsx(Gh,{className:"w-4 h-4"})}),y.jsx("button",{type:"button",onClick:()=>ft.info("Stop not yet implemented"),title:"Stop instance",className:"p-2 rounded-xl hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:y.jsx(Kh,{className:"w-4 h-4"})})]})]},c.id))})]})}function Oq({squadName:t,instanceId:e}){const[r,n]=N.useState(null),[i,a]=N.useState(null),o=Ou();if(N.useEffect(()=>{rt.get(`/squads/${t}/instances/${e}`).then(n).catch(()=>{ft.error("Failed to load instance")})},[t,e]),!r)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const c=qf[0];if(i){const u=r.members.find(p=>p.roleName===i),d=r.activity.filter(p=>p.agent===i);return y.jsx(Cq,{agentName:(u==null?void 0:u.displayName)||i,agentRole:i,agentStatus:(u==null?void 0:u.status)||"idle",currentTask:(u==null?void 0:u.currentTask)||null,events:d,color:c,onBack:()=>a(null),squadName:t})}return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${c}06`},children:[y.jsxs("button",{type:"button",onClick:()=>o(`/squads/${t}`),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(Tu,{className:"w-3.5 h-3.5"})," Back to ",t]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:c},children:"Instance"}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:r.instance.id.slice(0,8)}),r.instance.branch&&y.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:r.instance.branch})]}),y.jsx(Vt,{variant:To(r.instance.status),children:r.instance.status})]}),y.jsx("div",{className:"space-y-2",children:r.members.map(u=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3",children:[y.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${c}30`,background:`${c}12`},children:lR(u.roleName||u.role,c)}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-sm font-mono text-zinc-200",children:u.displayName}),y.jsx(Vt,{variant:To(u.status),children:u.status})]}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:u.role}),u.currentTask&&y.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:u.currentTask})]}),(u.status==="working"||u.status==="in meeting")&&y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:()=>a(u.roleName||u.role),title:"View work in progress",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:c},children:y.jsx(Gh,{className:"w-4 h-4"})}),u.status==="working"&&y.jsx("button",{type:"button",onClick:()=>ft.success(`${u.displayName} stopped`),title:"Stop agent",className:"p-2 rounded-xl hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:y.jsx(Kh,{className:"w-4 h-4"})})]})]},u.id))}),(r.instance.status==="meeting"||r.instance.status==="planning")&&r.instance.meetingLog&&r.instance.meetingLog.length>0&&y.jsxs("div",{className:"mt-6",children:[y.jsx("h3",{className:"text-lg tracking-wide mb-3",style:{fontFamily:"'Bebas Neue', sans-serif",color:c},children:"Meeting Discussion"}),y.jsx("div",{className:"space-y-2",children:r.instance.meetingLog.map((u,d)=>{const p=u.match(/^\[([^\]]+)\]\s*(.*)/s),h=p?p[1]:"unknown",g=p?p[2]:u;return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-xl px-4 py-3",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[y.jsx(Vh,{className:"w-3.5 h-3.5",style:{color:"#818cf8"}}),y.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-indigo-400",children:h})]}),y.jsx("p",{className:"text-xs text-zinc-400 whitespace-pre-wrap leading-relaxed",children:g})]},`meeting-${d}`)})})]})]})}const Aq={thought:{label:"Thinking",icon:qP,color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool_call:{label:"Tool Call",icon:L4,color:"#38bdf8",bg:"rgba(56,189,248,0.1)"},tool_result:{label:"Tool Result",icon:o4,color:"#34d399",bg:"rgba(52,211,153,0.1)"},message:{label:"Message",icon:DP,color:"#E43A9C",bg:"rgba(228,58,156,0.15)"},decision:{label:"Decision",icon:zP,color:"#fbbf24",bg:"rgba(251,191,36,0.1)"},meeting:{label:"Meeting",icon:Vh,color:"#818cf8",bg:"rgba(129,140,248,0.1)"}};function Tq(t){const e=t.toLowerCase();return e.includes("meeting")?"meeting":e.includes("tool_call")||e.includes("tool-call")?"tool_call":e.includes("tool_result")||e.includes("tool-result")?"tool_result":e.includes("thought")||e.includes("thinking")||e.includes("reason")?"thought":e.includes("decision")?"decision":"message"}function Cq({agentName:t,agentRole:e,agentStatus:r,currentTask:n,events:i,color:a,onBack:o,squadName:c}){return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${a}06`},children:[y.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(Tu,{className:"w-3.5 h-3.5"})," Back to ",c]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:a},children:t}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:e}),n&&y.jsx("p",{className:"text-sm text-zinc-400 mt-1",children:n})]}),y.jsx(Vt,{variant:To(r),children:r})]}),y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),y.jsxs("div",{className:"space-y-3 pl-10",children:[i.length===0&&y.jsx("div",{className:"text-center py-12 text-zinc-700 font-mono text-sm",children:"No activity recorded yet"}),i.map(u=>{const d=Tq(u.type),p=Aq[d],h=p.icon,g=d==="tool_call"||d==="tool_result",v=u.type.toLowerCase().includes("error")||u.type.toLowerCase().includes("fail");return y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:p.bg,border:`1px solid ${p.color}30`},children:y.jsx(h,{className:"w-3.5 h-3.5",style:{color:p.color}})}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[y.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider",style:{color:p.color},children:p.label}),u.model&&y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 border border-white/[0.08] rounded px-1.5 py-px bg-white/[0.03]",children:u.model}),v&&y.jsx(Vt,{variant:"error",children:"failed"})]}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:new Date(u.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),g?y.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2.5 bg-black/20",children:u.content}):y.jsx("p",{className:"text-[12px] text-zinc-400 leading-relaxed",children:u.content})]})]},u.id)}),y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${a}15`,border:`1px solid ${a}40`},children:y.jsx(UP,{className:"w-3.5 h-3.5 animate-spin",style:{color:a}})}),y.jsx("div",{className:"glass-card border rounded-2xl px-4 py-3",style:{borderColor:`${a}20`},children:y.jsx("span",{className:"text-[11px] font-mono",style:{color:a},children:"Agent is working…"})})]})]})]})]})}var jg,NE;function Zr(){if(NE)return jg;NE=1;var t=Array.isArray;return jg=t,jg}var Pg,RE;function cR(){if(RE)return Pg;RE=1;var t=typeof Vd=="object"&&Vd&&Vd.Object===Object&&Vd;return Pg=t,Pg}var Ng,IE;function Ei(){if(IE)return Ng;IE=1;var t=cR(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Ng=r,Ng}var Rg,$E;function Pu(){if($E)return Rg;$E=1;var t=Ei(),e=t.Symbol;return Rg=e,Rg}var Ig,ME;function jq(){if(ME)return Ig;ME=1;var t=Pu(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var c=r.call(o,i),u=o[i];try{o[i]=void 0;var d=!0}catch{}var p=n.call(o);return d&&(c?o[i]=u:delete o[i]),p}return Ig=a,Ig}var $g,LE;function Pq(){if(LE)return $g;LE=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return $g=r,$g}var Mg,DE;function ra(){if(DE)return Mg;DE=1;var t=Pu(),e=jq(),r=Pq(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(c){return c==null?c===void 0?i:n:a&&a in Object(c)?e(c):r(c)}return Mg=o,Mg}var Lg,zE;function na(){if(zE)return Lg;zE=1;function t(e){return e!=null&&typeof e=="object"}return Lg=t,Lg}var Dg,BE;function yl(){if(BE)return Dg;BE=1;var t=ra(),e=na(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return Dg=n,Dg}var zg,UE;function Gw(){if(UE)return zg;UE=1;var t=Zr(),e=yl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var c=typeof a;return c=="number"||c=="symbol"||c=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return zg=i,zg}var Bg,qE;function qa(){if(qE)return Bg;qE=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Bg=t,Bg}var Ug,FE;function Kw(){if(FE)return Ug;FE=1;var t=ra(),e=qa(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(c){if(!e(c))return!1;var u=t(c);return u==n||u==i||u==r||u==a}return Ug=o,Ug}var qg,HE;function Nq(){if(HE)return qg;HE=1;var t=Ei(),e=t["__core-js_shared__"];return qg=e,qg}var Fg,WE;function Rq(){if(WE)return Fg;WE=1;var t=Nq(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return Fg=r,Fg}var Hg,GE;function uR(){if(GE)return Hg;GE=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Hg=r,Hg}var Wg,KE;function Iq(){if(KE)return Wg;KE=1;var t=Kw(),e=Rq(),r=qa(),n=uR(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,u=o.toString,d=c.hasOwnProperty,p=RegExp("^"+u.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(g){if(!r(g)||e(g))return!1;var v=t(g)?p:a;return v.test(n(g))}return Wg=h,Wg}var Gg,VE;function $q(){if(VE)return Gg;VE=1;function t(e,r){return e==null?void 0:e[r]}return Gg=t,Gg}var Kg,XE;function zo(){if(XE)return Kg;XE=1;var t=Iq(),e=$q();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return Kg=r,Kg}var Vg,YE;function rp(){if(YE)return Vg;YE=1;var t=zo(),e=t(Object,"create");return Vg=e,Vg}var Xg,JE;function Mq(){if(JE)return Xg;JE=1;var t=rp();function e(){this.__data__=t?t(null):{},this.size=0}return Xg=e,Xg}var Yg,ZE;function Lq(){if(ZE)return Yg;ZE=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Yg=t,Yg}var Jg,QE;function Dq(){if(QE)return Jg;QE=1;var t=rp(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var c=o[a];return c===e?void 0:c}return n.call(o,a)?o[a]:void 0}return Jg=i,Jg}var Zg,eO;function zq(){if(eO)return Zg;eO=1;var t=rp(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return Zg=n,Zg}var Qg,tO;function Bq(){if(tO)return Qg;tO=1;var t=rp(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return Qg=r,Qg}var ey,rO;function Uq(){if(rO)return ey;rO=1;var t=Mq(),e=Lq(),r=Dq(),n=zq(),i=Bq();function a(o){var c=-1,u=o==null?0:o.length;for(this.clear();++c<u;){var d=o[c];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ey=a,ey}var ty,nO;function qq(){if(nO)return ty;nO=1;function t(){this.__data__=[],this.size=0}return ty=t,ty}var ry,iO;function Vw(){if(iO)return ry;iO=1;function t(e,r){return e===r||e!==e&&r!==r}return ry=t,ry}var ny,aO;function np(){if(aO)return ny;aO=1;var t=Vw();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return ny=e,ny}var iy,oO;function Fq(){if(oO)return iy;oO=1;var t=np(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var c=a.length-1;return o==c?a.pop():r.call(a,o,1),--this.size,!0}return iy=n,iy}var ay,sO;function Hq(){if(sO)return ay;sO=1;var t=np();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return ay=e,ay}var oy,lO;function Wq(){if(lO)return oy;lO=1;var t=np();function e(r){return t(this.__data__,r)>-1}return oy=e,oy}var sy,cO;function Gq(){if(cO)return sy;cO=1;var t=np();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return sy=e,sy}var ly,uO;function ip(){if(uO)return ly;uO=1;var t=qq(),e=Fq(),r=Hq(),n=Wq(),i=Gq();function a(o){var c=-1,u=o==null?0:o.length;for(this.clear();++c<u;){var d=o[c];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ly=a,ly}var cy,dO;function Xw(){if(dO)return cy;dO=1;var t=zo(),e=Ei(),r=t(e,"Map");return cy=r,cy}var uy,fO;function Kq(){if(fO)return uy;fO=1;var t=Uq(),e=ip(),r=Xw();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return uy=n,uy}var dy,hO;function Vq(){if(hO)return dy;hO=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return dy=t,dy}var fy,pO;function ap(){if(pO)return fy;pO=1;var t=Vq();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return fy=e,fy}var hy,mO;function Xq(){if(mO)return hy;mO=1;var t=ap();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return hy=e,hy}var py,gO;function Yq(){if(gO)return py;gO=1;var t=ap();function e(r){return t(this,r).get(r)}return py=e,py}var my,yO;function Jq(){if(yO)return my;yO=1;var t=ap();function e(r){return t(this,r).has(r)}return my=e,my}var gy,vO;function Zq(){if(vO)return gy;vO=1;var t=ap();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return gy=e,gy}var yy,bO;function Yw(){if(bO)return yy;bO=1;var t=Kq(),e=Xq(),r=Yq(),n=Jq(),i=Zq();function a(o){var c=-1,u=o==null?0:o.length;for(this.clear();++c<u;){var d=o[c];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,yy=a,yy}var vy,xO;function dR(){if(xO)return vy;xO=1;var t=Yw(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var o=arguments,c=i?i.apply(this,o):o[0],u=a.cache;if(u.has(c))return u.get(c);var d=n.apply(this,o);return a.cache=u.set(c,d)||u,d};return a.cache=new(r.Cache||t),a}return r.Cache=t,vy=r,vy}var by,wO;function Qq(){if(wO)return by;wO=1;var t=dR(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return by=r,by}var xy,_O;function e9(){if(_O)return xy;_O=1;var t=Qq(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(o,c,u,d){a.push(u?d.replace(r,"$1"):c||o)}),a});return xy=n,xy}var wy,SO;function Jw(){if(SO)return wy;SO=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return wy=t,wy}var _y,kO;function t9(){if(kO)return _y;kO=1;var t=Pu(),e=Jw(),r=Zr(),n=yl(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(c){if(typeof c=="string")return c;if(r(c))return e(c,o)+"";if(n(c))return a?a.call(c):"";var u=c+"";return u=="0"&&1/c==-1/0?"-0":u}return _y=o,_y}var Sy,EO;function fR(){if(EO)return Sy;EO=1;var t=t9();function e(r){return r==null?"":t(r)}return Sy=e,Sy}var ky,OO;function hR(){if(OO)return ky;OO=1;var t=Zr(),e=Gw(),r=e9(),n=fR();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return ky=i,ky}var Ey,AO;function op(){if(AO)return Ey;AO=1;var t=yl();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ey=e,Ey}var Oy,TO;function Zw(){if(TO)return Oy;TO=1;var t=hR(),e=op();function r(n,i){i=t(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[e(i[a++])];return a&&a==o?n:void 0}return Oy=r,Oy}var Ay,CO;function pR(){if(CO)return Ay;CO=1;var t=Zw();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return Ay=e,Ay}var r9=pR();const An=vt(r9);var Ty,jO;function n9(){if(jO)return Ty;jO=1;function t(e){return e==null}return Ty=t,Ty}var i9=n9();const Qe=vt(i9);var Cy,PO;function a9(){if(PO)return Cy;PO=1;var t=ra(),e=Zr(),r=na(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return Cy=i,Cy}var o9=a9();const No=vt(o9);var s9=Kw();const Ye=vt(s9);var l9=qa();const vl=vt(l9);var jy={exports:{}},pt={};/**
|
|
435
|
-
* @license React
|
|
436
|
-
* react-is.production.min.js
|
|
437
|
-
*
|
|
438
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the MIT license found in the
|
|
441
|
-
* LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/var NO;function c9(){if(NO)return pt;NO=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),x;x=Symbol.for("react.module.reference");function _(b){if(typeof b=="object"&&b!==null){var k=b.$$typeof;switch(k){case t:switch(b=b.type,b){case r:case i:case n:case d:case p:return b;default:switch(b=b&&b.$$typeof,b){case c:case o:case u:case g:case h:case a:return b;default:return k}}case e:return k}}}return pt.ContextConsumer=o,pt.ContextProvider=a,pt.Element=t,pt.ForwardRef=u,pt.Fragment=r,pt.Lazy=g,pt.Memo=h,pt.Portal=e,pt.Profiler=i,pt.StrictMode=n,pt.Suspense=d,pt.SuspenseList=p,pt.isAsyncMode=function(){return!1},pt.isConcurrentMode=function(){return!1},pt.isContextConsumer=function(b){return _(b)===o},pt.isContextProvider=function(b){return _(b)===a},pt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},pt.isForwardRef=function(b){return _(b)===u},pt.isFragment=function(b){return _(b)===r},pt.isLazy=function(b){return _(b)===g},pt.isMemo=function(b){return _(b)===h},pt.isPortal=function(b){return _(b)===e},pt.isProfiler=function(b){return _(b)===i},pt.isStrictMode=function(b){return _(b)===n},pt.isSuspense=function(b){return _(b)===d},pt.isSuspenseList=function(b){return _(b)===p},pt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===i||b===n||b===d||b===p||b===v||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===h||b.$$typeof===a||b.$$typeof===o||b.$$typeof===u||b.$$typeof===x||b.getModuleId!==void 0)},pt.typeOf=_,pt}var RO;function u9(){return RO||(RO=1,jy.exports=c9()),jy.exports}var d9=u9(),Py,IO;function mR(){if(IO)return Py;IO=1;var t=ra(),e=na(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return Py=n,Py}var Ny,$O;function f9(){if($O)return Ny;$O=1;var t=mR();function e(r){return t(r)&&r!=+r}return Ny=e,Ny}var h9=f9();const Nu=vt(h9);var p9=mR();const m9=vt(p9);var Jn=function(e){return e===0?0:e>0?1:-1},So=function(e){return No(e)&&e.indexOf("%")===e.length-1},ge=function(e){return m9(e)&&!Nu(e)},g9=function(e){return Qe(e)},or=function(e){return ge(e)||No(e)},y9=0,Ru=function(e){var r=++y9;return"".concat(e||"").concat(r)},Ro=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ge(e)&&!No(e))return n;var a;if(So(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Nu(a)&&(a=n),i&&a>r&&(a=r),a},Na=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},v9=function(e){if(!Array.isArray(e))return!1;for(var r=e.length,n={},i=0;i<r;i++)if(!n[e[i]])n[e[i]]=!0;else return!0;return!1},Vn=function(e,r){return ge(e)&&ge(r)?function(n){return e+n*(r-e)}:function(){return r}};function Ff(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):An(n,e))===r})}var b9=function(e,r){return ge(e)&&ge(r)?e-r:No(e)&&No(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Ds(t,e){for(var r in t)if({}.hasOwnProperty.call(t,r)&&(!{}.hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if({}.hasOwnProperty.call(e,n)&&!{}.hasOwnProperty.call(t,n))return!1;return!0}function ex(t){"@babel/helpers - typeof";return ex=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ex(t)}var x9=["viewBox","children"],w9=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],MO=["points","pathLength"],Ry={svg:x9,polygon:MO,polyline:MO},Qw=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Hf=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(N.isValidElement(e)&&(n=e.props),!vl(n))return null;var i={};return Object.keys(n).forEach(function(a){Qw.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},_9=function(e,r,n){return function(i){return e(r,n,i),null}},Wf=function(e,r,n){if(!vl(e)||ex(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];Qw.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=_9(o,r,n))}),i},S9=["children"],k9=["children"];function LO(t,e){if(t==null)return{};var r=E9(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function E9(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function tx(t){"@babel/helpers - typeof";return tx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tx(t)}var DO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Gi=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},zO=null,Iy=null,e1=function t(e){if(e===zO&&Array.isArray(Iy))return Iy;var r=[];return N.Children.forEach(e,function(n){Qe(n)||(d9.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),Iy=r,zO=e,r};function Tn(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return Gi(i)}):n=[Gi(e)],e1(t).forEach(function(i){var a=An(i,"type.displayName")||An(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function sn(t,e){var r=Tn(t,e);return r&&r[0]}var BO=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!ge(n)||n<=0||!ge(i)||i<=0)},O9=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],A9=function(e){return e&&e.type&&No(e.type)&&O9.indexOf(e.type)>=0},T9=function(e){return e&&tx(e)==="object"&&"clipDot"in e},C9=function(e,r,n,i){var a,o=(a=Ry==null?void 0:Ry[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Ye(e)&&(i&&o.includes(r)||w9.includes(r))||n&&Qw.includes(r)},it=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(N.isValidElement(e)&&(i=e.props),!vl(i))return null;var a={};return Object.keys(i).forEach(function(o){var c;C9((c=i)===null||c===void 0?void 0:c[o],o,r,n)&&(a[o]=i[o])}),a},rx=function t(e,r){if(e===r)return!0;var n=N.Children.count(e);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return UO(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var a=e[i],o=r[i];if(Array.isArray(a)||Array.isArray(o)){if(!t(a,o))return!1}else if(!UO(a,o))return!1}return!0},UO=function(e,r){if(Qe(e)&&Qe(r))return!0;if(!Qe(e)&&!Qe(r)){var n=e.props||{},i=n.children,a=LO(n,S9),o=r.props||{},c=o.children,u=LO(o,k9);return i&&c?Ds(a,u)&&rx(i,c):!i&&!c?Ds(a,u):!1}return!1},qO=function(e,r){var n=[],i={};return e1(e).forEach(function(a,o){if(A9(a))n.push(a);else if(a){var c=Gi(a.type),u=r[c]||{},d=u.handler,p=u.once;if(d&&(!p||!i[c])){var h=d(a,c,o);n.push(h),i[c]=!0}}}),n},j9=function(e){var r=e&&e.type;return r&&DO[r]?DO[r]:null},P9=function(e,r){return e1(r).indexOf(e)},N9=["children","width","height","viewBox","className","style","title","desc"];function nx(){return nx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},nx.apply(this,arguments)}function R9(t,e){if(t==null)return{};var r=I9(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function I9(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function ix(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,a=t.className,o=t.style,c=t.title,u=t.desc,d=R9(t,N9),p=i||{width:r,height:n,x:0,y:0},h=at("recharts-surface",a);return I.createElement("svg",nx({},it(d,!0,"svg"),{className:h,width:r,height:n,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),I.createElement("title",null,c),I.createElement("desc",null,u),e)}var $9=["children","className"];function ax(){return ax=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ax.apply(this,arguments)}function M9(t,e){if(t==null)return{};var r=L9(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function L9(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Xt=I.forwardRef(function(t,e){var r=t.children,n=t.className,i=M9(t,$9),a=at("recharts-layer",n);return I.createElement("g",ax({className:a},it(i,!0),{ref:e}),r)}),Ki=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a]},$y,FO;function D9(){if(FO)return $y;FO=1;function t(e,r,n){var i=-1,a=e.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i<a;)o[i]=e[i+r];return o}return $y=t,$y}var My,HO;function z9(){if(HO)return My;HO=1;var t=D9();function e(r,n,i){var a=r.length;return i=i===void 0?a:i,!n&&i>=a?r:t(r,n,i)}return My=e,My}var Ly,WO;function gR(){if(WO)return Ly;WO=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+t+i+a+"]");function u(d){return c.test(d)}return Ly=u,Ly}var Dy,GO;function B9(){if(GO)return Dy;GO=1;function t(e){return e.split("")}return Dy=t,Dy}var zy,KO;function U9(){if(KO)return zy;KO=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="["+t+"]",c="["+i+"]",u="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+u+")",p="[^"+t+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",x=d+"?",_="["+a+"]?",b="(?:"+v+"(?:"+[p,h,g].join("|")+")"+_+x+")*",k=_+x+b,E="(?:"+[p+c+"?",c,h,g,o].join("|")+")",O=RegExp(u+"(?="+u+")|"+E+k,"g");function A(T){return T.match(O)||[]}return zy=A,zy}var By,VO;function q9(){if(VO)return By;VO=1;var t=B9(),e=gR(),r=U9();function n(i){return e(i)?r(i):t(i)}return By=n,By}var Uy,XO;function F9(){if(XO)return Uy;XO=1;var t=z9(),e=gR(),r=q9(),n=fR();function i(a){return function(o){o=n(o);var c=e(o)?r(o):void 0,u=c?c[0]:o.charAt(0),d=c?t(c,1).join(""):o.slice(1);return u[a]()+d}}return Uy=i,Uy}var qy,YO;function H9(){if(YO)return qy;YO=1;var t=F9(),e=t("toUpperCase");return qy=e,qy}var W9=H9();const sp=vt(W9);function Tt(t){return function(){return t}}const yR=Math.cos,Gf=Math.sin,ri=Math.sqrt,Kf=Math.PI,lp=2*Kf,ox=Math.PI,sx=2*ox,bo=1e-6,G9=sx-bo;function vR(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function K9(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return vR;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class V9{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?vR:K9(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,o){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,c=this._y1,u=n-e,d=i-r,p=o-e,h=c-r,g=p*p+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(g>bo)if(!(Math.abs(h*u-d*p)>bo)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let v=n-o,x=i-c,_=u*u+d*d,b=v*v+x*x,k=Math.sqrt(_),E=Math.sqrt(g),O=a*Math.tan((ox-Math.acos((_+g-b)/(2*k*E)))/2),A=O/E,T=O/k;Math.abs(A-1)>bo&&this._append`L${e+A*p},${r+A*h}`,this._append`A${a},${a},0,0,${+(h*v>p*x)},${this._x1=e+T*u},${this._y1=r+T*d}`}}arc(e,r,n,i,a,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(i),u=n*Math.sin(i),d=e+c,p=r+u,h=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${d},${p}`:(Math.abs(this._x1-d)>bo||Math.abs(this._y1-p)>bo)&&this._append`L${d},${p}`,n&&(g<0&&(g=g%sx+sx),g>G9?this._append`A${n},${n},0,1,${h},${e-c},${r-u}A${n},${n},0,1,${h},${this._x1=d},${this._y1=p}`:g>bo&&this._append`A${n},${n},0,${+(g>=ox)},${h},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function t1(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new V9(e)}function r1(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function bR(t){this._context=t}bR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function cp(t){return new bR(t)}function xR(t){return t[0]}function wR(t){return t[1]}function _R(t,e){var r=Tt(!0),n=null,i=cp,a=null,o=t1(c);t=typeof t=="function"?t:t===void 0?xR:Tt(t),e=typeof e=="function"?e:e===void 0?wR:Tt(e);function c(u){var d,p=(u=r1(u)).length,h,g=!1,v;for(n==null&&(a=i(v=o())),d=0;d<=p;++d)!(d<p&&r(h=u[d],d,u))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+t(h,d,u),+e(h,d,u));if(v)return a=null,v+""||null}return c.x=function(u){return arguments.length?(t=typeof u=="function"?u:Tt(+u),c):t},c.y=function(u){return arguments.length?(e=typeof u=="function"?u:Tt(+u),c):e},c.defined=function(u){return arguments.length?(r=typeof u=="function"?u:Tt(!!u),c):r},c.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),c):i},c.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),c):n},c}function uf(t,e,r){var n=null,i=Tt(!0),a=null,o=cp,c=null,u=t1(d);t=typeof t=="function"?t:t===void 0?xR:Tt(+t),e=typeof e=="function"?e:Tt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?wR:Tt(+r);function d(h){var g,v,x,_=(h=r1(h)).length,b,k=!1,E,O=new Array(_),A=new Array(_);for(a==null&&(c=o(E=u())),g=0;g<=_;++g){if(!(g<_&&i(b=h[g],g,h))===k)if(k=!k)v=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),x=g-1;x>=v;--x)c.point(O[x],A[x]);c.lineEnd(),c.areaEnd()}k&&(O[g]=+t(b,g,h),A[g]=+e(b,g,h),c.point(n?+n(b,g,h):O[g],r?+r(b,g,h):A[g]))}if(E)return c=null,E+""||null}function p(){return _R().defined(i).curve(o).context(a)}return d.x=function(h){return arguments.length?(t=typeof h=="function"?h:Tt(+h),n=null,d):t},d.x0=function(h){return arguments.length?(t=typeof h=="function"?h:Tt(+h),d):t},d.x1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Tt(+h),d):n},d.y=function(h){return arguments.length?(e=typeof h=="function"?h:Tt(+h),r=null,d):e},d.y0=function(h){return arguments.length?(e=typeof h=="function"?h:Tt(+h),d):e},d.y1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Tt(+h),d):r},d.lineX0=d.lineY0=function(){return p().x(t).y(e)},d.lineY1=function(){return p().x(t).y(r)},d.lineX1=function(){return p().x(n).y(e)},d.defined=function(h){return arguments.length?(i=typeof h=="function"?h:Tt(!!h),d):i},d.curve=function(h){return arguments.length?(o=h,a!=null&&(c=o(a)),d):o},d.context=function(h){return arguments.length?(h==null?a=c=null:c=o(a=h),d):a},d}class SR{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function X9(t){return new SR(t,!0)}function Y9(t){return new SR(t,!1)}const n1={draw(t,e){const r=ri(e/Kf);t.moveTo(r,0),t.arc(0,0,r,0,lp)}},J9={draw(t,e){const r=ri(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},kR=ri(1/3),Z9=kR*2,Q9={draw(t,e){const r=ri(e/Z9),n=r*kR;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},eF={draw(t,e){const r=ri(e),n=-r/2;t.rect(n,n,r,r)}},tF=.8908130915292852,ER=Gf(Kf/10)/Gf(7*Kf/10),rF=Gf(lp/10)*ER,nF=-yR(lp/10)*ER,iF={draw(t,e){const r=ri(e*tF),n=rF*r,i=nF*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=lp*a/5,c=yR(o),u=Gf(o);t.lineTo(u*r,-c*r),t.lineTo(c*n-u*i,u*n+c*i)}t.closePath()}},Fy=ri(3),aF={draw(t,e){const r=-ri(e/(Fy*3));t.moveTo(0,r*2),t.lineTo(-Fy*r,-r),t.lineTo(Fy*r,-r),t.closePath()}},_n=-.5,Sn=ri(3)/2,lx=1/ri(12),oF=(lx/2+1)*3,sF={draw(t,e){const r=ri(e/oF),n=r/2,i=r*lx,a=n,o=r*lx+r,c=-a,u=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(c,u),t.lineTo(_n*n-Sn*i,Sn*n+_n*i),t.lineTo(_n*a-Sn*o,Sn*a+_n*o),t.lineTo(_n*c-Sn*u,Sn*c+_n*u),t.lineTo(_n*n+Sn*i,_n*i-Sn*n),t.lineTo(_n*a+Sn*o,_n*o-Sn*a),t.lineTo(_n*c+Sn*u,_n*u-Sn*c),t.closePath()}};function lF(t,e){let r=null,n=t1(i);t=typeof t=="function"?t:Tt(t||n1),e=typeof e=="function"?e:Tt(e===void 0?64:+e);function i(){let a;if(r||(r=a=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:Tt(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:Tt(+a),i):e},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Vf(){}function Xf(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function OR(t){this._context=t}OR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Xf(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Xf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function cF(t){return new OR(t)}function AR(t){this._context=t}AR.prototype={areaStart:Vf,areaEnd:Vf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Xf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function uF(t){return new AR(t)}function TR(t){this._context=t}TR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Xf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function dF(t){return new TR(t)}function CR(t){this._context=t}CR.prototype={areaStart:Vf,areaEnd:Vf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function fF(t){return new CR(t)}function JO(t){return t<0?-1:1}function ZO(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),c=(a*i+o*n)/(n+i);return(JO(a)+JO(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function QO(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Hy(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,c=(a-n)/3;t._context.bezierCurveTo(n+c,i+c*e,a-c,o-c*r,a,o)}function Yf(t){this._context=t}Yf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Hy(this,this._t0,QO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Hy(this,QO(this,r=ZO(this,t,e)),r);break;default:Hy(this,this._t0,r=ZO(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function jR(t){this._context=new PR(t)}(jR.prototype=Object.create(Yf.prototype)).point=function(t,e){Yf.prototype.point.call(this,e,t)};function PR(t){this._context=t}PR.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function hF(t){return new Yf(t)}function pF(t){return new jR(t)}function NR(t){this._context=t}NR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=eA(t),i=eA(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[o],e[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function eA(t){var e,r=t.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(i[r-1]=o[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function mF(t){return new NR(t)}function up(t,e){this._context=t,this._t=e}up.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function gF(t){return new up(t,.5)}function yF(t){return new up(t,0)}function vF(t){return new up(t,1)}function Fs(t,e){if((o=t.length)>1)for(var r=1,n,i,a=t[e[0]],o,c=a.length;r<o;++r)for(i=a,a=t[e[r]],n=0;n<c;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function cx(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function bF(t,e){return t[e]}function xF(t){const e=[];return e.key=t,e}function wF(){var t=Tt([]),e=cx,r=Fs,n=bF;function i(a){var o=Array.from(t.apply(this,arguments),xF),c,u=o.length,d=-1,p;for(const h of a)for(c=0,++d;c<u;++c)(o[c][d]=[0,+n(h,o[c].key,d,a)]).data=h;for(c=0,p=r1(e(o));c<u;++c)o[p[c]].index=c;return r(o,p),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:Tt(Array.from(a)),i):t},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Tt(+a),i):n},i.order=function(a){return arguments.length?(e=a==null?cx:typeof a=="function"?a:Tt(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??Fs,i):r},i}function _F(t,e){if((n=t.length)>0){for(var r,n,i=0,a=t[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=t[r][i][1]||0;if(o)for(r=0;r<n;++r)t[r][i][1]/=o}Fs(t,e)}}function SF(t,e){if((i=t.length)>0){for(var r=0,n=t[e[0]],i,a=n.length;r<a;++r){for(var o=0,c=0;o<i;++o)c+=t[o][r][1]||0;n[r][1]+=n[r][0]=-c/2}Fs(t,e)}}function kF(t,e){if(!(!((o=t.length)>0)||!((a=(i=t[e[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var c=0,u=0,d=0;c<o;++c){for(var p=t[e[c]],h=p[n][1]||0,g=p[n-1][1]||0,v=(h-g)/2,x=0;x<c;++x){var _=t[e[x]],b=_[n][1]||0,k=_[n-1][1]||0;v+=b-k}u+=h,d+=v*h}i[n-1][1]+=i[n-1][0]=r,u&&(r-=d/u)}i[n-1][1]+=i[n-1][0]=r,Fs(t,e)}}function Fc(t){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fc(t)}var EF=["type","size","sizeType"];function ux(){return ux=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ux.apply(this,arguments)}function tA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function rA(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tA(Object(r),!0).forEach(function(n){OF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function OF(t,e,r){return e=AF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AF(t){var e=TF(t,"string");return Fc(e)=="symbol"?e:e+""}function TF(t,e){if(Fc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Fc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CF(t,e){if(t==null)return{};var r=jF(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function jF(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var RR={symbolCircle:n1,symbolCross:J9,symbolDiamond:Q9,symbolSquare:eF,symbolStar:iF,symbolTriangle:aF,symbolWye:sF},PF=Math.PI/180,NF=function(e){var r="symbol".concat(sp(e));return RR[r]||n1},RF=function(e,r,n){if(r==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*PF;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},IF=function(e,r){RR["symbol".concat(sp(e))]=r},i1=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,a=i===void 0?64:i,o=e.sizeType,c=o===void 0?"area":o,u=CF(e,EF),d=rA(rA({},u),{},{type:n,size:a,sizeType:c}),p=function(){var b=NF(n),k=lF().type(b).size(RF(a,c,n));return k()},h=d.className,g=d.cx,v=d.cy,x=it(d,!0);return g===+g&&v===+v&&a===+a?I.createElement("path",ux({},x,{className:at("recharts-symbols",h),transform:"translate(".concat(g,", ").concat(v,")"),d:p()})):null};i1.registerSymbol=IF;function Hs(t){"@babel/helpers - typeof";return Hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hs(t)}function dx(){return dx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},dx.apply(this,arguments)}function nA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function $F(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nA(Object(r),!0).forEach(function(n){Hc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function MF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function LF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$R(n.key),n)}}function DF(t,e,r){return e&&LF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function zF(t,e,r){return e=Jf(e),BF(t,IR()?Reflect.construct(e,r||[],Jf(t).constructor):e.apply(t,r))}function BF(t,e){if(e&&(Hs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UF(t)}function UF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function IR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IR=function(){return!!t})()}function Jf(t){return Jf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Jf(t)}function qF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fx(t,e)}function fx(t,e){return fx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fx(t,e)}function Hc(t,e,r){return e=$R(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $R(t){var e=FF(t,"string");return Hs(e)=="symbol"?e:e+""}function FF(t,e){if(Hs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var kn=32,a1=(function(t){function e(){return MF(this,e),zF(this,e,arguments)}return qF(e,t),DF(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=kn/2,o=kn/6,c=kn/3,u=n.inactive?i:n.color;if(n.type==="plainline")return I.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:kn,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return I.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(a,"h").concat(c,`
|
|
443
|
-
A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(a,`
|
|
444
|
-
H`).concat(kn,"M").concat(2*c,",").concat(a,`
|
|
445
|
-
A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return I.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(kn/8,"h").concat(kn,"v").concat(kn*3/4,"h").concat(-kn,"z"),className:"recharts-legend-icon"});if(I.isValidElement(n.legendIcon)){var d=$F({},n);return delete d.legendIcon,I.cloneElement(n.legendIcon,d)}return I.createElement(i1,{fill:u,cx:a,cy:a,size:kn,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,c=i.layout,u=i.formatter,d=i.inactiveColor,p={x:0,y:0,width:kn,height:kn},h={display:c==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(v,x){var _=v.formatter||u,b=at(Hc(Hc({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",v.inactive));if(v.type==="none")return null;var k=Ye(v.value)?null:v.value;Ki(!Ye(v.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var E=v.inactive?d:v.color;return I.createElement("li",dx({className:b,style:h,key:"legend-item-".concat(x)},Wf(n.props,v,x)),I.createElement(ix,{width:o,height:o,viewBox:p,style:g},n.renderIcon(v)),I.createElement("span",{className:"recharts-legend-item-text",style:{color:E}},_?_(k,v,x):k))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return I.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(N.PureComponent);Hc(a1,"displayName","Legend");Hc(a1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Wy,iA;function HF(){if(iA)return Wy;iA=1;var t=ip();function e(){this.__data__=new t,this.size=0}return Wy=e,Wy}var Gy,aA;function WF(){if(aA)return Gy;aA=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Gy=t,Gy}var Ky,oA;function GF(){if(oA)return Ky;oA=1;function t(e){return this.__data__.get(e)}return Ky=t,Ky}var Vy,sA;function KF(){if(sA)return Vy;sA=1;function t(e){return this.__data__.has(e)}return Vy=t,Vy}var Xy,lA;function VF(){if(lA)return Xy;lA=1;var t=ip(),e=Xw(),r=Yw(),n=200;function i(a,o){var c=this.__data__;if(c instanceof t){var u=c.__data__;if(!e||u.length<n-1)return u.push([a,o]),this.size=++c.size,this;c=this.__data__=new r(u)}return c.set(a,o),this.size=c.size,this}return Xy=i,Xy}var Yy,cA;function MR(){if(cA)return Yy;cA=1;var t=ip(),e=HF(),r=WF(),n=GF(),i=KF(),a=VF();function o(c){var u=this.__data__=new t(c);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=a,Yy=o,Yy}var Jy,uA;function XF(){if(uA)return Jy;uA=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Jy=e,Jy}var Zy,dA;function YF(){if(dA)return Zy;dA=1;function t(e){return this.__data__.has(e)}return Zy=t,Zy}var Qy,fA;function LR(){if(fA)return Qy;fA=1;var t=Yw(),e=XF(),r=YF();function n(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new t;++a<o;)this.add(i[a])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,Qy=n,Qy}var ev,hA;function DR(){if(hA)return ev;hA=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(e[n],n,e))return!0;return!1}return ev=t,ev}var tv,pA;function zR(){if(pA)return tv;pA=1;function t(e,r){return e.has(r)}return tv=t,tv}var rv,mA;function BR(){if(mA)return rv;mA=1;var t=LR(),e=DR(),r=zR(),n=1,i=2;function a(o,c,u,d,p,h){var g=u&n,v=o.length,x=c.length;if(v!=x&&!(g&&x>v))return!1;var _=h.get(o),b=h.get(c);if(_&&b)return _==c&&b==o;var k=-1,E=!0,O=u&i?new t:void 0;for(h.set(o,c),h.set(c,o);++k<v;){var A=o[k],T=c[k];if(d)var C=g?d(T,A,k,c,o,h):d(A,T,k,o,c,h);if(C!==void 0){if(C)continue;E=!1;break}if(O){if(!e(c,function(j,R){if(!r(O,R)&&(A===j||p(A,j,u,d,h)))return O.push(R)})){E=!1;break}}else if(!(A===T||p(A,T,u,d,h))){E=!1;break}}return h.delete(o),h.delete(c),E}return rv=a,rv}var nv,gA;function JF(){if(gA)return nv;gA=1;var t=Ei(),e=t.Uint8Array;return nv=e,nv}var iv,yA;function ZF(){if(yA)return iv;yA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,a){n[++r]=[a,i]}),n}return iv=t,iv}var av,vA;function o1(){if(vA)return av;vA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return av=t,av}var ov,bA;function QF(){if(bA)return ov;bA=1;var t=Pu(),e=JF(),r=Vw(),n=BR(),i=ZF(),a=o1(),o=1,c=2,u="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Map]",g="[object Number]",v="[object RegExp]",x="[object Set]",_="[object String]",b="[object Symbol]",k="[object ArrayBuffer]",E="[object DataView]",O=t?t.prototype:void 0,A=O?O.valueOf:void 0;function T(C,j,R,M,Y,W,B){switch(R){case E:if(C.byteLength!=j.byteLength||C.byteOffset!=j.byteOffset)return!1;C=C.buffer,j=j.buffer;case k:return!(C.byteLength!=j.byteLength||!W(new e(C),new e(j)));case u:case d:case g:return r(+C,+j);case p:return C.name==j.name&&C.message==j.message;case v:case _:return C==j+"";case h:var X=i;case x:var K=M&o;if(X||(X=a),C.size!=j.size&&!K)return!1;var U=B.get(C);if(U)return U==j;M|=c,B.set(C,j);var G=n(X(C),X(j),M,Y,W,B);return B.delete(C),G;case b:if(A)return A.call(C)==A.call(j)}return!1}return ov=T,ov}var sv,xA;function UR(){if(xA)return sv;xA=1;function t(e,r){for(var n=-1,i=r.length,a=e.length;++n<i;)e[a+n]=r[n];return e}return sv=t,sv}var lv,wA;function e7(){if(wA)return lv;wA=1;var t=UR(),e=Zr();function r(n,i,a){var o=i(n);return e(n)?o:t(o,a(n))}return lv=r,lv}var cv,_A;function t7(){if(_A)return cv;_A=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=0,o=[];++n<i;){var c=e[n];r(c,n,e)&&(o[a++]=c)}return o}return cv=t,cv}var uv,SA;function r7(){if(SA)return uv;SA=1;function t(){return[]}return uv=t,uv}var dv,kA;function n7(){if(kA)return dv;kA=1;var t=t7(),e=r7(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),t(i(o),function(c){return n.call(o,c)}))}:e;return dv=a,dv}var fv,EA;function i7(){if(EA)return fv;EA=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return fv=t,fv}var hv,OA;function a7(){if(OA)return hv;OA=1;var t=ra(),e=na(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return hv=n,hv}var pv,AA;function s1(){if(AA)return pv;AA=1;var t=a7(),e=na(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,a=t((function(){return arguments})())?t:function(o){return e(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return pv=a,pv}var Ec={exports:{}},mv,TA;function o7(){if(TA)return mv;TA=1;function t(){return!1}return mv=t,mv}Ec.exports;var CA;function qR(){return CA||(CA=1,(function(t,e){var r=Ei(),n=o7(),i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,c=o?r.Buffer:void 0,u=c?c.isBuffer:void 0,d=u||n;t.exports=d})(Ec,Ec.exports)),Ec.exports}var gv,jA;function l1(){if(jA)return gv;jA=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return gv=r,gv}var yv,PA;function c1(){if(PA)return yv;PA=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return yv=e,yv}var vv,NA;function s7(){if(NA)return vv;NA=1;var t=ra(),e=c1(),r=na(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",p="[object Number]",h="[object Object]",g="[object RegExp]",v="[object Set]",x="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",k="[object DataView]",E="[object Float32Array]",O="[object Float64Array]",A="[object Int8Array]",T="[object Int16Array]",C="[object Int32Array]",j="[object Uint8Array]",R="[object Uint8ClampedArray]",M="[object Uint16Array]",Y="[object Uint32Array]",W={};W[E]=W[O]=W[A]=W[T]=W[C]=W[j]=W[R]=W[M]=W[Y]=!0,W[n]=W[i]=W[b]=W[a]=W[k]=W[o]=W[c]=W[u]=W[d]=W[p]=W[h]=W[g]=W[v]=W[x]=W[_]=!1;function B(X){return r(X)&&e(X.length)&&!!W[t(X)]}return vv=B,vv}var bv,RA;function FR(){if(RA)return bv;RA=1;function t(e){return function(r){return e(r)}}return bv=t,bv}var Oc={exports:{}};Oc.exports;var IA;function l7(){return IA||(IA=1,(function(t,e){var r=cR(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,c=(function(){try{var u=i&&i.require&&i.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();t.exports=c})(Oc,Oc.exports)),Oc.exports}var xv,$A;function HR(){if($A)return xv;$A=1;var t=s7(),e=FR(),r=l7(),n=r&&r.isTypedArray,i=n?e(n):t;return xv=i,xv}var wv,MA;function c7(){if(MA)return wv;MA=1;var t=i7(),e=s1(),r=Zr(),n=qR(),i=l1(),a=HR(),o=Object.prototype,c=o.hasOwnProperty;function u(d,p){var h=r(d),g=!h&&e(d),v=!h&&!g&&n(d),x=!h&&!g&&!v&&a(d),_=h||g||v||x,b=_?t(d.length,String):[],k=b.length;for(var E in d)(p||c.call(d,E))&&!(_&&(E=="length"||v&&(E=="offset"||E=="parent")||x&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||i(E,k)))&&b.push(E);return b}return wv=u,wv}var _v,LA;function u7(){if(LA)return _v;LA=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return _v=e,_v}var Sv,DA;function WR(){if(DA)return Sv;DA=1;function t(e,r){return function(n){return e(r(n))}}return Sv=t,Sv}var kv,zA;function d7(){if(zA)return kv;zA=1;var t=WR(),e=t(Object.keys,Object);return kv=e,kv}var Ev,BA;function f7(){if(BA)return Ev;BA=1;var t=u7(),e=d7(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!t(a))return e(a);var o=[];for(var c in Object(a))n.call(a,c)&&c!="constructor"&&o.push(c);return o}return Ev=i,Ev}var Ov,UA;function Iu(){if(UA)return Ov;UA=1;var t=Kw(),e=c1();function r(n){return n!=null&&e(n.length)&&!t(n)}return Ov=r,Ov}var Av,qA;function dp(){if(qA)return Av;qA=1;var t=c7(),e=f7(),r=Iu();function n(i){return r(i)?t(i):e(i)}return Av=n,Av}var Tv,FA;function h7(){if(FA)return Tv;FA=1;var t=e7(),e=n7(),r=dp();function n(i){return t(i,r,e)}return Tv=n,Tv}var Cv,HA;function p7(){if(HA)return Cv;HA=1;var t=h7(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,c,u,d,p){var h=c&e,g=t(a),v=g.length,x=t(o),_=x.length;if(v!=_&&!h)return!1;for(var b=v;b--;){var k=g[b];if(!(h?k in o:n.call(o,k)))return!1}var E=p.get(a),O=p.get(o);if(E&&O)return E==o&&O==a;var A=!0;p.set(a,o),p.set(o,a);for(var T=h;++b<v;){k=g[b];var C=a[k],j=o[k];if(u)var R=h?u(j,C,k,o,a,p):u(C,j,k,a,o,p);if(!(R===void 0?C===j||d(C,j,c,u,p):R)){A=!1;break}T||(T=k=="constructor")}if(A&&!T){var M=a.constructor,Y=o.constructor;M!=Y&&"constructor"in a&&"constructor"in o&&!(typeof M=="function"&&M instanceof M&&typeof Y=="function"&&Y instanceof Y)&&(A=!1)}return p.delete(a),p.delete(o),A}return Cv=i,Cv}var jv,WA;function m7(){if(WA)return jv;WA=1;var t=zo(),e=Ei(),r=t(e,"DataView");return jv=r,jv}var Pv,GA;function g7(){if(GA)return Pv;GA=1;var t=zo(),e=Ei(),r=t(e,"Promise");return Pv=r,Pv}var Nv,KA;function GR(){if(KA)return Nv;KA=1;var t=zo(),e=Ei(),r=t(e,"Set");return Nv=r,Nv}var Rv,VA;function y7(){if(VA)return Rv;VA=1;var t=zo(),e=Ei(),r=t(e,"WeakMap");return Rv=r,Rv}var Iv,XA;function v7(){if(XA)return Iv;XA=1;var t=m7(),e=Xw(),r=g7(),n=GR(),i=y7(),a=ra(),o=uR(),c="[object Map]",u="[object Object]",d="[object Promise]",p="[object Set]",h="[object WeakMap]",g="[object DataView]",v=o(t),x=o(e),_=o(r),b=o(n),k=o(i),E=a;return(t&&E(new t(new ArrayBuffer(1)))!=g||e&&E(new e)!=c||r&&E(r.resolve())!=d||n&&E(new n)!=p||i&&E(new i)!=h)&&(E=function(O){var A=a(O),T=A==u?O.constructor:void 0,C=T?o(T):"";if(C)switch(C){case v:return g;case x:return c;case _:return d;case b:return p;case k:return h}return A}),Iv=E,Iv}var $v,YA;function b7(){if(YA)return $v;YA=1;var t=MR(),e=BR(),r=QF(),n=p7(),i=v7(),a=Zr(),o=qR(),c=HR(),u=1,d="[object Arguments]",p="[object Array]",h="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function x(_,b,k,E,O,A){var T=a(_),C=a(b),j=T?p:i(_),R=C?p:i(b);j=j==d?h:j,R=R==d?h:R;var M=j==h,Y=R==h,W=j==R;if(W&&o(_)){if(!o(b))return!1;T=!0,M=!1}if(W&&!M)return A||(A=new t),T||c(_)?e(_,b,k,E,O,A):r(_,b,j,k,E,O,A);if(!(k&u)){var B=M&&v.call(_,"__wrapped__"),X=Y&&v.call(b,"__wrapped__");if(B||X){var K=B?_.value():_,U=X?b.value():b;return A||(A=new t),O(K,U,k,E,A)}}return W?(A||(A=new t),n(_,b,k,E,O,A)):!1}return $v=x,$v}var Mv,JA;function u1(){if(JA)return Mv;JA=1;var t=b7(),e=na();function r(n,i,a,o,c){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,a,o,r,c)}return Mv=r,Mv}var Lv,ZA;function x7(){if(ZA)return Lv;ZA=1;var t=MR(),e=u1(),r=1,n=2;function i(a,o,c,u){var d=c.length,p=d,h=!u;if(a==null)return!p;for(a=Object(a);d--;){var g=c[d];if(h&&g[2]?g[1]!==a[g[0]]:!(g[0]in a))return!1}for(;++d<p;){g=c[d];var v=g[0],x=a[v],_=g[1];if(h&&g[2]){if(x===void 0&&!(v in a))return!1}else{var b=new t;if(u)var k=u(x,_,v,a,o,b);if(!(k===void 0?e(_,x,r|n,u,b):k))return!1}}return!0}return Lv=i,Lv}var Dv,QA;function KR(){if(QA)return Dv;QA=1;var t=qa();function e(r){return r===r&&!t(r)}return Dv=e,Dv}var zv,eT;function w7(){if(eT)return zv;eT=1;var t=KR(),e=dp();function r(n){for(var i=e(n),a=i.length;a--;){var o=i[a],c=n[o];i[a]=[o,c,t(c)]}return i}return zv=r,zv}var Bv,tT;function VR(){if(tT)return Bv;tT=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return Bv=t,Bv}var Uv,rT;function _7(){if(rT)return Uv;rT=1;var t=x7(),e=w7(),r=VR();function n(i){var a=e(i);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(o){return o===i||t(o,i,a)}}return Uv=n,Uv}var qv,nT;function S7(){if(nT)return qv;nT=1;function t(e,r){return e!=null&&r in Object(e)}return qv=t,qv}var Fv,iT;function k7(){if(iT)return Fv;iT=1;var t=hR(),e=s1(),r=Zr(),n=l1(),i=c1(),a=op();function o(c,u,d){u=t(u,c);for(var p=-1,h=u.length,g=!1;++p<h;){var v=a(u[p]);if(!(g=c!=null&&d(c,v)))break;c=c[v]}return g||++p!=h?g:(h=c==null?0:c.length,!!h&&i(h)&&n(v,h)&&(r(c)||e(c)))}return Fv=o,Fv}var Hv,aT;function E7(){if(aT)return Hv;aT=1;var t=S7(),e=k7();function r(n,i){return n!=null&&e(n,i,t)}return Hv=r,Hv}var Wv,oT;function O7(){if(oT)return Wv;oT=1;var t=u1(),e=pR(),r=E7(),n=Gw(),i=KR(),a=VR(),o=op(),c=1,u=2;function d(p,h){return n(p)&&i(h)?a(o(p),h):function(g){var v=e(g,p);return v===void 0&&v===h?r(g,p):t(h,v,c|u)}}return Wv=d,Wv}var Gv,sT;function bl(){if(sT)return Gv;sT=1;function t(e){return e}return Gv=t,Gv}var Kv,lT;function A7(){if(lT)return Kv;lT=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Kv=t,Kv}var Vv,cT;function T7(){if(cT)return Vv;cT=1;var t=Zw();function e(r){return function(n){return t(n,r)}}return Vv=e,Vv}var Xv,uT;function C7(){if(uT)return Xv;uT=1;var t=A7(),e=T7(),r=Gw(),n=op();function i(a){return r(a)?t(n(a)):e(a)}return Xv=i,Xv}var Yv,dT;function Fa(){if(dT)return Yv;dT=1;var t=_7(),e=O7(),r=bl(),n=Zr(),i=C7();function a(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):i(o)}return Yv=a,Yv}var Jv,fT;function XR(){if(fT)return Jv;fT=1;function t(e,r,n,i){for(var a=e.length,o=n+(i?1:-1);i?o--:++o<a;)if(r(e[o],o,e))return o;return-1}return Jv=t,Jv}var Zv,hT;function j7(){if(hT)return Zv;hT=1;function t(e){return e!==e}return Zv=t,Zv}var Qv,pT;function P7(){if(pT)return Qv;pT=1;function t(e,r,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===r)return i;return-1}return Qv=t,Qv}var e0,mT;function N7(){if(mT)return e0;mT=1;var t=XR(),e=j7(),r=P7();function n(i,a,o){return a===a?r(i,a,o):t(i,e,o)}return e0=n,e0}var t0,gT;function R7(){if(gT)return t0;gT=1;var t=N7();function e(r,n){var i=r==null?0:r.length;return!!i&&t(r,n,0)>-1}return t0=e,t0}var r0,yT;function I7(){if(yT)return r0;yT=1;function t(e,r,n){for(var i=-1,a=e==null?0:e.length;++i<a;)if(n(r,e[i]))return!0;return!1}return r0=t,r0}var n0,vT;function $7(){if(vT)return n0;vT=1;function t(){}return n0=t,n0}var i0,bT;function M7(){if(bT)return i0;bT=1;var t=GR(),e=$7(),r=o1(),n=1/0,i=t&&1/r(new t([,-0]))[1]==n?function(a){return new t(a)}:e;return i0=i,i0}var a0,xT;function L7(){if(xT)return a0;xT=1;var t=LR(),e=R7(),r=I7(),n=zR(),i=M7(),a=o1(),o=200;function c(u,d,p){var h=-1,g=e,v=u.length,x=!0,_=[],b=_;if(p)x=!1,g=r;else if(v>=o){var k=d?null:i(u);if(k)return a(k);x=!1,g=n,b=new t}else b=d?[]:_;e:for(;++h<v;){var E=u[h],O=d?d(E):E;if(E=p||E!==0?E:0,x&&O===O){for(var A=b.length;A--;)if(b[A]===O)continue e;d&&b.push(O),_.push(E)}else g(b,O,p)||(b!==_&&b.push(O),_.push(E))}return _}return a0=c,a0}var o0,wT;function D7(){if(wT)return o0;wT=1;var t=Fa(),e=L7();function r(n,i){return n&&n.length?e(n,t(i,2)):[]}return o0=r,o0}var z7=D7();const _T=vt(z7);function YR(t,e,r){return e===!0?_T(t,r):Ye(e)?_T(t,e):t}function Ws(t){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ws(t)}var B7=["ref"];function ST(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Di(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ST(Object(r),!0).forEach(function(n){fp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ST(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function U7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ZR(n.key),n)}}function q7(t,e,r){return e&&kT(t.prototype,e),r&&kT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function F7(t,e,r){return e=Zf(e),H7(t,JR()?Reflect.construct(e,r||[],Zf(t).constructor):e.apply(t,r))}function H7(t,e){if(e&&(Ws(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W7(t)}function W7(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function JR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JR=function(){return!!t})()}function Zf(t){return Zf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zf(t)}function G7(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hx(t,e)}function hx(t,e){return hx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hx(t,e)}function fp(t,e,r){return e=ZR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ZR(t){var e=K7(t,"string");return Ws(e)=="symbol"?e:e+""}function K7(t,e){if(Ws(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function V7(t,e){if(t==null)return{};var r=X7(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function X7(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Y7(t){return t.value}function J7(t,e){if(I.isValidElement(t))return I.cloneElement(t,e);if(typeof t=="function")return I.createElement(t,e);e.ref;var r=V7(e,B7);return I.createElement(a1,r)}var ET=1,zs=(function(t){function e(){var r;U7(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=F7(this,e,[].concat(i)),fp(r,"lastBoundingBox",{width:-1,height:-1}),r}return G7(e,t),q7(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>ET||Math.abs(i.height-this.lastBoundingBox.height)>ET)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Di({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,c=i.verticalAlign,u=i.margin,d=i.chartWidth,p=i.chartHeight,h,g;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var v=this.getBBoxSnapshot();h={left:((d||0)-v.width)/2}}else h=o==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(c==="middle"){var x=this.getBBoxSnapshot();g={top:((p||0)-x.height)/2}}else g=c==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return Di(Di({},h),g)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,c=i.height,u=i.wrapperStyle,d=i.payloadUniqBy,p=i.payload,h=Di(Di({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(u)),u);return I.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(v){n.wrapperNode=v}},J7(a,Di(Di({},this.props),{},{payload:YR(p,d,Y7)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Di(Di({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&ge(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);fp(zs,"displayName","Legend");fp(zs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var s0,OT;function Z7(){if(OT)return s0;OT=1;var t=Pu(),e=s1(),r=Zr(),n=t?t.isConcatSpreadable:void 0;function i(a){return r(a)||e(a)||!!(n&&a&&a[n])}return s0=i,s0}var l0,AT;function QR(){if(AT)return l0;AT=1;var t=UR(),e=Z7();function r(n,i,a,o,c){var u=-1,d=n.length;for(a||(a=e),c||(c=[]);++u<d;){var p=n[u];i>0&&a(p)?i>1?r(p,i-1,a,o,c):t(c,p):o||(c[c.length]=p)}return c}return l0=r,l0}var c0,TT;function Q7(){if(TT)return c0;TT=1;function t(e){return function(r,n,i){for(var a=-1,o=Object(r),c=i(r),u=c.length;u--;){var d=c[e?u:++a];if(n(o[d],d,o)===!1)break}return r}}return c0=t,c0}var u0,CT;function eH(){if(CT)return u0;CT=1;var t=Q7(),e=t();return u0=e,u0}var d0,jT;function eI(){if(jT)return d0;jT=1;var t=eH(),e=dp();function r(n,i){return n&&t(n,i,e)}return d0=r,d0}var f0,PT;function tH(){if(PT)return f0;PT=1;var t=Iu();function e(r,n){return function(i,a){if(i==null)return i;if(!t(i))return r(i,a);for(var o=i.length,c=n?o:-1,u=Object(i);(n?c--:++c<o)&&a(u[c],c,u)!==!1;);return i}}return f0=e,f0}var h0,NT;function d1(){if(NT)return h0;NT=1;var t=eI(),e=tH(),r=e(t);return h0=r,h0}var p0,RT;function tI(){if(RT)return p0;RT=1;var t=d1(),e=Iu();function r(n,i){var a=-1,o=e(n)?Array(n.length):[];return t(n,function(c,u,d){o[++a]=i(c,u,d)}),o}return p0=r,p0}var m0,IT;function rH(){if(IT)return m0;IT=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return m0=t,m0}var g0,$T;function nH(){if($T)return g0;$T=1;var t=yl();function e(r,n){if(r!==n){var i=r!==void 0,a=r===null,o=r===r,c=t(r),u=n!==void 0,d=n===null,p=n===n,h=t(n);if(!d&&!h&&!c&&r>n||c&&u&&p&&!d&&!h||a&&u&&p||!i&&p||!o)return 1;if(!a&&!c&&!h&&r<n||h&&i&&o&&!a&&!c||d&&i&&o||!u&&o||!p)return-1}return 0}return g0=e,g0}var y0,MT;function iH(){if(MT)return y0;MT=1;var t=nH();function e(r,n,i){for(var a=-1,o=r.criteria,c=n.criteria,u=o.length,d=i.length;++a<u;){var p=t(o[a],c[a]);if(p){if(a>=d)return p;var h=i[a];return p*(h=="desc"?-1:1)}}return r.index-n.index}return y0=e,y0}var v0,LT;function aH(){if(LT)return v0;LT=1;var t=Jw(),e=Zw(),r=Fa(),n=tI(),i=rH(),a=FR(),o=iH(),c=bl(),u=Zr();function d(p,h,g){h.length?h=t(h,function(_){return u(_)?function(b){return e(b,_.length===1?_[0]:_)}:_}):h=[c];var v=-1;h=t(h,a(r));var x=n(p,function(_,b,k){var E=t(h,function(O){return O(_)});return{criteria:E,index:++v,value:_}});return i(x,function(_,b){return o(_,b,g)})}return v0=d,v0}var b0,DT;function oH(){if(DT)return b0;DT=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return b0=t,b0}var x0,zT;function sH(){if(zT)return x0;zT=1;var t=oH(),e=Math.max;function r(n,i,a){return i=e(i===void 0?n.length-1:i,0),function(){for(var o=arguments,c=-1,u=e(o.length-i,0),d=Array(u);++c<u;)d[c]=o[i+c];c=-1;for(var p=Array(i+1);++c<i;)p[c]=o[c];return p[i]=a(d),t(n,this,p)}}return x0=r,x0}var w0,BT;function lH(){if(BT)return w0;BT=1;function t(e){return function(){return e}}return w0=t,w0}var _0,UT;function rI(){if(UT)return _0;UT=1;var t=zo(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return _0=e,_0}var S0,qT;function cH(){if(qT)return S0;qT=1;var t=lH(),e=rI(),r=bl(),n=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(a),writable:!0})}:r;return S0=n,S0}var k0,FT;function uH(){if(FT)return k0;FT=1;var t=800,e=16,r=Date.now;function n(i){var a=0,o=0;return function(){var c=r(),u=e-(c-o);if(o=c,u>0){if(++a>=t)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return k0=n,k0}var E0,HT;function dH(){if(HT)return E0;HT=1;var t=cH(),e=uH(),r=e(t);return E0=r,E0}var O0,WT;function fH(){if(WT)return O0;WT=1;var t=bl(),e=sH(),r=dH();function n(i,a){return r(e(i,a,t),i+"")}return O0=n,O0}var A0,GT;function hp(){if(GT)return A0;GT=1;var t=Vw(),e=Iu(),r=l1(),n=qa();function i(a,o,c){if(!n(c))return!1;var u=typeof o;return(u=="number"?e(c)&&r(o,c.length):u=="string"&&o in c)?t(c[o],a):!1}return A0=i,A0}var T0,KT;function hH(){if(KT)return T0;KT=1;var t=QR(),e=aH(),r=fH(),n=hp(),i=r(function(a,o){if(a==null)return[];var c=o.length;return c>1&&n(a,o[0],o[1])?o=[]:c>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(a,t(o,1),[])});return T0=i,T0}var pH=hH();const f1=vt(pH);function Wc(t){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wc(t)}function px(){return px=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},px.apply(this,arguments)}function mH(t,e){return bH(t)||vH(t,e)||yH(t,e)||gH()}function gH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
446
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yH(t,e){if(t){if(typeof t=="string")return VT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VT(t,e)}}function VT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function vH(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function bH(t){if(Array.isArray(t))return t}function XT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function C0(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?XT(Object(r),!0).forEach(function(n){xH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):XT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xH(t,e,r){return e=wH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wH(t){var e=_H(t,"string");return Wc(e)=="symbol"?e:e+""}function _H(t,e){if(Wc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SH(t){return Array.isArray(t)&&or(t[0])&&or(t[1])?t.join(" ~ "):t}var kH=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,a=i===void 0?{}:i,o=e.itemStyle,c=o===void 0?{}:o,u=e.labelStyle,d=u===void 0?{}:u,p=e.payload,h=e.formatter,g=e.itemSorter,v=e.wrapperClassName,x=e.labelClassName,_=e.label,b=e.labelFormatter,k=e.accessibilityLayer,E=k===void 0?!1:k,O=function(){if(p&&p.length){var B={padding:0,margin:0},X=(g?f1(p,g):p).map(function(K,U){if(K.type==="none")return null;var G=C0({display:"block",paddingTop:4,paddingBottom:4,color:K.color||"#000"},c),J=K.formatter||h||SH,F=K.value,te=K.name,q=F,z=te;if(J&&q!=null&&z!=null){var L=J(F,te,K,U,p);if(Array.isArray(L)){var Z=mH(L,2);q=Z[0],z=Z[1]}else q=L}return I.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:G},or(z)?I.createElement("span",{className:"recharts-tooltip-item-name"},z):null,or(z)?I.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,I.createElement("span",{className:"recharts-tooltip-item-value"},q),I.createElement("span",{className:"recharts-tooltip-item-unit"},K.unit||""))});return I.createElement("ul",{className:"recharts-tooltip-item-list",style:B},X)}return null},A=C0({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),T=C0({margin:0},d),C=!Qe(_),j=C?_:"",R=at("recharts-default-tooltip",v),M=at("recharts-tooltip-label",x);C&&b&&p!==void 0&&p!==null&&(j=b(_,p));var Y=E?{role:"status","aria-live":"assertive"}:{};return I.createElement("div",px({className:R,style:A},Y),I.createElement("p",{className:M,style:T},I.isValidElement(j)?j:"".concat(j)),O())};function Gc(t){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gc(t)}function df(t,e,r){return e=EH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EH(t){var e=OH(t,"string");return Gc(e)=="symbol"?e:e+""}function OH(t,e){if(Gc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Gc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fc="recharts-tooltip-wrapper",AH={visibility:"hidden"};function TH(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return at(fc,df(df(df(df({},"".concat(fc,"-right"),ge(r)&&e&&ge(e.x)&&r>=e.x),"".concat(fc,"-left"),ge(r)&&e&&ge(e.x)&&r<e.x),"".concat(fc,"-bottom"),ge(n)&&e&&ge(e.y)&&n>=e.y),"".concat(fc,"-top"),ge(n)&&e&&ge(e.y)&&n<e.y))}function YT(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,i=t.offsetTopLeft,a=t.position,o=t.reverseDirection,c=t.tooltipDimension,u=t.viewBox,d=t.viewBoxDimension;if(a&&ge(a[n]))return a[n];var p=r[n]-c-i,h=r[n]+i;if(e[n])return o[n]?p:h;if(o[n]){var g=p,v=u[n];return g<v?Math.max(h,u[n]):Math.max(p,u[n])}var x=h+c,_=u[n]+d;return x>_?Math.max(p,u[n]):Math.max(h,u[n])}function CH(t){var e=t.translateX,r=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function jH(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,c=t.useTranslate3d,u=t.viewBox,d,p,h;return o.height>0&&o.width>0&&r?(p=YT({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),h=YT({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=CH({translateX:p,translateY:h,useTranslate3d:c})):d=AH,{cssProperties:d,cssClasses:TH({translateX:p,translateY:h,coordinate:r})}}function Gs(t){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gs(t)}function JT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ZT(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?JT(Object(r),!0).forEach(function(n){gx(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):JT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function PH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NH(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iI(n.key),n)}}function RH(t,e,r){return e&&NH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function IH(t,e,r){return e=Qf(e),$H(t,nI()?Reflect.construct(e,r||[],Qf(t).constructor):e.apply(t,r))}function $H(t,e){if(e&&(Gs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MH(t)}function MH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nI=function(){return!!t})()}function Qf(t){return Qf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qf(t)}function LH(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mx(t,e)}function mx(t,e){return mx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mx(t,e)}function gx(t,e,r){return e=iI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iI(t){var e=DH(t,"string");return Gs(e)=="symbol"?e:e+""}function DH(t,e){if(Gs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Gs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var QT=1,zH=(function(t){function e(){var r;PH(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=IH(this,e,[].concat(i)),gx(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),gx(r,"handleKeyDown",function(o){if(o.key==="Escape"){var c,u,d,p;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(u=r.props.coordinate)===null||u===void 0?void 0:u.x)!==null&&c!==void 0?c:0,y:(d=(p=r.props.coordinate)===null||p===void 0?void 0:p.y)!==null&&d!==void 0?d:0}})}}),r}return LH(e,t),RH(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>QT||Math.abs(n.height-this.state.lastBoundingBox.height)>QT)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,c=i.animationDuration,u=i.animationEasing,d=i.children,p=i.coordinate,h=i.hasPayload,g=i.isAnimationActive,v=i.offset,x=i.position,_=i.reverseDirection,b=i.useTranslate3d,k=i.viewBox,E=i.wrapperStyle,O=jH({allowEscapeViewBox:o,coordinate:p,offsetTopLeft:v,position:x,reverseDirection:_,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:k}),A=O.cssClasses,T=O.cssProperties,C=ZT(ZT({transition:g&&a?"transform ".concat(c,"ms ").concat(u):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&h?"visible":"hidden",position:"absolute",top:0,left:0},E);return I.createElement("div",{tabIndex:-1,className:A,style:C,ref:function(R){n.wrapperNode=R}},d)}}])})(N.PureComponent),BH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},xl={isSsr:BH()};function Ks(t){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ks(t)}function e2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function t2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?e2(Object(r),!0).forEach(function(n){h1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function UH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qH(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oI(n.key),n)}}function FH(t,e,r){return e&&qH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function HH(t,e,r){return e=eh(e),WH(t,aI()?Reflect.construct(e,r||[],eh(t).constructor):e.apply(t,r))}function WH(t,e){if(e&&(Ks(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GH(t)}function GH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aI=function(){return!!t})()}function eh(t){return eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},eh(t)}function KH(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yx(t,e)}function yx(t,e){return yx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yx(t,e)}function h1(t,e,r){return e=oI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oI(t){var e=VH(t,"string");return Ks(e)=="symbol"?e:e+""}function VH(t,e){if(Ks(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function XH(t){return t.dataKey}function YH(t,e){return I.isValidElement(t)?I.cloneElement(t,e):typeof t=="function"?I.createElement(t,e):I.createElement(kH,e)}var ln=(function(t){function e(){return UH(this,e),HH(this,e,arguments)}return KH(e,t),FH(e,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,c=i.animationDuration,u=i.animationEasing,d=i.content,p=i.coordinate,h=i.filterNull,g=i.isAnimationActive,v=i.offset,x=i.payload,_=i.payloadUniqBy,b=i.position,k=i.reverseDirection,E=i.useTranslate3d,O=i.viewBox,A=i.wrapperStyle,T=x??[];h&&T.length&&(T=YR(x.filter(function(j){return j.value!=null&&(j.hide!==!0||n.props.includeHidden)}),_,XH));var C=T.length>0;return I.createElement(zH,{allowEscapeViewBox:o,animationDuration:c,animationEasing:u,isAnimationActive:g,active:a,coordinate:p,hasPayload:C,offset:v,position:b,reverseDirection:k,useTranslate3d:E,viewBox:O,wrapperStyle:A},YH(d,t2(t2({},this.props),{},{payload:T})))}}])})(N.PureComponent);h1(ln,"displayName","Tooltip");h1(ln,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!xl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var j0,r2;function JH(){if(r2)return j0;r2=1;var t=Ei(),e=function(){return t.Date.now()};return j0=e,j0}var P0,n2;function ZH(){if(n2)return P0;n2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return P0=e,P0}var N0,i2;function QH(){if(i2)return N0;i2=1;var t=ZH(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return N0=r,N0}var R0,a2;function sI(){if(a2)return R0;a2=1;var t=QH(),e=qa(),r=yl(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function u(d){if(typeof d=="number")return d;if(r(d))return n;if(e(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=e(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=t(d);var h=a.test(d);return h||o.test(d)?c(d.slice(2),h?2:8):i.test(d)?n:+d}return R0=u,R0}var I0,o2;function eW(){if(o2)return I0;o2=1;var t=qa(),e=JH(),r=sI(),n="Expected a function",i=Math.max,a=Math.min;function o(c,u,d){var p,h,g,v,x,_,b=0,k=!1,E=!1,O=!0;if(typeof c!="function")throw new TypeError(n);u=r(u)||0,t(d)&&(k=!!d.leading,E="maxWait"in d,g=E?i(r(d.maxWait)||0,u):g,O="trailing"in d?!!d.trailing:O);function A(X){var K=p,U=h;return p=h=void 0,b=X,v=c.apply(U,K),v}function T(X){return b=X,x=setTimeout(R,u),k?A(X):v}function C(X){var K=X-_,U=X-b,G=u-K;return E?a(G,g-U):G}function j(X){var K=X-_,U=X-b;return _===void 0||K>=u||K<0||E&&U>=g}function R(){var X=e();if(j(X))return M(X);x=setTimeout(R,C(X))}function M(X){return x=void 0,O&&p?A(X):(p=h=void 0,v)}function Y(){x!==void 0&&clearTimeout(x),b=0,p=_=h=x=void 0}function W(){return x===void 0?v:M(e())}function B(){var X=e(),K=j(X);if(p=arguments,h=this,_=X,K){if(x===void 0)return T(_);if(E)return clearTimeout(x),x=setTimeout(R,u),A(_)}return x===void 0&&(x=setTimeout(R,u)),v}return B.cancel=Y,B.flush=W,B}return I0=o,I0}var $0,s2;function tW(){if(s2)return $0;s2=1;var t=eW(),e=qa(),r="Expected a function";function n(i,a,o){var c=!0,u=!0;if(typeof i!="function")throw new TypeError(r);return e(o)&&(c="leading"in o?!!o.leading:c,u="trailing"in o?!!o.trailing:u),t(i,a,{leading:c,maxWait:a,trailing:u})}return $0=n,$0}var rW=tW();const lI=vt(rW);function Kc(t){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kc(t)}function l2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ff(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l2(Object(r),!0).forEach(function(n){nW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nW(t,e,r){return e=iW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iW(t){var e=aW(t,"string");return Kc(e)=="symbol"?e:e+""}function aW(t,e){if(Kc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Kc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oW(t,e){return uW(t)||cW(t,e)||lW(t,e)||sW()}function sW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
447
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lW(t,e){if(t){if(typeof t=="string")return c2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c2(t,e)}}function c2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function uW(t){if(Array.isArray(t))return t}var th=N.forwardRef(function(t,e){var r=t.aspect,n=t.initialDimension,i=n===void 0?{width:-1,height:-1}:n,a=t.width,o=a===void 0?"100%":a,c=t.height,u=c===void 0?"100%":c,d=t.minWidth,p=d===void 0?0:d,h=t.minHeight,g=t.maxHeight,v=t.children,x=t.debounce,_=x===void 0?0:x,b=t.id,k=t.className,E=t.onResize,O=t.style,A=O===void 0?{}:O,T=N.useRef(null),C=N.useRef();C.current=E,N.useImperativeHandle(e,function(){return Object.defineProperty(T.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),T.current},configurable:!0})});var j=N.useState({containerWidth:i.width,containerHeight:i.height}),R=oW(j,2),M=R[0],Y=R[1],W=N.useCallback(function(X,K){Y(function(U){var G=Math.round(X),J=Math.round(K);return U.containerWidth===G&&U.containerHeight===J?U:{containerWidth:G,containerHeight:J}})},[]);N.useEffect(function(){var X=function(te){var q,z=te[0].contentRect,L=z.width,Z=z.height;W(L,Z),(q=C.current)===null||q===void 0||q.call(C,L,Z)};_>0&&(X=lI(X,_,{trailing:!0,leading:!1}));var K=new ResizeObserver(X),U=T.current.getBoundingClientRect(),G=U.width,J=U.height;return W(G,J),K.observe(T.current),function(){K.disconnect()}},[W,_]);var B=N.useMemo(function(){var X=M.containerWidth,K=M.containerHeight;if(X<0||K<0)return null;Ki(So(o)||So(u),`The width(%s) and height(%s) are both fixed numbers,
|
|
448
|
-
maybe you don't need to use a ResponsiveContainer.`,o,u),Ki(!r||r>0,"The aspect(%s) must be greater than zero.",r);var U=So(o)?X:o,G=So(u)?K:u;r&&r>0&&(U?G=U/r:G&&(U=G*r),g&&G>g&&(G=g)),Ki(U>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
449
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
450
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
451
|
-
height and width.`,U,G,o,u,p,h,r);var J=!Array.isArray(v)&&Gi(v.type).endsWith("Chart");return I.Children.map(v,function(F){return I.isValidElement(F)?N.cloneElement(F,ff({width:U,height:G},J?{style:ff({height:"100%",width:"100%",maxHeight:G,maxWidth:U},F.props.style)}:{})):F})},[r,v,u,g,h,p,M,o]);return I.createElement("div",{id:b?"".concat(b):void 0,className:at("recharts-responsive-container",k),style:ff(ff({},A),{},{width:o,height:u,minWidth:p,minHeight:h,maxHeight:g}),ref:T},B)}),cI=function(e){return null};cI.displayName="Cell";function Vc(t){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vc(t)}function u2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function vx(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?u2(Object(r),!0).forEach(function(n){dW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dW(t,e,r){return e=fW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fW(t){var e=hW(t,"string");return Vc(e)=="symbol"?e:e+""}function hW(t,e){if(Vc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Vc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _s={widthCache:{},cacheCount:0},pW=2e3,mW={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},d2="recharts_measurement_span";function gW(t){var e=vx({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var Pc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||xl.isSsr)return{width:0,height:0};var n=gW(r),i=JSON.stringify({text:e,copyStyle:n});if(_s.widthCache[i])return _s.widthCache[i];try{var a=document.getElementById(d2);a||(a=document.createElement("span"),a.setAttribute("id",d2),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=vx(vx({},mW),n);Object.assign(a.style,o),a.textContent="".concat(e);var c=a.getBoundingClientRect(),u={width:c.width,height:c.height};return _s.widthCache[i]=u,++_s.cacheCount>pW&&(_s.cacheCount=0,_s.widthCache={}),u}catch{return{width:0,height:0}}},yW=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Xc(t){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xc(t)}function rh(t,e){return wW(t)||xW(t,e)||bW(t,e)||vW()}function vW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
452
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bW(t,e){if(t){if(typeof t=="string")return f2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f2(t,e)}}function f2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function wW(t){if(Array.isArray(t))return t}function _W(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h2(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kW(n.key),n)}}function SW(t,e,r){return e&&h2(t.prototype,e),r&&h2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function kW(t){var e=EW(t,"string");return Xc(e)=="symbol"?e:e+""}function EW(t,e){if(Xc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var p2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,m2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,OW=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,AW=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,uI={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},TW=Object.keys(uI),Ns="NaN";function CW(t,e){return t*uI[e]}var hf=(function(){function t(e,r){_W(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!OW.test(r)&&(this.num=NaN,this.unit=""),TW.includes(r)&&(this.num=CW(e,r),this.unit="px")}return SW(t,[{key:"add",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,i=(n=AW.exec(r))!==null&&n!==void 0?n:[],a=rh(i,3),o=a[1],c=a[2];return new t(parseFloat(o),c??"")}}])})();function dI(t){if(t.includes(Ns))return Ns;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=p2.exec(e))!==null&&r!==void 0?r:[],i=rh(n,4),a=i[1],o=i[2],c=i[3],u=hf.parse(a??""),d=hf.parse(c??""),p=o==="*"?u.multiply(d):u.divide(d);if(p.isNaN())return Ns;e=e.replace(p2,p.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var h,g=(h=m2.exec(e))!==null&&h!==void 0?h:[],v=rh(g,4),x=v[1],_=v[2],b=v[3],k=hf.parse(x??""),E=hf.parse(b??""),O=_==="+"?k.add(E):k.subtract(E);if(O.isNaN())return Ns;e=e.replace(m2,O.toString())}return e}var g2=/\(([^()]*)\)/;function jW(t){for(var e=t;e.includes("(");){var r=g2.exec(e),n=rh(r,2),i=n[1];e=e.replace(g2,dI(i))}return e}function PW(t){var e=t.replace(/\s+/g,"");return e=jW(e),e=dI(e),e}function NW(t){try{return PW(t)}catch{return Ns}}function M0(t){var e=NW(t.slice(5,-1));return e===Ns?"":e}var RW=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],IW=["dx","dy","angle","className","breakAll"];function bx(){return bx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},bx.apply(this,arguments)}function y2(t,e){if(t==null)return{};var r=$W(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function $W(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function v2(t,e){return zW(t)||DW(t,e)||LW(t,e)||MW()}function MW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
453
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LW(t,e){if(t){if(typeof t=="string")return b2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b2(t,e)}}function b2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function DW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function zW(t){if(Array.isArray(t))return t}var fI=/[ \f\n\r\t\v\u2028\u2029]+/,hI=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];Qe(r)||(n?a=r.toString().split(""):a=r.toString().split(fI));var o=a.map(function(u){return{word:u,width:Pc(u,i).width}}),c=n?0:Pc(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},BW=function(e,r,n,i,a){var o=e.maxLines,c=e.children,u=e.style,d=e.breakAll,p=ge(o),h=c,g=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(G,J){var F=J.word,te=J.width,q=G[G.length-1];if(q&&(i==null||a||q.width+te+n<Number(i)))q.words.push(F),q.width+=te+n;else{var z={words:[F],width:te};G.push(z)}return G},[])},v=g(r),x=function(U){return U.reduce(function(G,J){return G.width>J.width?G:J})};if(!p)return v;for(var _="…",b=function(U){var G=h.slice(0,U),J=hI({breakAll:d,style:u,children:G+_}).wordsWithComputedWidth,F=g(J),te=F.length>o||x(F).width>Number(i);return[te,F]},k=0,E=h.length-1,O=0,A;k<=E&&O<=h.length-1;){var T=Math.floor((k+E)/2),C=T-1,j=b(C),R=v2(j,2),M=R[0],Y=R[1],W=b(T),B=v2(W,1),X=B[0];if(!M&&!X&&(k=T+1),M&&X&&(E=T-1),!M&&X){A=Y;break}O++}return A||v},x2=function(e){var r=Qe(e)?[]:e.toString().split(fI);return[{words:r}]},UW=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,c=e.maxLines;if((r||n)&&!xl.isSsr){var u,d,p=hI({breakAll:o,children:i,style:a});if(p){var h=p.wordsWithComputedWidth,g=p.spaceWidth;u=h,d=g}else return x2(i);return BW({breakAll:o,children:i,maxLines:c,style:a},u,d,r,n)}return x2(i)},w2="#808080",nh=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.lineHeight,c=o===void 0?"1em":o,u=e.capHeight,d=u===void 0?"0.71em":u,p=e.scaleToFit,h=p===void 0?!1:p,g=e.textAnchor,v=g===void 0?"start":g,x=e.verticalAnchor,_=x===void 0?"end":x,b=e.fill,k=b===void 0?w2:b,E=y2(e,RW),O=N.useMemo(function(){return UW({breakAll:E.breakAll,children:E.children,maxLines:E.maxLines,scaleToFit:h,style:E.style,width:E.width})},[E.breakAll,E.children,E.maxLines,h,E.style,E.width]),A=E.dx,T=E.dy,C=E.angle,j=E.className,R=E.breakAll,M=y2(E,IW);if(!or(n)||!or(a))return null;var Y=n+(ge(A)?A:0),W=a+(ge(T)?T:0),B;switch(_){case"start":B=M0("calc(".concat(d,")"));break;case"middle":B=M0("calc(".concat((O.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:B=M0("calc(".concat(O.length-1," * -").concat(c,")"));break}var X=[];if(h){var K=O[0].width,U=E.width;X.push("scale(".concat((ge(U)?U/K:1)/K,")"))}return C&&X.push("rotate(".concat(C,", ").concat(Y,", ").concat(W,")")),X.length&&(M.transform=X.join(" ")),I.createElement("text",bx({},it(M,!0),{x:Y,y:W,className:at("recharts-text",j),textAnchor:v,fill:k.includes("url")?w2:k}),O.map(function(G,J){var F=G.words.join(R?"":" ");return I.createElement("tspan",{x:Y,dy:J===0?B:c,key:"".concat(F,"-").concat(J)},F)}))};function Ma(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qW(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function p1(t){let e,r,n;t.length!==2?(e=Ma,r=(c,u)=>Ma(t(c),u),n=(c,u)=>t(c)-u):(e=t===Ma||t===qW?t:FW,r=t,n=t);function i(c,u,d=0,p=c.length){if(d<p){if(e(u,u)!==0)return p;do{const h=d+p>>>1;r(c[h],u)<0?d=h+1:p=h}while(d<p)}return d}function a(c,u,d=0,p=c.length){if(d<p){if(e(u,u)!==0)return p;do{const h=d+p>>>1;r(c[h],u)<=0?d=h+1:p=h}while(d<p)}return d}function o(c,u,d=0,p=c.length){const h=i(c,u,d,p-1);return h>d&&n(c[h-1],u)>-n(c[h],u)?h-1:h}return{left:i,center:o,right:a}}function FW(){return 0}function pI(t){return t===null?NaN:+t}function*HW(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const WW=p1(Ma),$u=WW.right;p1(pI).center;class _2 extends Map{constructor(e,r=VW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(S2(this,e))}has(e){return super.has(S2(this,e))}set(e,r){return super.set(GW(this,e),r)}delete(e){return super.delete(KW(this,e))}}function S2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function GW({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function KW({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function VW(t){return t!==null&&typeof t=="object"?t.valueOf():t}function XW(t=Ma){if(t===Ma)return mI;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||n===0?n:(t(r,r)===0)-(t(e,e)===0)}}function mI(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const YW=Math.sqrt(50),JW=Math.sqrt(10),ZW=Math.sqrt(2);function ih(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=YW?10:a>=JW?5:a>=ZW?2:1;let c,u,d;return i<0?(d=Math.pow(10,-i)/o,c=Math.round(t*d),u=Math.round(e*d),c/d<t&&++c,u/d>e&&--u,d=-d):(d=Math.pow(10,i)*o,c=Math.round(t/d),u=Math.round(e/d),c*d<t&&++c,u*d>e&&--u),u<c&&.5<=r&&r<2?ih(t,e,r*2):[c,u,d]}function xx(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[i,a,o]=n?ih(e,t,r):ih(t,e,r);if(!(a>=i))return[];const c=a-i+1,u=new Array(c);if(n)if(o<0)for(let d=0;d<c;++d)u[d]=(a-d)/-o;else for(let d=0;d<c;++d)u[d]=(a-d)*o;else if(o<0)for(let d=0;d<c;++d)u[d]=(i+d)/-o;else for(let d=0;d<c;++d)u[d]=(i+d)*o;return u}function wx(t,e,r){return e=+e,t=+t,r=+r,ih(t,e,r)[2]}function _x(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?wx(e,t,r):wx(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function k2(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function E2(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function gI(t,e,r=0,n=1/0,i){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(i=i===void 0?mI:XW(i);n>r;){if(n-r>600){const u=n-r+1,d=e-r+1,p=Math.log(u),h=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*h*(u-h)/u)*(d-u/2<0?-1:1),v=Math.max(r,Math.floor(e-d*h/u+g)),x=Math.min(n,Math.floor(e+(u-d)*h/u+g));gI(t,e,v,x,i)}const a=t[e];let o=r,c=n;for(hc(t,r,e),i(t[n],a)>0&&hc(t,r,n);o<c;){for(hc(t,o,c),++o,--c;i(t[o],a)<0;)++o;for(;i(t[c],a)>0;)--c}i(t[r],a)===0?hc(t,r,c):(++c,hc(t,c,n)),c<=e&&(r=c+1),e<=c&&(n=c-1)}return t}function hc(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function QW(t,e,r){if(t=Float64Array.from(HW(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return E2(t);if(e>=1)return k2(t);var n,i=(n-1)*e,a=Math.floor(i),o=k2(gI(t,a).subarray(0,a+1)),c=E2(t.subarray(a+1));return o+(c-o)*(i-a)}}function eG(t,e,r=pI){if(!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t),c=+r(t[a+1],a+1,t);return o+(c-o)*(i-a)}}function tG(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n<i;)a[n]=t+n*r;return a}function Pn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ia(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const Sx=Symbol("implicit");function m1(){var t=new _2,e=[],r=[],n=Sx;function i(a){let o=t.get(a);if(o===void 0){if(n!==Sx)return n;t.set(a,o=e.push(a)-1)}return r[o%r.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new _2;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return m1(e,r).unknown(n)},Pn.apply(i,arguments),i}function Yc(){var t=m1().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,o,c=!1,u=0,d=0,p=.5;delete t.unknown;function h(){var g=e().length,v=i<n,x=v?i:n,_=v?n:i;a=(_-x)/Math.max(1,g-u+d*2),c&&(a=Math.floor(a)),x+=(_-x-a*(g-u))*p,o=a*(1-u),c&&(x=Math.round(x),o=Math.round(o));var b=tG(g).map(function(k){return x+a*k});return r(v?b.reverse():b)}return t.domain=function(g){return arguments.length?(e(g),h()):e()},t.range=function(g){return arguments.length?([n,i]=g,n=+n,i=+i,h()):[n,i]},t.rangeRound=function(g){return[n,i]=g,n=+n,i=+i,c=!0,h()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(g){return arguments.length?(c=!!g,h()):c},t.padding=function(g){return arguments.length?(u=Math.min(1,d=+g),h()):u},t.paddingInner=function(g){return arguments.length?(u=Math.min(1,g),h()):u},t.paddingOuter=function(g){return arguments.length?(d=+g,h()):d},t.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),h()):p},t.copy=function(){return Yc(e(),[n,i]).round(c).paddingInner(u).paddingOuter(d).align(p)},Pn.apply(h(),arguments)}function yI(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return yI(e())},t}function Nc(){return yI(Yc.apply(null,arguments).paddingInner(1))}function g1(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function vI(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Mu(){}var Jc=.7,ah=1/Jc,Bs="\\s*([+-]?\\d+)\\s*",Zc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rG=/^#([0-9a-f]{3,8})$/,nG=new RegExp(`^rgb\\(${Bs},${Bs},${Bs}\\)$`),iG=new RegExp(`^rgb\\(${_i},${_i},${_i}\\)$`),aG=new RegExp(`^rgba\\(${Bs},${Bs},${Bs},${Zc}\\)$`),oG=new RegExp(`^rgba\\(${_i},${_i},${_i},${Zc}\\)$`),sG=new RegExp(`^hsl\\(${Zc},${_i},${_i}\\)$`),lG=new RegExp(`^hsla\\(${Zc},${_i},${_i},${Zc}\\)$`),O2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};g1(Mu,Qc,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:A2,formatHex:A2,formatHex8:cG,formatHsl:uG,formatRgb:T2,toString:T2});function A2(){return this.rgb().formatHex()}function cG(){return this.rgb().formatHex8()}function uG(){return bI(this).formatHsl()}function T2(){return this.rgb().formatRgb()}function Qc(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=rG.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?C2(e):r===3?new Jr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?pf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?pf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=nG.exec(t))?new Jr(e[1],e[2],e[3],1):(e=iG.exec(t))?new Jr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=aG.exec(t))?pf(e[1],e[2],e[3],e[4]):(e=oG.exec(t))?pf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=sG.exec(t))?N2(e[1],e[2]/100,e[3]/100,1):(e=lG.exec(t))?N2(e[1],e[2]/100,e[3]/100,e[4]):O2.hasOwnProperty(t)?C2(O2[t]):t==="transparent"?new Jr(NaN,NaN,NaN,0):null}function C2(t){return new Jr(t>>16&255,t>>8&255,t&255,1)}function pf(t,e,r,n){return n<=0&&(t=e=r=NaN),new Jr(t,e,r,n)}function dG(t){return t instanceof Mu||(t=Qc(t)),t?(t=t.rgb(),new Jr(t.r,t.g,t.b,t.opacity)):new Jr}function kx(t,e,r,n){return arguments.length===1?dG(t):new Jr(t,e,r,n??1)}function Jr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}g1(Jr,kx,vI(Mu,{brighter(t){return t=t==null?ah:Math.pow(ah,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Jc:Math.pow(Jc,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jr(Co(this.r),Co(this.g),Co(this.b),oh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:j2,formatHex:j2,formatHex8:fG,formatRgb:P2,toString:P2}));function j2(){return`#${ko(this.r)}${ko(this.g)}${ko(this.b)}`}function fG(){return`#${ko(this.r)}${ko(this.g)}${ko(this.b)}${ko((isNaN(this.opacity)?1:this.opacity)*255)}`}function P2(){const t=oh(this.opacity);return`${t===1?"rgb(":"rgba("}${Co(this.r)}, ${Co(this.g)}, ${Co(this.b)}${t===1?")":`, ${t})`}`}function oh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Co(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ko(t){return t=Co(t),(t<16?"0":"")+t.toString(16)}function N2(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Yn(t,e,r,n)}function bI(t){if(t instanceof Yn)return new Yn(t.h,t.s,t.l,t.opacity);if(t instanceof Mu||(t=Qc(t)),!t)return new Yn;if(t instanceof Yn)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,c=a-i,u=(a+i)/2;return c?(e===a?o=(r-n)/c+(r<n)*6:r===a?o=(n-e)/c+2:o=(e-r)/c+4,c/=u<.5?a+i:2-a-i,o*=60):c=u>0&&u<1?0:o,new Yn(o,c,u,t.opacity)}function hG(t,e,r,n){return arguments.length===1?bI(t):new Yn(t,e,r,n??1)}function Yn(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}g1(Yn,hG,vI(Mu,{brighter(t){return t=t==null?ah:Math.pow(ah,t),new Yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Jc:Math.pow(Jc,t),new Yn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Jr(L0(t>=240?t-240:t+120,i,n),L0(t,i,n),L0(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Yn(R2(this.h),mf(this.s),mf(this.l),oh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=oh(this.opacity);return`${t===1?"hsl(":"hsla("}${R2(this.h)}, ${mf(this.s)*100}%, ${mf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function R2(t){return t=(t||0)%360,t<0?t+360:t}function mf(t){return Math.max(0,Math.min(1,t||0))}function L0(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const y1=t=>()=>t;function pG(t,e){return function(r){return t+r*e}}function mG(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function gG(t){return(t=+t)==1?xI:function(e,r){return r-e?mG(e,r,t):y1(isNaN(e)?r:e)}}function xI(t,e){var r=e-t;return r?pG(t,r):y1(isNaN(t)?e:t)}const I2=(function t(e){var r=gG(e);function n(i,a){var o=r((i=kx(i)).r,(a=kx(a)).r),c=r(i.g,a.g),u=r(i.b,a.b),d=xI(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=c(p),i.b=u(p),i.opacity=d(p),i+""}}return n.gamma=t,n})(1);function yG(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=t[i]*(1-a)+e[i]*a;return n}}function vG(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function bG(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=wl(t[o],e[o]);for(;o<r;++o)a[o]=e[o];return function(c){for(o=0;o<n;++o)a[o]=i[o](c);return a}}function xG(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function sh(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function wG(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=wl(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Ex=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,D0=new RegExp(Ex.source,"g");function _G(t){return function(){return t}}function SG(t){return function(e){return t(e)+""}}function kG(t,e){var r=Ex.lastIndex=D0.lastIndex=0,n,i,a,o=-1,c=[],u=[];for(t=t+"",e=e+"";(n=Ex.exec(t))&&(i=D0.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),c[o]?c[o]+=a:c[++o]=a),(n=n[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,u.push({i:o,x:sh(n,i)})),r=D0.lastIndex;return r<e.length&&(a=e.slice(r),c[o]?c[o]+=a:c[++o]=a),c.length<2?u[0]?SG(u[0].x):_G(e):(e=u.length,function(d){for(var p=0,h;p<e;++p)c[(h=u[p]).i]=h.x(d);return c.join("")})}function wl(t,e){var r=typeof e,n;return e==null||r==="boolean"?y1(e):(r==="number"?sh:r==="string"?(n=Qc(e))?(e=n,I2):kG:e instanceof Qc?I2:e instanceof Date?xG:vG(e)?yG:Array.isArray(e)?bG:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?wG:sh)(t,e)}function v1(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function EG(t,e){e===void 0&&(e=t,t=wl);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return function(o){var c=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[c](o-c)}}function OG(t){return function(){return t}}function lh(t){return+t}var $2=[0,1];function Br(t){return t}function Ox(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:OG(isNaN(e)?NaN:.5)}function AG(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function TG(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Ox(i,n),a=r(o,a)):(n=Ox(n,i),a=r(a,o)),function(c){return a(n(c))}}function CG(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)i[o]=Ox(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(c){var u=$u(t,c,1,n)-1;return a[u](i[u](c))}}function Lu(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function pp(){var t=$2,e=$2,r=wl,n,i,a,o=Br,c,u,d;function p(){var g=Math.min(t.length,e.length);return o!==Br&&(o=AG(t[0],t[g-1])),c=g>2?CG:TG,u=d=null,h}function h(g){return g==null||isNaN(g=+g)?a:(u||(u=c(t.map(n),e,r)))(n(o(g)))}return h.invert=function(g){return o(i((d||(d=c(e,t.map(n),sh)))(g)))},h.domain=function(g){return arguments.length?(t=Array.from(g,lh),p()):t.slice()},h.range=function(g){return arguments.length?(e=Array.from(g),p()):e.slice()},h.rangeRound=function(g){return e=Array.from(g),r=v1,p()},h.clamp=function(g){return arguments.length?(o=g?!0:Br,p()):o!==Br},h.interpolate=function(g){return arguments.length?(r=g,p()):r},h.unknown=function(g){return arguments.length?(a=g,h):a},function(g,v){return n=g,i=v,p()}}function b1(){return pp()(Br,Br)}function jG(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ch(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Vs(t){return t=ch(Math.abs(t)),t?t[1]:NaN}function PG(t,e){return function(r,n){for(var i=r.length,a=[],o=0,c=t[0],u=0;i>0&&c>0&&(u+c+1>n&&(c=Math.max(1,n-u)),a.push(r.substring(i-=c,i+c)),!((u+=c+1)>n));)c=t[o=(o+1)%t.length];return a.reverse().join(e)}}function NG(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var RG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eu(t){if(!(e=RG.exec(t)))throw new Error("invalid format: "+t);var e;return new x1({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}eu.prototype=x1.prototype;function x1(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}x1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function IG(t){e:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var uh;function $G(t,e){var r=ch(t,e);if(!r)return uh=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(uh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+ch(t,Math.max(0,e+a-1))[0]}function M2(t,e){var r=ch(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const L2={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:jG,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>M2(t*100,e),r:M2,s:$G,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function D2(t){return t}var z2=Array.prototype.map,B2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function MG(t){var e=t.grouping===void 0||t.thousands===void 0?D2:PG(z2.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?D2:NG(z2.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function d(h,g){h=eu(h);var v=h.fill,x=h.align,_=h.sign,b=h.symbol,k=h.zero,E=h.width,O=h.comma,A=h.precision,T=h.trim,C=h.type;C==="n"?(O=!0,C="g"):L2[C]||(A===void 0&&(A=12),T=!0,C="g"),(k||v==="0"&&x==="=")&&(k=!0,v="0",x="=");var j=(g&&g.prefix!==void 0?g.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),R=(b==="$"?n:/[%p]/.test(C)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),M=L2[C],Y=/[defgprs%]/.test(C);A=A===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function W(B){var X=j,K=R,U,G,J;if(C==="c")K=M(B)+K,B="";else{B=+B;var F=B<0||1/B<0;if(B=isNaN(B)?u:M(Math.abs(B),A),T&&(B=IG(B)),F&&+B==0&&_!=="+"&&(F=!1),X=(F?_==="("?_:c:_==="-"||_==="("?"":_)+X,K=(C==="s"&&!isNaN(B)&&uh!==void 0?B2[8+uh/3]:"")+K+(F&&_==="("?")":""),Y){for(U=-1,G=B.length;++U<G;)if(J=B.charCodeAt(U),48>J||J>57){K=(J===46?i+B.slice(U+1):B.slice(U))+K,B=B.slice(0,U);break}}}O&&!k&&(B=e(B,1/0));var te=X.length+B.length+K.length,q=te<E?new Array(E-te+1).join(v):"";switch(O&&k&&(B=e(q+B,q.length?E-K.length:1/0),q=""),x){case"<":B=X+B+K+q;break;case"=":B=X+q+B+K;break;case"^":B=q.slice(0,te=q.length>>1)+X+B+K+q.slice(te);break;default:B=q+X+B+K;break}return a(B)}return W.toString=function(){return h+""},W}function p(h,g){var v=Math.max(-8,Math.min(8,Math.floor(Vs(g)/3)))*3,x=Math.pow(10,-v),_=d((h=eu(h),h.type="f",h),{suffix:B2[8+v/3]});return function(b){return _(x*b)}}return{format:d,formatPrefix:p}}var gf,w1,wI;LG({thousands:",",grouping:[3],currency:["$",""]});function LG(t){return gf=MG(t),w1=gf.format,wI=gf.formatPrefix,gf}function DG(t){return Math.max(0,-Vs(Math.abs(t)))}function zG(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Vs(e)/3)))*3-Vs(Math.abs(t)))}function BG(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Vs(e)-Vs(t))+1}function _I(t,e,r,n){var i=_x(t,e,r),a;switch(n=eu(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=zG(i,o))&&(n.precision=a),wI(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=BG(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=DG(i))&&(n.precision=a-(n.type==="%")*2);break}}return w1(n)}function Ha(t){var e=t.domain;return t.ticks=function(r){var n=e();return xx(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return _I(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,o=n[i],c=n[a],u,d,p=10;for(c<o&&(d=o,o=c,c=d,d=i,i=a,a=d);p-- >0;){if(d=wx(o,c,r),d===u)return n[i]=o,n[a]=c,e(n);if(d>0)o=Math.floor(o/d)*d,c=Math.ceil(c/d)*d;else if(d<0)o=Math.ceil(o*d)/d,c=Math.floor(c*d)/d;else break;u=d}return t},t}function dh(){var t=b1();return t.copy=function(){return Lu(t,dh())},Pn.apply(t,arguments),Ha(t)}function SI(t){var e;function r(n){return n==null||isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=Array.from(n,lh),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return SI(t).unknown(e)},t=arguments.length?Array.from(t,lh):[0,1],Ha(r)}function kI(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),t[r]=e.floor(i),t[n]=e.ceil(a),t}function U2(t){return Math.log(t)}function q2(t){return Math.exp(t)}function UG(t){return-Math.log(-t)}function qG(t){return-Math.exp(-t)}function FG(t){return isFinite(t)?+("1e"+t):t<0?0:t}function HG(t){return t===10?FG:t===Math.E?Math.exp:e=>Math.pow(t,e)}function WG(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function F2(t){return(e,r)=>-t(-e,r)}function _1(t){const e=t(U2,q2),r=e.domain;let n=10,i,a;function o(){return i=WG(n),a=HG(n),r()[0]<0?(i=F2(i),a=F2(a),t(UG,qG)):t(U2,q2),e}return e.base=function(c){return arguments.length?(n=+c,o()):n},e.domain=function(c){return arguments.length?(r(c),o()):r()},e.ticks=c=>{const u=r();let d=u[0],p=u[u.length-1];const h=p<d;h&&([d,p]=[p,d]);let g=i(d),v=i(p),x,_;const b=c==null?10:+c;let k=[];if(!(n%1)&&v-g<b){if(g=Math.floor(g),v=Math.ceil(v),d>0){for(;g<=v;++g)for(x=1;x<n;++x)if(_=g<0?x/a(-g):x*a(g),!(_<d)){if(_>p)break;k.push(_)}}else for(;g<=v;++g)for(x=n-1;x>=1;--x)if(_=g>0?x/a(-g):x*a(g),!(_<d)){if(_>p)break;k.push(_)}k.length*2<b&&(k=xx(d,p,b))}else k=xx(g,v,Math.min(v-g,b)).map(a);return h?k.reverse():k},e.tickFormat=(c,u)=>{if(c==null&&(c=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=eu(u)).precision==null&&(u.trim=!0),u=w1(u)),c===1/0)return u;const d=Math.max(1,n*c/e.ticks().length);return p=>{let h=p/a(Math.round(i(p)));return h*n<n-.5&&(h*=n),h<=d?u(p):""}},e.nice=()=>r(kI(r(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),e}function EI(){const t=_1(pp()).domain([1,10]);return t.copy=()=>Lu(t,EI()).base(t.base()),Pn.apply(t,arguments),t}function H2(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function W2(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function S1(t){var e=1,r=t(H2(e),W2(e));return r.constant=function(n){return arguments.length?t(H2(e=+n),W2(e)):e},Ha(r)}function OI(){var t=S1(pp());return t.copy=function(){return Lu(t,OI()).constant(t.constant())},Pn.apply(t,arguments)}function G2(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function GG(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function KG(t){return t<0?-t*t:t*t}function k1(t){var e=t(Br,Br),r=1;function n(){return r===1?t(Br,Br):r===.5?t(GG,KG):t(G2(r),G2(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Ha(e)}function E1(){var t=k1(pp());return t.copy=function(){return Lu(t,E1()).exponent(t.exponent())},Pn.apply(t,arguments),t}function VG(){return E1.apply(null,arguments).exponent(.5)}function K2(t){return Math.sign(t)*t*t}function XG(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function AI(){var t=b1(),e=[0,1],r=!1,n;function i(a){var o=XG(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(K2(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,lh)).map(K2)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return AI(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Pn.apply(i,arguments),Ha(i)}function TI(){var t=[],e=[],r=[],n;function i(){var o=0,c=Math.max(1,e.length);for(r=new Array(c-1);++o<c;)r[o-1]=eG(t,o/c);return a}function a(o){return o==null||isNaN(o=+o)?n:e[$u(r,o)]}return a.invertExtent=function(o){var c=e.indexOf(o);return c<0?[NaN,NaN]:[c>0?r[c-1]:t[0],c<r.length?r[c]:t[t.length-1]]},a.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let c of o)c!=null&&!isNaN(c=+c)&&t.push(c);return t.sort(Ma),i()},a.range=function(o){return arguments.length?(e=Array.from(o),i()):e.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return TI().domain(t).range(e).unknown(n)},Pn.apply(a,arguments)}function CI(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[$u(n,u,0,r)]:a}function c(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*e-(u-r)*t)/(r+1);return o}return o.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,c()):[t,e]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,c()):i.slice()},o.invertExtent=function(u){var d=i.indexOf(u);return d<0?[NaN,NaN]:d<1?[t,n[0]]:d>=r?[n[r-1],e]:[n[d-1],n[d]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return CI().domain([t,e]).range(i).unknown(a)},Pn.apply(Ha(o),arguments)}function jI(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[$u(t,a,0,n)]:r}return i.domain=function(a){return arguments.length?(t=Array.from(a),n=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),n=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var o=e.indexOf(a);return[t[o-1],t[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return jI().domain(t).range(e).unknown(r)},Pn.apply(i,arguments)}const z0=new Date,B0=new Date;function sr(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const o=i(a),c=i.ceil(a);return a-o<c-a?o:c},i.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,c)=>{const u=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<o)||!(c>0))return u;let d;do u.push(d=new Date(+a)),e(a,c),t(a);while(d<a&&a<o);return u},i.filter=a=>sr(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;e(o,-1),!a(o););else for(;--c>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(z0.setTime(+a),B0.setTime(+o),t(z0),t(B0),Math.floor(r(z0,B0))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const fh=sr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);fh.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?sr(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):fh);fh.range;const qi=1e3,On=qi*60,Fi=On*60,Yi=Fi*24,O1=Yi*7,V2=Yi*30,U0=Yi*365,Eo=sr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qi)},(t,e)=>(e-t)/qi,t=>t.getUTCSeconds());Eo.range;const A1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qi)},(t,e)=>{t.setTime(+t+e*On)},(t,e)=>(e-t)/On,t=>t.getMinutes());A1.range;const T1=sr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*On)},(t,e)=>(e-t)/On,t=>t.getUTCMinutes());T1.range;const C1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qi-t.getMinutes()*On)},(t,e)=>{t.setTime(+t+e*Fi)},(t,e)=>(e-t)/Fi,t=>t.getHours());C1.range;const j1=sr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Fi)},(t,e)=>(e-t)/Fi,t=>t.getUTCHours());j1.range;const Du=sr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*On)/Yi,t=>t.getDate()-1);Du.range;const mp=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>t.getUTCDate()-1);mp.range;const PI=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>Math.floor(t/Yi));PI.range;function Bo(t){return sr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*On)/O1)}const gp=Bo(0),hh=Bo(1),YG=Bo(2),JG=Bo(3),Xs=Bo(4),ZG=Bo(5),QG=Bo(6);gp.range;hh.range;YG.range;JG.range;Xs.range;ZG.range;QG.range;function Uo(t){return sr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/O1)}const yp=Uo(0),ph=Uo(1),eK=Uo(2),tK=Uo(3),Ys=Uo(4),rK=Uo(5),nK=Uo(6);yp.range;ph.range;eK.range;tK.range;Ys.range;rK.range;nK.range;const P1=sr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());P1.range;const N1=sr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());N1.range;const Ji=sr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Ji.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Ji.range;const Zi=sr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Zi.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});Zi.range;function NI(t,e,r,n,i,a){const o=[[Eo,1,qi],[Eo,5,5*qi],[Eo,15,15*qi],[Eo,30,30*qi],[a,1,On],[a,5,5*On],[a,15,15*On],[a,30,30*On],[i,1,Fi],[i,3,3*Fi],[i,6,6*Fi],[i,12,12*Fi],[n,1,Yi],[n,2,2*Yi],[r,1,O1],[e,1,V2],[e,3,3*V2],[t,1,U0]];function c(d,p,h){const g=p<d;g&&([d,p]=[p,d]);const v=h&&typeof h.range=="function"?h:u(d,p,h),x=v?v.range(d,+p+1):[];return g?x.reverse():x}function u(d,p,h){const g=Math.abs(p-d)/h,v=p1(([,,b])=>b).right(o,g);if(v===o.length)return t.every(_x(d/U0,p/U0,h));if(v===0)return fh.every(Math.max(_x(d,p,h),1));const[x,_]=o[g/o[v-1][2]<o[v][2]/g?v-1:v];return x.every(_)}return[c,u]}const[iK,aK]=NI(Zi,N1,yp,PI,j1,T1),[oK,sK]=NI(Ji,P1,gp,Du,C1,A1);function q0(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function F0(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function pc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function lK(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,c=t.months,u=t.shortMonths,d=mc(i),p=gc(i),h=mc(a),g=gc(a),v=mc(o),x=gc(o),_=mc(c),b=gc(c),k=mc(u),E=gc(u),O={a:J,A:F,b:te,B:q,c:null,d:eC,e:eC,f:PK,g:UK,G:FK,H:TK,I:CK,j:jK,L:RI,m:NK,M:RK,p:z,q:L,Q:nC,s:iC,S:IK,u:$K,U:MK,V:LK,w:DK,W:zK,x:null,X:null,y:BK,Y:qK,Z:HK,"%":rC},A={a:Z,A:se,b:le,B:ve,c:null,d:tC,e:tC,f:VK,g:iV,G:oV,H:WK,I:GK,j:KK,L:$I,m:XK,M:YK,p:qe,q:xe,Q:nC,s:iC,S:JK,u:ZK,U:QK,V:eV,w:tV,W:rV,x:null,X:null,y:nV,Y:aV,Z:sV,"%":rC},T={a:Y,A:W,b:B,B:X,c:K,d:Z2,e:Z2,f:kK,g:J2,G:Y2,H:Q2,I:Q2,j:xK,L:SK,m:bK,M:wK,p:M,q:vK,Q:OK,s:AK,S:_K,u:hK,U:pK,V:mK,w:fK,W:gK,x:U,X:G,y:J2,Y:Y2,Z:yK,"%":EK};O.x=C(r,O),O.X=C(n,O),O.c=C(e,O),A.x=C(r,A),A.X=C(n,A),A.c=C(e,A);function C(ae,Se){return function(Me){var oe=[],et=-1,Fe=0,kt=ae.length,wt,Et,Sr;for(Me instanceof Date||(Me=new Date(+Me));++et<kt;)ae.charCodeAt(et)===37&&(oe.push(ae.slice(Fe,et)),(Et=X2[wt=ae.charAt(++et)])!=null?wt=ae.charAt(++et):Et=wt==="e"?" ":"0",(Sr=Se[wt])&&(wt=Sr(Me,Et)),oe.push(wt),Fe=et+1);return oe.push(ae.slice(Fe,et)),oe.join("")}}function j(ae,Se){return function(Me){var oe=pc(1900,void 0,1),et=R(oe,ae,Me+="",0),Fe,kt;if(et!=Me.length)return null;if("Q"in oe)return new Date(oe.Q);if("s"in oe)return new Date(oe.s*1e3+("L"in oe?oe.L:0));if(Se&&!("Z"in oe)&&(oe.Z=0),"p"in oe&&(oe.H=oe.H%12+oe.p*12),oe.m===void 0&&(oe.m="q"in oe?oe.q:0),"V"in oe){if(oe.V<1||oe.V>53)return null;"w"in oe||(oe.w=1),"Z"in oe?(Fe=F0(pc(oe.y,0,1)),kt=Fe.getUTCDay(),Fe=kt>4||kt===0?ph.ceil(Fe):ph(Fe),Fe=mp.offset(Fe,(oe.V-1)*7),oe.y=Fe.getUTCFullYear(),oe.m=Fe.getUTCMonth(),oe.d=Fe.getUTCDate()+(oe.w+6)%7):(Fe=q0(pc(oe.y,0,1)),kt=Fe.getDay(),Fe=kt>4||kt===0?hh.ceil(Fe):hh(Fe),Fe=Du.offset(Fe,(oe.V-1)*7),oe.y=Fe.getFullYear(),oe.m=Fe.getMonth(),oe.d=Fe.getDate()+(oe.w+6)%7)}else("W"in oe||"U"in oe)&&("w"in oe||(oe.w="u"in oe?oe.u%7:"W"in oe?1:0),kt="Z"in oe?F0(pc(oe.y,0,1)).getUTCDay():q0(pc(oe.y,0,1)).getDay(),oe.m=0,oe.d="W"in oe?(oe.w+6)%7+oe.W*7-(kt+5)%7:oe.w+oe.U*7-(kt+6)%7);return"Z"in oe?(oe.H+=oe.Z/100|0,oe.M+=oe.Z%100,F0(oe)):q0(oe)}}function R(ae,Se,Me,oe){for(var et=0,Fe=Se.length,kt=Me.length,wt,Et;et<Fe;){if(oe>=kt)return-1;if(wt=Se.charCodeAt(et++),wt===37){if(wt=Se.charAt(et++),Et=T[wt in X2?Se.charAt(et++):wt],!Et||(oe=Et(ae,Me,oe))<0)return-1}else if(wt!=Me.charCodeAt(oe++))return-1}return oe}function M(ae,Se,Me){var oe=d.exec(Se.slice(Me));return oe?(ae.p=p.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function Y(ae,Se,Me){var oe=v.exec(Se.slice(Me));return oe?(ae.w=x.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function W(ae,Se,Me){var oe=h.exec(Se.slice(Me));return oe?(ae.w=g.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function B(ae,Se,Me){var oe=k.exec(Se.slice(Me));return oe?(ae.m=E.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function X(ae,Se,Me){var oe=_.exec(Se.slice(Me));return oe?(ae.m=b.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function K(ae,Se,Me){return R(ae,e,Se,Me)}function U(ae,Se,Me){return R(ae,r,Se,Me)}function G(ae,Se,Me){return R(ae,n,Se,Me)}function J(ae){return o[ae.getDay()]}function F(ae){return a[ae.getDay()]}function te(ae){return u[ae.getMonth()]}function q(ae){return c[ae.getMonth()]}function z(ae){return i[+(ae.getHours()>=12)]}function L(ae){return 1+~~(ae.getMonth()/3)}function Z(ae){return o[ae.getUTCDay()]}function se(ae){return a[ae.getUTCDay()]}function le(ae){return u[ae.getUTCMonth()]}function ve(ae){return c[ae.getUTCMonth()]}function qe(ae){return i[+(ae.getUTCHours()>=12)]}function xe(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var Se=C(ae+="",O);return Se.toString=function(){return ae},Se},parse:function(ae){var Se=j(ae+="",!1);return Se.toString=function(){return ae},Se},utcFormat:function(ae){var Se=C(ae+="",A);return Se.toString=function(){return ae},Se},utcParse:function(ae){var Se=j(ae+="",!0);return Se.toString=function(){return ae},Se}}}var X2={"-":"",_:" ",0:"0"},gr=/^\s*\d+/,cK=/^%/,uK=/[\\^$*+?|[\]().{}]/g;function dt(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function dK(t){return t.replace(uK,"\\$&")}function mc(t){return new RegExp("^(?:"+t.map(dK).join("|")+")","i")}function gc(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function fK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function hK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function pK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function mK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function gK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Y2(t,e,r){var n=gr.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function J2(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function yK(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function vK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function bK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Z2(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function xK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Q2(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function wK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function _K(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function SK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function kK(t,e,r){var n=gr.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function EK(t,e,r){var n=cK.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function OK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function AK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function eC(t,e){return dt(t.getDate(),e,2)}function TK(t,e){return dt(t.getHours(),e,2)}function CK(t,e){return dt(t.getHours()%12||12,e,2)}function jK(t,e){return dt(1+Du.count(Ji(t),t),e,3)}function RI(t,e){return dt(t.getMilliseconds(),e,3)}function PK(t,e){return RI(t,e)+"000"}function NK(t,e){return dt(t.getMonth()+1,e,2)}function RK(t,e){return dt(t.getMinutes(),e,2)}function IK(t,e){return dt(t.getSeconds(),e,2)}function $K(t){var e=t.getDay();return e===0?7:e}function MK(t,e){return dt(gp.count(Ji(t)-1,t),e,2)}function II(t){var e=t.getDay();return e>=4||e===0?Xs(t):Xs.ceil(t)}function LK(t,e){return t=II(t),dt(Xs.count(Ji(t),t)+(Ji(t).getDay()===4),e,2)}function DK(t){return t.getDay()}function zK(t,e){return dt(hh.count(Ji(t)-1,t),e,2)}function BK(t,e){return dt(t.getFullYear()%100,e,2)}function UK(t,e){return t=II(t),dt(t.getFullYear()%100,e,2)}function qK(t,e){return dt(t.getFullYear()%1e4,e,4)}function FK(t,e){var r=t.getDay();return t=r>=4||r===0?Xs(t):Xs.ceil(t),dt(t.getFullYear()%1e4,e,4)}function HK(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+dt(e/60|0,"0",2)+dt(e%60,"0",2)}function tC(t,e){return dt(t.getUTCDate(),e,2)}function WK(t,e){return dt(t.getUTCHours(),e,2)}function GK(t,e){return dt(t.getUTCHours()%12||12,e,2)}function KK(t,e){return dt(1+mp.count(Zi(t),t),e,3)}function $I(t,e){return dt(t.getUTCMilliseconds(),e,3)}function VK(t,e){return $I(t,e)+"000"}function XK(t,e){return dt(t.getUTCMonth()+1,e,2)}function YK(t,e){return dt(t.getUTCMinutes(),e,2)}function JK(t,e){return dt(t.getUTCSeconds(),e,2)}function ZK(t){var e=t.getUTCDay();return e===0?7:e}function QK(t,e){return dt(yp.count(Zi(t)-1,t),e,2)}function MI(t){var e=t.getUTCDay();return e>=4||e===0?Ys(t):Ys.ceil(t)}function eV(t,e){return t=MI(t),dt(Ys.count(Zi(t),t)+(Zi(t).getUTCDay()===4),e,2)}function tV(t){return t.getUTCDay()}function rV(t,e){return dt(ph.count(Zi(t)-1,t),e,2)}function nV(t,e){return dt(t.getUTCFullYear()%100,e,2)}function iV(t,e){return t=MI(t),dt(t.getUTCFullYear()%100,e,2)}function aV(t,e){return dt(t.getUTCFullYear()%1e4,e,4)}function oV(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Ys(t):Ys.ceil(t),dt(t.getUTCFullYear()%1e4,e,4)}function sV(){return"+0000"}function rC(){return"%"}function nC(t){return+t}function iC(t){return Math.floor(+t/1e3)}var Ss,LI,DI;lV({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lV(t){return Ss=lK(t),LI=Ss.format,Ss.parse,DI=Ss.utcFormat,Ss.utcParse,Ss}function cV(t){return new Date(t)}function uV(t){return t instanceof Date?+t:+new Date(+t)}function R1(t,e,r,n,i,a,o,c,u,d){var p=b1(),h=p.invert,g=p.domain,v=d(".%L"),x=d(":%S"),_=d("%I:%M"),b=d("%I %p"),k=d("%a %d"),E=d("%b %d"),O=d("%B"),A=d("%Y");function T(C){return(u(C)<C?v:c(C)<C?x:o(C)<C?_:a(C)<C?b:n(C)<C?i(C)<C?k:E:r(C)<C?O:A)(C)}return p.invert=function(C){return new Date(h(C))},p.domain=function(C){return arguments.length?g(Array.from(C,uV)):g().map(cV)},p.ticks=function(C){var j=g();return t(j[0],j[j.length-1],C??10)},p.tickFormat=function(C,j){return j==null?T:d(j)},p.nice=function(C){var j=g();return(!C||typeof C.range!="function")&&(C=e(j[0],j[j.length-1],C??10)),C?g(kI(j,C)):p},p.copy=function(){return Lu(p,R1(t,e,r,n,i,a,o,c,u,d))},p}function dV(){return Pn.apply(R1(oK,sK,Ji,P1,gp,Du,C1,A1,Eo,LI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function fV(){return Pn.apply(R1(iK,aK,Zi,N1,yp,mp,j1,T1,Eo,DI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function vp(){var t=0,e=1,r,n,i,a,o=Br,c=!1,u;function d(h){return h==null||isNaN(h=+h)?u:o(i===0?.5:(h=(a(h)-r)*i,c?Math.max(0,Math.min(1,h)):h))}d.domain=function(h){return arguments.length?([t,e]=h,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),d):[t,e]},d.clamp=function(h){return arguments.length?(c=!!h,d):c},d.interpolator=function(h){return arguments.length?(o=h,d):o};function p(h){return function(g){var v,x;return arguments.length?([v,x]=g,o=h(v,x),d):[o(0),o(1)]}}return d.range=p(wl),d.rangeRound=p(v1),d.unknown=function(h){return arguments.length?(u=h,d):u},function(h){return a=h,r=h(t),n=h(e),i=r===n?0:1/(n-r),d}}function Wa(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function zI(){var t=Ha(vp()(Br));return t.copy=function(){return Wa(t,zI())},ia.apply(t,arguments)}function BI(){var t=_1(vp()).domain([1,10]);return t.copy=function(){return Wa(t,BI()).base(t.base())},ia.apply(t,arguments)}function UI(){var t=S1(vp());return t.copy=function(){return Wa(t,UI()).constant(t.constant())},ia.apply(t,arguments)}function I1(){var t=k1(vp());return t.copy=function(){return Wa(t,I1()).exponent(t.exponent())},ia.apply(t,arguments)}function hV(){return I1.apply(null,arguments).exponent(.5)}function qI(){var t=[],e=Br;function r(n){if(n!=null&&!isNaN(n=+n))return e(($u(t,n,1)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let i of n)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(Ma),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.range=function(){return t.map((n,i)=>e(i/(t.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>QW(t,a/n))},r.copy=function(){return qI(e).domain(t)},ia.apply(r,arguments)}function bp(){var t=0,e=.5,r=1,n=1,i,a,o,c,u,d=Br,p,h=!1,g;function v(_){return isNaN(_=+_)?g:(_=.5+((_=+p(_))-a)*(n*_<n*a?c:u),d(h?Math.max(0,Math.min(1,_)):_))}v.domain=function(_){return arguments.length?([t,e,r]=_,i=p(t=+t),a=p(e=+e),o=p(r=+r),c=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v):[t,e,r]},v.clamp=function(_){return arguments.length?(h=!!_,v):h},v.interpolator=function(_){return arguments.length?(d=_,v):d};function x(_){return function(b){var k,E,O;return arguments.length?([k,E,O]=b,d=EG(_,[k,E,O]),v):[d(0),d(.5),d(1)]}}return v.range=x(wl),v.rangeRound=x(v1),v.unknown=function(_){return arguments.length?(g=_,v):g},function(_){return p=_,i=_(t),a=_(e),o=_(r),c=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function FI(){var t=Ha(bp()(Br));return t.copy=function(){return Wa(t,FI())},ia.apply(t,arguments)}function HI(){var t=_1(bp()).domain([.1,1,10]);return t.copy=function(){return Wa(t,HI()).base(t.base())},ia.apply(t,arguments)}function WI(){var t=S1(bp());return t.copy=function(){return Wa(t,WI()).constant(t.constant())},ia.apply(t,arguments)}function $1(){var t=k1(bp());return t.copy=function(){return Wa(t,$1()).exponent(t.exponent())},ia.apply(t,arguments)}function pV(){return $1.apply(null,arguments).exponent(.5)}const aC=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Yc,scaleDiverging:FI,scaleDivergingLog:HI,scaleDivergingPow:$1,scaleDivergingSqrt:pV,scaleDivergingSymlog:WI,scaleIdentity:SI,scaleImplicit:Sx,scaleLinear:dh,scaleLog:EI,scaleOrdinal:m1,scalePoint:Nc,scalePow:E1,scaleQuantile:TI,scaleQuantize:CI,scaleRadial:AI,scaleSequential:zI,scaleSequentialLog:BI,scaleSequentialPow:I1,scaleSequentialQuantile:qI,scaleSequentialSqrt:hV,scaleSequentialSymlog:UI,scaleSqrt:VG,scaleSymlog:OI,scaleThreshold:jI,scaleTime:dV,scaleUtc:fV,tickFormat:_I},Symbol.toStringTag,{value:"Module"}));var H0,oC;function GI(){if(oC)return H0;oC=1;var t=yl();function e(r,n,i){for(var a=-1,o=r.length;++a<o;){var c=r[a],u=n(c);if(u!=null&&(d===void 0?u===u&&!t(u):i(u,d)))var d=u,p=c}return p}return H0=e,H0}var W0,sC;function mV(){if(sC)return W0;sC=1;function t(e,r){return e>r}return W0=t,W0}var G0,lC;function gV(){if(lC)return G0;lC=1;var t=GI(),e=mV(),r=bl();function n(i){return i&&i.length?t(i,r,e):void 0}return G0=n,G0}var yV=gV();const xp=vt(yV);var K0,cC;function vV(){if(cC)return K0;cC=1;function t(e,r){return e<r}return K0=t,K0}var V0,uC;function bV(){if(uC)return V0;uC=1;var t=GI(),e=vV(),r=bl();function n(i){return i&&i.length?t(i,r,e):void 0}return V0=n,V0}var xV=bV();const wp=vt(xV);var X0,dC;function wV(){if(dC)return X0;dC=1;var t=Jw(),e=Fa(),r=tI(),n=Zr();function i(a,o){var c=n(a)?t:r;return c(a,e(o,3))}return X0=i,X0}var Y0,fC;function _V(){if(fC)return Y0;fC=1;var t=QR(),e=wV();function r(n,i){return t(e(n,i),1)}return Y0=r,Y0}var SV=_V();const kV=vt(SV);var J0,hC;function EV(){if(hC)return J0;hC=1;var t=u1();function e(r,n){return t(r,n)}return J0=e,J0}var OV=EV();const _p=vt(OV);var _l=1e9,AV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},L1,It=!0,Cn="[DecimalError] ",jo=Cn+"Invalid argument: ",M1=Cn+"Exponent out of range: ",Sl=Math.floor,xo=Math.pow,TV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,un,mr=1e7,Pt=7,KI=9007199254740991,mh=Sl(KI/Pt),Te={};Te.absoluteValue=Te.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};Te.comparedTo=Te.cmp=function(t){var e,r,n,i,a=this;if(t=new a.constructor(t),a.s!==t.s)return a.s||-t.s;if(a.e!==t.e)return a.e>t.e^a.s<0?1:-1;for(n=a.d.length,i=t.d.length,e=0,r=n<i?n:i;e<r;++e)if(a.d[e]!==t.d[e])return a.d[e]>t.d[e]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};Te.decimalPlaces=Te.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*Pt;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};Te.dividedBy=Te.div=function(t){return Vi(this,new this.constructor(t))};Te.dividedToIntegerBy=Te.idiv=function(t){var e=this,r=e.constructor;return St(Vi(e,new r(t),0,1),r.precision)};Te.equals=Te.eq=function(t){return!this.cmp(t)};Te.exponent=function(){return er(this)};Te.greaterThan=Te.gt=function(t){return this.cmp(t)>0};Te.greaterThanOrEqualTo=Te.gte=function(t){return this.cmp(t)>=0};Te.isInteger=Te.isint=function(){return this.e>this.d.length-2};Te.isNegative=Te.isneg=function(){return this.s<0};Te.isPositive=Te.ispos=function(){return this.s>0};Te.isZero=function(){return this.s===0};Te.lessThan=Te.lt=function(t){return this.cmp(t)<0};Te.lessThanOrEqualTo=Te.lte=function(t){return this.cmp(t)<1};Te.logarithm=Te.log=function(t){var e,r=this,n=r.constructor,i=n.precision,a=i+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(un))throw Error(Cn+"NaN");if(r.s<1)throw Error(Cn+(r.s?"NaN":"-Infinity"));return r.eq(un)?new n(0):(It=!1,e=Vi(tu(r,a),tu(t,a),a),It=!0,St(e,i))};Te.minus=Te.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?YI(e,t):VI(e,(t.s=-t.s,t))};Te.modulo=Te.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(Cn+"NaN");return r.s?(It=!1,e=Vi(r,t,0,1).times(t),It=!0,r.minus(e)):St(new n(r),i)};Te.naturalExponential=Te.exp=function(){return XI(this)};Te.naturalLogarithm=Te.ln=function(){return tu(this)};Te.negated=Te.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Te.plus=Te.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?VI(e,t):YI(e,(t.s=-t.s,t))};Te.precision=Te.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(jo+t);if(e=er(i)+1,n=i.d.length-1,r=n*Pt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};Te.squareRoot=Te.sqrt=function(){var t,e,r,n,i,a,o,c=this,u=c.constructor;if(c.s<1){if(!c.s)return new u(0);throw Error(Cn+"NaN")}for(t=er(c),It=!1,i=Math.sqrt(+c),i==0||i==1/0?(e=wi(c.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Sl((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new u(e)):n=new u(i.toString()),r=u.precision,i=o=r+3;;)if(a=n,n=a.plus(Vi(c,a,o+2)).times(.5),wi(a.d).slice(0,o)===(e=wi(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(St(a,r+1,0),a.times(a).eq(c)){n=a;break}}else if(e!="9999")break;o+=4}return It=!0,St(n,r)};Te.times=Te.mul=function(t){var e,r,n,i,a,o,c,u,d,p=this,h=p.constructor,g=p.d,v=(t=new h(t)).d;if(!p.s||!t.s)return new h(0);for(t.s*=p.s,r=p.e+t.e,u=g.length,d=v.length,u<d&&(a=g,g=v,v=a,o=u,u=d,d=o),a=[],o=u+d,n=o;n--;)a.push(0);for(n=d;--n>=0;){for(e=0,i=u+n;i>n;)c=a[i]+v[n]*g[i-n-1]+e,a[i--]=c%mr|0,e=c/mr|0;a[i]=(a[i]+e)%mr|0}for(;!a[--o];)a.pop();return e?++r:a.shift(),t.d=a,t.e=r,It?St(t,h.precision):t};Te.toDecimalPlaces=Te.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ki(t,0,_l),e===void 0?e=n.rounding:ki(e,0,8),St(r,t+er(r)+1,e))};Te.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Io(n,!0):(ki(t,0,_l),e===void 0?e=i.rounding:ki(e,0,8),n=St(new i(n),t+1,e),r=Io(n,!0,t+1)),r};Te.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?Io(i):(ki(t,0,_l),e===void 0?e=a.rounding:ki(e,0,8),n=St(new a(i),t+er(i)+1,e),r=Io(n.abs(),!1,t+er(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Te.toInteger=Te.toint=function(){var t=this,e=t.constructor;return St(new e(t),er(t)+1,e.rounding)};Te.toNumber=function(){return+this};Te.toPower=Te.pow=function(t){var e,r,n,i,a,o,c=this,u=c.constructor,d=12,p=+(t=new u(t));if(!t.s)return new u(un);if(c=new u(c),!c.s){if(t.s<1)throw Error(Cn+"Infinity");return c}if(c.eq(un))return c;if(n=u.precision,t.eq(un))return St(c,n);if(e=t.e,r=t.d.length-1,o=e>=r,a=c.s,o){if((r=p<0?-p:p)<=KI){for(i=new u(un),e=Math.ceil(n/Pt+4),It=!1;r%2&&(i=i.times(c),mC(i.d,e)),r=Sl(r/2),r!==0;)c=c.times(c),mC(c.d,e);return It=!0,t.s<0?new u(un).div(i):St(i,n)}}else if(a<0)throw Error(Cn+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,c.s=1,It=!1,i=t.times(tu(c,n+d)),It=!0,i=XI(i),i.s=a,i};Te.toPrecision=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?(r=er(i),n=Io(i,r<=a.toExpNeg||r>=a.toExpPos)):(ki(t,1,_l),e===void 0?e=a.rounding:ki(e,0,8),i=St(new a(i),t,e),r=er(i),n=Io(i,t<=r||r<=a.toExpNeg,t)),n};Te.toSignificantDigits=Te.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ki(t,1,_l),e===void 0?e=n.rounding:ki(e,0,8)),St(new n(r),t,e)};Te.toString=Te.valueOf=Te.val=Te.toJSON=Te[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=er(t),r=t.constructor;return Io(t,e<=r.toExpNeg||e>=r.toExpPos)};function VI(t,e){var r,n,i,a,o,c,u,d,p=t.constructor,h=p.precision;if(!t.s||!e.s)return e.s||(e=new p(t)),It?St(e,h):e;if(u=t.d,d=e.d,o=t.e,i=e.e,u=u.slice(),a=o-i,a){for(a<0?(n=u,a=-a,c=d.length):(n=d,i=o,c=u.length),o=Math.ceil(h/Pt),c=o>c?o+1:c+1,a>c&&(a=c,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(c=u.length,a=d.length,c-a<0&&(a=c,n=d,d=u,u=n),r=0;a;)r=(u[--a]=u[a]+d[a]+r)/mr|0,u[a]%=mr;for(r&&(u.unshift(r),++i),c=u.length;u[--c]==0;)u.pop();return e.d=u,e.e=i,It?St(e,h):e}function ki(t,e,r){if(t!==~~t||t<e||t>r)throw Error(jo+t)}function wi(t){var e,r,n,i=t.length-1,a="",o=t[0];if(i>0){for(a+=o,e=1;e<i;e++)n=t[e]+"",r=Pt-n.length,r&&(a+=Ca(r)),a+=n;o=t[e],n=o+"",r=Pt-n.length,r&&(a+=Ca(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Vi=(function(){function t(n,i){var a,o=0,c=n.length;for(n=n.slice();c--;)a=n[c]*i+o,n[c]=a%mr|0,o=a/mr|0;return o&&n.unshift(o),n}function e(n,i,a,o){var c,u;if(a!=o)u=a>o?1:-1;else for(c=u=0;c<a;c++)if(n[c]!=i[c]){u=n[c]>i[c]?1:-1;break}return u}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*mr+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var c,u,d,p,h,g,v,x,_,b,k,E,O,A,T,C,j,R,M=n.constructor,Y=n.s==i.s?1:-1,W=n.d,B=i.d;if(!n.s)return new M(n);if(!i.s)throw Error(Cn+"Division by zero");for(u=n.e-i.e,j=B.length,T=W.length,v=new M(Y),x=v.d=[],d=0;B[d]==(W[d]||0);)++d;if(B[d]>(W[d]||0)&&--u,a==null?E=a=M.precision:o?E=a+(er(n)-er(i))+1:E=a,E<0)return new M(0);if(E=E/Pt+2|0,d=0,j==1)for(p=0,B=B[0],E++;(d<T||p)&&E--;d++)O=p*mr+(W[d]||0),x[d]=O/B|0,p=O%B|0;else{for(p=mr/(B[0]+1)|0,p>1&&(B=t(B,p),W=t(W,p),j=B.length,T=W.length),A=j,_=W.slice(0,j),b=_.length;b<j;)_[b++]=0;R=B.slice(),R.unshift(0),C=B[0],B[1]>=mr/2&&++C;do p=0,c=e(B,_,j,b),c<0?(k=_[0],j!=b&&(k=k*mr+(_[1]||0)),p=k/C|0,p>1?(p>=mr&&(p=mr-1),h=t(B,p),g=h.length,b=_.length,c=e(h,_,g,b),c==1&&(p--,r(h,j<g?R:B,g))):(p==0&&(c=p=1),h=B.slice()),g=h.length,g<b&&h.unshift(0),r(_,h,b),c==-1&&(b=_.length,c=e(B,_,j,b),c<1&&(p++,r(_,j<b?R:B,b))),b=_.length):c===0&&(p++,_=[0]),x[d++]=p,c&&_[0]?_[b++]=W[A]||0:(_=[W[A]],b=1);while((A++<T||_[0]!==void 0)&&E--)}return x[0]||x.shift(),v.e=u,St(v,o?a+er(v)+1:a)}})();function XI(t,e){var r,n,i,a,o,c,u=0,d=0,p=t.constructor,h=p.precision;if(er(t)>16)throw Error(M1+er(t));if(!t.s)return new p(un);for(It=!1,c=h,o=new p(.03125);t.abs().gte(.1);)t=t.times(o),d+=5;for(n=Math.log(xo(2,d))/Math.LN10*2+5|0,c+=n,r=i=a=new p(un),p.precision=c;;){if(i=St(i.times(t),c),r=r.times(++u),o=a.plus(Vi(i,r,c)),wi(o.d).slice(0,c)===wi(a.d).slice(0,c)){for(;d--;)a=St(a.times(a),c);return p.precision=h,e==null?(It=!0,St(a,h)):a}a=o}}function er(t){for(var e=t.e*Pt,r=t.d[0];r>=10;r/=10)e++;return e}function Z0(t,e,r){if(e>t.LN10.sd())throw It=!0,r&&(t.precision=r),Error(Cn+"LN10 precision limit exceeded");return St(new t(t.LN10),e)}function Ca(t){for(var e="";t--;)e+="0";return e}function tu(t,e){var r,n,i,a,o,c,u,d,p,h=1,g=10,v=t,x=v.d,_=v.constructor,b=_.precision;if(v.s<1)throw Error(Cn+(v.s?"NaN":"-Infinity"));if(v.eq(un))return new _(0);if(e==null?(It=!1,d=b):d=e,v.eq(10))return e==null&&(It=!0),Z0(_,d);if(d+=g,_.precision=d,r=wi(x),n=r.charAt(0),a=er(v),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(t),r=wi(v.d),n=r.charAt(0),h++;a=er(v),n>1?(v=new _("0."+r),a++):v=new _(n+"."+r.slice(1))}else return u=Z0(_,d+2,b).times(a+""),v=tu(new _(n+"."+r.slice(1)),d-g).plus(u),_.precision=b,e==null?(It=!0,St(v,b)):v;for(c=o=v=Vi(v.minus(un),v.plus(un),d),p=St(v.times(v),d),i=3;;){if(o=St(o.times(p),d),u=c.plus(Vi(o,new _(i),d)),wi(u.d).slice(0,d)===wi(c.d).slice(0,d))return c=c.times(2),a!==0&&(c=c.plus(Z0(_,d+2,b).times(a+""))),c=Vi(c,new _(h),d),_.precision=b,e==null?(It=!0,St(c,b)):c;c=u,i+=2}}function pC(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(n,i),e){if(i-=n,r=r-n-1,t.e=Sl(r/Pt),t.d=[],n=(r+1)%Pt,r<0&&(n+=Pt),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=Pt;n<i;)t.d.push(+e.slice(n,n+=Pt));e=e.slice(n),n=Pt-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),It&&(t.e>mh||t.e<-mh))throw Error(M1+r)}else t.s=0,t.e=0,t.d=[0];return t}function St(t,e,r){var n,i,a,o,c,u,d,p,h=t.d;for(o=1,a=h[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=Pt,i=e,d=h[p=0];else{if(p=Math.ceil((n+1)/Pt),a=h.length,p>=a)return t;for(d=a=h[p],o=1;a>=10;a/=10)o++;n%=Pt,i=n-Pt+o}if(r!==void 0&&(a=xo(10,o-i-1),c=d/a%10|0,u=e<0||h[p+1]!==void 0||d%a,u=r<4?(c||u)&&(r==0||r==(t.s<0?3:2)):c>5||c==5&&(r==4||u||r==6&&(n>0?i>0?d/xo(10,o-i):0:h[p-1])%10&1||r==(t.s<0?8:7))),e<1||!h[0])return u?(a=er(t),h.length=1,e=e-a-1,h[0]=xo(10,(Pt-e%Pt)%Pt),t.e=Sl(-e/Pt)||0):(h.length=1,h[0]=t.e=t.s=0),t;if(n==0?(h.length=p,a=1,p--):(h.length=p+1,a=xo(10,Pt-n),h[p]=i>0?(d/xo(10,o-i)%xo(10,i)|0)*a:0),u)for(;;)if(p==0){(h[0]+=a)==mr&&(h[0]=1,++t.e);break}else{if(h[p]+=a,h[p]!=mr)break;h[p--]=0,a=1}for(n=h.length;h[--n]===0;)h.pop();if(It&&(t.e>mh||t.e<-mh))throw Error(M1+er(t));return t}function YI(t,e){var r,n,i,a,o,c,u,d,p,h,g=t.constructor,v=g.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new g(t),It?St(e,v):e;if(u=t.d,h=e.d,n=e.e,d=t.e,u=u.slice(),o=d-n,o){for(p=o<0,p?(r=u,o=-o,c=h.length):(r=h,n=d,c=u.length),i=Math.max(Math.ceil(v/Pt),c)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=u.length,c=h.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(u[i]!=h[i]){p=u[i]<h[i];break}o=0}for(p&&(r=u,u=h,h=r,e.s=-e.s),c=u.length,i=h.length-c;i>0;--i)u[c++]=0;for(i=h.length;i>o;){if(u[--i]<h[i]){for(a=i;a&&u[--a]===0;)u[a]=mr-1;--u[a],u[i]+=mr}u[i]-=h[i]}for(;u[--c]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=n,It?St(e,v):e):new g(0)}function Io(t,e,r){var n,i=er(t),a=wi(t.d),o=a.length;return e?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ca(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ca(-i-1)+a,r&&(n=r-o)>0&&(a+=Ca(n))):i>=o?(a+=Ca(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Ca(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Ca(n))),t.s<0?"-"+a:a}function mC(t,e){if(t.length>e)return t.length=e,!0}function JI(t){var e,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(jo+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return pC(o,a.toString())}else if(typeof a!="string")throw Error(jo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,TV.test(a))pC(o,a);else throw Error(jo+a)}if(i.prototype=Te,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=JI,i.config=i.set=CV,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function CV(t){if(!t||typeof t!="object")throw Error(Cn+"Object expected");var e,r,n,i=["precision",1,_l,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((n=t[r=i[e]])!==void 0)if(Sl(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(jo+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(jo+r+": "+n);return this}var L1=JI(AV);un=new L1(1);const xt=L1;function jV(t){return IV(t)||RV(t)||NV(t)||PV()}function PV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
454
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NV(t,e){if(t){if(typeof t=="string")return Ax(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ax(t,e)}}function RV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function IV(t){if(Array.isArray(t))return Ax(t)}function Ax(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var $V=function(e){return e},ZI={},QI=function(e){return e===ZI},gC=function(e){return function r(){return arguments.length===0||arguments.length===1&&QI(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},MV=function t(e,r){return e===1?r:gC(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.filter(function(c){return c!==ZI}).length;return o>=e?r.apply(void 0,i):t(e-o,gC(function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];var p=i.map(function(h){return QI(h)?u.shift():h});return r.apply(void 0,jV(p).concat(u))}))})},Sp=function(e){return MV(e.length,e)},Tx=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},LV=Sp(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),DV=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return $V;var i=r.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(c,u){return u(c)},a.apply(void 0,arguments))}},Cx=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},e$=function(e){var r=null,n=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return r&&a.every(function(c,u){return c===r[u]})||(r=a,n=e.apply(void 0,a)),n}};function zV(t){var e;return t===0?e=1:e=Math.floor(new xt(t).abs().log(10).toNumber())+1,e}function BV(t,e,r){for(var n=new xt(t),i=0,a=[];n.lt(e)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var UV=Sp(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),qV=Sp(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),FV=Sp(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const kp={rangeStep:BV,getDigitCount:zV,interpolateNumber:UV,uninterpolateNumber:qV,uninterpolateTruncation:FV};function jx(t){return GV(t)||WV(t)||t$(t)||HV()}function HV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
455
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function GV(t){if(Array.isArray(t))return Px(t)}function ru(t,e){return XV(t)||VV(t,e)||t$(t,e)||KV()}function KV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
456
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t$(t,e){if(t){if(typeof t=="string")return Px(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Px(t,e)}}function Px(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function VV(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),c;!(n=(c=o.next()).done)&&(r.push(c.value),!(e&&r.length===e));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function XV(t){if(Array.isArray(t))return t}function r$(t){var e=ru(t,2),r=e[0],n=e[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function n$(t,e,r){if(t.lte(0))return new xt(0);var n=kp.getDigitCount(t.toNumber()),i=new xt(10).pow(n),a=t.div(i),o=n!==1?.05:.1,c=new xt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),u=c.mul(i);return e?u:new xt(Math.ceil(u))}function YV(t,e,r){var n=1,i=new xt(t);if(!i.isint()&&r){var a=Math.abs(t);a<1?(n=new xt(10).pow(kp.getDigitCount(t)-1),i=new xt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new xt(Math.floor(t)))}else t===0?i=new xt(Math.floor((e-1)/2)):r||(i=new xt(Math.floor(t)));var o=Math.floor((e-1)/2),c=DV(LV(function(u){return i.add(new xt(u-o).mul(n)).toNumber()}),Tx);return c(0,e)}function i$(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(r-1)))return{step:new xt(0),tickMin:new xt(0),tickMax:new xt(0)};var a=n$(new xt(e).sub(t).div(r-1),n,i),o;t<=0&&e>=0?o=new xt(0):(o=new xt(t).add(e).div(2),o=o.sub(new xt(o).mod(a)));var c=Math.ceil(o.sub(t).div(a).toNumber()),u=Math.ceil(new xt(e).sub(o).div(a).toNumber()),d=c+u+1;return d>r?i$(t,e,r,n,i+1):(d<r&&(u=e>0?u+(r-d):u,c=e>0?c:c+(r-d)),{step:a,tickMin:o.sub(new xt(c).mul(a)),tickMax:o.add(new xt(u).mul(a))})}function JV(t){var e=ru(t,2),r=e[0],n=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),c=r$([r,n]),u=ru(c,2),d=u[0],p=u[1];if(d===-1/0||p===1/0){var h=p===1/0?[d].concat(jx(Tx(0,i-1).map(function(){return 1/0}))):[].concat(jx(Tx(0,i-1).map(function(){return-1/0})),[p]);return r>n?Cx(h):h}if(d===p)return YV(d,i,a);var g=i$(d,p,o,a),v=g.step,x=g.tickMin,_=g.tickMax,b=kp.rangeStep(x,_.add(new xt(.1).mul(v)),v);return r>n?Cx(b):b}function ZV(t,e){var r=ru(t,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=r$([n,i]),c=ru(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0)return[n,i];if(u===d)return[u];var p=Math.max(e,2),h=n$(new xt(d).sub(u).div(p-1),a,0),g=[].concat(jx(kp.rangeStep(new xt(u),new xt(d).sub(new xt(.99).mul(h)),h)),[d]);return n>i?Cx(g):g}var QV=e$(JV),eX=e$(ZV),tX="Invariant failed";function $o(t,e){throw new Error(tX)}var rX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Js(t){"@babel/helpers - typeof";return Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(t)}function gh(){return gh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gh.apply(this,arguments)}function nX(t,e){return sX(t)||oX(t,e)||aX(t,e)||iX()}function iX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
457
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aX(t,e){if(t){if(typeof t=="string")return yC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yC(t,e)}}function yC(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oX(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function sX(t){if(Array.isArray(t))return t}function lX(t,e){if(t==null)return{};var r=cX(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function cX(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function uX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dX(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s$(n.key),n)}}function fX(t,e,r){return e&&dX(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function hX(t,e,r){return e=yh(e),pX(t,a$()?Reflect.construct(e,r||[],yh(t).constructor):e.apply(t,r))}function pX(t,e){if(e&&(Js(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mX(t)}function mX(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(a$=function(){return!!t})()}function yh(t){return yh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yh(t)}function gX(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nx(t,e)}function Nx(t,e){return Nx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Nx(t,e)}function o$(t,e,r){return e=s$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s$(t){var e=yX(t,"string");return Js(e)=="symbol"?e:e+""}function yX(t,e){if(Js(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Js(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var zu=(function(t){function e(){return uX(this,e),hX(this,e,arguments)}return gX(e,t),fX(e,[{key:"render",value:function(){var n=this.props,i=n.offset,a=n.layout,o=n.width,c=n.dataKey,u=n.data,d=n.dataPointFormatter,p=n.xAxis,h=n.yAxis,g=lX(n,rX),v=it(g,!1);this.props.direction==="x"&&p.type!=="number"&&$o();var x=u.map(function(_){var b=d(_,c),k=b.x,E=b.y,O=b.value,A=b.errorVal;if(!A)return null;var T=[],C,j;if(Array.isArray(A)){var R=nX(A,2);C=R[0],j=R[1]}else C=j=A;if(a==="vertical"){var M=p.scale,Y=E+i,W=Y+o,B=Y-o,X=M(O-C),K=M(O+j);T.push({x1:K,y1:W,x2:K,y2:B}),T.push({x1:X,y1:Y,x2:K,y2:Y}),T.push({x1:X,y1:W,x2:X,y2:B})}else if(a==="horizontal"){var U=h.scale,G=k+i,J=G-o,F=G+o,te=U(O-C),q=U(O+j);T.push({x1:J,y1:q,x2:F,y2:q}),T.push({x1:G,y1:te,x2:G,y2:q}),T.push({x1:J,y1:te,x2:F,y2:te})}return I.createElement(Xt,gh({className:"recharts-errorBar",key:"bar-".concat(T.map(function(z){return"".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))},v),T.map(function(z){return I.createElement("line",gh({},z,{key:"line-".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))}))});return I.createElement(Xt,{className:"recharts-errorBars"},x)}}])})(I.Component);o$(zu,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});o$(zu,"displayName","ErrorBar");function nu(t){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nu(t)}function vC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vC(Object(r),!0).forEach(function(n){vX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vX(t,e,r){return e=bX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bX(t){var e=xX(t,"string");return nu(e)=="symbol"?e:e+""}function xX(t,e){if(nu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(nu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var l$=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,o=sn(r,zs);if(!o)return null;var c=zs.defaultProps,u=c!==void 0?yo(yo({},c),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:a==="children"?d=(n||[]).reduce(function(p,h){var g=h.item,v=h.props,x=v.sectors||v.data||[];return p.concat(x.map(function(_){return{type:o.props.iconType||g.props.legendType,value:_.name,color:_.fill,payload:_}}))},[]):d=(n||[]).map(function(p){var h=p.item,g=h.type.defaultProps,v=g!==void 0?yo(yo({},g),h.props):{},x=v.dataKey,_=v.name,b=v.legendType,k=v.hide;return{inactive:k,dataKey:x,type:u.iconType||b||"square",color:D1(h),value:_||x,payload:v}}),yo(yo(yo({},u),zs.getWithHeight(o,i)),{},{payload:d,item:o})};function iu(t){"@babel/helpers - typeof";return iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iu(t)}function bC(t){return kX(t)||SX(t)||_X(t)||wX()}function wX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
458
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _X(t,e){if(t){if(typeof t=="string")return Rx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rx(t,e)}}function SX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kX(t){if(Array.isArray(t))return Rx(t)}function Rx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ht(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xC(Object(r),!0).forEach(function(n){Us(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Us(t,e,r){return e=EX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EX(t){var e=OX(t,"string");return iu(e)=="symbol"?e:e+""}function OX(t,e){if(iu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(iu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dn(t,e,r){return Qe(t)||Qe(e)?r:or(e)?An(t,e,r):Ye(e)?e(t):r}function Rc(t,e,r,n){var i=kV(t,function(c){return dn(c,e)});if(r==="number"){var a=i.filter(function(c){return ge(c)||parseFloat(c)});return a.length?[wp(a),xp(a)]:[1/0,-1/0]}var o=n?i.filter(function(c){return!Qe(c)}):i;return o.map(function(c){return or(c)||c instanceof Date?c:""})}var AX=function(e){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,c=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(c<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var u=a.range,d=0;d<c;d++){var p=d>0?i[d-1].coordinate:i[c-1].coordinate,h=i[d].coordinate,g=d>=c-1?i[0].coordinate:i[d+1].coordinate,v=void 0;if(Jn(h-p)!==Jn(g-h)){var x=[];if(Jn(g-h)===Jn(u[1]-u[0])){v=g;var _=h+u[1]-u[0];x[0]=Math.min(_,(_+p)/2),x[1]=Math.max(_,(_+p)/2)}else{v=p;var b=g+u[1]-u[0];x[0]=Math.min(h,(b+h)/2),x[1]=Math.max(h,(b+h)/2)}var k=[Math.min(h,(v+h)/2),Math.max(h,(v+h)/2)];if(e>k[0]&&e<=k[1]||e>=x[0]&&e<=x[1]){o=i[d].index;break}}else{var E=Math.min(p,g),O=Math.max(p,g);if(e>(E+h)/2&&e<=(O+h)/2){o=i[d].index;break}}}else for(var A=0;A<c;A++)if(A===0&&e<=(n[A].coordinate+n[A+1].coordinate)/2||A>0&&A<c-1&&e>(n[A].coordinate+n[A-1].coordinate)/2&&e<=(n[A].coordinate+n[A+1].coordinate)/2||A===c-1&&e>(n[A].coordinate+n[A-1].coordinate)/2){o=n[A].index;break}return o},D1=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Ht(Ht({},e.type.defaultProps),e.props):e.props,o=a.stroke,c=a.fill,u;switch(i){case"Line":u=o;break;case"Area":case"Radar":u=o&&o!=="none"?o:c;break;default:u=c;break}return u},TX=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},c=Object.keys(a),u=0,d=c.length;u<d;u++)for(var p=a[c[u]].stackGroups,h=Object.keys(p),g=0,v=h.length;g<v;g++){var x=p[h[g]],_=x.items,b=x.cateAxisId,k=_.filter(function(j){return Gi(j.type).indexOf("Bar")>=0});if(k&&k.length){var E=k[0].type.defaultProps,O=E!==void 0?Ht(Ht({},E),k[0].props):k[0].props,A=O.barSize,T=O[b];o[T]||(o[T]=[]);var C=Qe(A)?r:A;o[T].push({item:k[0],stackList:k.slice(1),barSize:Qe(C)?void 0:Ro(C,n,0)})}}return o},CX=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,c=e.maxBarSize,u=o.length;if(u<1)return null;var d=Ro(r,i,0,!0),p,h=[];if(o[0].barSize===+o[0].barSize){var g=!1,v=i/u,x=o.reduce(function(A,T){return A+T.barSize||0},0);x+=(u-1)*d,x>=i&&(x-=(u-1)*d,d=0),x>=i&&v>0&&(g=!0,v*=.9,x=u*v);var _=(i-x)/2>>0,b={offset:_-d,size:0};p=o.reduce(function(A,T){var C={item:T.item,position:{offset:b.offset+b.size+d,size:g?v:T.barSize}},j=[].concat(bC(A),[C]);return b=j[j.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(R){j.push({item:R,position:b})}),j},h)}else{var k=Ro(n,i,0,!0);i-2*k-(u-1)*d<=0&&(d=0);var E=(i-2*k-(u-1)*d)/u;E>1&&(E>>=0);var O=c===+c?Math.min(E,c):E;p=o.reduce(function(A,T,C){var j=[].concat(bC(A),[{item:T.item,position:{offset:k+(E+d)*C+(E-O)/2,size:O}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(R){j.push({item:R,position:j[j.length-1].position})}),j},h)}return p},jX=function(e,r,n,i){var a=n.children,o=n.width,c=n.margin,u=o-(c.left||0)-(c.right||0),d=l$({children:a,legendWidth:u});if(d){var p=i||{},h=p.width,g=p.height,v=d.align,x=d.verticalAlign,_=d.layout;if((_==="vertical"||_==="horizontal"&&x==="middle")&&v!=="center"&&ge(e[v]))return Ht(Ht({},e),{},Us({},v,e[v]+(h||0)));if((_==="horizontal"||_==="vertical"&&v==="center")&&x!=="middle"&&ge(e[x]))return Ht(Ht({},e),{},Us({},x,e[x]+(g||0)))}return e},PX=function(e,r,n){return Qe(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},c$=function(e,r,n,i,a){var o=r.props.children,c=Tn(o,zu).filter(function(d){return PX(i,a,d.props.direction)});if(c&&c.length){var u=c.map(function(d){return d.props.dataKey});return e.reduce(function(d,p){var h=dn(p,n);if(Qe(h))return d;var g=Array.isArray(h)?[wp(h),xp(h)]:[h,h],v=u.reduce(function(x,_){var b=dn(p,_,0),k=g[0]-Math.abs(Array.isArray(b)?b[0]:b),E=g[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(k,x[0]),Math.max(E,x[1])]},[1/0,-1/0]);return[Math.min(v[0],d[0]),Math.max(v[1],d[1])]},[1/0,-1/0])}return null},NX=function(e,r,n,i,a){var o=r.map(function(c){return c$(e,c,n,a,i)}).filter(function(c){return!Qe(c)});return o&&o.length?o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]):null},u$=function(e,r,n,i,a){var o=r.map(function(u){var d=u.props.dataKey;return n==="number"&&d&&c$(e,u,d,i)||Rc(e,d,n,a)});if(n==="number")return o.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);var c={};return o.reduce(function(u,d){for(var p=0,h=d.length;p<h;p++)c[d[p]]||(c[d[p]]=!0,u.push(d[p]));return u},[])},d$=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},f$=function(e,r,n,i){if(i)return e.map(function(u){return u.coordinate});var a,o,c=e.map(function(u){return u.coordinate===r&&(a=!0),u.coordinate===n&&(o=!0),u.coordinate});return a||c.push(r),o||c.push(n),c},Hi=function(e,r,n){if(!e)return null;var i=e.scale,a=e.duplicateDomain,o=e.type,c=e.range,u=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,d=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/u:0;if(d=e.axisType==="angleAxis"&&(c==null?void 0:c.length)>=2?Jn(c[0]-c[1])*2*d:d,r&&(e.ticks||e.niceTicks)){var p=(e.ticks||e.niceTicks).map(function(h){var g=a?a.indexOf(h):h;return{coordinate:i(g)+d,value:h,offset:d}});return p.filter(function(h){return!Nu(h.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(h,g){return{coordinate:i(h)+d,value:h,index:g,offset:d}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(h){return{coordinate:i(h)+d,value:h,offset:d}}):i.domain().map(function(h,g){return{coordinate:i(h)+d,value:a?a[h]:h,index:g,offset:d}})},Q0=new WeakMap,yf=function(e,r){if(typeof r!="function")return e;Q0.has(e)||Q0.set(e,new WeakMap);var n=Q0.get(e);if(n.has(r))return n.get(r);var i=function(){e.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},RX=function(e,r,n){var i=e.scale,a=e.type,o=e.layout,c=e.axisType;if(i==="auto")return o==="radial"&&c==="radiusAxis"?{scale:Yc(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:dh(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Nc(),realScaleType:"point"}:a==="category"?{scale:Yc(),realScaleType:"band"}:{scale:dh(),realScaleType:"linear"};if(No(i)){var u="scale".concat(sp(i));return{scale:(aC[u]||Nc)(),realScaleType:aC[u]?u:"point"}}return Ye(i)?{scale:i}:{scale:Nc(),realScaleType:"point"}},wC=1e-4,IX=function(e){var r=e.domain();if(!(!r||r.length<=2)){var n=r.length,i=e.range(),a=Math.min(i[0],i[1])-wC,o=Math.max(i[0],i[1])+wC,c=e(r[0]),u=e(r[n-1]);(c<a||c>o||u<a||u>o)&&e.domain([r[0],r[n-1]])}},$X=function(e,r){if(!e)return null;for(var n=0,i=e.length;n<i;n++)if(e[n].item===r)return e[n].position;return null},MX=function(e,r){if(!r||r.length!==2||!ge(r[0])||!ge(r[1]))return e;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a=[e[0],e[1]];return(!ge(e[0])||e[0]<n)&&(a[0]=n),(!ge(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},LX=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var a=0,o=0,c=0;c<r;++c){var u=Nu(e[c][n][1])?e[c][n][0]:e[c][n][1];u>=0?(e[c][n][0]=a,e[c][n][1]=a+u,a=e[c][n][1]):(e[c][n][0]=o,e[c][n][1]=o+u,o=e[c][n][1])}},DX=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var a=0,o=0;o<r;++o){var c=Nu(e[o][n][1])?e[o][n][0]:e[o][n][1];c>=0?(e[o][n][0]=a,e[o][n][1]=a+c,a=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},zX={sign:LX,expand:_F,none:Fs,silhouette:SF,wiggle:kF,positive:DX},BX=function(e,r,n){var i=r.map(function(c){return c.props.dataKey}),a=zX[n],o=wF().keys(i).value(function(c,u){return+dn(c,u,0)}).order(cx).offset(a);return o(e)},UX=function(e,r,n,i,a,o){if(!e)return null;var c=o?r.reverse():r,u={},d=c.reduce(function(h,g){var v,x=(v=g.type)!==null&&v!==void 0&&v.defaultProps?Ht(Ht({},g.type.defaultProps),g.props):g.props,_=x.stackId,b=x.hide;if(b)return h;var k=x[n],E=h[k]||{hasStack:!1,stackGroups:{}};if(or(_)){var O=E.stackGroups[_]||{numericAxisId:n,cateAxisId:i,items:[]};O.items.push(g),E.hasStack=!0,E.stackGroups[_]=O}else E.stackGroups[Ru("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[g]};return Ht(Ht({},h),{},Us({},k,E))},u),p={};return Object.keys(d).reduce(function(h,g){var v=d[g];if(v.hasStack){var x={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(_,b){var k=v.stackGroups[b];return Ht(Ht({},_),{},Us({},b,{numericAxisId:n,cateAxisId:i,items:k.items,stackedData:BX(e,k.items,a)}))},x)}return Ht(Ht({},h),{},Us({},g,v))},p)},qX=function(e,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,c=r.allowDecimals,u=n||r.scale;if(u!=="auto"&&u!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=e.domain();if(!d.length)return null;var p=QV(d,a,c);return e.domain([wp(p),xp(p)]),{niceTicks:p}}if(a&&i==="number"){var h=e.domain(),g=eX(h,a,c);return{niceTicks:g}}return null};function _C(t){var e=t.axis,r=t.ticks,n=t.bandSize,i=t.entry,a=t.index,o=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Qe(i[e.dataKey])){var c=Ff(r,"value",i[e.dataKey]);if(c)return c.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var u=dn(i,Qe(o)?e.dataKey:o);return Qe(u)?null:e.scale(u)}var SC=function(e){var r=e.axis,n=e.ticks,i=e.offset,a=e.bandSize,o=e.entry,c=e.index;if(r.type==="category")return n[c]?n[c].coordinate+i:null;var u=dn(o,r.dataKey,r.domain[c]);return Qe(u)?null:r.scale(u)-a/2+i},FX=function(e){var r=e.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},HX=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Ht(Ht({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(or(a)){var o=r[a];if(o){var c=o.items.indexOf(e);return c>=0?o.stackedData[c]:null}}return null},WX=function(e){return e.reduce(function(r,n){return[wp(n.concat([r[0]]).filter(ge)),xp(n.concat([r[1]]).filter(ge))]},[1/0,-1/0])},h$=function(e,r,n){return Object.keys(e).reduce(function(i,a){var o=e[a],c=o.stackedData,u=c.reduce(function(d,p){var h=WX(p.slice(r,n+1));return[Math.min(d[0],h[0]),Math.max(d[1],h[1])]},[1/0,-1/0]);return[Math.min(u[0],i[0]),Math.max(u[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},kC=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,EC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ix=function(e,r,n){if(Ye(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(ge(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(kC.test(e[0])){var a=+kC.exec(e[0])[1];i[0]=r[0]-a}else Ye(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(ge(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if(EC.test(e[1])){var o=+EC.exec(e[1])[1];i[1]=r[1]+o}else Ye(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},vh=function(e,r,n){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!n||i>0)return i}if(e&&r&&r.length>=2){for(var a=f1(r,function(h){return h.coordinate}),o=1/0,c=1,u=a.length;c<u;c++){var d=a[c],p=a[c-1];o=Math.min((d.coordinate||0)-(p.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},OC=function(e,r,n){return!e||!e.length||_p(e,An(n,"type.defaultProps.domain"))?r:e},p$=function(e,r){var n=e.type.defaultProps?Ht(Ht({},e.type.defaultProps),e.props):e.props,i=n.dataKey,a=n.name,o=n.unit,c=n.formatter,u=n.tooltipType,d=n.chartType,p=n.hide;return Ht(Ht({},it(e,!1)),{},{dataKey:i,unit:o,formatter:c,name:a||i,color:D1(e),value:dn(r,i),type:u,payload:r,chartType:d,hide:p})};function au(t){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},au(t)}function AC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function TC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AC(Object(r),!0).forEach(function(n){GX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function GX(t,e,r){return e=KX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function KX(t){var e=VX(t,"string");return au(e)=="symbol"?e:e+""}function VX(t,e){if(au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bh=Math.PI/180,XX=function(e){return e*180/Math.PI},_r=function(e,r,n,i){return{x:e+Math.cos(-bh*i)*n,y:r+Math.sin(-bh*i)*n}},YX=function(e,r){var n=e.x,i=e.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},JX=function(e,r){var n=e.x,i=e.y,a=r.cx,o=r.cy,c=YX({x:n,y:i},{x:a,y:o});if(c<=0)return{radius:c};var u=(n-a)/c,d=Math.acos(u);return i>o&&(d=2*Math.PI-d),{radius:c,angle:XX(d),angleInRadian:d}},ZX=function(e){var r=e.startAngle,n=e.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},QX=function(e,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),c=Math.min(a,o);return e+c*360},CC=function(e,r){var n=e.x,i=e.y,a=JX({x:n,y:i},r),o=a.radius,c=a.angle,u=r.innerRadius,d=r.outerRadius;if(o<u||o>d)return!1;if(o===0)return!0;var p=ZX(r),h=p.startAngle,g=p.endAngle,v=c,x;if(h<=g){for(;v>g;)v-=360;for(;v<h;)v+=360;x=v>=h&&v<=g}else{for(;v>h;)v-=360;for(;v<g;)v+=360;x=v>=g&&v<=h}return x?TC(TC({},r),{},{radius:o,angle:QX(v,r)}):null};function ou(t){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ou(t)}var eY=["offset"];function tY(t){return aY(t)||iY(t)||nY(t)||rY()}function rY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
459
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nY(t,e){if(t){if(typeof t=="string")return $x(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $x(t,e)}}function iY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function aY(t){if(Array.isArray(t))return $x(t)}function $x(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oY(t,e){if(t==null)return{};var r=sY(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function sY(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function jC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ar(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jC(Object(r),!0).forEach(function(n){lY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function lY(t,e,r){return e=cY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cY(t){var e=uY(t,"string");return ou(e)=="symbol"?e:e+""}function uY(t,e){if(ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function su(){return su=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},su.apply(this,arguments)}var dY=function(e){var r=e.value,n=e.formatter,i=Qe(e.children)?r:e.children;return Ye(n)?n(i):i},fY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),360);return n*i},hY=function(e,r,n){var i=e.position,a=e.viewBox,o=e.offset,c=e.className,u=a,d=u.cx,p=u.cy,h=u.innerRadius,g=u.outerRadius,v=u.startAngle,x=u.endAngle,_=u.clockWise,b=(h+g)/2,k=fY(v,x),E=k>=0?1:-1,O,A;i==="insideStart"?(O=v+E*o,A=_):i==="insideEnd"?(O=x-E*o,A=!_):i==="end"&&(O=x+E*o,A=_),A=k<=0?A:!A;var T=_r(d,p,b,O),C=_r(d,p,b,O+(A?1:-1)*359),j="M".concat(T.x,",").concat(T.y,`
|
|
460
|
-
A`).concat(b,",").concat(b,",0,1,").concat(A?0:1,`,
|
|
461
|
-
`).concat(C.x,",").concat(C.y),R=Qe(e.id)?Ru("recharts-radial-line-"):e.id;return I.createElement("text",su({},n,{dominantBaseline:"central",className:at("recharts-radial-bar-label",c)}),I.createElement("defs",null,I.createElement("path",{id:R,d:j})),I.createElement("textPath",{xlinkHref:"#".concat(R)},r))},pY=function(e){var r=e.viewBox,n=e.offset,i=e.position,a=r,o=a.cx,c=a.cy,u=a.innerRadius,d=a.outerRadius,p=a.startAngle,h=a.endAngle,g=(p+h)/2;if(i==="outside"){var v=_r(o,c,d+n,g),x=v.x,_=v.y;return{x,y:_,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var b=(u+d)/2,k=_r(o,c,b,g),E=k.x,O=k.y;return{x:E,y:O,textAnchor:"middle",verticalAnchor:"middle"}},mY=function(e){var r=e.viewBox,n=e.parentViewBox,i=e.offset,a=e.position,o=r,c=o.x,u=o.y,d=o.width,p=o.height,h=p>=0?1:-1,g=h*i,v=h>0?"end":"start",x=h>0?"start":"end",_=d>=0?1:-1,b=_*i,k=_>0?"end":"start",E=_>0?"start":"end";if(a==="top"){var O={x:c+d/2,y:u-h*i,textAnchor:"middle",verticalAnchor:v};return ar(ar({},O),n?{height:Math.max(u-n.y,0),width:d}:{})}if(a==="bottom"){var A={x:c+d/2,y:u+p+g,textAnchor:"middle",verticalAnchor:x};return ar(ar({},A),n?{height:Math.max(n.y+n.height-(u+p),0),width:d}:{})}if(a==="left"){var T={x:c-b,y:u+p/2,textAnchor:k,verticalAnchor:"middle"};return ar(ar({},T),n?{width:Math.max(T.x-n.x,0),height:p}:{})}if(a==="right"){var C={x:c+d+b,y:u+p/2,textAnchor:E,verticalAnchor:"middle"};return ar(ar({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:p}:{})}var j=n?{width:d,height:p}:{};return a==="insideLeft"?ar({x:c+b,y:u+p/2,textAnchor:E,verticalAnchor:"middle"},j):a==="insideRight"?ar({x:c+d-b,y:u+p/2,textAnchor:k,verticalAnchor:"middle"},j):a==="insideTop"?ar({x:c+d/2,y:u+g,textAnchor:"middle",verticalAnchor:x},j):a==="insideBottom"?ar({x:c+d/2,y:u+p-g,textAnchor:"middle",verticalAnchor:v},j):a==="insideTopLeft"?ar({x:c+b,y:u+g,textAnchor:E,verticalAnchor:x},j):a==="insideTopRight"?ar({x:c+d-b,y:u+g,textAnchor:k,verticalAnchor:x},j):a==="insideBottomLeft"?ar({x:c+b,y:u+p-g,textAnchor:E,verticalAnchor:v},j):a==="insideBottomRight"?ar({x:c+d-b,y:u+p-g,textAnchor:k,verticalAnchor:v},j):vl(a)&&(ge(a.x)||So(a.x))&&(ge(a.y)||So(a.y))?ar({x:c+Ro(a.x,d),y:u+Ro(a.y,p),textAnchor:"end",verticalAnchor:"end"},j):ar({x:c+d/2,y:u+p/2,textAnchor:"middle",verticalAnchor:"middle"},j)},gY=function(e){return"cx"in e&&ge(e.cx)};function jr(t){var e=t.offset,r=e===void 0?5:e,n=oY(t,eY),i=ar({offset:r},n),a=i.viewBox,o=i.position,c=i.value,u=i.children,d=i.content,p=i.className,h=p===void 0?"":p,g=i.textBreakAll;if(!a||Qe(c)&&Qe(u)&&!N.isValidElement(d)&&!Ye(d))return null;if(N.isValidElement(d))return N.cloneElement(d,i);var v;if(Ye(d)){if(v=N.createElement(d,i),N.isValidElement(v))return v}else v=dY(i);var x=gY(a),_=it(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return hY(i,v,_);var b=x?pY(i):mY(i);return I.createElement(nh,su({className:at("recharts-label",h)},_,b,{breakAll:g}),v)}jr.displayName="Label";var m$=function(e){var r=e.cx,n=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,c=e.r,u=e.radius,d=e.innerRadius,p=e.outerRadius,h=e.x,g=e.y,v=e.top,x=e.left,_=e.width,b=e.height,k=e.clockWise,E=e.labelViewBox;if(E)return E;if(ge(_)&&ge(b)){if(ge(h)&&ge(g))return{x:h,y:g,width:_,height:b};if(ge(v)&&ge(x))return{x:v,y:x,width:_,height:b}}return ge(h)&&ge(g)?{x:h,y:g,width:0,height:0}:ge(r)&&ge(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:d||0,outerRadius:p||u||c||0,clockWise:k}:e.viewBox?e.viewBox:{}},yY=function(e,r){return e?e===!0?I.createElement(jr,{key:"label-implicit",viewBox:r}):or(e)?I.createElement(jr,{key:"label-implicit",viewBox:r,value:e}):N.isValidElement(e)?e.type===jr?N.cloneElement(e,{key:"label-implicit",viewBox:r}):I.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):Ye(e)?I.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):vl(e)?I.createElement(jr,su({viewBox:r},e,{key:"label-implicit"})):null:null},vY=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var i=e.children,a=m$(e),o=Tn(i,jr).map(function(u,d){return N.cloneElement(u,{viewBox:r||a,key:"label-".concat(d)})});if(!n)return o;var c=yY(e.label,r||a);return[c].concat(tY(o))};jr.parseViewBox=m$;jr.renderCallByParent=vY;var eb,PC;function bY(){if(PC)return eb;PC=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return eb=t,eb}var xY=bY();const wY=vt(xY);function lu(t){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lu(t)}var _Y=["valueAccessor"],SY=["data","dataKey","clockWise","id","textBreakAll"];function kY(t){return TY(t)||AY(t)||OY(t)||EY()}function EY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
462
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OY(t,e){if(t){if(typeof t=="string")return Mx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mx(t,e)}}function AY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function TY(t){if(Array.isArray(t))return Mx(t)}function Mx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function xh(){return xh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},xh.apply(this,arguments)}function NC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function RC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?NC(Object(r),!0).forEach(function(n){CY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):NC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function CY(t,e,r){return e=jY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jY(t){var e=PY(t,"string");return lu(e)=="symbol"?e:e+""}function PY(t,e){if(lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IC(t,e){if(t==null)return{};var r=NY(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function NY(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var RY=function(e){return Array.isArray(e.value)?wY(e.value):e.value};function La(t){var e=t.valueAccessor,r=e===void 0?RY:e,n=IC(t,_Y),i=n.data,a=n.dataKey,o=n.clockWise,c=n.id,u=n.textBreakAll,d=IC(n,SY);return!i||!i.length?null:I.createElement(Xt,{className:"recharts-label-list"},i.map(function(p,h){var g=Qe(a)?r(p,h):dn(p&&p.payload,a),v=Qe(c)?{}:{id:"".concat(c,"-").concat(h)};return I.createElement(jr,xh({},it(p,!0),d,v,{parentViewBox:p.parentViewBox,value:g,textBreakAll:u,viewBox:jr.parseViewBox(Qe(o)?p:RC(RC({},p),{},{clockWise:o})),key:"label-".concat(h),index:h}))}))}La.displayName="LabelList";function IY(t,e){return t?t===!0?I.createElement(La,{key:"labelList-implicit",data:e}):I.isValidElement(t)||Ye(t)?I.createElement(La,{key:"labelList-implicit",data:e,content:t}):vl(t)?I.createElement(La,xh({data:e},t,{key:"labelList-implicit"})):null:null}function $Y(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var n=t.children,i=Tn(n,La).map(function(o,c){return N.cloneElement(o,{data:e,key:"labelList-".concat(c)})});if(!r)return i;var a=IY(t.label,e);return[a].concat(kY(i))}La.renderCallByParent=$Y;function cu(t){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cu(t)}function Lx(){return Lx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Lx.apply(this,arguments)}function $C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function MC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$C(Object(r),!0).forEach(function(n){MY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$C(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function MY(t,e,r){return e=LY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function LY(t){var e=DY(t,"string");return cu(e)=="symbol"?e:e+""}function DY(t,e){if(cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var zY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},vf=function(e){var r=e.cx,n=e.cy,i=e.radius,a=e.angle,o=e.sign,c=e.isExternal,u=e.cornerRadius,d=e.cornerIsExternal,p=u*(c?1:-1)+i,h=Math.asin(u/p)/bh,g=d?a:a+o*h,v=_r(r,n,p,g),x=_r(r,n,i,g),_=d?a-o*h:a,b=_r(r,n,p*Math.cos(h*bh),_);return{center:v,circleTangency:x,lineTangency:b,theta:h}},g$=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.startAngle,c=e.endAngle,u=zY(o,c),d=o+u,p=_r(r,n,a,o),h=_r(r,n,a,d),g="M ".concat(p.x,",").concat(p.y,`
|
|
463
|
-
A `).concat(a,",").concat(a,`,0,
|
|
464
|
-
`).concat(+(Math.abs(u)>180),",").concat(+(o>d),`,
|
|
465
|
-
`).concat(h.x,",").concat(h.y,`
|
|
466
|
-
`);if(i>0){var v=_r(r,n,i,o),x=_r(r,n,i,d);g+="L ".concat(x.x,",").concat(x.y,`
|
|
467
|
-
A `).concat(i,",").concat(i,`,0,
|
|
468
|
-
`).concat(+(Math.abs(u)>180),",").concat(+(o<=d),`,
|
|
469
|
-
`).concat(v.x,",").concat(v.y," Z")}else g+="L ".concat(r,",").concat(n," Z");return g},BY=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,c=e.forceCornerRadius,u=e.cornerIsExternal,d=e.startAngle,p=e.endAngle,h=Jn(p-d),g=vf({cx:r,cy:n,radius:a,angle:d,sign:h,cornerRadius:o,cornerIsExternal:u}),v=g.circleTangency,x=g.lineTangency,_=g.theta,b=vf({cx:r,cy:n,radius:a,angle:p,sign:-h,cornerRadius:o,cornerIsExternal:u}),k=b.circleTangency,E=b.lineTangency,O=b.theta,A=u?Math.abs(d-p):Math.abs(d-p)-_-O;if(A<0)return c?"M ".concat(x.x,",").concat(x.y,`
|
|
470
|
-
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
471
|
-
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
472
|
-
`):g$({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:d,endAngle:p});var T="M ".concat(x.x,",").concat(x.y,`
|
|
473
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(v.x,",").concat(v.y,`
|
|
474
|
-
A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(h<0),",").concat(k.x,",").concat(k.y,`
|
|
475
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(E.x,",").concat(E.y,`
|
|
476
|
-
`);if(i>0){var C=vf({cx:r,cy:n,radius:i,angle:d,sign:h,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),j=C.circleTangency,R=C.lineTangency,M=C.theta,Y=vf({cx:r,cy:n,radius:i,angle:p,sign:-h,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),W=Y.circleTangency,B=Y.lineTangency,X=Y.theta,K=u?Math.abs(d-p):Math.abs(d-p)-M-X;if(K<0&&o===0)return"".concat(T,"L").concat(r,",").concat(n,"Z");T+="L".concat(B.x,",").concat(B.y,`
|
|
477
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(W.x,",").concat(W.y,`
|
|
478
|
-
A`).concat(i,",").concat(i,",0,").concat(+(K>180),",").concat(+(h>0),",").concat(j.x,",").concat(j.y,`
|
|
479
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(R.x,",").concat(R.y,"Z")}else T+="L".concat(r,",").concat(n,"Z");return T},UY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},y$=function(e){var r=MC(MC({},UY),e),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,c=r.cornerRadius,u=r.forceCornerRadius,d=r.cornerIsExternal,p=r.startAngle,h=r.endAngle,g=r.className;if(o<a||p===h)return null;var v=at("recharts-sector",g),x=o-a,_=Ro(c,x,0,!0),b;return _>0&&Math.abs(p-h)<360?b=BY({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(_,x/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:h}):b=g$({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:p,endAngle:h}),I.createElement("path",Lx({},it(r,!0),{className:v,d:b,role:"img"}))};function uu(t){"@babel/helpers - typeof";return uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uu(t)}function Dx(){return Dx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Dx.apply(this,arguments)}function LC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function DC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?LC(Object(r),!0).forEach(function(n){qY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):LC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qY(t,e,r){return e=FY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FY(t){var e=HY(t,"string");return uu(e)=="symbol"?e:e+""}function HY(t,e){if(uu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(uu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var zC={curveBasisClosed:uF,curveBasisOpen:dF,curveBasis:cF,curveBumpX:X9,curveBumpY:Y9,curveLinearClosed:fF,curveLinear:cp,curveMonotoneX:hF,curveMonotoneY:pF,curveNatural:mF,curveStep:gF,curveStepAfter:vF,curveStepBefore:yF},bf=function(e){return e.x===+e.x&&e.y===+e.y},yc=function(e){return e.x},vc=function(e){return e.y},WY=function(e,r){if(Ye(e))return e;var n="curve".concat(sp(e));return(n==="curveMonotone"||n==="curveBump")&&r?zC["".concat(n).concat(r==="vertical"?"Y":"X")]:zC[n]||cp},GY=function(e){var r=e.type,n=r===void 0?"linear":r,i=e.points,a=i===void 0?[]:i,o=e.baseLine,c=e.layout,u=e.connectNulls,d=u===void 0?!1:u,p=WY(n,c),h=d?a.filter(function(_){return bf(_)}):a,g;if(Array.isArray(o)){var v=d?o.filter(function(_){return bf(_)}):o,x=h.map(function(_,b){return DC(DC({},_),{},{base:v[b]})});return c==="vertical"?g=uf().y(vc).x1(yc).x0(function(_){return _.base.x}):g=uf().x(yc).y1(vc).y0(function(_){return _.base.y}),g.defined(bf).curve(p),g(x)}return c==="vertical"&&ge(o)?g=uf().y(vc).x1(yc).x0(o):ge(o)?g=uf().x(yc).y1(vc).y0(o):g=_R().x(yc).y(vc),g.defined(bf).curve(p),g(h)},zx=function(e){var r=e.className,n=e.points,i=e.path,a=e.pathRef;if((!n||!n.length)&&!i)return null;var o=n&&n.length?GY(e):i;return N.createElement("path",Dx({},it(e,!1),Hf(e),{className:at("recharts-curve",r),d:o,ref:a}))},tb={exports:{}},rb,BC;function KY(){if(BC)return rb;BC=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return rb=t,rb}var nb,UC;function VY(){if(UC)return nb;UC=1;var t=KY();function e(){}function r(){}return r.resetWarningCache=e,nb=function(){function n(o,c,u,d,p,h){if(h!==t){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},nb}var qC;function XY(){return qC||(qC=1,tb.exports=VY()()),tb.exports}var YY=XY();const mt=vt(YY),{getOwnPropertyNames:JY,getOwnPropertySymbols:ZY}=Object,{hasOwnProperty:QY}=Object.prototype;function ib(t,e){return function(n,i,a){return t(n,i,a)&&e(n,i,a)}}function xf(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);const{cache:a}=i,o=a.get(r),c=a.get(n);if(o&&c)return o===n&&c===r;a.set(r,n),a.set(n,r);const u=t(r,n,i);return a.delete(r),a.delete(n),u}}function eJ(t){return t!=null?t[Symbol.toStringTag]:void 0}function FC(t){return JY(t).concat(ZY(t))}const tJ=Object.hasOwn||((t,e)=>QY.call(t,e));function qo(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const rJ="__v",nJ="__o",iJ="_owner",{getOwnPropertyDescriptor:HC,keys:WC}=Object;function aJ(t,e){return t.byteLength===e.byteLength&&wh(new Uint8Array(t),new Uint8Array(e))}function oJ(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function sJ(t,e){return t.byteLength===e.byteLength&&wh(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function lJ(t,e){return qo(t.getTime(),e.getTime())}function cJ(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function uJ(t,e){return t===e}function GC(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),a=t.entries();let o,c,u=0;for(;(o=a.next())&&!o.done;){const d=e.entries();let p=!1,h=0;for(;(c=d.next())&&!c.done;){if(i[h]){h++;continue}const g=o.value,v=c.value;if(r.equals(g[0],v[0],u,h,t,e,r)&&r.equals(g[1],v[1],g[0],v[0],t,e,r)){p=i[h]=!0;break}h++}if(!p)return!1;u++}return!0}const dJ=qo;function fJ(t,e,r){const n=WC(t);let i=n.length;if(WC(e).length!==i)return!1;for(;i-- >0;)if(!v$(t,e,r,n[i]))return!1;return!0}function bc(t,e,r){const n=FC(t);let i=n.length;if(FC(e).length!==i)return!1;let a,o,c;for(;i-- >0;)if(a=n[i],!v$(t,e,r,a)||(o=HC(t,a),c=HC(e,a),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function hJ(t,e){return qo(t.valueOf(),e.valueOf())}function pJ(t,e){return t.source===e.source&&t.flags===e.flags}function KC(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),a=t.values();let o,c;for(;(o=a.next())&&!o.done;){const u=e.values();let d=!1,p=0;for(;(c=u.next())&&!c.done;){if(!i[p]&&r.equals(o.value,c.value,o.value,c.value,t,e,r)){d=i[p]=!0;break}p++}if(!d)return!1}return!0}function wh(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function mJ(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function v$(t,e,r,n){return(n===iJ||n===nJ||n===rJ)&&(t.$$typeof||e.$$typeof)?!0:tJ(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}const gJ="[object ArrayBuffer]",yJ="[object Arguments]",vJ="[object Boolean]",bJ="[object DataView]",xJ="[object Date]",wJ="[object Error]",_J="[object Map]",SJ="[object Number]",kJ="[object Object]",EJ="[object RegExp]",OJ="[object Set]",AJ="[object String]",TJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},CJ="[object URL]",jJ=Object.prototype.toString;function PJ({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:p,areSetsEqual:h,areTypedArraysEqual:g,areUrlsEqual:v,unknownTagComparators:x}){return function(b,k,E){if(b===k)return!0;if(b==null||k==null)return!1;const O=typeof b;if(O!==typeof k)return!1;if(O!=="object")return O==="number"?c(b,k,E):O==="function"?a(b,k,E):!1;const A=b.constructor;if(A!==k.constructor)return!1;if(A===Object)return u(b,k,E);if(Array.isArray(b))return e(b,k,E);if(A===Date)return n(b,k,E);if(A===RegExp)return p(b,k,E);if(A===Map)return o(b,k,E);if(A===Set)return h(b,k,E);const T=jJ.call(b);if(T===xJ)return n(b,k,E);if(T===EJ)return p(b,k,E);if(T===_J)return o(b,k,E);if(T===OJ)return h(b,k,E);if(T===kJ)return typeof b.then!="function"&&typeof k.then!="function"&&u(b,k,E);if(T===CJ)return v(b,k,E);if(T===wJ)return i(b,k,E);if(T===yJ)return u(b,k,E);if(TJ[T])return g(b,k,E);if(T===gJ)return t(b,k,E);if(T===bJ)return r(b,k,E);if(T===vJ||T===SJ||T===AJ)return d(b,k,E);if(x){let C=x[T];if(!C){const j=eJ(b);j&&(C=x[j])}if(C)return C(b,k,E)}return!1}}function NJ({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:aJ,areArraysEqual:r?bc:oJ,areDataViewsEqual:sJ,areDatesEqual:lJ,areErrorsEqual:cJ,areFunctionsEqual:uJ,areMapsEqual:r?ib(GC,bc):GC,areNumbersEqual:dJ,areObjectsEqual:r?bc:fJ,arePrimitiveWrappersEqual:hJ,areRegExpsEqual:pJ,areSetsEqual:r?ib(KC,bc):KC,areTypedArraysEqual:r?ib(wh,bc):wh,areUrlsEqual:mJ,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const i=xf(n.areArraysEqual),a=xf(n.areMapsEqual),o=xf(n.areObjectsEqual),c=xf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return n}function RJ(t){return function(e,r,n,i,a,o,c){return t(e,r,c)}}function IJ({circular:t,comparator:e,createState:r,equals:n,strict:i}){if(r)return function(c,u){const{cache:d=t?new WeakMap:void 0,meta:p}=r();return e(c,u,{cache:d,equals:n,meta:p,strict:i})};if(t)return function(c,u){return e(c,u,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(c,u){return e(c,u,a)}}const $J=Ga();Ga({strict:!0});Ga({circular:!0});Ga({circular:!0,strict:!0});Ga({createInternalComparator:()=>qo});Ga({strict:!0,createInternalComparator:()=>qo});Ga({circular:!0,createInternalComparator:()=>qo});Ga({circular:!0,createInternalComparator:()=>qo,strict:!0});function Ga(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:i=!1}=t,a=NJ(t),o=PJ(a),c=r?r(o):RJ(o);return IJ({circular:e,comparator:o,createState:n,equals:c,strict:i})}function MJ(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function VC(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>e?(t(a),r=-1):MJ(i)};requestAnimationFrame(n)}function Bx(t){"@babel/helpers - typeof";return Bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bx(t)}function LJ(t){return UJ(t)||BJ(t)||zJ(t)||DJ()}function DJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
480
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zJ(t,e){if(t){if(typeof t=="string")return XC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XC(t,e)}}function XC(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function BJ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function UJ(t){if(Array.isArray(t))return t}function qJ(){var t={},e=function(){return null},r=!1,n=function i(a){if(!r){if(Array.isArray(a)){if(!a.length)return;var o=a,c=LJ(o),u=c[0],d=c.slice(1);if(typeof u=="number"){VC(i.bind(null,d),u);return}i(u),VC(i.bind(null,d));return}Bx(a)==="object"&&(t=a,e(t)),typeof a=="function"&&a()}};return{stop:function(){r=!0},start:function(a){r=!1,n(a)},subscribe:function(a){return e=a,function(){e=function(){return null}}}}}function du(t){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},du(t)}function YC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function JC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?YC(Object(r),!0).forEach(function(n){b$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):YC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function b$(t,e,r){return e=FJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FJ(t){var e=HJ(t,"string");return du(e)==="symbol"?e:String(e)}function HJ(t,e){if(du(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(du(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var WJ=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,i){return n.filter(function(a){return i.includes(a)})})},GJ=function(e){return e},KJ=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Ic=function(e,r){return Object.keys(r).reduce(function(n,i){return JC(JC({},n),{},b$({},i,e(i,r[i])))},{})},ZC=function(e,r,n){return e.map(function(i){return"".concat(KJ(i)," ").concat(r,"ms ").concat(n)}).join(",")};function VJ(t,e){return JJ(t)||YJ(t,e)||x$(t,e)||XJ()}function XJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
481
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YJ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function JJ(t){if(Array.isArray(t))return t}function ZJ(t){return tZ(t)||eZ(t)||x$(t)||QJ()}function QJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
482
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x$(t,e){if(t){if(typeof t=="string")return Ux(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ux(t,e)}}function eZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tZ(t){if(Array.isArray(t))return Ux(t)}function Ux(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var _h=1e-4,w$=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},_$=function(e,r){return e.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},QC=function(e,r){return function(n){var i=w$(e,r);return _$(i,n)}},rZ=function(e,r){return function(n){var i=w$(e,r),a=[].concat(ZJ(i.map(function(o,c){return o*c}).slice(1)),[0]);return _$(a,n)}},ej=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0],a=r[1],o=r[2],c=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,a=0,o=1,c=1;break;case"ease":i=.25,a=.1,o=.25,c=1;break;case"ease-in":i=.42,a=0,o=1,c=1;break;case"ease-out":i=.42,a=0,o=.58,c=1;break;case"ease-in-out":i=0,a=0,o=.58,c=1;break;default:{var u=r[0].split("(");if(u[0]==="cubic-bezier"&&u[1].split(")")[0].split(",").length===4){var d=u[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),p=VJ(d,4);i=p[0],a=p[1],o=p[2],c=p[3]}}}var h=QC(i,o),g=QC(a,c),v=rZ(i,o),x=function(k){return k>1?1:k<0?0:k},_=function(k){for(var E=k>1?1:k,O=E,A=0;A<8;++A){var T=h(O)-E,C=v(O);if(Math.abs(T-E)<_h||C<_h)return g(O);O=x(O-T/C)}return g(O)};return _.isStepper=!1,_},nZ=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.stiff,n=r===void 0?100:r,i=e.damping,a=i===void 0?8:i,o=e.dt,c=o===void 0?17:o,u=function(p,h,g){var v=-(p-h)*n,x=g*a,_=g+(v-x)*c/1e3,b=g*c/1e3+p;return Math.abs(b-h)<_h&&Math.abs(_)<_h?[h,0]:[b,_]};return u.isStepper=!0,u.dt=c,u},iZ=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return ej(i);case"spring":return nZ();default:if(i.split("(")[0]==="cubic-bezier")return ej(i)}return typeof i=="function"?i:null};function fu(t){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fu(t)}function tj(t){return sZ(t)||oZ(t)||S$(t)||aZ()}function aZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
483
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function sZ(t){if(Array.isArray(t))return Fx(t)}function rj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function wr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rj(Object(r),!0).forEach(function(n){qx(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qx(t,e,r){return e=lZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lZ(t){var e=cZ(t,"string");return fu(e)==="symbol"?e:String(e)}function cZ(t,e){if(fu(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uZ(t,e){return hZ(t)||fZ(t,e)||S$(t,e)||dZ()}function dZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
484
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S$(t,e){if(t){if(typeof t=="string")return Fx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fx(t,e)}}function Fx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function hZ(t){if(Array.isArray(t))return t}var Sh=function(e,r,n){return e+(r-e)*n},Hx=function(e){var r=e.from,n=e.to;return r!==n},pZ=function t(e,r,n){var i=Ic(function(a,o){if(Hx(o)){var c=e(o.from,o.to,o.velocity),u=uZ(c,2),d=u[0],p=u[1];return wr(wr({},o),{},{from:d,velocity:p})}return o},r);return n<1?Ic(function(a,o){return Hx(o)?wr(wr({},o),{},{velocity:Sh(o.velocity,i[a].velocity,n),from:Sh(o.from,i[a].from,n)}):o},r):t(e,i,n-1)};const mZ=(function(t,e,r,n,i){var a=WJ(t,e),o=a.reduce(function(b,k){return wr(wr({},b),{},qx({},k,[t[k],e[k]]))},{}),c=a.reduce(function(b,k){return wr(wr({},b),{},qx({},k,{from:t[k],velocity:0,to:e[k]}))},{}),u=-1,d,p,h=function(){return null},g=function(){return Ic(function(k,E){return E.from},c)},v=function(){return!Object.values(c).filter(Hx).length},x=function(k){d||(d=k);var E=k-d,O=E/r.dt;c=pZ(r,c,O),i(wr(wr(wr({},t),e),g())),d=k,v()||(u=requestAnimationFrame(h))},_=function(k){p||(p=k);var E=(k-p)/n,O=Ic(function(T,C){return Sh.apply(void 0,tj(C).concat([r(E)]))},o);if(i(wr(wr(wr({},t),e),O)),E<1)u=requestAnimationFrame(h);else{var A=Ic(function(T,C){return Sh.apply(void 0,tj(C).concat([r(1)]))},o);i(wr(wr(wr({},t),e),A))}};return h=r.isStepper?x:_,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(u)}}});function Zs(t){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zs(t)}var gZ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function yZ(t,e){if(t==null)return{};var r=vZ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function vZ(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function ab(t){return _Z(t)||wZ(t)||xZ(t)||bZ()}function bZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
485
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xZ(t,e){if(t){if(typeof t=="string")return Wx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wx(t,e)}}function wZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _Z(t){if(Array.isArray(t))return Wx(t)}function Wx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Un(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nj(Object(r),!0).forEach(function(n){Ac(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ac(t,e,r){return e=k$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SZ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kZ(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k$(n.key),n)}}function EZ(t,e,r){return e&&kZ(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function k$(t){var e=OZ(t,"string");return Zs(e)==="symbol"?e:String(e)}function OZ(t,e){if(Zs(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Zs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AZ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gx(t,e)}function Gx(t,e){return Gx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Gx(t,e)}function TZ(t){var e=CZ();return function(){var n=kh(t),i;if(e){var a=kh(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Kx(this,i)}}function Kx(t,e){if(e&&(Zs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vx(t)}function Vx(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function CZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kh(t){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kh(t)}var Qi=(function(t){AZ(r,t);var e=TZ(r);function r(n,i){var a;SZ(this,r),a=e.call(this,n,i);var o=a.props,c=o.isActive,u=o.attributeName,d=o.from,p=o.to,h=o.steps,g=o.children,v=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Vx(a)),a.changeStyle=a.changeStyle.bind(Vx(a)),!c||v<=0)return a.state={style:{}},typeof g=="function"&&(a.state={style:p}),Kx(a);if(h&&h.length)a.state={style:h[0].style};else if(d){if(typeof g=="function")return a.state={style:d},Kx(a);a.state={style:u?Ac({},u,d):d}}else a.state={style:{}};return a}return EZ(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,c=a.canBegin,u=a.attributeName,d=a.shouldReAnimate,p=a.to,h=a.from,g=this.state.style;if(c){if(!o){var v={style:u?Ac({},u,p):p};this.state&&g&&(u&&g[u]!==p||!u&&g!==p)&&this.setState(v);return}if(!($J(i.to,p)&&i.canBegin&&i.isActive)){var x=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var _=x||d?h:i.to;if(this.state&&g){var b={style:u?Ac({},u,_):_};(u&&g[u]!==_||!u&&g!==_)&&this.setState(b)}this.runAnimation(Un(Un({},this.props),{},{from:_,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,c=i.to,u=i.duration,d=i.easing,p=i.begin,h=i.onAnimationEnd,g=i.onAnimationStart,v=mZ(o,c,iZ(d),u,this.changeStyle),x=function(){a.stopJSAnimation=v()};this.manager.start([g,p,x,u,h])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,c=i.begin,u=i.onAnimationStart,d=o[0],p=d.style,h=d.duration,g=h===void 0?0:h,v=function(_,b,k){if(k===0)return _;var E=b.duration,O=b.easing,A=O===void 0?"ease":O,T=b.style,C=b.properties,j=b.onAnimationEnd,R=k>0?o[k-1]:b,M=C||Object.keys(T);if(typeof A=="function"||A==="spring")return[].concat(ab(_),[a.runJSAnimation.bind(a,{from:R.style,to:T,duration:E,easing:A}),E]);var Y=ZC(M,E,A),W=Un(Un(Un({},R.style),T),{},{transition:Y});return[].concat(ab(_),[W,E,j]).filter(GJ)};return this.manager.start([u].concat(ab(o.reduce(v,[p,Math.max(g,c)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=qJ());var a=i.begin,o=i.duration,c=i.attributeName,u=i.to,d=i.easing,p=i.onAnimationStart,h=i.onAnimationEnd,g=i.steps,v=i.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof d=="function"||typeof v=="function"||d==="spring"){this.runJSAnimation(i);return}if(g.length>1){this.runStepAnimation(i);return}var _=c?Ac({},c,u):u,b=ZC(Object.keys(_),o,d);x.start([p,a,Un(Un({},_),{},{transition:b}),o,h])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var c=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var u=yZ(i,gZ),d=N.Children.count(a),p=this.state.style;if(typeof a=="function")return a(p);if(!c||d===0||o<=0)return a;var h=function(v){var x=v.props,_=x.style,b=_===void 0?{}:_,k=x.className,E=N.cloneElement(v,Un(Un({},u),{},{style:Un(Un({},b),p),className:k}));return E};return d===1?h(N.Children.only(a)):I.createElement("div",null,N.Children.map(a,function(g){return h(g)}))}}]),r})(N.PureComponent);Qi.displayName="Animate";Qi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Qi.propTypes={from:mt.oneOfType([mt.object,mt.string]),to:mt.oneOfType([mt.object,mt.string]),attributeName:mt.string,duration:mt.number,begin:mt.number,easing:mt.oneOfType([mt.string,mt.func]),steps:mt.arrayOf(mt.shape({duration:mt.number.isRequired,style:mt.object.isRequired,easing:mt.oneOfType([mt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),mt.func]),properties:mt.arrayOf("string"),onAnimationEnd:mt.func})),children:mt.oneOfType([mt.node,mt.func]),isActive:mt.bool,canBegin:mt.bool,onAnimationEnd:mt.func,shouldReAnimate:mt.bool,onAnimationStart:mt.func,onAnimationReStart:mt.func};function hu(t){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hu(t)}function Eh(){return Eh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Eh.apply(this,arguments)}function jZ(t,e){return IZ(t)||RZ(t,e)||NZ(t,e)||PZ()}function PZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
486
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NZ(t,e){if(t){if(typeof t=="string")return ij(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ij(t,e)}}function ij(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function RZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function IZ(t){if(Array.isArray(t))return t}function aj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function oj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?aj(Object(r),!0).forEach(function(n){$Z(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):aj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $Z(t,e,r){return e=MZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MZ(t){var e=LZ(t,"string");return hu(e)=="symbol"?e:e+""}function LZ(t,e){if(hu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var sj=function(e,r,n,i,a){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),c=i>=0?1:-1,u=n>=0?1:-1,d=i>=0&&n>=0||i<0&&n<0?1:0,p;if(o>0&&a instanceof Array){for(var h=[0,0,0,0],g=0,v=4;g<v;g++)h[g]=a[g]>o?o:a[g];p="M".concat(e,",").concat(r+c*h[0]),h[0]>0&&(p+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(d,",").concat(e+u*h[0],",").concat(r)),p+="L ".concat(e+n-u*h[1],",").concat(r),h[1]>0&&(p+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(d,`,
|
|
487
|
-
`).concat(e+n,",").concat(r+c*h[1])),p+="L ".concat(e+n,",").concat(r+i-c*h[2]),h[2]>0&&(p+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(d,`,
|
|
488
|
-
`).concat(e+n-u*h[2],",").concat(r+i)),p+="L ".concat(e+u*h[3],",").concat(r+i),h[3]>0&&(p+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(d,`,
|
|
489
|
-
`).concat(e,",").concat(r+i-c*h[3])),p+="Z"}else if(o>0&&a===+a&&a>0){var x=Math.min(o,a);p="M ".concat(e,",").concat(r+c*x,`
|
|
490
|
-
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+u*x,",").concat(r,`
|
|
491
|
-
L `).concat(e+n-u*x,",").concat(r,`
|
|
492
|
-
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+n,",").concat(r+c*x,`
|
|
493
|
-
L `).concat(e+n,",").concat(r+i-c*x,`
|
|
494
|
-
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+n-u*x,",").concat(r+i,`
|
|
495
|
-
L `).concat(e+u*x,",").concat(r+i,`
|
|
496
|
-
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e,",").concat(r+i-c*x," Z")}else p="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return p},DZ=function(e,r){if(!e||!r)return!1;var n=e.x,i=e.y,a=r.x,o=r.y,c=r.width,u=r.height;if(Math.abs(c)>0&&Math.abs(u)>0){var d=Math.min(a,a+c),p=Math.max(a,a+c),h=Math.min(o,o+u),g=Math.max(o,o+u);return n>=d&&n<=p&&i>=h&&i<=g}return!1},zZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},z1=function(e){var r=oj(oj({},zZ),e),n=N.useRef(),i=N.useState(-1),a=jZ(i,2),o=a[0],c=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var A=n.current.getTotalLength();A&&c(A)}catch{}},[]);var u=r.x,d=r.y,p=r.width,h=r.height,g=r.radius,v=r.className,x=r.animationEasing,_=r.animationDuration,b=r.animationBegin,k=r.isAnimationActive,E=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||h!==+h||p===0||h===0)return null;var O=at("recharts-rectangle",v);return E?I.createElement(Qi,{canBegin:o>0,from:{width:p,height:h,x:u,y:d},to:{width:p,height:h,x:u,y:d},duration:_,animationEasing:x,isActive:E},function(A){var T=A.width,C=A.height,j=A.x,R=A.y;return I.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,isActive:k,easing:x},I.createElement("path",Eh({},it(r,!0),{className:O,d:sj(j,R,T,C,g),ref:n})))}):I.createElement("path",Eh({},it(r,!0),{className:O,d:sj(u,d,p,h,g)}))};function Xx(){return Xx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Xx.apply(this,arguments)}var B1=function(e){var r=e.cx,n=e.cy,i=e.r,a=e.className,o=at("recharts-dot",a);return r===+r&&n===+n&&i===+i?N.createElement("circle",Xx({},it(e,!1),Hf(e),{className:o,cx:r,cy:n,r:i})):null};function pu(t){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pu(t)}var BZ=["x","y","top","left","width","height","className"];function Yx(){return Yx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Yx.apply(this,arguments)}function lj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UZ(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lj(Object(r),!0).forEach(function(n){qZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qZ(t,e,r){return e=FZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FZ(t){var e=HZ(t,"string");return pu(e)=="symbol"?e:e+""}function HZ(t,e){if(pu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WZ(t,e){if(t==null)return{};var r=GZ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function GZ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var KZ=function(e,r,n,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},VZ=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.top,c=o===void 0?0:o,u=e.left,d=u===void 0?0:u,p=e.width,h=p===void 0?0:p,g=e.height,v=g===void 0?0:g,x=e.className,_=WZ(e,BZ),b=UZ({x:n,y:a,top:c,left:d,width:h,height:v},_);return!ge(n)||!ge(a)||!ge(h)||!ge(v)||!ge(c)||!ge(d)?null:I.createElement("path",Yx({},it(b,!0),{className:at("recharts-cross",x),d:KZ(n,a,h,v,c,d)}))},ob,cj;function XZ(){if(cj)return ob;cj=1;var t=WR(),e=t(Object.getPrototypeOf,Object);return ob=e,ob}var sb,uj;function YZ(){if(uj)return sb;uj=1;var t=ra(),e=XZ(),r=na(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,c=a.hasOwnProperty,u=o.call(Object);function d(p){if(!r(p)||t(p)!=n)return!1;var h=e(p);if(h===null)return!0;var g=c.call(h,"constructor")&&h.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==u}return sb=d,sb}var JZ=YZ();const ZZ=vt(JZ);var lb,dj;function QZ(){if(dj)return lb;dj=1;var t=ra(),e=na(),r="[object Boolean]";function n(i){return i===!0||i===!1||e(i)&&t(i)==r}return lb=n,lb}var eQ=QZ();const tQ=vt(eQ);function mu(t){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mu(t)}function Oh(){return Oh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Oh.apply(this,arguments)}function rQ(t,e){return oQ(t)||aQ(t,e)||iQ(t,e)||nQ()}function nQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
497
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iQ(t,e){if(t){if(typeof t=="string")return fj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fj(t,e)}}function fj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function aQ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function oQ(t){if(Array.isArray(t))return t}function hj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function pj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hj(Object(r),!0).forEach(function(n){sQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sQ(t,e,r){return e=lQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lQ(t){var e=cQ(t,"string");return mu(e)=="symbol"?e:e+""}function cQ(t,e){if(mu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mj=function(e,r,n,i,a){var o=n-i,c;return c="M ".concat(e,",").concat(r),c+="L ".concat(e+n,",").concat(r),c+="L ".concat(e+n-o/2,",").concat(r+a),c+="L ".concat(e+n-o/2-i,",").concat(r+a),c+="L ".concat(e,",").concat(r," Z"),c},uQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},dQ=function(e){var r=pj(pj({},uQ),e),n=N.useRef(),i=N.useState(-1),a=rQ(i,2),o=a[0],c=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&c(O)}catch{}},[]);var u=r.x,d=r.y,p=r.upperWidth,h=r.lowerWidth,g=r.height,v=r.className,x=r.animationEasing,_=r.animationDuration,b=r.animationBegin,k=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||h!==+h||g!==+g||p===0&&h===0||g===0)return null;var E=at("recharts-trapezoid",v);return k?I.createElement(Qi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:g,x:u,y:d},to:{upperWidth:p,lowerWidth:h,height:g,x:u,y:d},duration:_,animationEasing:x,isActive:k},function(O){var A=O.upperWidth,T=O.lowerWidth,C=O.height,j=O.x,R=O.y;return I.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,easing:x},I.createElement("path",Oh({},it(r,!0),{className:E,d:mj(j,R,A,T,C),ref:n})))}):I.createElement("g",null,I.createElement("path",Oh({},it(r,!0),{className:E,d:mj(u,d,p,h,g)})))},fQ=["option","shapeType","propTransformer","activeClassName","isActive"];function gu(t){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gu(t)}function hQ(t,e){if(t==null)return{};var r=pQ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function pQ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function gj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ah(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gj(Object(r),!0).forEach(function(n){mQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mQ(t,e,r){return e=gQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gQ(t){var e=yQ(t,"string");return gu(e)=="symbol"?e:e+""}function yQ(t,e){if(gu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vQ(t,e){return Ah(Ah({},e),t)}function bQ(t,e){return t==="symbols"}function yj(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return I.createElement(z1,r);case"trapezoid":return I.createElement(dQ,r);case"sector":return I.createElement(y$,r);case"symbols":if(bQ(e))return I.createElement(i1,r);break;default:return null}}function xQ(t){return N.isValidElement(t)?t.props:t}function wQ(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?vQ:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,c=t.isActive,u=hQ(t,fQ),d;if(N.isValidElement(e))d=N.cloneElement(e,Ah(Ah({},u),xQ(e)));else if(Ye(e))d=e(u);else if(ZZ(e)&&!tQ(e)){var p=i(e,u);d=I.createElement(yj,{shapeType:r,elementProps:p})}else{var h=u;d=I.createElement(yj,{shapeType:r,elementProps:h})}return c?I.createElement(Xt,{className:o},d):d}function Ep(t,e){return e!=null&&"trapezoids"in t.props}function Op(t,e){return e!=null&&"sectors"in t.props}function yu(t,e){return e!=null&&"points"in t.props}function _Q(t,e){var r,n,i=t.x===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.x)||t.x===e.x,a=t.y===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.y)||t.y===e.y;return i&&a}function SQ(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function kQ(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function EQ(t,e){var r;return Ep(t,e)?r=_Q:Op(t,e)?r=SQ:yu(t,e)&&(r=kQ),r}function OQ(t,e){var r;return Ep(t,e)?r="trapezoids":Op(t,e)?r="sectors":yu(t,e)&&(r="points"),r}function AQ(t,e){if(Ep(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Op(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return yu(t,e)?e.payload:{}}function TQ(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=OQ(r,e),a=AQ(r,e),o=n.filter(function(u,d){var p=_p(a,u),h=r.props[i].filter(function(x){var _=EQ(r,e);return _(x,e)}),g=r.props[i].indexOf(h[h.length-1]),v=d===g;return p&&v}),c=n.indexOf(o[o.length-1]);return c}var cb,vj;function CQ(){if(vj)return cb;vj=1;var t=Math.ceil,e=Math.max;function r(n,i,a,o){for(var c=-1,u=e(t((i-n)/(a||1)),0),d=Array(u);u--;)d[o?u:++c]=n,n+=a;return d}return cb=r,cb}var ub,bj;function E$(){if(bj)return ub;bj=1;var t=sI(),e=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=t(i),i===e||i===-e){var a=i<0?-1:1;return a*r}return i===i?i:0}return ub=n,ub}var db,xj;function jQ(){if(xj)return db;xj=1;var t=CQ(),e=hp(),r=E$();function n(i){return function(a,o,c){return c&&typeof c!="number"&&e(a,o,c)&&(o=c=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),c=c===void 0?a<o?1:-1:r(c),t(a,o,c,i)}}return db=n,db}var fb,wj;function PQ(){if(wj)return fb;wj=1;var t=jQ(),e=t();return fb=e,fb}var NQ=PQ();const Th=vt(NQ);function vu(t){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vu(t)}function _j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Sj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_j(Object(r),!0).forEach(function(n){O$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_j(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function O$(t,e,r){return e=RQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function RQ(t){var e=IQ(t,"string");return vu(e)=="symbol"?e:e+""}function IQ(t,e){if(vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $Q=["Webkit","Moz","O","ms"],MQ=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=$Q.reduce(function(a,o){return Sj(Sj({},a),{},O$({},o+n,r))},{});return i[e]=r,i};function Qs(t){"@babel/helpers - typeof";return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qs(t)}function Ch(){return Ch=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ch.apply(this,arguments)}function kj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function hb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kj(Object(r),!0).forEach(function(n){on(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function LQ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ej(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T$(n.key),n)}}function DQ(t,e,r){return e&&Ej(t.prototype,e),r&&Ej(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function zQ(t,e,r){return e=jh(e),BQ(t,A$()?Reflect.construct(e,r||[],jh(t).constructor):e.apply(t,r))}function BQ(t,e){if(e&&(Qs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UQ(t)}function UQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A$=function(){return!!t})()}function jh(t){return jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jh(t)}function qQ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jx(t,e)}function Jx(t,e){return Jx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Jx(t,e)}function on(t,e,r){return e=T$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T$(t){var e=FQ(t,"string");return Qs(e)=="symbol"?e:e+""}function FQ(t,e){if(Qs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Qs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var HQ=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,a=e.x,o=e.width,c=e.travellerWidth;if(!r||!r.length)return{};var u=r.length,d=Nc().domain(Th(0,u)).range([a,a+o-c]),p=d.domain().map(function(h){return d(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(n),endX:d(i),scale:d,scaleValues:p}},Oj=function(e){return e.changedTouches&&!!e.changedTouches.length},el=(function(t){function e(r){var n;return LQ(this,e),n=zQ(this,e,[r]),on(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),on(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),on(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,c=i.startIndex;o==null||o({endIndex:a,startIndex:c})}),n.detachDragEndListener()}),on(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),on(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),on(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),on(n,"handleSlideDragStart",function(i){var a=Oj(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return qQ(e,t),DQ(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,c=this.props,u=c.gap,d=c.data,p=d.length-1,h=Math.min(i,a),g=Math.max(i,a),v=e.getIndexInRange(o,h),x=e.getIndexInRange(o,g);return{startIndex:v-v%u,endIndex:x===p?p:x-x%u}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,c=i.dataKey,u=dn(a[n],c,n);return Ye(o)?o(u,n):u}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,c=i.endX,u=this.props,d=u.x,p=u.width,h=u.travellerWidth,g=u.startIndex,v=u.endIndex,x=u.onChange,_=n.pageX-a;_>0?_=Math.min(_,d+p-h-c,d+p-h-o):_<0&&(_=Math.max(_,d-o,d-c));var b=this.getIndex({startX:o+_,endX:c+_});(b.startIndex!==g||b.endIndex!==v)&&x&&x(b),this.setState({startX:o+_,endX:c+_,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=Oj(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,c=i.endX,u=i.startX,d=this.state[o],p=this.props,h=p.x,g=p.width,v=p.travellerWidth,x=p.onChange,_=p.gap,b=p.data,k={startX:this.state.startX,endX:this.state.endX},E=n.pageX-a;E>0?E=Math.min(E,h+g-v-d):E<0&&(E=Math.max(E,h-d)),k[o]=d+E;var O=this.getIndex(k),A=O.startIndex,T=O.endIndex,C=function(){var R=b.length-1;return o==="startX"&&(c>u?A%_===0:T%_===0)||c<u&&T===R||o==="endX"&&(c>u?T%_===0:A%_===0)||c>u&&T===R};this.setState(on(on({},o,d+E),"brushMoveStartX",n.pageX),function(){x&&C()&&x(O)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,c=o.scaleValues,u=o.startX,d=o.endX,p=this.state[i],h=c.indexOf(p);if(h!==-1){var g=h+n;if(!(g===-1||g>=c.length)){var v=c[g];i==="startX"&&v>=d||i==="endX"&&v<=u||this.setState(on({},i,v),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,c=n.height,u=n.fill,d=n.stroke;return I.createElement("rect",{stroke:d,fill:u,x:i,y:a,width:o,height:c})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,c=n.height,u=n.data,d=n.children,p=n.padding,h=N.Children.only(d);return h?I.cloneElement(h,{x:i,y:a,width:o,height:c,margin:p,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,c=this,u=this.props,d=u.y,p=u.travellerWidth,h=u.height,g=u.traveller,v=u.ariaLabel,x=u.data,_=u.startIndex,b=u.endIndex,k=Math.max(n,this.props.x),E=hb(hb({},it(this.props,!1)),{},{x:k,y:d,width:p,height:h}),O=v||"Min value: ".concat((a=x[_])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=x[b])===null||o===void 0?void 0:o.name);return I.createElement(Xt,{tabIndex:0,role:"slider","aria-label":O,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),c.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(g,E))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,c=a.height,u=a.stroke,d=a.travellerWidth,p=Math.min(n,i)+d,h=Math.max(Math.abs(i-n)-d,0);return I.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:p,y:o,width:h,height:c})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,c=n.height,u=n.travellerWidth,d=n.stroke,p=this.state,h=p.startX,g=p.endX,v=5,x={pointerEvents:"none",fill:d};return I.createElement(Xt,{className:"recharts-brush-texts"},I.createElement(nh,Ch({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,g)-v,y:o+c/2},x),this.getTextOfTick(i)),I.createElement(nh,Ch({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,g)+u+v,y:o+c/2},x),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,c=n.x,u=n.y,d=n.width,p=n.height,h=n.alwaysShowText,g=this.state,v=g.startX,x=g.endX,_=g.isTextActive,b=g.isSlideMoving,k=g.isTravellerMoving,E=g.isTravellerFocused;if(!i||!i.length||!ge(c)||!ge(u)||!ge(d)||!ge(p)||d<=0||p<=0)return null;var O=at("recharts-brush",a),A=I.Children.count(o)===1,T=MQ("userSelect","none");return I.createElement(Xt,{className:O,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(v,x),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(x,"endX"),(_||b||k||E||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,c=n.height,u=n.stroke,d=Math.floor(a+c/2)-1;return I.createElement(I.Fragment,null,I.createElement("rect",{x:i,y:a,width:o,height:c,fill:u,stroke:"none"}),I.createElement("line",{x1:i+1,y1:d,x2:i+o-1,y2:d,fill:"none",stroke:"#fff"}),I.createElement("line",{x1:i+1,y1:d+2,x2:i+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return I.isValidElement(n)?a=I.cloneElement(n,i):Ye(n)?a=n(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,c=n.x,u=n.travellerWidth,d=n.updateId,p=n.startIndex,h=n.endIndex;if(a!==i.prevData||d!==i.prevUpdateId)return hb({prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:c,prevWidth:o},a&&a.length?HQ({data:a,width:o,x:c,travellerWidth:u,startIndex:p,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||c!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([c,c+o-u]);var g=i.scale.domain().map(function(v){return i.scale(v)});return{prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:c,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,c=a-1;c-o>1;){var u=Math.floor((o+c)/2);n[u]>i?c=u:o=u}return i>=n[c]?c:o}}])})(N.PureComponent);on(el,"displayName","Brush");on(el,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var pb,Aj;function WQ(){if(Aj)return pb;Aj=1;var t=d1();function e(r,n){var i;return t(r,function(a,o,c){return i=n(a,o,c),!i}),!!i}return pb=e,pb}var mb,Tj;function GQ(){if(Tj)return mb;Tj=1;var t=DR(),e=Fa(),r=WQ(),n=Zr(),i=hp();function a(o,c,u){var d=n(o)?t:r;return u&&i(o,c,u)&&(c=void 0),d(o,e(c,3))}return mb=a,mb}var KQ=GQ();const VQ=vt(KQ);var Si=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},gb,Cj;function XQ(){if(Cj)return gb;Cj=1;var t=rI();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return gb=e,gb}var yb,jj;function YQ(){if(jj)return yb;jj=1;var t=XQ(),e=eI(),r=Fa();function n(i,a){var o={};return a=r(a,3),e(i,function(c,u,d){t(o,u,a(c,u,d))}),o}return yb=n,yb}var JQ=YQ();const ZQ=vt(JQ);var vb,Pj;function QQ(){if(Pj)return vb;Pj=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(!r(e[n],n,e))return!1;return!0}return vb=t,vb}var bb,Nj;function eee(){if(Nj)return bb;Nj=1;var t=d1();function e(r,n){var i=!0;return t(r,function(a,o,c){return i=!!n(a,o,c),i}),i}return bb=e,bb}var xb,Rj;function tee(){if(Rj)return xb;Rj=1;var t=QQ(),e=eee(),r=Fa(),n=Zr(),i=hp();function a(o,c,u){var d=n(o)?t:e;return u&&i(o,c,u)&&(c=void 0),d(o,r(c,3))}return xb=a,xb}var ree=tee();const C$=vt(ree);var nee=["x","y"];function bu(t){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu(t)}function Zx(){return Zx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Zx.apply(this,arguments)}function Ij(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ij(Object(r),!0).forEach(function(n){iee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ij(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function iee(t,e,r){return e=aee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aee(t){var e=oee(t,"string");return bu(e)=="symbol"?e:e+""}function oee(t,e){if(bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function see(t,e){if(t==null)return{};var r=lee(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function lee(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function cee(t,e){var r=t.x,n=t.y,i=see(t,nee),a="".concat(r),o=parseInt(a,10),c="".concat(n),u=parseInt(c,10),d="".concat(e.height||i.height),p=parseInt(d,10),h="".concat(e.width||i.width),g=parseInt(h,10);return xc(xc(xc(xc(xc({},e),i),o?{x:o}:{}),u?{y:u}:{}),{},{height:p,width:g,name:e.name,radius:e.radius})}function $j(t){return I.createElement(wQ,Zx({shapeType:"rectangle",propTransformer:cee,activeClassName:"recharts-active-bar"},t))}var uee=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof e=="number")return e;var a=ge(n)||g9(n);return a?e(n,i):(a||$o(),r)}},dee=["value","background"],j$;function tl(t){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tl(t)}function fee(t,e){if(t==null)return{};var r=hee(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function hee(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Ph(){return Ph=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ph.apply(this,arguments)}function Mj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Mj(Object(r),!0).forEach(function(n){Ia(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,N$(n.key),n)}}function mee(t,e,r){return e&&Lj(t.prototype,e),r&&Lj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gee(t,e,r){return e=Nh(e),yee(t,P$()?Reflect.construct(e,r||[],Nh(t).constructor):e.apply(t,r))}function yee(t,e){if(e&&(tl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vee(t)}function vee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P$=function(){return!!t})()}function Nh(t){return Nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nh(t)}function bee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qx(t,e)}function Qx(t,e){return Qx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qx(t,e)}function Ia(t,e,r){return e=N$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N$(t){var e=xee(t,"string");return tl(e)=="symbol"?e:e+""}function xee(t,e){if(tl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(tl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ea=(function(t){function e(){var r;pee(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=gee(this,e,[].concat(i)),Ia(r,"state",{isAnimationFinished:!1}),Ia(r,"id",Ru("recharts-bar-")),Ia(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Ia(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return bee(e,t),mee(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,o=a.shape,c=a.dataKey,u=a.activeIndex,d=a.activeBar,p=it(this.props,!1);return n&&n.map(function(h,g){var v=g===u,x=v?d:o,_=Jt(Jt(Jt({},p),h),{},{isActive:v,option:x,index:g,dataKey:c,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return I.createElement(Xt,Ph({className:"recharts-bar-rectangle"},Wf(i.props,h,g),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value,"-").concat(g)}),I.createElement($j,_))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,o=i.layout,c=i.isAnimationActive,u=i.animationBegin,d=i.animationDuration,p=i.animationEasing,h=i.animationId,g=this.state.prevData;return I.createElement(Qi,{begin:u,duration:d,isActive:c,easing:p,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var x=v.t,_=a.map(function(b,k){var E=g&&g[k];if(E){var O=Vn(E.x,b.x),A=Vn(E.y,b.y),T=Vn(E.width,b.width),C=Vn(E.height,b.height);return Jt(Jt({},b),{},{x:O(x),y:A(x),width:T(x),height:C(x)})}if(o==="horizontal"){var j=Vn(0,b.height),R=j(x);return Jt(Jt({},b),{},{y:b.y+b.height-R,height:R})}var M=Vn(0,b.width),Y=M(x);return Jt(Jt({},b),{},{width:Y})});return I.createElement(Xt,null,n.renderRectanglesStatically(_))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!_p(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,o=i.dataKey,c=i.activeIndex,u=it(this.props.background,!1);return a.map(function(d,p){d.value;var h=d.background,g=fee(d,dee);if(!h)return null;var v=Jt(Jt(Jt(Jt(Jt({},g),{},{fill:"#eee"},h),u),Wf(n.props,d,p)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:p,className:"recharts-bar-background-rectangle"});return I.createElement($j,Ph({key:"background-bar-".concat(p),option:n.props.background,isActive:p===c},v))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,c=a.xAxis,u=a.yAxis,d=a.layout,p=a.children,h=Tn(p,zu);if(!h)return null;var g=d==="vertical"?o[0].height/2:o[0].width/2,v=function(b,k){var E=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:E,errorVal:dn(b,k)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return I.createElement(Xt,x,h.map(function(_){return I.cloneElement(_,{key:"error-bar-".concat(i,"-").concat(_.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,offset:g,dataPointFormatter:v})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,o=n.className,c=n.xAxis,u=n.yAxis,d=n.left,p=n.top,h=n.width,g=n.height,v=n.isAnimationActive,x=n.background,_=n.id;if(i||!a||!a.length)return null;var b=this.state.isAnimationFinished,k=at("recharts-bar",o),E=c&&c.allowDataOverflow,O=u&&u.allowDataOverflow,A=E||O,T=Qe(_)?this.id:_;return I.createElement(Xt,{className:k},E||O?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(T)},I.createElement("rect",{x:E?d:d-h/2,y:O?p:p-g/2,width:E?h:h*2,height:O?g:g*2}))):null,I.createElement(Xt,{className:"recharts-bar-rectangles",clipPath:A?"url(#clipPath-".concat(T,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(A,T),(!v||b)&&La.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])})(N.PureComponent);j$=ea;Ia(ea,"displayName","Bar");Ia(ea,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!xl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ia(ea,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,a=t.xAxis,o=t.yAxis,c=t.xAxisTicks,u=t.yAxisTicks,d=t.stackedData,p=t.dataStartIndex,h=t.displayedData,g=t.offset,v=$X(n,r);if(!v)return null;var x=e.layout,_=r.type.defaultProps,b=_!==void 0?Jt(Jt({},_),r.props):r.props,k=b.dataKey,E=b.children,O=b.minPointSize,A=x==="horizontal"?o:a,T=d?A.scale.domain():null,C=FX({numericAxis:A}),j=Tn(E,cI),R=h.map(function(M,Y){var W,B,X,K,U,G;d?W=MX(d[p+Y],T):(W=dn(M,k),Array.isArray(W)||(W=[C,W]));var J=uee(O,j$.defaultProps.minPointSize)(W[1],Y);if(x==="horizontal"){var F,te=[o.scale(W[0]),o.scale(W[1])],q=te[0],z=te[1];B=SC({axis:a,ticks:c,bandSize:i,offset:v.offset,entry:M,index:Y}),X=(F=z??q)!==null&&F!==void 0?F:void 0,K=v.size;var L=q-z;if(U=Number.isNaN(L)?0:L,G={x:B,y:o.y,width:K,height:o.height},Math.abs(J)>0&&Math.abs(U)<Math.abs(J)){var Z=Jn(U||J)*(Math.abs(J)-Math.abs(U));X-=Z,U+=Z}}else{var se=[a.scale(W[0]),a.scale(W[1])],le=se[0],ve=se[1];if(B=le,X=SC({axis:o,ticks:u,bandSize:i,offset:v.offset,entry:M,index:Y}),K=ve-le,U=v.size,G={x:a.x,y:X,width:a.width,height:U},Math.abs(J)>0&&Math.abs(K)<Math.abs(J)){var qe=Jn(K||J)*(Math.abs(J)-Math.abs(K));K+=qe}}return Jt(Jt(Jt({},M),{},{x:B,y:X,width:K,height:U,value:d?W:W[1],payload:M,background:G},j&&j[Y]&&j[Y].props),{},{tooltipPayload:[p$(r,M)],tooltipPosition:{x:B+K/2,y:X+U/2}})});return Jt({data:R,layout:x},g)});function xu(t){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xu(t)}function wee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R$(n.key),n)}}function _ee(t,e,r){return e&&Dj(t.prototype,e),r&&Dj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function zj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Hn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zj(Object(r),!0).forEach(function(n){Ap(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ap(t,e,r){return e=R$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R$(t){var e=See(t,"string");return xu(e)=="symbol"?e:e+""}function See(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var I$=function(e,r,n,i,a){var o=e.width,c=e.height,u=e.layout,d=e.children,p=Object.keys(r),h={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:c-n.bottom,bottomMirror:c-n.bottom},g=!!sn(d,ea);return p.reduce(function(v,x){var _=r[x],b=_.orientation,k=_.domain,E=_.padding,O=E===void 0?{}:E,A=_.mirror,T=_.reversed,C="".concat(b).concat(A?"Mirror":""),j,R,M,Y,W;if(_.type==="number"&&(_.padding==="gap"||_.padding==="no-gap")){var B=k[1]-k[0],X=1/0,K=_.categoricalDomain.sort(b9);if(K.forEach(function(se,le){le>0&&(X=Math.min((se||0)-(K[le-1]||0),X))}),Number.isFinite(X)){var U=X/B,G=_.layout==="vertical"?n.height:n.width;if(_.padding==="gap"&&(j=U*G/2),_.padding==="no-gap"){var J=Ro(e.barCategoryGap,U*G),F=U*G/2;j=F-J-(F-J)/G*J}}}i==="xAxis"?R=[n.left+(O.left||0)+(j||0),n.left+n.width-(O.right||0)-(j||0)]:i==="yAxis"?R=u==="horizontal"?[n.top+n.height-(O.bottom||0),n.top+(O.top||0)]:[n.top+(O.top||0)+(j||0),n.top+n.height-(O.bottom||0)-(j||0)]:R=_.range,T&&(R=[R[1],R[0]]);var te=RX(_,a,g),q=te.scale,z=te.realScaleType;q.domain(k).range(R),IX(q);var L=qX(q,Hn(Hn({},_),{},{realScaleType:z}));i==="xAxis"?(W=b==="top"&&!A||b==="bottom"&&A,M=n.left,Y=h[C]-W*_.height):i==="yAxis"&&(W=b==="left"&&!A||b==="right"&&A,M=h[C]-W*_.width,Y=n.top);var Z=Hn(Hn(Hn({},_),L),{},{realScaleType:z,x:M,y:Y,scale:q,width:i==="xAxis"?n.width:_.width,height:i==="yAxis"?n.height:_.height});return Z.bandSize=vh(Z,L),!_.hide&&i==="xAxis"?h[C]+=(W?-1:1)*Z.height:_.hide||(h[C]+=(W?-1:1)*Z.width),Hn(Hn({},v),{},Ap({},x,Z))},{})},$$=function(e,r){var n=e.x,i=e.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},kee=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return $$({x:r,y:n},{x:i,y:a})},M$=(function(){function t(e){wee(this,t),this.scale=e}return _ee(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(r)+c}default:return this.scale(r)}if(i){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+u}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new t(r)}}])})();Ap(M$,"EPS",1e-4);var U1=function(e){var r=Object.keys(e).reduce(function(n,i){return Hn(Hn({},n),{},Ap({},i,M$.create(e[i])))},{});return Hn(Hn({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,c=a.position;return ZQ(i,function(u,d){return r[d].apply(u,{bandAware:o,position:c})})},isInRange:function(i){return C$(i,function(a,o){return r[o].isInRange(a)})}})};function Eee(t){return(t%180+180)%180}var Oee=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Eee(i),o=a*Math.PI/180,c=Math.atan(n/r),u=o>c&&o<Math.PI-c?n/Math.sin(o):r/Math.cos(o);return Math.abs(u)},wb,Bj;function Aee(){if(Bj)return wb;Bj=1;var t=Fa(),e=Iu(),r=dp();function n(i){return function(a,o,c){var u=Object(a);if(!e(a)){var d=t(o,3);a=r(a),o=function(h){return d(u[h],h,u)}}var p=i(a,o,c);return p>-1?u[d?a[p]:p]:void 0}}return wb=n,wb}var _b,Uj;function Tee(){if(Uj)return _b;Uj=1;var t=E$();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return _b=e,_b}var Sb,qj;function Cee(){if(qj)return Sb;qj=1;var t=XR(),e=Fa(),r=Tee(),n=Math.max;function i(a,o,c){var u=a==null?0:a.length;if(!u)return-1;var d=c==null?0:r(c);return d<0&&(d=n(u+d,0)),t(a,e(o,3),d)}return Sb=i,Sb}var kb,Fj;function jee(){if(Fj)return kb;Fj=1;var t=Aee(),e=Cee(),r=t(e);return kb=r,kb}var Pee=jee();const Nee=vt(Pee);var Ree=dR();const Iee=vt(Ree);var $ee=Iee(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),q1=N.createContext(void 0),F1=N.createContext(void 0),L$=N.createContext(void 0),D$=N.createContext({}),z$=N.createContext(void 0),B$=N.createContext(0),U$=N.createContext(0),Hj=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=e.clipPathId,c=e.children,u=e.width,d=e.height,p=$ee(a);return I.createElement(q1.Provider,{value:n},I.createElement(F1.Provider,{value:i},I.createElement(D$.Provider,{value:a},I.createElement(L$.Provider,{value:p},I.createElement(z$.Provider,{value:o},I.createElement(B$.Provider,{value:d},I.createElement(U$.Provider,{value:u},c)))))))},Mee=function(){return N.useContext(z$)},q$=function(e){var r=N.useContext(q1);r==null&&$o();var n=r[e];return n==null&&$o(),n},Lee=function(){var e=N.useContext(q1);return Na(e)},Dee=function(){var e=N.useContext(F1),r=Nee(e,function(n){return C$(n.domain,Number.isFinite)});return r||Na(e)},F$=function(e){var r=N.useContext(F1);r==null&&$o();var n=r[e];return n==null&&$o(),n},zee=function(){var e=N.useContext(L$);return e},Bee=function(){return N.useContext(D$)},H1=function(){return N.useContext(U$)},W1=function(){return N.useContext(B$)};function rl(t){"@babel/helpers - typeof";return rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rl(t)}function Uee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W$(n.key),n)}}function Fee(t,e,r){return e&&qee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Hee(t,e,r){return e=Rh(e),Wee(t,H$()?Reflect.construct(e,r||[],Rh(t).constructor):e.apply(t,r))}function Wee(t,e){if(e&&(rl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gee(t)}function Gee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function H$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(H$=function(){return!!t})()}function Rh(t){return Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rh(t)}function Kee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ew(t,e)}function ew(t,e){return ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ew(t,e)}function Wj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Gj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wj(Object(r),!0).forEach(function(n){G1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function G1(t,e,r){return e=W$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function W$(t){var e=Vee(t,"string");return rl(e)=="symbol"?e:e+""}function Vee(t,e){if(rl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(rl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Xee(t,e){return Qee(t)||Zee(t,e)||Jee(t,e)||Yee()}function Yee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
498
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jee(t,e){if(t){if(typeof t=="string")return Kj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kj(t,e)}}function Kj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Zee(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function Qee(t){if(Array.isArray(t))return t}function tw(){return tw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},tw.apply(this,arguments)}var ete=function(e,r){var n;return I.isValidElement(e)?n=I.cloneElement(e,r):Ye(e)?n=e(r):n=I.createElement("line",tw({},r,{className:"recharts-reference-line-line"})),n},tte=function(e,r,n,i,a,o,c,u,d){var p=a.x,h=a.y,g=a.width,v=a.height;if(n){var x=d.y,_=e.y.apply(x,{position:o});if(Si(d,"discard")&&!e.y.isInRange(_))return null;var b=[{x:p+g,y:_},{x:p,y:_}];return u==="left"?b.reverse():b}if(r){var k=d.x,E=e.x.apply(k,{position:o});if(Si(d,"discard")&&!e.x.isInRange(E))return null;var O=[{x:E,y:h+v},{x:E,y:h}];return c==="top"?O.reverse():O}if(i){var A=d.segment,T=A.map(function(C){return e.apply(C,{position:o})});return Si(d,"discard")&&VQ(T,function(C){return!e.isInRange(C)})?null:T}return null};function rte(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,a=t.yAxisId,o=t.shape,c=t.className,u=t.alwaysShow,d=Mee(),p=q$(i),h=F$(a),g=zee();if(!d||!g)return null;Ki(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=U1({x:p.scale,y:h.scale}),x=or(e),_=or(r),b=n&&n.length===2,k=tte(v,x,_,b,g,t.position,p.orientation,h.orientation,t);if(!k)return null;var E=Xee(k,2),O=E[0],A=O.x,T=O.y,C=E[1],j=C.x,R=C.y,M=Si(t,"hidden")?"url(#".concat(d,")"):void 0,Y=Gj(Gj({clipPath:M},it(t,!0)),{},{x1:A,y1:T,x2:j,y2:R});return I.createElement(Xt,{className:at("recharts-reference-line",c)},ete(o,Y),jr.renderCallByParent(t,kee({x1:A,y1:T,x2:j,y2:R})))}var K1=(function(t){function e(){return Uee(this,e),Hee(this,e,arguments)}return Kee(e,t),Fee(e,[{key:"render",value:function(){return I.createElement(rte,this.props)}}])})(I.Component);G1(K1,"displayName","ReferenceLine");G1(K1,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function rw(){return rw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},rw.apply(this,arguments)}function nl(t){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nl(t)}function Vj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Xj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vj(Object(r),!0).forEach(function(n){Tp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ite(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,K$(n.key),n)}}function ate(t,e,r){return e&&ite(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ote(t,e,r){return e=Ih(e),ste(t,G$()?Reflect.construct(e,r||[],Ih(t).constructor):e.apply(t,r))}function ste(t,e){if(e&&(nl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lte(t)}function lte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function G$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G$=function(){return!!t})()}function Ih(t){return Ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ih(t)}function cte(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nw(t,e)}function nw(t,e){return nw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},nw(t,e)}function Tp(t,e,r){return e=K$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K$(t){var e=ute(t,"string");return nl(e)=="symbol"?e:e+""}function ute(t,e){if(nl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(nl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var dte=function(e){var r=e.x,n=e.y,i=e.xAxis,a=e.yAxis,o=U1({x:i.scale,y:a.scale}),c=o.apply({x:r,y:n},{bandAware:!0});return Si(e,"discard")&&!o.isInRange(c)?null:c},Cp=(function(t){function e(){return nte(this,e),ote(this,e,arguments)}return cte(e,t),ate(e,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,c=n.alwaysShow,u=n.clipPathId,d=or(i),p=or(a);if(Ki(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!d||!p)return null;var h=dte(this.props);if(!h)return null;var g=h.x,v=h.y,x=this.props,_=x.shape,b=x.className,k=Si(this.props,"hidden")?"url(#".concat(u,")"):void 0,E=Xj(Xj({clipPath:k},it(this.props,!0)),{},{cx:g,cy:v});return I.createElement(Xt,{className:at("recharts-reference-dot",b)},e.renderDot(_,E),jr.renderCallByParent(this.props,{x:g-o,y:v-o,width:2*o,height:2*o}))}}])})(I.Component);Tp(Cp,"displayName","ReferenceDot");Tp(Cp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Tp(Cp,"renderDot",function(t,e){var r;return I.isValidElement(t)?r=I.cloneElement(t,e):Ye(t)?r=t(e):r=I.createElement(B1,rw({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function iw(){return iw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},iw.apply(this,arguments)}function il(t){"@babel/helpers - typeof";return il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},il(t)}function Yj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yj(Object(r),!0).forEach(function(n){jp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function fte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hte(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,X$(n.key),n)}}function pte(t,e,r){return e&&hte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function mte(t,e,r){return e=$h(e),gte(t,V$()?Reflect.construct(e,r||[],$h(t).constructor):e.apply(t,r))}function gte(t,e){if(e&&(il(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yte(t)}function yte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function V$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V$=function(){return!!t})()}function $h(t){return $h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$h(t)}function vte(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aw(t,e)}function aw(t,e){return aw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},aw(t,e)}function jp(t,e,r){return e=X$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X$(t){var e=bte(t,"string");return il(e)=="symbol"?e:e+""}function bte(t,e){if(il(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(il(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var xte=function(e,r,n,i,a){var o=a.x1,c=a.x2,u=a.y1,d=a.y2,p=a.xAxis,h=a.yAxis;if(!p||!h)return null;var g=U1({x:p.scale,y:h.scale}),v={x:e?g.x.apply(o,{position:"start"}):g.x.rangeMin,y:n?g.y.apply(u,{position:"start"}):g.y.rangeMin},x={x:r?g.x.apply(c,{position:"end"}):g.x.rangeMax,y:i?g.y.apply(d,{position:"end"}):g.y.rangeMax};return Si(a,"discard")&&(!g.isInRange(v)||!g.isInRange(x))?null:$$(v,x)},Pp=(function(t){function e(){return fte(this,e),mte(this,e,arguments)}return vte(e,t),pte(e,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,c=n.y2,u=n.className,d=n.alwaysShow,p=n.clipPathId;Ki(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=or(i),g=or(a),v=or(o),x=or(c),_=this.props.shape;if(!h&&!g&&!v&&!x&&!_)return null;var b=xte(h,g,v,x,this.props);if(!b&&!_)return null;var k=Si(this.props,"hidden")?"url(#".concat(p,")"):void 0;return I.createElement(Xt,{className:at("recharts-reference-area",u)},e.renderRect(_,Jj(Jj({clipPath:k},it(this.props,!0)),b)),jr.renderCallByParent(this.props,b))}}])})(I.Component);jp(Pp,"displayName","ReferenceArea");jp(Pp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});jp(Pp,"renderRect",function(t,e){var r;return I.isValidElement(t)?r=I.cloneElement(t,e):Ye(t)?r=t(e):r=I.createElement(z1,iw({},e,{className:"recharts-reference-area-rect"})),r});function Y$(t,e,r){if(e<1)return[];if(e===1&&r===void 0)return t;for(var n=[],i=0;i<t.length;i+=e)n.push(t[i]);return n}function wte(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Oee(n,r)}function _te(t,e,r){var n=r==="width",i=t.x,a=t.y,o=t.width,c=t.height;return e===1?{start:n?i:a,end:n?i+o:a+c}:{start:n?i+o:a+c,end:n?i:a}}function Mh(t,e,r,n,i){if(t*e<t*n||t*e>t*i)return!1;var a=r();return t*(e-t*a/2-n)>=0&&t*(e+t*a/2-i)<=0}function Ste(t,e){return Y$(t,e+1)}function kte(t,e,r,n,i){for(var a=(n||[]).slice(),o=e.start,c=e.end,u=0,d=1,p=o,h=function(){var x=n==null?void 0:n[u];if(x===void 0)return{v:Y$(n,d)};var _=u,b,k=function(){return b===void 0&&(b=r(x,_)),b},E=x.coordinate,O=u===0||Mh(t,E,k,p,c);O||(u=0,p=o,d+=1),O&&(p=E+t*(k()/2+i),u+=d)},g;d<=a.length;)if(g=h(),g)return g.v;return[]}function wu(t){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wu(t)}function Zj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Cr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zj(Object(r),!0).forEach(function(n){Ete(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ete(t,e,r){return e=Ote(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ote(t){var e=Ate(t,"string");return wu(e)=="symbol"?e:e+""}function Ate(t,e){if(wu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tte(t,e,r,n,i){for(var a=(n||[]).slice(),o=a.length,c=e.start,u=e.end,d=function(g){var v=a[g],x,_=function(){return x===void 0&&(x=r(v,g)),x};if(g===o-1){var b=t*(v.coordinate+t*_()/2-u);a[g]=v=Cr(Cr({},v),{},{tickCoord:b>0?v.coordinate-b*t:v.coordinate})}else a[g]=v=Cr(Cr({},v),{},{tickCoord:v.coordinate});var k=Mh(t,v.tickCoord,_,c,u);k&&(u=v.tickCoord-t*(_()/2+i),a[g]=Cr(Cr({},v),{},{isShow:!0}))},p=o-1;p>=0;p--)d(p);return a}function Cte(t,e,r,n,i,a){var o=(n||[]).slice(),c=o.length,u=e.start,d=e.end;if(a){var p=n[c-1],h=r(p,c-1),g=t*(p.coordinate+t*h/2-d);o[c-1]=p=Cr(Cr({},p),{},{tickCoord:g>0?p.coordinate-g*t:p.coordinate});var v=Mh(t,p.tickCoord,function(){return h},u,d);v&&(d=p.tickCoord-t*(h/2+i),o[c-1]=Cr(Cr({},p),{},{isShow:!0}))}for(var x=a?c-1:c,_=function(E){var O=o[E],A,T=function(){return A===void 0&&(A=r(O,E)),A};if(E===0){var C=t*(O.coordinate-t*T()/2-u);o[E]=O=Cr(Cr({},O),{},{tickCoord:C<0?O.coordinate-C*t:O.coordinate})}else o[E]=O=Cr(Cr({},O),{},{tickCoord:O.coordinate});var j=Mh(t,O.tickCoord,T,u,d);j&&(u=O.tickCoord+t*(T()/2+i),o[E]=Cr(Cr({},O),{},{isShow:!0}))},b=0;b<x;b++)_(b);return o}function V1(t,e,r){var n=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,c=t.orientation,u=t.interval,d=t.tickFormatter,p=t.unit,h=t.angle;if(!i||!i.length||!n)return[];if(ge(u)||xl.isSsr)return Ste(i,typeof u=="number"&&ge(u)?u:0);var g=[],v=c==="top"||c==="bottom"?"width":"height",x=p&&v==="width"?Pc(p,{fontSize:e,letterSpacing:r}):{width:0,height:0},_=function(O,A){var T=Ye(d)?d(O.value,A):O.value;return v==="width"?wte(Pc(T,{fontSize:e,letterSpacing:r}),x,h):Pc(T,{fontSize:e,letterSpacing:r})[v]},b=i.length>=2?Jn(i[1].coordinate-i[0].coordinate):1,k=_te(a,b,v);return u==="equidistantPreserveStart"?kte(b,k,_,i,o):(u==="preserveStart"||u==="preserveStartEnd"?g=Cte(b,k,_,i,o,u==="preserveStartEnd"):g=Tte(b,k,_,i,o),g.filter(function(E){return E.isShow}))}var jte=["viewBox"],Pte=["viewBox"],Nte=["ticks"];function al(t){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},al(t)}function Rs(){return Rs=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Rs.apply(this,arguments)}function Qj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ir(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qj(Object(r),!0).forEach(function(n){X1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Eb(t,e){if(t==null)return{};var r=Rte(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Rte(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Ite(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Z$(n.key),n)}}function $te(t,e,r){return e&&eP(t.prototype,e),r&&eP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Mte(t,e,r){return e=Lh(e),Lte(t,J$()?Reflect.construct(e,r||[],Lh(t).constructor):e.apply(t,r))}function Lte(t,e){if(e&&(al(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dte(t)}function Dte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function J$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(J$=function(){return!!t})()}function Lh(t){return Lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lh(t)}function zte(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ow(t,e)}function ow(t,e){return ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ow(t,e)}function X1(t,e,r){return e=Z$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z$(t){var e=Bte(t,"string");return al(e)=="symbol"?e:e+""}function Bte(t,e){if(al(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(al(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var kl=(function(t){function e(r){var n;return Ite(this,e),n=Mte(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return zte(e,t),$te(e,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=Eb(n,jte),c=this.props,u=c.viewBox,d=Eb(c,Pte);return!Ds(a,u)||!Ds(o,d)||!Ds(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.x,o=i.y,c=i.width,u=i.height,d=i.orientation,p=i.tickSize,h=i.mirror,g=i.tickMargin,v,x,_,b,k,E,O=h?-1:1,A=n.tickSize||p,T=ge(n.tickCoord)?n.tickCoord:n.coordinate;switch(d){case"top":v=x=n.coordinate,b=o+ +!h*u,_=b-O*A,E=_-O*g,k=T;break;case"left":_=b=n.coordinate,x=a+ +!h*c,v=x-O*A,k=v-O*g,E=T;break;case"right":_=b=n.coordinate,x=a+ +h*c,v=x+O*A,k=v+O*g,E=T;break;default:v=x=n.coordinate,b=o+ +h*u,_=b+O*A,E=_+O*g,k=T;break}return{line:{x1:v,y1:_,x2:x,y2:b},tick:{x:k,y:E}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,c=n.height,u=n.orientation,d=n.mirror,p=n.axisLine,h=ir(ir(ir({},it(this.props,!1)),it(p,!1)),{},{fill:"none"});if(u==="top"||u==="bottom"){var g=+(u==="top"&&!d||u==="bottom"&&d);h=ir(ir({},h),{},{x1:i,y1:a+g*c,x2:i+o,y2:a+g*c})}else{var v=+(u==="left"&&!d||u==="right"&&d);h=ir(ir({},h),{},{x1:i+v*o,y1:a,x2:i+v*o,y2:a+c})}return I.createElement("line",Rs({},h,{className:at("recharts-cartesian-axis-line",An(p,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,c=this.props,u=c.tickLine,d=c.stroke,p=c.tick,h=c.tickFormatter,g=c.unit,v=V1(ir(ir({},this.props),{},{ticks:n}),i,a),x=this.getTickTextAnchor(),_=this.getTickVerticalAnchor(),b=it(this.props,!1),k=it(p,!1),E=ir(ir({},b),{},{fill:"none"},it(u,!1)),O=v.map(function(A,T){var C=o.getTickLineCoord(A),j=C.line,R=C.tick,M=ir(ir(ir(ir({textAnchor:x,verticalAnchor:_},b),{},{stroke:"none",fill:d},k),R),{},{index:T,payload:A,visibleTicksCount:v.length,tickFormatter:h});return I.createElement(Xt,Rs({className:"recharts-cartesian-axis-tick",key:"tick-".concat(A.value,"-").concat(A.coordinate,"-").concat(A.tickCoord)},Wf(o.props,A,T)),u&&I.createElement("line",Rs({},E,j,{className:at("recharts-cartesian-axis-tick-line",An(u,"className"))})),p&&e.renderTickItem(p,M,"".concat(Ye(h)?h(A.value,T):A.value).concat(g||"")))});return I.createElement("g",{className:"recharts-cartesian-axis-ticks"},O)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,c=i.height,u=i.ticksGenerator,d=i.className,p=i.hide;if(p)return null;var h=this.props,g=h.ticks,v=Eb(h,Nte),x=g;return Ye(u)&&(x=g&&g.length>0?u(this.props):u(v)),o<=0||c<=0||!x||!x.length?null:I.createElement(Xt,{className:at("recharts-cartesian-axis",d),ref:function(b){n.layerReference=b}},a&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),jr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,c=at(i.className,"recharts-cartesian-axis-tick-value");return I.isValidElement(n)?o=I.cloneElement(n,ir(ir({},i),{},{className:c})):Ye(n)?o=n(ir(ir({},i),{},{className:c})):o=I.createElement(nh,Rs({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(N.Component);X1(kl,"displayName","CartesianAxis");X1(kl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Ute=["x1","y1","x2","y2","key"],qte=["offset"];function Mo(t){"@babel/helpers - typeof";return Mo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mo(t)}function tP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tP(Object(r),!0).forEach(function(n){Fte(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fte(t,e,r){return e=Hte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hte(t){var e=Wte(t,"string");return Mo(e)=="symbol"?e:e+""}function Wte(t,e){if(Mo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Mo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Oo(){return Oo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Oo.apply(this,arguments)}function rP(t,e){if(t==null)return{};var r=Gte(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Gte(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Kte=function(e){var r=e.fill;if(!r||r==="none")return null;var n=e.fillOpacity,i=e.x,a=e.y,o=e.width,c=e.height,u=e.ry;return I.createElement("rect",{x:i,y:a,ry:u,width:o,height:c,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Q$(t,e){var r;if(I.isValidElement(t))r=I.cloneElement(t,e);else if(Ye(t))r=t(e);else{var n=e.x1,i=e.y1,a=e.x2,o=e.y2,c=e.key,u=rP(e,Ute),d=it(u,!1);d.offset;var p=rP(d,qte);r=I.createElement("line",Oo({},p,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:c}))}return r}function Vte(t){var e=t.x,r=t.width,n=t.horizontal,i=n===void 0?!0:n,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(c,u){var d=Pr(Pr({},t),{},{x1:e,y1:c,x2:e+r,y2:c,key:"line-".concat(u),index:u});return Q$(i,d)});return I.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Xte(t){var e=t.y,r=t.height,n=t.vertical,i=n===void 0?!0:n,a=t.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(c,u){var d=Pr(Pr({},t),{},{x1:c,y1:e,x2:c,y2:e+r,key:"line-".concat(u),index:u});return Q$(i,d)});return I.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Yte(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,a=t.width,o=t.height,c=t.horizontalPoints,u=t.horizontal,d=u===void 0?!0:u;if(!d||!e||!e.length)return null;var p=c.map(function(g){return Math.round(g+i-i)}).sort(function(g,v){return g-v});i!==p[0]&&p.unshift(0);var h=p.map(function(g,v){var x=!p[v+1],_=x?i+o-g:p[v+1]-g;if(_<=0)return null;var b=v%e.length;return I.createElement("rect",{key:"react-".concat(v),y:g,x:n,height:_,width:a,stroke:"none",fill:e[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return I.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function Jte(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,a=t.x,o=t.y,c=t.width,u=t.height,d=t.verticalPoints;if(!r||!n||!n.length)return null;var p=d.map(function(g){return Math.round(g+a-a)}).sort(function(g,v){return g-v});a!==p[0]&&p.unshift(0);var h=p.map(function(g,v){var x=!p[v+1],_=x?a+c-g:p[v+1]-g;if(_<=0)return null;var b=v%n.length;return I.createElement("rect",{key:"react-".concat(v),x:g,y:o,width:_,height:u,stroke:"none",fill:n[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return I.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var Zte=function(e,r){var n=e.xAxis,i=e.width,a=e.height,o=e.offset;return f$(V1(Pr(Pr(Pr({},kl.defaultProps),n),{},{ticks:Hi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},Qte=function(e,r){var n=e.yAxis,i=e.width,a=e.height,o=e.offset;return f$(V1(Pr(Pr(Pr({},kl.defaultProps),n),{},{ticks:Hi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},ks={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function _u(t){var e,r,n,i,a,o,c=H1(),u=W1(),d=Bee(),p=Pr(Pr({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:ks.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:ks.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:ks.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:ks.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:ks.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:ks.verticalFill,x:ge(t.x)?t.x:d.left,y:ge(t.y)?t.y:d.top,width:ge(t.width)?t.width:d.width,height:ge(t.height)?t.height:d.height}),h=p.x,g=p.y,v=p.width,x=p.height,_=p.syncWithTicks,b=p.horizontalValues,k=p.verticalValues,E=Lee(),O=Dee();if(!ge(v)||v<=0||!ge(x)||x<=0||!ge(h)||h!==+h||!ge(g)||g!==+g)return null;var A=p.verticalCoordinatesGenerator||Zte,T=p.horizontalCoordinatesGenerator||Qte,C=p.horizontalPoints,j=p.verticalPoints;if((!C||!C.length)&&Ye(T)){var R=b&&b.length,M=T({yAxis:O?Pr(Pr({},O),{},{ticks:R?b:O.ticks}):void 0,width:c,height:u,offset:d},R?!0:_);Ki(Array.isArray(M),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Mo(M),"]")),Array.isArray(M)&&(C=M)}if((!j||!j.length)&&Ye(A)){var Y=k&&k.length,W=A({xAxis:E?Pr(Pr({},E),{},{ticks:Y?k:E.ticks}):void 0,width:c,height:u,offset:d},Y?!0:_);Ki(Array.isArray(W),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Mo(W),"]")),Array.isArray(W)&&(j=W)}return I.createElement("g",{className:"recharts-cartesian-grid"},I.createElement(Kte,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),I.createElement(Vte,Oo({},p,{offset:d,horizontalPoints:C,xAxis:E,yAxis:O})),I.createElement(Xte,Oo({},p,{offset:d,verticalPoints:j,xAxis:E,yAxis:O})),I.createElement(Yte,Oo({},p,{horizontalPoints:C})),I.createElement(Jte,Oo({},p,{verticalPoints:j})))}_u.displayName="CartesianGrid";var ere=["type","layout","connectNulls","ref"],tre=["key"];function ol(t){"@babel/helpers - typeof";return ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ol(t)}function nP(t,e){if(t==null)return{};var r=rre(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function rre(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function $c(){return $c=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},$c.apply(this,arguments)}function iP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function an(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iP(Object(r),!0).forEach(function(n){Wn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Es(t){return ore(t)||are(t)||ire(t)||nre()}function nre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
499
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ire(t,e){if(t){if(typeof t=="string")return sw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sw(t,e)}}function are(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ore(t){if(Array.isArray(t))return sw(t)}function sw(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tM(n.key),n)}}function lre(t,e,r){return e&&aP(t.prototype,e),r&&aP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cre(t,e,r){return e=Dh(e),ure(t,eM()?Reflect.construct(e,r||[],Dh(t).constructor):e.apply(t,r))}function ure(t,e){if(e&&(ol(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dre(t)}function dre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eM=function(){return!!t})()}function Dh(t){return Dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dh(t)}function fre(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lw(t,e)}function lw(t,e){return lw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},lw(t,e)}function Wn(t,e,r){return e=tM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tM(t){var e=hre(t,"string");return ol(e)=="symbol"?e:e+""}function hre(t,e){if(ol(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ol(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Bu=(function(t){function e(){var r;sre(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=cre(this,e,[].concat(i)),Wn(r,"state",{isAnimationFinished:!0,totalLength:0}),Wn(r,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Wn(r,"getStrokeDasharray",function(o,c,u){var d=u.reduce(function(k,E){return k+E});if(!d)return r.generateSimpleStrokeDasharray(c,o);for(var p=Math.floor(o/d),h=o%d,g=c-o,v=[],x=0,_=0;x<u.length;_+=u[x],++x)if(_+u[x]>h){v=[].concat(Es(u.slice(0,x)),[h-_]);break}var b=v.length%2===0?[0,g]:[g];return[].concat(Es(e.repeat(u,p)),Es(v),b).map(function(k){return"".concat(k,"px")}).join(", ")}),Wn(r,"id",Ru("recharts-line-")),Wn(r,"pathRef",function(o){r.mainCurve=o}),Wn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Wn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return fre(e,t),lre(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,c=a.xAxis,u=a.yAxis,d=a.layout,p=a.children,h=Tn(p,zu);if(!h)return null;var g=function(_,b){return{x:_.x,y:_.y,value:_.value,errorVal:dn(_.payload,b)}},v={clipPath:n?"url(#clipPath-".concat(i,")"):null};return I.createElement(Xt,v,h.map(function(x){return I.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,dataPointFormatter:g})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,u=c.dot,d=c.points,p=c.dataKey,h=it(this.props,!1),g=it(u,!0),v=d.map(function(_,b){var k=an(an(an({key:"dot-".concat(b),r:3},h),g),{},{index:b,cx:_.x,cy:_.y,value:_.value,dataKey:p,payload:_.payload,points:d});return e.renderDotItem(u,k)}),x={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return I.createElement(Xt,$c({className:"recharts-line-dots",key:"dots"},x),v)}},{key:"renderCurveStatically",value:function(n,i,a,o){var c=this.props,u=c.type,d=c.layout,p=c.connectNulls;c.ref;var h=nP(c,ere),g=an(an(an({},it(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:u,layout:d,connectNulls:p});return I.createElement(zx,$c({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,c=o.points,u=o.strokeDasharray,d=o.isAnimationActive,p=o.animationBegin,h=o.animationDuration,g=o.animationEasing,v=o.animationId,x=o.animateNewValues,_=o.width,b=o.height,k=this.state,E=k.prevPoints,O=k.totalLength;return I.createElement(Qi,{begin:p,duration:h,isActive:d,easing:g,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var T=A.t;if(E){var C=E.length/c.length,j=c.map(function(B,X){var K=Math.floor(X*C);if(E[K]){var U=E[K],G=Vn(U.x,B.x),J=Vn(U.y,B.y);return an(an({},B),{},{x:G(T),y:J(T)})}if(x){var F=Vn(_*2,B.x),te=Vn(b/2,B.y);return an(an({},B),{},{x:F(T),y:te(T)})}return an(an({},B),{},{x:B.x,y:B.y})});return a.renderCurveStatically(j,n,i)}var R=Vn(0,O),M=R(T),Y;if(u){var W="".concat(u).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});Y=a.getStrokeDasharray(M,O,W)}else Y=a.generateSimpleStrokeDasharray(O,M);return a.renderCurveStatically(c,n,i,{strokeDasharray:Y})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,c=a.isAnimationActive,u=this.state,d=u.prevPoints,p=u.totalLength;return c&&o&&o.length&&(!d&&p>0||!_p(d,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,c=i.points,u=i.className,d=i.xAxis,p=i.yAxis,h=i.top,g=i.left,v=i.width,x=i.height,_=i.isAnimationActive,b=i.id;if(a||!c||!c.length)return null;var k=this.state.isAnimationFinished,E=c.length===1,O=at("recharts-line",u),A=d&&d.allowDataOverflow,T=p&&p.allowDataOverflow,C=A||T,j=Qe(b)?this.id:b,R=(n=it(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},M=R.r,Y=M===void 0?3:M,W=R.strokeWidth,B=W===void 0?2:W,X=T9(o)?o:{},K=X.clipDot,U=K===void 0?!0:K,G=Y*2+B;return I.createElement(Xt,{className:O},A||T?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(j)},I.createElement("rect",{x:A?g:g-v/2,y:T?h:h-x/2,width:A?v:v*2,height:T?x:x*2})),!U&&I.createElement("clipPath",{id:"clipPath-dots-".concat(j)},I.createElement("rect",{x:g-G/2,y:h-G/2,width:v+G,height:x+G}))):null,!E&&this.renderCurve(C,j),this.renderErrorBar(C,j),(E||o)&&this.renderDots(C,U,j),(!_||k)&&La.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Es(n),[0]):n,o=[],c=0;c<i;++c)o=[].concat(Es(o),Es(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(I.isValidElement(n))a=I.cloneElement(n,i);else if(Ye(n))a=n(i);else{var o=i.key,c=nP(i,tre),u=at("recharts-line-dot",typeof n!="boolean"?n.className:"");a=I.createElement(B1,$c({key:o},c,{className:u}))}return a}}])})(N.PureComponent);Wn(Bu,"displayName","Line");Wn(Bu,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!xl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Wn(Bu,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,o=t.dataKey,c=t.bandSize,u=t.displayedData,d=t.offset,p=e.layout,h=u.map(function(g,v){var x=dn(g,o);return p==="horizontal"?{x:_C({axis:r,ticks:i,bandSize:c,entry:g,index:v}),y:Qe(x)?null:n.scale(x),value:x,payload:g}:{x:Qe(x)?null:r.scale(x),y:_C({axis:n,ticks:a,bandSize:c,entry:g,index:v}),value:x,payload:g}});return an({points:h,layout:p},d)});function sl(t){"@babel/helpers - typeof";return sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sl(t)}function pre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mre(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iM(n.key),n)}}function gre(t,e,r){return e&&mre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function yre(t,e,r){return e=zh(e),vre(t,rM()?Reflect.construct(e,r||[],zh(t).constructor):e.apply(t,r))}function vre(t,e){if(e&&(sl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bre(t)}function bre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rM=function(){return!!t})()}function zh(t){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zh(t)}function xre(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cw(t,e)}function cw(t,e){return cw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cw(t,e)}function nM(t,e,r){return e=iM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iM(t){var e=wre(t,"string");return sl(e)=="symbol"?e:e+""}function wre(t,e){if(sl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(sl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function uw(){return uw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},uw.apply(this,arguments)}function _re(t){var e=t.xAxisId,r=H1(),n=W1(),i=q$(e);return i==null?null:N.createElement(kl,uw({},i,{className:at("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Hi(o,!0)}}))}var za=(function(t){function e(){return pre(this,e),yre(this,e,arguments)}return xre(e,t),gre(e,[{key:"render",value:function(){return N.createElement(_re,this.props)}}])})(N.Component);nM(za,"displayName","XAxis");nM(za,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function ll(t){"@babel/helpers - typeof";return ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ll(t)}function Sre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kre(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,sM(n.key),n)}}function Ere(t,e,r){return e&&kre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ore(t,e,r){return e=Bh(e),Are(t,aM()?Reflect.construct(e,r||[],Bh(t).constructor):e.apply(t,r))}function Are(t,e){if(e&&(ll(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tre(t)}function Tre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aM=function(){return!!t})()}function Bh(t){return Bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bh(t)}function Cre(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dw(t,e)}function dw(t,e){return dw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dw(t,e)}function oM(t,e,r){return e=sM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sM(t){var e=jre(t,"string");return ll(e)=="symbol"?e:e+""}function jre(t,e){if(ll(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ll(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function fw(){return fw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fw.apply(this,arguments)}var Pre=function(e){var r=e.yAxisId,n=H1(),i=W1(),a=F$(r);return a==null?null:N.createElement(kl,fw({},a,{className:at("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(c){return Hi(c,!0)}}))},Ba=(function(t){function e(){return Sre(this,e),Ore(this,e,arguments)}return Cre(e,t),Ere(e,[{key:"render",value:function(){return N.createElement(Pre,this.props)}}])})(N.Component);oM(Ba,"displayName","YAxis");oM(Ba,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function oP(t){return $re(t)||Ire(t)||Rre(t)||Nre()}function Nre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
500
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rre(t,e){if(t){if(typeof t=="string")return hw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hw(t,e)}}function Ire(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $re(t){if(Array.isArray(t))return hw(t)}function hw(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var pw=function(e,r,n,i,a){var o=Tn(e,K1),c=Tn(e,Cp),u=[].concat(oP(o),oP(c)),d=Tn(e,Pp),p="".concat(i,"Id"),h=i[0],g=r;if(u.length&&(g=u.reduce(function(_,b){if(b.props[p]===n&&Si(b.props,"extendDomain")&&ge(b.props[h])){var k=b.props[h];return[Math.min(_[0],k),Math.max(_[1],k)]}return _},g)),d.length){var v="".concat(h,"1"),x="".concat(h,"2");g=d.reduce(function(_,b){if(b.props[p]===n&&Si(b.props,"extendDomain")&&ge(b.props[v])&&ge(b.props[x])){var k=b.props[v],E=b.props[x];return[Math.min(_[0],k,E),Math.max(_[1],k,E)]}return _},g)}return a&&a.length&&(g=a.reduce(function(_,b){return ge(b)?[Math.min(_[0],b),Math.max(_[1],b)]:_},g)),g},Ob={exports:{}},sP;function Mre(){return sP||(sP=1,(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(u,d,p){this.fn=u,this.context=d,this.once=p||!1}function a(u,d,p,h,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,h||u,g),x=r?r+d:d;return u._events[x]?u._events[x].fn?u._events[x]=[u._events[x],v]:u._events[x].push(v):(u._events[x]=v,u._eventsCount++),u}function o(u,d){--u._eventsCount===0?u._events=new n:delete u._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],p,h;if(this._eventsCount===0)return d;for(h in p=this._events)e.call(p,h)&&d.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},c.prototype.listeners=function(d){var p=r?r+d:d,h=this._events[p];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,v=h.length,x=new Array(v);g<v;g++)x[g]=h[g].fn;return x},c.prototype.listenerCount=function(d){var p=r?r+d:d,h=this._events[p];return h?h.fn?1:h.length:0},c.prototype.emit=function(d,p,h,g,v,x){var _=r?r+d:d;if(!this._events[_])return!1;var b=this._events[_],k=arguments.length,E,O;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),k){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,p),!0;case 3:return b.fn.call(b.context,p,h),!0;case 4:return b.fn.call(b.context,p,h,g),!0;case 5:return b.fn.call(b.context,p,h,g,v),!0;case 6:return b.fn.call(b.context,p,h,g,v,x),!0}for(O=1,E=new Array(k-1);O<k;O++)E[O-1]=arguments[O];b.fn.apply(b.context,E)}else{var A=b.length,T;for(O=0;O<A;O++)switch(b[O].once&&this.removeListener(d,b[O].fn,void 0,!0),k){case 1:b[O].fn.call(b[O].context);break;case 2:b[O].fn.call(b[O].context,p);break;case 3:b[O].fn.call(b[O].context,p,h);break;case 4:b[O].fn.call(b[O].context,p,h,g);break;default:if(!E)for(T=1,E=new Array(k-1);T<k;T++)E[T-1]=arguments[T];b[O].fn.apply(b[O].context,E)}}return!0},c.prototype.on=function(d,p,h){return a(this,d,p,h,!1)},c.prototype.once=function(d,p,h){return a(this,d,p,h,!0)},c.prototype.removeListener=function(d,p,h,g){var v=r?r+d:d;if(!this._events[v])return this;if(!p)return o(this,v),this;var x=this._events[v];if(x.fn)x.fn===p&&(!g||x.once)&&(!h||x.context===h)&&o(this,v);else{for(var _=0,b=[],k=x.length;_<k;_++)(x[_].fn!==p||g&&!x[_].once||h&&x[_].context!==h)&&b.push(x[_]);b.length?this._events[v]=b.length===1?b[0]:b:o(this,v)}return this},c.prototype.removeAllListeners=function(d){var p;return d?(p=r?r+d:d,this._events[p]&&o(this,p)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t.exports=c})(Ob)),Ob.exports}var Lre=Mre();const Dre=vt(Lre);var Ab=new Dre,Tb="recharts.syncMouseEvents";function Su(t){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Su(t)}function zre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bre(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lM(n.key),n)}}function Ure(t,e,r){return e&&Bre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Cb(t,e,r){return e=lM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lM(t){var e=qre(t,"string");return Su(e)=="symbol"?e:e+""}function qre(t,e){if(Su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Fre=(function(){function t(){zre(this,t),Cb(this,"activeIndex",0),Cb(this,"coordinateList",[]),Cb(this,"layout","horizontal")}return Ure(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,c=o===void 0?null:o,u=r.layout,d=u===void 0?null:u,p=r.offset,h=p===void 0?null:p,g=r.mouseHandlerCallback,v=g===void 0?null:g;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=c??this.container,this.layout=d??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=v??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,o=i.y,c=i.height,u=this.coordinateList[this.activeIndex].coordinate,d=((r=window)===null||r===void 0?void 0:r.scrollX)||0,p=((n=window)===null||n===void 0?void 0:n.scrollY)||0,h=a+u+d,g=o+this.offset.top+c/2+p;this.mouseHandlerCallback({pageX:h,pageY:g})}}}])})();function Hre(t,e,r){if(r==="number"&&e===!0&&Array.isArray(t)){var n=t==null?void 0:t[0],i=t==null?void 0:t[1];if(n&&i&&ge(n)&&ge(i))return!0}return!1}function Wre(t,e,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-i,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function cM(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,a=t.endAngle,o=_r(e,r,n,i),c=_r(e,r,n,a);return{points:[o,c],cx:e,cy:r,radius:n,startAngle:i,endAngle:a}}function Gre(t,e,r){var n,i,a,o;if(t==="horizontal")n=e.x,a=n,i=r.top,o=r.top+r.height;else if(t==="vertical")i=e.y,o=i,n=r.left,a=r.left+r.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var c=e.cx,u=e.cy,d=e.innerRadius,p=e.outerRadius,h=e.angle,g=_r(c,u,d,h),v=_r(c,u,p,h);n=g.x,i=g.y,a=v.x,o=v.y}else return cM(e);return[{x:n,y:i},{x:a,y:o}]}function ku(t){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ku(t)}function lP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function wf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lP(Object(r),!0).forEach(function(n){Kre(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Kre(t,e,r){return e=Vre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vre(t){var e=Xre(t,"string");return ku(e)=="symbol"?e:e+""}function Xre(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yre(t){var e,r,n=t.element,i=t.tooltipEventType,a=t.isActive,o=t.activeCoordinate,c=t.activePayload,u=t.offset,d=t.activeTooltipIndex,p=t.tooltipAxisBandSize,h=t.layout,g=t.chartName,v=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!v||!a||!o||g!=="ScatterChart"&&i!=="axis")return null;var x,_=zx;if(g==="ScatterChart")x=o,_=VZ;else if(g==="BarChart")x=Wre(h,o,u,p),_=z1;else if(h==="radial"){var b=cM(o),k=b.cx,E=b.cy,O=b.radius,A=b.startAngle,T=b.endAngle;x={cx:k,cy:E,startAngle:A,endAngle:T,innerRadius:O,outerRadius:O},_=y$}else x={points:Gre(h,o,u)},_=zx;var C=wf(wf(wf(wf({stroke:"#ccc",pointerEvents:"none"},u),x),it(v,!1)),{},{payload:c,payloadIndex:d,className:at("recharts-tooltip-cursor",v.className)});return N.isValidElement(v)?N.cloneElement(v,C):N.createElement(_,C)}var Jre=["item"],Zre=["children","className","width","height","style","compact","title","desc"];function cl(t){"@babel/helpers - typeof";return cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cl(t)}function Is(){return Is=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Is.apply(this,arguments)}function cP(t,e){return tne(t)||ene(t,e)||dM(t,e)||Qre()}function Qre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
501
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ene(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function tne(t){if(Array.isArray(t))return t}function uP(t,e){if(t==null)return{};var r=rne(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function rne(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function nne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ine(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fM(n.key),n)}}function ane(t,e,r){return e&&ine(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function one(t,e,r){return e=Uh(e),sne(t,uM()?Reflect.construct(e,r||[],Uh(t).constructor):e.apply(t,r))}function sne(t,e){if(e&&(cl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lne(t)}function lne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uM=function(){return!!t})()}function Uh(t){return Uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uh(t)}function cne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mw(t,e)}function mw(t,e){return mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mw(t,e)}function ul(t){return fne(t)||dne(t)||dM(t)||une()}function une(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
502
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dM(t,e){if(t){if(typeof t=="string")return gw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gw(t,e)}}function dne(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function fne(t){if(Array.isArray(t))return gw(t)}function gw(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dP(Object(r),!0).forEach(function(n){ze(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ze(t,e,r){return e=fM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fM(t){var e=hne(t,"string");return cl(e)=="symbol"?e:e+""}function hne(t,e){if(cl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var pne={xAxis:["bottom","top"],yAxis:["left","right"]},mne={width:"100%",height:"100%"},hM={x:0,y:0};function _f(t){return t}var gne=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},yne=function(e,r,n,i){var a=r.find(function(p){return p&&p.index===n});if(a){if(e==="horizontal")return{x:a.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:a.coordinate};if(e==="centric"){var o=a.coordinate,c=i.radius;return ie(ie(ie({},i),_r(i.cx,i.cy,c,o)),{},{angle:o,radius:c})}var u=a.coordinate,d=i.angle;return ie(ie(ie({},i),_r(i.cx,i.cy,u,d)),{},{angle:d,radius:u})}return hM},Np=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(c,u){var d=u.props.data;return d&&d.length?[].concat(ul(c),ul(d)):c},[]);return o.length>0?o:e&&e.length&&ge(i)&&ge(a)?e.slice(i,a+1):[]};function pM(t){return t==="number"?[0,"auto"]:void 0}var yw=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,c=Np(r,e);return n<0||!a||!a.length||n>=c.length?null:a.reduce(function(u,d){var p,h=(p=d.props.data)!==null&&p!==void 0?p:r;h&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(h=h.slice(e.dataStartIndex,e.dataEndIndex+1));var g;if(o.dataKey&&!o.allowDuplicatedCategory){var v=h===void 0?c:h;g=Ff(v,o.dataKey,i)}else g=h&&h[n]||c[n];return g?[].concat(ul(u),[p$(d,g)]):u},[])},fP=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=gne(a,n),c=e.orderedTooltipTicks,u=e.tooltipAxis,d=e.tooltipTicks,p=AX(o,c,d,u);if(p>=0&&d){var h=d[p]&&d[p].value,g=yw(e,r,p,h),v=yne(n,c,p,a);return{activeTooltipIndex:p,activeLabel:h,activePayload:g,activeCoordinate:v}}return null},vne=function(e,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,c=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.layout,h=e.children,g=e.stackOffset,v=d$(p,a);return n.reduce(function(x,_){var b,k=_.type.defaultProps!==void 0?ie(ie({},_.type.defaultProps),_.props):_.props,E=k.type,O=k.dataKey,A=k.allowDataOverflow,T=k.allowDuplicatedCategory,C=k.scale,j=k.ticks,R=k.includeHidden,M=k[o];if(x[M])return x;var Y=Np(e.data,{graphicalItems:i.filter(function(L){var Z,se=o in L.props?L.props[o]:(Z=L.type.defaultProps)===null||Z===void 0?void 0:Z[o];return se===M}),dataStartIndex:u,dataEndIndex:d}),W=Y.length,B,X,K;Hre(k.domain,A,E)&&(B=Ix(k.domain,null,A),v&&(E==="number"||C!=="auto")&&(K=Rc(Y,O,"category")));var U=pM(E);if(!B||B.length===0){var G,J=(G=k.domain)!==null&&G!==void 0?G:U;if(O){if(B=Rc(Y,O,E),E==="category"&&v){var F=v9(B);T&&F?(X=B,B=Th(0,W)):T||(B=OC(J,B,_).reduce(function(L,Z){return L.indexOf(Z)>=0?L:[].concat(ul(L),[Z])},[]))}else if(E==="category")T?B=B.filter(function(L){return L!==""&&!Qe(L)}):B=OC(J,B,_).reduce(function(L,Z){return L.indexOf(Z)>=0||Z===""||Qe(Z)?L:[].concat(ul(L),[Z])},[]);else if(E==="number"){var te=NX(Y,i.filter(function(L){var Z,se,le=o in L.props?L.props[o]:(Z=L.type.defaultProps)===null||Z===void 0?void 0:Z[o],ve="hide"in L.props?L.props.hide:(se=L.type.defaultProps)===null||se===void 0?void 0:se.hide;return le===M&&(R||!ve)}),O,a,p);te&&(B=te)}v&&(E==="number"||C!=="auto")&&(K=Rc(Y,O,"category"))}else v?B=Th(0,W):c&&c[M]&&c[M].hasStack&&E==="number"?B=g==="expand"?[0,1]:h$(c[M].stackGroups,u,d):B=u$(Y,i.filter(function(L){var Z=o in L.props?L.props[o]:L.type.defaultProps[o],se="hide"in L.props?L.props.hide:L.type.defaultProps.hide;return Z===M&&(R||!se)}),E,p,!0);if(E==="number")B=pw(h,B,M,a,j),J&&(B=Ix(J,B,A));else if(E==="category"&&J){var q=J,z=B.every(function(L){return q.indexOf(L)>=0});z&&(B=q)}}return ie(ie({},x),{},ze({},M,ie(ie({},k),{},{axisType:a,domain:B,categoricalDomain:K,duplicateDomain:X,originalDomain:(b=k.domain)!==null&&b!==void 0?b:U,isCategorical:v,layout:p})))},{})},bne=function(e,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,c=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.layout,h=e.children,g=Np(e.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:d}),v=g.length,x=d$(p,a),_=-1;return n.reduce(function(b,k){var E=k.type.defaultProps!==void 0?ie(ie({},k.type.defaultProps),k.props):k.props,O=E[o],A=pM("number");if(!b[O]){_++;var T;return x?T=Th(0,v):c&&c[O]&&c[O].hasStack?(T=h$(c[O].stackGroups,u,d),T=pw(h,T,O,a)):(T=Ix(A,u$(g,n.filter(function(C){var j,R,M=o in C.props?C.props[o]:(j=C.type.defaultProps)===null||j===void 0?void 0:j[o],Y="hide"in C.props?C.props.hide:(R=C.type.defaultProps)===null||R===void 0?void 0:R.hide;return M===O&&!Y}),"number",p),i.defaultProps.allowDataOverflow),T=pw(h,T,O,a)),ie(ie({},b),{},ze({},O,ie(ie({axisType:a},i.defaultProps),{},{hide:!0,orientation:An(pne,"".concat(a,".").concat(_%2),null),domain:T,originalDomain:A,isCategorical:x,layout:p})))}return b},{})},xne=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,c=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.children,h="".concat(i,"Id"),g=Tn(p,a),v={};return g&&g.length?v=vne(e,{axes:g,graphicalItems:o,axisType:i,axisIdKey:h,stackGroups:c,dataStartIndex:u,dataEndIndex:d}):o&&o.length&&(v=bne(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:h,stackGroups:c,dataStartIndex:u,dataEndIndex:d})),v},wne=function(e){var r=Na(e),n=Hi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:f1(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:vh(r,n)}},hP=function(e){var r=e.children,n=e.defaultShowTooltip,i=sn(r,el),a=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},_ne=function(e){return!e||!e.length?!1:e.some(function(r){var n=Gi(r&&r.type);return n&&n.indexOf("Bar")>=0})},pP=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Sne=function(e,r){var n=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,c=e.yAxisMap,u=c===void 0?{}:c,d=n.width,p=n.height,h=n.children,g=n.margin||{},v=sn(h,el),x=sn(h,zs),_=Object.keys(u).reduce(function(T,C){var j=u[C],R=j.orientation;return!j.mirror&&!j.hide?ie(ie({},T),{},ze({},R,T[R]+j.width)):T},{left:g.left||0,right:g.right||0}),b=Object.keys(o).reduce(function(T,C){var j=o[C],R=j.orientation;return!j.mirror&&!j.hide?ie(ie({},T),{},ze({},R,An(T,"".concat(R))+j.height)):T},{top:g.top||0,bottom:g.bottom||0}),k=ie(ie({},b),_),E=k.bottom;v&&(k.bottom+=v.props.height||el.defaultProps.height),x&&r&&(k=jX(k,i,n,r));var O=d-k.left-k.right,A=p-k.top-k.bottom;return ie(ie({brushBottom:E},k),{},{width:Math.max(O,0),height:Math.max(A,0)})},kne=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},mM=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,o=e.validateTooltipEventTypes,c=o===void 0?["axis"]:o,u=e.axisComponents,d=e.legendContent,p=e.formatAxisMap,h=e.defaultProps,g=function(k,E){var O=E.graphicalItems,A=E.stackGroups,T=E.offset,C=E.updateId,j=E.dataStartIndex,R=E.dataEndIndex,M=k.barSize,Y=k.layout,W=k.barGap,B=k.barCategoryGap,X=k.maxBarSize,K=pP(Y),U=K.numericAxisName,G=K.cateAxisName,J=_ne(O),F=[];return O.forEach(function(te,q){var z=Np(k.data,{graphicalItems:[te],dataStartIndex:j,dataEndIndex:R}),L=te.type.defaultProps!==void 0?ie(ie({},te.type.defaultProps),te.props):te.props,Z=L.dataKey,se=L.maxBarSize,le=L["".concat(U,"Id")],ve=L["".concat(G,"Id")],qe={},xe=u.reduce(function(lr,_t){var kr=E["".concat(_t.axisType,"Map")],Ir=L["".concat(_t.axisType,"Id")];kr&&kr[Ir]||_t.axisType==="zAxis"||$o();var ni=kr[Ir];return ie(ie({},lr),{},ze(ze({},_t.axisType,ni),"".concat(_t.axisType,"Ticks"),Hi(ni)))},qe),ae=xe[G],Se=xe["".concat(G,"Ticks")],Me=A&&A[le]&&A[le].hasStack&&HX(te,A[le].stackGroups),oe=Gi(te.type).indexOf("Bar")>=0,et=vh(ae,Se),Fe=[],kt=J&&TX({barSize:M,stackGroups:A,totalSize:kne(xe,G)});if(oe){var wt,Et,Sr=Qe(se)?X:se,Bt=(wt=(Et=vh(ae,Se,!0))!==null&&Et!==void 0?Et:Sr)!==null&&wt!==void 0?wt:0;Fe=CX({barGap:W,barCategoryGap:B,bandSize:Bt!==et?Bt:et,sizeList:kt[ve],maxBarSize:Sr}),Bt!==et&&(Fe=Fe.map(function(lr){return ie(ie({},lr),{},{position:ie(ie({},lr.position),{},{offset:lr.position.offset-Bt/2})})}))}var Rr=te&&te.type&&te.type.getComposedData;Rr&&F.push({props:ie(ie({},Rr(ie(ie({},xe),{},{displayedData:z,props:k,dataKey:Z,item:te,bandSize:et,barPosition:Fe,offset:T,stackedData:Me,layout:Y,dataStartIndex:j,dataEndIndex:R}))),{},ze(ze(ze({key:te.key||"item-".concat(q)},U,xe[U]),G,xe[G]),"animationId",C)),childIndex:P9(te,k.children),item:te})}),F},v=function(k,E){var O=k.props,A=k.dataStartIndex,T=k.dataEndIndex,C=k.updateId;if(!BO({props:O}))return null;var j=O.children,R=O.layout,M=O.stackOffset,Y=O.data,W=O.reverseStackOrder,B=pP(R),X=B.numericAxisName,K=B.cateAxisName,U=Tn(j,n),G=UX(Y,U,"".concat(X,"Id"),"".concat(K,"Id"),M,W),J=u.reduce(function(L,Z){var se="".concat(Z.axisType,"Map");return ie(ie({},L),{},ze({},se,xne(O,ie(ie({},Z),{},{graphicalItems:U,stackGroups:Z.axisType===X&&G,dataStartIndex:A,dataEndIndex:T}))))},{}),F=Sne(ie(ie({},J),{},{props:O,graphicalItems:U}),E==null?void 0:E.legendBBox);Object.keys(J).forEach(function(L){J[L]=p(O,J[L],F,L.replace("Map",""),r)});var te=J["".concat(K,"Map")],q=wne(te),z=g(O,ie(ie({},J),{},{dataStartIndex:A,dataEndIndex:T,updateId:C,graphicalItems:U,stackGroups:G,offset:F}));return ie(ie({formattedGraphicalItems:z,graphicalItems:U,offset:F,stackGroups:G},q),J)},x=(function(b){function k(E){var O,A,T;return nne(this,k),T=one(this,k,[E]),ze(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ze(T,"accessibilityManager",new Fre),ze(T,"handleLegendBBoxUpdate",function(C){if(C){var j=T.state,R=j.dataStartIndex,M=j.dataEndIndex,Y=j.updateId;T.setState(ie({legendBBox:C},v({props:T.props,dataStartIndex:R,dataEndIndex:M,updateId:Y},ie(ie({},T.state),{},{legendBBox:C}))))}}),ze(T,"handleReceiveSyncEvent",function(C,j,R){if(T.props.syncId===C){if(R===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(j)}}),ze(T,"handleBrushChange",function(C){var j=C.startIndex,R=C.endIndex;if(j!==T.state.dataStartIndex||R!==T.state.dataEndIndex){var M=T.state.updateId;T.setState(function(){return ie({dataStartIndex:j,dataEndIndex:R},v({props:T.props,dataStartIndex:j,dataEndIndex:R,updateId:M},T.state))}),T.triggerSyncEvent({dataStartIndex:j,dataEndIndex:R})}}),ze(T,"handleMouseEnter",function(C){var j=T.getMouseInfo(C);if(j){var R=ie(ie({},j),{},{isTooltipActive:!0});T.setState(R),T.triggerSyncEvent(R);var M=T.props.onMouseEnter;Ye(M)&&M(R,C)}}),ze(T,"triggeredAfterMouseMove",function(C){var j=T.getMouseInfo(C),R=j?ie(ie({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(R),T.triggerSyncEvent(R);var M=T.props.onMouseMove;Ye(M)&&M(R,C)}),ze(T,"handleItemMouseEnter",function(C){T.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),ze(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),ze(T,"handleMouseMove",function(C){C.persist(),T.throttleTriggeredAfterMouseMove(C)}),ze(T,"handleMouseLeave",function(C){T.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};T.setState(j),T.triggerSyncEvent(j);var R=T.props.onMouseLeave;Ye(R)&&R(j,C)}),ze(T,"handleOuterEvent",function(C){var j=j9(C),R=An(T.props,"".concat(j));if(j&&Ye(R)){var M,Y;/.*touch.*/i.test(j)?Y=T.getMouseInfo(C.changedTouches[0]):Y=T.getMouseInfo(C),R((M=Y)!==null&&M!==void 0?M:{},C)}}),ze(T,"handleClick",function(C){var j=T.getMouseInfo(C);if(j){var R=ie(ie({},j),{},{isTooltipActive:!0});T.setState(R),T.triggerSyncEvent(R);var M=T.props.onClick;Ye(M)&&M(R,C)}}),ze(T,"handleMouseDown",function(C){var j=T.props.onMouseDown;if(Ye(j)){var R=T.getMouseInfo(C);j(R,C)}}),ze(T,"handleMouseUp",function(C){var j=T.props.onMouseUp;if(Ye(j)){var R=T.getMouseInfo(C);j(R,C)}}),ze(T,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),ze(T,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseDown(C.changedTouches[0])}),ze(T,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseUp(C.changedTouches[0])}),ze(T,"handleDoubleClick",function(C){var j=T.props.onDoubleClick;if(Ye(j)){var R=T.getMouseInfo(C);j(R,C)}}),ze(T,"handleContextMenu",function(C){var j=T.props.onContextMenu;if(Ye(j)){var R=T.getMouseInfo(C);j(R,C)}}),ze(T,"triggerSyncEvent",function(C){T.props.syncId!==void 0&&Ab.emit(Tb,T.props.syncId,C,T.eventEmitterSymbol)}),ze(T,"applySyncEvent",function(C){var j=T.props,R=j.layout,M=j.syncMethod,Y=T.state.updateId,W=C.dataStartIndex,B=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)T.setState(ie({dataStartIndex:W,dataEndIndex:B},v({props:T.props,dataStartIndex:W,dataEndIndex:B,updateId:Y},T.state)));else if(C.activeTooltipIndex!==void 0){var X=C.chartX,K=C.chartY,U=C.activeTooltipIndex,G=T.state,J=G.offset,F=G.tooltipTicks;if(!J)return;if(typeof M=="function")U=M(F,C);else if(M==="value"){U=-1;for(var te=0;te<F.length;te++)if(F[te].value===C.activeLabel){U=te;break}}var q=ie(ie({},J),{},{x:J.left,y:J.top}),z=Math.min(X,q.x+q.width),L=Math.min(K,q.y+q.height),Z=F[U]&&F[U].value,se=yw(T.state,T.props.data,U),le=F[U]?{x:R==="horizontal"?F[U].coordinate:z,y:R==="horizontal"?L:F[U].coordinate}:hM;T.setState(ie(ie({},C),{},{activeLabel:Z,activeCoordinate:le,activePayload:se,activeTooltipIndex:U}))}else T.setState(C)}),ze(T,"renderCursor",function(C){var j,R=T.state,M=R.isTooltipActive,Y=R.activeCoordinate,W=R.activePayload,B=R.offset,X=R.activeTooltipIndex,K=R.tooltipAxisBandSize,U=T.getTooltipEventType(),G=(j=C.props.active)!==null&&j!==void 0?j:M,J=T.props.layout,F=C.key||"_recharts-cursor";return I.createElement(Yre,{key:F,activeCoordinate:Y,activePayload:W,activeTooltipIndex:X,chartName:r,element:C,isActive:G,layout:J,offset:B,tooltipAxisBandSize:K,tooltipEventType:U})}),ze(T,"renderPolarAxis",function(C,j,R){var M=An(C,"type.axisType"),Y=An(T.state,"".concat(M,"Map")),W=C.type.defaultProps,B=W!==void 0?ie(ie({},W),C.props):C.props,X=Y&&Y[B["".concat(M,"Id")]];return N.cloneElement(C,ie(ie({},X),{},{className:at(M,X.className),key:C.key||"".concat(j,"-").concat(R),ticks:Hi(X,!0)}))}),ze(T,"renderPolarGrid",function(C){var j=C.props,R=j.radialLines,M=j.polarAngles,Y=j.polarRadius,W=T.state,B=W.radiusAxisMap,X=W.angleAxisMap,K=Na(B),U=Na(X),G=U.cx,J=U.cy,F=U.innerRadius,te=U.outerRadius;return N.cloneElement(C,{polarAngles:Array.isArray(M)?M:Hi(U,!0).map(function(q){return q.coordinate}),polarRadius:Array.isArray(Y)?Y:Hi(K,!0).map(function(q){return q.coordinate}),cx:G,cy:J,innerRadius:F,outerRadius:te,key:C.key||"polar-grid",radialLines:R})}),ze(T,"renderLegend",function(){var C=T.state.formattedGraphicalItems,j=T.props,R=j.children,M=j.width,Y=j.height,W=T.props.margin||{},B=M-(W.left||0)-(W.right||0),X=l$({children:R,formattedGraphicalItems:C,legendWidth:B,legendContent:d});if(!X)return null;var K=X.item,U=uP(X,Jre);return N.cloneElement(K,ie(ie({},U),{},{chartWidth:M,chartHeight:Y,margin:W,onBBoxUpdate:T.handleLegendBBoxUpdate}))}),ze(T,"renderTooltip",function(){var C,j=T.props,R=j.children,M=j.accessibilityLayer,Y=sn(R,ln);if(!Y)return null;var W=T.state,B=W.isTooltipActive,X=W.activeCoordinate,K=W.activePayload,U=W.activeLabel,G=W.offset,J=(C=Y.props.active)!==null&&C!==void 0?C:B;return N.cloneElement(Y,{viewBox:ie(ie({},G),{},{x:G.left,y:G.top}),active:J,label:U,payload:J?K:[],coordinate:X,accessibilityLayer:M})}),ze(T,"renderBrush",function(C){var j=T.props,R=j.margin,M=j.data,Y=T.state,W=Y.offset,B=Y.dataStartIndex,X=Y.dataEndIndex,K=Y.updateId;return N.cloneElement(C,{key:C.key||"_recharts-brush",onChange:yf(T.handleBrushChange,C.props.onChange),data:M,x:ge(C.props.x)?C.props.x:W.left,y:ge(C.props.y)?C.props.y:W.top+W.height+W.brushBottom-(R.bottom||0),width:ge(C.props.width)?C.props.width:W.width,startIndex:B,endIndex:X,updateId:"brush-".concat(K)})}),ze(T,"renderReferenceElement",function(C,j,R){if(!C)return null;var M=T,Y=M.clipPathId,W=T.state,B=W.xAxisMap,X=W.yAxisMap,K=W.offset,U=C.type.defaultProps||{},G=C.props,J=G.xAxisId,F=J===void 0?U.xAxisId:J,te=G.yAxisId,q=te===void 0?U.yAxisId:te;return N.cloneElement(C,{key:C.key||"".concat(j,"-").concat(R),xAxis:B[F],yAxis:X[q],viewBox:{x:K.left,y:K.top,width:K.width,height:K.height},clipPathId:Y})}),ze(T,"renderActivePoints",function(C){var j=C.item,R=C.activePoint,M=C.basePoint,Y=C.childIndex,W=C.isRange,B=[],X=j.props.key,K=j.item.type.defaultProps!==void 0?ie(ie({},j.item.type.defaultProps),j.item.props):j.item.props,U=K.activeDot,G=K.dataKey,J=ie(ie({index:Y,dataKey:G,cx:R.x,cy:R.y,r:4,fill:D1(j.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},it(U,!1)),Hf(U));return B.push(k.renderActiveDot(U,J,"".concat(X,"-activePoint-").concat(Y))),M?B.push(k.renderActiveDot(U,ie(ie({},J),{},{cx:M.x,cy:M.y}),"".concat(X,"-basePoint-").concat(Y))):W&&B.push(null),B}),ze(T,"renderGraphicChild",function(C,j,R){var M=T.filterFormatItem(C,j,R);if(!M)return null;var Y=T.getTooltipEventType(),W=T.state,B=W.isTooltipActive,X=W.tooltipAxis,K=W.activeTooltipIndex,U=W.activeLabel,G=T.props.children,J=sn(G,ln),F=M.props,te=F.points,q=F.isRange,z=F.baseLine,L=M.item.type.defaultProps!==void 0?ie(ie({},M.item.type.defaultProps),M.item.props):M.item.props,Z=L.activeDot,se=L.hide,le=L.activeBar,ve=L.activeShape,qe=!!(!se&&B&&J&&(Z||le||ve)),xe={};Y!=="axis"&&J&&J.props.trigger==="click"?xe={onClick:yf(T.handleItemMouseEnter,C.props.onClick)}:Y!=="axis"&&(xe={onMouseLeave:yf(T.handleItemMouseLeave,C.props.onMouseLeave),onMouseEnter:yf(T.handleItemMouseEnter,C.props.onMouseEnter)});var ae=N.cloneElement(C,ie(ie({},M.props),xe));function Se(_t){return typeof X.dataKey=="function"?X.dataKey(_t.payload):null}if(qe)if(K>=0){var Me,oe;if(X.dataKey&&!X.allowDuplicatedCategory){var et=typeof X.dataKey=="function"?Se:"payload.".concat(X.dataKey.toString());Me=Ff(te,et,U),oe=q&&z&&Ff(z,et,U)}else Me=te==null?void 0:te[K],oe=q&&z&&z[K];if(ve||le){var Fe=C.props.activeIndex!==void 0?C.props.activeIndex:K;return[N.cloneElement(C,ie(ie(ie({},M.props),xe),{},{activeIndex:Fe})),null,null]}if(!Qe(Me))return[ae].concat(ul(T.renderActivePoints({item:M,activePoint:Me,basePoint:oe,childIndex:K,isRange:q})))}else{var kt,wt=(kt=T.getItemByXY(T.state.activeCoordinate))!==null&&kt!==void 0?kt:{graphicalItem:ae},Et=wt.graphicalItem,Sr=Et.item,Bt=Sr===void 0?C:Sr,Rr=Et.childIndex,lr=ie(ie(ie({},M.props),xe),{},{activeIndex:Rr});return[N.cloneElement(Bt,lr),null,null]}return q?[ae,null,null]:[ae,null]}),ze(T,"renderCustomized",function(C,j,R){return N.cloneElement(C,ie(ie({key:"recharts-customized-".concat(R)},T.props),T.state))}),ze(T,"renderMap",{CartesianGrid:{handler:_f,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:_f},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:_f},YAxis:{handler:_f},Brush:{handler:T.renderBrush,once:!0},Bar:{handler:T.renderGraphicChild},Line:{handler:T.renderGraphicChild},Area:{handler:T.renderGraphicChild},Radar:{handler:T.renderGraphicChild},RadialBar:{handler:T.renderGraphicChild},Scatter:{handler:T.renderGraphicChild},Pie:{handler:T.renderGraphicChild},Funnel:{handler:T.renderGraphicChild},Tooltip:{handler:T.renderCursor,once:!0},PolarGrid:{handler:T.renderPolarGrid,once:!0},PolarAngleAxis:{handler:T.renderPolarAxis},PolarRadiusAxis:{handler:T.renderPolarAxis},Customized:{handler:T.renderCustomized}}),T.clipPathId="".concat((O=E.id)!==null&&O!==void 0?O:Ru("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=lI(T.triggeredAfterMouseMove,(A=E.throttleDelay)!==null&&A!==void 0?A:1e3/60),T.state={},T}return cne(k,b),ane(k,[{key:"componentDidMount",value:function(){var O,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,A=O.children,T=O.data,C=O.height,j=O.layout,R=sn(A,ln);if(R){var M=R.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var Y=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,W=yw(this.state,T,M,Y),B=this.state.tooltipTicks[M].coordinate,X=(this.state.offset.top+C)/2,K=j==="horizontal",U=K?{x:B,y:X}:{y:B,x:X},G=this.state.formattedGraphicalItems.find(function(F){var te=F.item;return te.type.name==="Scatter"});G&&(U=ie(ie({},U),G.props.points[M].tooltipPosition),W=G.props.points[M].tooltipPayload);var J={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:Y,activePayload:W,activeCoordinate:U};this.setState(J),this.renderCursor(R),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.margin){var T,C;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(O){rx([sn(O.children,ln)],[sn(this.props.children,ln)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=sn(this.props.children,ln);if(O&&typeof O.props.shared=="boolean"){var A=O.props.shared?"axis":"item";return c.indexOf(A)>=0?A:a}return a}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var A=this.container,T=A.getBoundingClientRect(),C=yW(T),j={chartX:Math.round(O.pageX-C.left),chartY:Math.round(O.pageY-C.top)},R=T.width/A.offsetWidth||1,M=this.inRange(j.chartX,j.chartY,R);if(!M)return null;var Y=this.state,W=Y.xAxisMap,B=Y.yAxisMap,X=this.getTooltipEventType(),K=fP(this.state,this.props.data,this.props.layout,M);if(X!=="axis"&&W&&B){var U=Na(W).scale,G=Na(B).scale,J=U&&U.invert?U.invert(j.chartX):null,F=G&&G.invert?G.invert(j.chartY):null;return ie(ie({},j),{},{xValue:J,yValue:F},K)}return K?ie(ie({},j),K):null}},{key:"inRange",value:function(O,A){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,j=O/T,R=A/T;if(C==="horizontal"||C==="vertical"){var M=this.state.offset,Y=j>=M.left&&j<=M.left+M.width&&R>=M.top&&R<=M.top+M.height;return Y?{x:j,y:R}:null}var W=this.state,B=W.angleAxisMap,X=W.radiusAxisMap;if(B&&X){var K=Na(B);return CC({x:j,y:R},K)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,A=this.getTooltipEventType(),T=sn(O,ln),C={};T&&A==="axis"&&(T.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=Hf(this.props,this.handleOuterEvent);return ie(ie({},j),C)}},{key:"addListener",value:function(){Ab.on(Tb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Ab.removeListener(Tb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,A,T){for(var C=this.state.formattedGraphicalItems,j=0,R=C.length;j<R;j++){var M=C[j];if(M.item===O||M.props.key===O.key||A===Gi(M.item.type)&&T===M.childIndex)return M}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,A=this.state.offset,T=A.left,C=A.top,j=A.height,R=A.width;return I.createElement("defs",null,I.createElement("clipPath",{id:O},I.createElement("rect",{x:T,y:C,height:j,width:R})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(A,T){var C=cP(T,2),j=C[0],R=C[1];return ie(ie({},A),{},ze({},j,R.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(A,T){var C=cP(T,2),j=C[0],R=C[1];return ie(ie({},A),{},ze({},j,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var A;return(A=this.state.xAxisMap)===null||A===void 0||(A=A[O])===null||A===void 0?void 0:A.scale}},{key:"getYScaleByAxisId",value:function(O){var A;return(A=this.state.yAxisMap)===null||A===void 0||(A=A[O])===null||A===void 0?void 0:A.scale}},{key:"getItemByXY",value:function(O){var A=this.state,T=A.formattedGraphicalItems,C=A.activeItem;if(T&&T.length)for(var j=0,R=T.length;j<R;j++){var M=T[j],Y=M.props,W=M.item,B=W.type.defaultProps!==void 0?ie(ie({},W.type.defaultProps),W.props):W.props,X=Gi(W.type);if(X==="Bar"){var K=(Y.data||[]).find(function(F){return DZ(O,F)});if(K)return{graphicalItem:M,payload:K}}else if(X==="RadialBar"){var U=(Y.data||[]).find(function(F){return CC(O,F)});if(U)return{graphicalItem:M,payload:U}}else if(Ep(M,C)||Op(M,C)||yu(M,C)){var G=TQ({graphicalItem:M,activeTooltipItem:C,itemData:B.data}),J=B.activeIndex===void 0?G:B.activeIndex;return{graphicalItem:ie(ie({},M),{},{childIndex:J}),payload:yu(M,C)?B.data[G]:M.props.data[G]}}}return null}},{key:"render",value:function(){var O=this;if(!BO(this))return null;var A=this.props,T=A.children,C=A.className,j=A.width,R=A.height,M=A.style,Y=A.compact,W=A.title,B=A.desc,X=uP(A,Zre),K=it(X,!1);if(Y)return I.createElement(Hj,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement(ix,Is({},K,{width:j,height:R,title:W,desc:B}),this.renderClipPath(),qO(T,this.renderMap)));if(this.props.accessibilityLayer){var U,G;K.tabIndex=(U=this.props.tabIndex)!==null&&U!==void 0?U:0,K.role=(G=this.props.role)!==null&&G!==void 0?G:"application",K.onKeyDown=function(F){O.accessibilityManager.keyboardEvent(F)},K.onFocus=function(){O.accessibilityManager.focus()}}var J=this.parseEventsOfWrapper();return I.createElement(Hj,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement("div",Is({className:at("recharts-wrapper",C),style:ie({position:"relative",cursor:"default",width:j,height:R},M)},J,{ref:function(te){O.container=te}}),I.createElement(ix,Is({},K,{width:j,height:R,title:W,desc:B,style:mne}),this.renderClipPath(),qO(T,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(N.Component);ze(x,"displayName",r),ze(x,"defaultProps",ie({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},h)),ze(x,"getDerivedStateFromProps",function(b,k){var E=b.dataKey,O=b.data,A=b.children,T=b.width,C=b.height,j=b.layout,R=b.stackOffset,M=b.margin,Y=k.dataStartIndex,W=k.dataEndIndex;if(k.updateId===void 0){var B=hP(b);return ie(ie(ie({},B),{},{updateId:0},v(ie(ie({props:b},B),{},{updateId:0}),k)),{},{prevDataKey:E,prevData:O,prevWidth:T,prevHeight:C,prevLayout:j,prevStackOffset:R,prevMargin:M,prevChildren:A})}if(E!==k.prevDataKey||O!==k.prevData||T!==k.prevWidth||C!==k.prevHeight||j!==k.prevLayout||R!==k.prevStackOffset||!Ds(M,k.prevMargin)){var X=hP(b),K={chartX:k.chartX,chartY:k.chartY,isTooltipActive:k.isTooltipActive},U=ie(ie({},fP(k,O,j)),{},{updateId:k.updateId+1}),G=ie(ie(ie({},X),K),U);return ie(ie(ie({},G),v(ie({props:b},G),k)),{},{prevDataKey:E,prevData:O,prevWidth:T,prevHeight:C,prevLayout:j,prevStackOffset:R,prevMargin:M,prevChildren:A})}if(!rx(A,k.prevChildren)){var J,F,te,q,z=sn(A,el),L=z&&(J=(F=z.props)===null||F===void 0?void 0:F.startIndex)!==null&&J!==void 0?J:Y,Z=z&&(te=(q=z.props)===null||q===void 0?void 0:q.endIndex)!==null&&te!==void 0?te:W,se=L!==Y||Z!==W,le=!Qe(O),ve=le&&!se?k.updateId:k.updateId+1;return ie(ie({updateId:ve},v(ie(ie({props:b},k),{},{updateId:ve,dataStartIndex:L,dataEndIndex:Z}),k)),{},{prevChildren:A,dataStartIndex:L,dataEndIndex:Z})}return null}),ze(x,"renderActiveDot",function(b,k,E){var O;return N.isValidElement(b)?O=N.cloneElement(b,k):Ye(b)?O=b(k):O=I.createElement(B1,k),I.createElement(Xt,{className:"recharts-active-dot",key:E},O)});var _=N.forwardRef(function(k,E){return I.createElement(x,Is({},k,{ref:E}))});return _.displayName=x.displayName,_},Ene=mM({chartName:"LineChart",GraphicalChild:Bu,axisComponents:[{axisType:"xAxis",AxisComp:za},{axisType:"yAxis",AxisComp:Ba}],formatAxisMap:I$}),vw=mM({chartName:"BarChart",GraphicalChild:ea,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:za},{axisType:"yAxis",AxisComp:Ba}],formatAxisMap:I$});const qh={backgroundColor:"#1e1e1e",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",color:"#e4e0dc",fontSize:"11px",fontFamily:"JetBrains Mono, monospace"};function Rt(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(Math.round(t))}function Zn(t){return`$${t.toFixed(2)}`}function $a({label:t,value:e,sub:r,accent:n}){return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-5 py-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mb-1",children:t}),y.jsx("p",{className:`text-xl font-mono font-medium ${n?"text-[#E43A9C]":"text-zinc-100"}`,children:e}),r&&y.jsx("p",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:r})]})}const One={summary:"Summary","by squad":"By Squad","by agent":"By Agent",io:"IO",timeline:"Timeline"};function Ane({tabs:t,active:e,onChange:r}){return y.jsx("div",{className:"flex gap-0 border-b border-white/[0.06] mb-5",children:t.map(n=>y.jsx("button",{type:"button",onClick:()=>r(n),className:`px-4 py-2 text-[11px] font-mono transition-colors border-b-2 -mb-px cursor-pointer ${e===n?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:One[n]??n},n))})}function Tne({records:t,totals:e}){const r=e.totalInputTokens+e.totalOutputTokens,n=new Map;for(const o of t){const c=o.squadId??"__io__",u=o.squadName??(o.squadId?`${o.squadId.slice(0,8)} (deleted)`:"IO Orchestrator"),d=n.get(c)??{name:u,inputTokens:0,outputTokens:0,calls:0,cost:0};d.inputTokens+=o.inputTokens,d.outputTokens+=o.outputTokens,d.calls+=1,d.cost+=o.estimatedCostUsd??0,n.set(c,d)}const i=Array.from(n.values()).sort((o,c)=>c.cost-o.cost),a=i.map(o=>({name:o.name.length>12?`${o.name.slice(0,12)}…`:o.name,cost:Number.parseFloat(o.cost.toFixed(2)),tokens:Math.round((o.inputTokens+o.outputTokens)/1e3)}));return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[y.jsx($a,{label:"Total Tokens",value:Rt(r),sub:`${Rt(e.totalInputTokens)} in · ${Rt(e.totalOutputTokens)} out`}),y.jsx($a,{label:"Total Cost",value:Zn(e.totalCostUsd),accent:!0}),y.jsx($a,{label:"API Calls",value:Rt(e.callCount),sub:"across all entities"}),y.jsx($a,{label:"Avg Cost / Call",value:e.callCount>0?Zn(e.totalCostUsd/e.callCount):"$0.00",sub:`over ${e.callCount} calls`})]}),y.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost by entity"}),a.length>0?y.jsx(th,{width:"100%",height:180,children:y.jsxs(vw,{data:a,barCategoryGap:"35%",children:[y.jsx(_u,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`$${o}`,width:40}),y.jsx(ln,{contentStyle:qh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`$${o.toFixed(2)}`,"Cost"]}),y.jsx(ea,{dataKey:"cost",fill:"url(#costGrad)",radius:[6,6,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"costGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens by entity (k)"}),a.length>0?y.jsx(th,{width:"100%",height:180,children:y.jsxs(vw,{data:a,barCategoryGap:"35%",children:[y.jsx(_u,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`${o}k`,width:40}),y.jsx(ln,{contentStyle:qh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`${o}k`,"Tokens"]}),y.jsx(ea,{dataKey:"tokens",fill:"url(#tokenGrad)",radius:[6,6,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"tokenGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#818cf8"}),y.jsx("stop",{offset:"100%",stopColor:"#6366f1",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Entity","Input","Output","Calls","Cost"].map(o=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),y.jsxs("tbody",{children:[i.map(o=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name)),y.jsxs("tr",{className:"bg-[#1a1a1a]",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-200 font-medium",children:"Total"}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:Rt(e.totalInputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:Rt(e.totalOutputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:e.callCount}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C] font-medium",children:Zn(e.totalCostUsd)})]})]})]})})]})}function Cne({records:t}){const[e,r]=N.useState([]),[n,i]=N.useState("cost"),[a,o]=N.useState("desc");function c(h){h===n?o(g=>g==="asc"?"desc":"asc"):(i(h),o("desc"))}const u=N.useMemo(()=>{const h=new Map;for(const v of t){if(!v.squadId)continue;const x=h.get(v.squadId)??{id:v.squadId,name:v.squadName??`${v.squadId.slice(0,8)} (deleted)`,agents:new Map,inputTokens:0,outputTokens:0,calls:0,cost:0};x.inputTokens+=v.inputTokens,x.outputTokens+=v.outputTokens,x.calls+=1,x.cost+=v.estimatedCostUsd??0;const _=v.agentRole??"unknown",b=x.agents.get(_)??{role:_,model:v.model,inputTokens:0,outputTokens:0,calls:0,cost:0};b.inputTokens+=v.inputTokens,b.outputTokens+=v.outputTokens,b.calls+=1,b.cost+=v.estimatedCostUsd??0,x.agents.set(_,b),h.set(v.squadId,x)}return[...Array.from(h.values())].sort((v,x)=>{const _=v[n],b=x[n],k=typeof _=="string"?_.localeCompare(b):_-b;return a==="desc"?-k:k})},[t,n,a]),d=h=>r(g=>g.includes(h)?g.filter(v=>v!==h):[...g,h]),p=[{key:"name",label:"Squad"},{key:"inputTokens",label:"In"},{key:"outputTokens",label:"Out"},{key:"calls",label:"Calls"},{key:"cost",label:"Cost"}];return u.length===0?y.jsx("div",{className:"text-center py-12 text-zinc-700 text-[11px] font-mono",children:"No squad usage data"}):y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-1 px-1 mb-1",children:[y.jsx("span",{className:"text-[10px] font-mono text-zinc-700 mr-1",children:"sort by"}),p.map(h=>y.jsxs("button",{type:"button",onClick:()=>c(h.key),className:`flex items-center gap-0.5 px-2 py-1 rounded-lg text-[10px] font-mono transition-colors ${n===h.key?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400 hover:bg-white/[0.04]"}`,style:n===h.key?{background:"rgba(228,58,156,0.1)"}:void 0,children:[h.label,n===h.key&&y.jsx("span",{className:"text-[9px]",children:a==="desc"?"↓":"↑"})]},h.key))]}),u.map(h=>{const g=e.includes(h.id),v=Array.from(h.agents.values());return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl overflow-hidden",children:[y.jsxs("button",{type:"button",onClick:()=>d(h.id),className:"w-full flex items-center gap-3 px-4 py-3.5 hover:bg-white/[0.02] transition-colors text-left cursor-pointer",children:[y.jsx("div",{className:`transition-transform ${g?"rotate-90":""}`,children:y.jsx(Cw,{className:"w-3.5 h-3.5 text-zinc-600"})}),y.jsx("span",{className:"text-sm font-mono text-zinc-100 flex-1",children:h.name}),y.jsxs("div",{className:"flex items-center gap-6 text-[11px] font-mono",children:[y.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"in"}),Rt(h.inputTokens)]}),y.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"out"}),Rt(h.outputTokens)]}),y.jsxs("span",{className:"text-zinc-500",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"calls"}),h.calls]}),y.jsx("span",{className:"text-[#E43A9C] font-medium w-16 text-right",children:Zn(h.cost)})]})]}),g&&y.jsx("div",{className:"border-t border-white/[0.05]",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"bg-[#191919]",children:["Agent","Model","Input","Output","Calls","Cost"].map(x=>y.jsx("th",{className:`text-left px-4 py-2 text-zinc-700 font-medium ${x==="Cost"?"text-right":""}`,children:x},x))})}),y.jsx("tbody",{children:v.map(x=>y.jsxs("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-2.5 text-zinc-300",children:x.role}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-600",children:x.model}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:Rt(x.inputTokens)}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:Rt(x.outputTokens)}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:x.calls}),y.jsx("td",{className:"px-4 py-2.5 text-right text-[#E43A9C]",children:Zn(x.cost)})]},x.role))})]})})]},h.id)})]})}function jne({records:t}){const e=N.useMemo(()=>{const n=new Map;for(const i of t){const a=`${i.squadId??"io"}:${i.agentRole??"orchestrator"}`,o=n.get(a)??{name:i.agentRole??"orchestrator",squad:i.squadName??(i.squadId?i.squadId.slice(0,8):"IO"),model:i.model,inputTokens:0,outputTokens:0,calls:0,cost:0};o.inputTokens+=i.inputTokens,o.outputTokens+=i.outputTokens,o.calls+=1,o.cost+=i.estimatedCostUsd??0,n.set(a,o)}return Array.from(n.values()).sort((i,a)=>a.cost-i.cost)},[t]),r=e.reduce((n,i)=>n+i.cost,0);return y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Agent","Squad","Model","Input","Output","Calls","Cost","% of total"].map(n=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),y.jsx("tbody",{children:e.map(n=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.squad}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.model}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(n.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(n.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(n.cost)}),y.jsx("td",{className:"px-4 py-3",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:"w-16 h-1.5 rounded-full bg-[#252525] overflow-hidden",children:y.jsx("div",{className:"h-full bg-[#E43A9C] rounded-full",style:{width:`${r>0?n.cost/r*100:0}%`}})}),y.jsx("span",{className:"text-zinc-600 text-[10px]",children:r>0?`${(n.cost/r*100).toFixed(1)}%`:"0%"})]})})]},`${n.squad}:${n.name}`))})]})})}function Pne({records:t}){const e=N.useMemo(()=>t.filter(o=>!o.squadId),[t]),r=N.useMemo(()=>{const o=new Map;for(const c of e){const u=c.agentRole??"orchestrator",d=o.get(u)??{name:u,model:c.model,inputTokens:0,outputTokens:0,calls:0,cost:0};d.inputTokens+=c.inputTokens,d.outputTokens+=c.outputTokens,d.calls+=1,d.cost+=c.estimatedCostUsd??0,o.set(u,d)}return Array.from(o.values()).sort((c,u)=>u.cost-c.cost)},[e]),n=e.reduce((o,c)=>o+c.inputTokens,0),i=e.reduce((o,c)=>o+c.outputTokens,0),a=e.reduce((o,c)=>o+(c.estimatedCostUsd??0),0);return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[y.jsx($a,{label:"IO Tokens",value:Rt(n+i),sub:`${Rt(n)} in · ${Rt(i)} out`}),y.jsx($a,{label:"IO Cost",value:Zn(a),accent:!0}),y.jsx($a,{label:"IO Calls",value:Rt(e.length)}),y.jsx($a,{label:"IO Roles",value:String(r.length)})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Role","Model","Input","Output","Calls","Cost"].map(o=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),y.jsx("tbody",{children:r.map(o=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:o.model}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name))})]})})]})}function Nne({records:t}){const e=N.useMemo(()=>{const n=new Map;for(const i of t){const a=i.timestamp.slice(0,10),o=n.get(a)??{date:a,inputTokens:0,outputTokens:0,cost:0,calls:0};o.inputTokens+=i.inputTokens,o.outputTokens+=i.outputTokens,o.cost+=i.estimatedCostUsd??0,o.calls+=1,n.set(a,o)}return Array.from(n.values()).sort((i,a)=>i.date.localeCompare(a.date))},[t]),r=e.map(n=>({...n,label:new Date(n.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),tokens:n.inputTokens+n.outputTokens}));return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens per day"}),r.length>0?y.jsx(th,{width:"100%",height:220,children:y.jsxs(Ene,{data:r,children:[y.jsx(_u,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:Rt,width:44}),y.jsx(ln,{contentStyle:qh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:n=>[Rt(n),"Tokens"]}),y.jsx(Bu,{type:"monotone",dataKey:"tokens",stroke:"#E43A9C",strokeWidth:2,dot:!1})]})}):y.jsx("div",{className:"h-[220px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost per day"}),r.length>0?y.jsx(th,{width:"100%",height:180,children:y.jsxs(vw,{data:r,barCategoryGap:"20%",children:[y.jsx(_u,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:n=>`$${n.toFixed(2)}`,width:44}),y.jsx(ln,{contentStyle:qh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:n=>[Zn(n),"Cost"]}),y.jsx(ea,{dataKey:"cost",fill:"url(#costGradTl)",radius:[4,4,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"costGradTl",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Date","Input","Output","Calls","Cost"].map(n=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),y.jsx("tbody",{children:e.map(n=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.date}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(n.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(n.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(n.cost)})]},n.date))})]})})]})}function Rne(){const[t,e]=N.useState("summary"),[r,n]=N.useState(null),[i,a]=N.useState("14d"),o=["summary","by squad","by agent","io","timeline"];if(N.useEffect(()=>{const u=new Date;i==="7d"?u.setDate(u.getDate()-7):i==="14d"?u.setDate(u.getDate()-14):i==="30d"?u.setDate(u.getDate()-30):u.setDate(u.getDate()-1),rt.get(`/usage?since=${u.toISOString()}`).then(n).catch(()=>{})},[i]),!r)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600 font-mono text-[11px]",children:"Loading..."});const c=i==="1d"?"Today":`Last ${i}`;return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[y.jsxs("div",{className:"flex items-start justify-between mb-5 gap-4 flex-wrap",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Usage"}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:c})]}),y.jsx("div",{className:"flex gap-1 p-1 rounded-xl bg-white/[0.03] border border-white/[0.07]",children:["1d","7d","14d","30d"].map(u=>y.jsx("button",{type:"button",onClick:()=>a(u),className:`px-3 py-1.5 rounded-lg text-[11px] font-mono transition-colors cursor-pointer ${i===u?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400"}`,style:i===u?{background:"rgba(228,58,156,0.12)"}:void 0,children:u},u))})]}),y.jsx(Ane,{tabs:o,active:t,onChange:u=>e(u)}),t==="summary"&&y.jsx(Tne,{records:r.records,totals:r.totals}),t==="by squad"&&y.jsx(Cne,{records:r.records}),t==="by agent"&&y.jsx(jne,{records:r.records}),t==="io"&&y.jsx(Pne,{records:r.records}),t==="timeline"&&y.jsx(Nne,{records:r.records})]})}function gM(t){return[...t].sort((e,r)=>e.isDir!==r.isDir?e.isDir?-1:1:e.name.localeCompare(r.name)).map(e=>({...e,children:gM(e.children)}))}function Ine(t){const e=[];for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e,a="";for(const[o,c]of n.entries()){const u=o===n.length-1;a=a?`${a}/${c}`:c;let d=i.find(p=>p.path===a);d||(d={name:u&&r.name||c,path:a,isDir:!u,children:[]},i.push(d)),i=d.children}}return gM(e)}function yM(t,e){return e?t.flatMap(r=>{const n=r.name.toLowerCase().includes(e)||r.path.toLowerCase().includes(e);if(!r.isDir)return n?[r]:[];if(n)return[r];const i=yM(r.children,e);return i.length?[{...r,children:i}]:[]}):t}function bw(t){const e=new Set;for(const r of t)if(r.isDir){e.add(r.path);for(const n of bw(r.children))e.add(n)}return e}function $ne(t){const e=t.split("/").filter(Boolean),r=[];let n="";for(const i of e.slice(0,-1))n=n?`${n}/${i}`:i,r.push(n);return r}function vM({node:t,depth:e,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o}){const c=r===t.path,u=t.isDir&&(n.has(t.path)||i.has(t.path)),d=12+e*16;return t.isDir?y.jsxs("div",{children:[y.jsxs("button",{type:"button",onClick:()=>a(t.path),className:"flex w-full items-center gap-2 rounded-lg py-2 pr-3 text-left text-[11px] font-mono text-zinc-400 transition-colors hover:bg-white/[0.04] hover:text-zinc-200",style:{paddingLeft:d},children:[y.jsx(Cw,{size:14,className:`shrink-0 transition-transform ${u?"rotate-90":""}`}),u?y.jsx(e4,{size:14,className:"shrink-0 text-zinc-500"}):y.jsx(r4,{size:14,className:"shrink-0 text-zinc-500"}),y.jsx("span",{className:"truncate",children:t.name})]}),u&&y.jsx("div",{children:t.children.map(p=>y.jsx(vM,{node:p,depth:e+1,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o},p.path))})]}):y.jsxs("button",{type:"button",onClick:()=>o(t.path),className:`flex w-full items-center gap-2 rounded-lg py-2 pr-3 text-left text-[11px] font-mono transition-colors ${c?"border-l-2 border-[#E43A9C] bg-[#E43A9C]/10 text-[#E43A9C]":"text-zinc-500 hover:bg-white/[0.04] hover:text-zinc-300"}`,style:{paddingLeft:d},children:[y.jsx(Z5,{size:14,className:"shrink-0"}),y.jsx("span",{className:"truncate",children:t.name})]})}function Mne(){const[t,e]=N.useState([]),[r,n]=N.useState(null),[i,a]=N.useState(""),[o,c]=N.useState(!1),[u,d]=N.useState(""),[p,h]=N.useState(""),[g,v]=N.useState(""),[x,_]=N.useState(new Set),[b,k]=N.useState(!1);N.useEffect(()=>{R()},[]);const E=N.useMemo(()=>Ine(t),[t]),O=g.trim().toLowerCase(),A=N.useMemo(()=>yM(E,O),[E,O]),T=N.useMemo(()=>{const U=O?bw(A):new Set;if(r)for(const G of $ne(r))U.add(G);return U},[A,O,r]),C=r?(function U(G){for(const J of G){if(J.path===r)return J;const F=U(J.children);if(F)return F}return null})(A):null,j=(C==null?void 0:C.name)??(r?r.split("/").pop()??"":"");N.useEffect(()=>{const U=bw(E);_(G=>new Set([...G,...U]))},[E]);async function R(){try{const U=await rt.get("/wiki/all");e(U.pages)}catch{e([])}}function M(U){if(U.startsWith("squads/")){const G=U.split("/"),J=G[1]??"",F=G.slice(2).join("/");return{scope:J,relativePath:F}}return U.startsWith("io/")?{scope:"io",relativePath:U.slice(3)}:U.startsWith("shared/")?{scope:"shared",relativePath:U.slice(7)}:{scope:"shared",relativePath:U}}async function Y(U){try{const{scope:G,relativePath:J}=M(U),F=await rt.get(`/wiki/${G}/${J}`);a(F.content),d(F.content),n(U),c(!1)}catch{ft.error("Failed to load page")}}async function W(){if(r)try{const{scope:U,relativePath:G}=M(r);await rt.put(`/wiki/${U}/${G}`,{content:u}),a(u),c(!1),ft.success("Page saved")}catch{ft.error("Failed to save page")}}async function B(){if(r)try{const{scope:U,relativePath:G}=M(r);await rt.delete(`/wiki/${U}/${G}`),ft.success("Page deleted"),n(null),a(""),d(""),c(!1),R()}catch{ft.error("Failed to delete page")}}async function X(){let U=p.trim().replace(/^\/+|\/+$/g,"");if(!U)return;U=U.replace(/\.md$/i,"");const G=U.startsWith("io/")||U.startsWith("shared/")||U.startsWith("squads/")?U:`shared/${U}`;k(!0);try{const{scope:J,relativePath:F}=M(G),te=F.split("/").slice(-1)[0]??F;await rt.put(`/wiki/${J}/${F}`,{content:`# ${te}
|
|
503
|
-
|
|
504
|
-
`}),ft.success("Page created"),h(""),await R(),await Y(G)}catch{ft.error("Failed to create page")}finally{k(!1)}}function K(U){_(G=>{const J=new Set(G);return J.has(U)?J.delete(U):J.add(U),J})}return y.jsxs("div",{className:"flex h-full",children:[y.jsxs("div",{className:"flex h-full w-64 flex-col border-r border-white/[0.07] bg-[#181818]",children:[y.jsx("div",{className:"border-b border-white/[0.07] p-3",children:y.jsxs("div",{className:"relative",children:[y.jsx(WP,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-zinc-600"}),y.jsx("input",{type:"text",value:g,onChange:U=>v(U.target.value),placeholder:"Search pages...",className:"w-full rounded-lg border border-white/[0.07] bg-white/[0.04] py-2 pl-8 pr-3 text-[11px] font-mono text-zinc-300 outline-none placeholder:text-zinc-700 focus:border-[#E43A9C]/50"})]})}),y.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3",children:A.length>0?A.map(U=>y.jsx(vM,{node:U,depth:0,selectedPage:r,expandedPaths:x,autoExpandedPaths:T,onToggle:K,onSelect:Y},U.path)):y.jsx("p",{className:"py-4 text-center font-mono text-[11px] text-zinc-700",children:"No pages found"})}),y.jsx("div",{className:"border-t border-white/[0.07] p-3",children:y.jsxs("div",{className:"space-y-2",children:[y.jsx("input",{type:"text",value:p,onChange:U=>h(U.target.value),onKeyDown:U=>{U.key==="Enter"&&X(),U.key==="Escape"&&h("")},placeholder:"folder/new-page",className:"w-full rounded-lg border border-white/[0.07] bg-white/[0.04] px-3 py-2 text-[11px] font-mono text-zinc-300 outline-none placeholder:text-zinc-700 focus:border-[#E43A9C]/50"}),y.jsx(Da,{onClick:X,disabled:!p.trim()||b,className:"w-full justify-center px-3 py-2",children:b?y.jsxs(y.Fragment,{children:[y.jsx(Os,{size:13,className:"animate-spin"})," Creating..."]}):y.jsxs(y.Fragment,{children:[y.jsx(HP,{size:13})," Add Page"]})})]})})]}),y.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:r?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-white/[0.07] px-6",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate font-mono text-sm text-zinc-100",children:j}),y.jsxs("p",{className:"truncate font-mono text-[11px] text-zinc-500",children:[r,".md"]})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[o?y.jsxs(y.Fragment,{children:[y.jsxs(Da,{onClick:W,className:"px-3 py-1.5",children:[y.jsx(jw,{size:12})," Save"]}),y.jsx(Wi,{onClick:()=>{c(!1),d(i)},className:"px-3 py-1.5",children:"Cancel"})]}):y.jsxs(Wi,{onClick:()=>{c(!0),d(i)},className:"px-3 py-1.5",children:[y.jsx($b,{size:12})," Edit"]}),y.jsxs(qw,{onClick:B,className:"px-3 py-1.5",children:[y.jsx($s,{size:12})," Delete"]})]})]}),y.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o?y.jsx("textarea",{value:u,onChange:U=>d(U.target.value),className:"h-full min-h-[320px] w-full resize-none rounded-xl border border-white/[0.07] bg-[#181818] p-4 font-mono text-sm text-zinc-300 outline-none focus:border-[#E43A9C]/50"}):y.jsx("div",{className:"mx-auto max-w-4xl",children:y.jsx("div",{className:"prose-io text-sm text-zinc-300",dangerouslySetInnerHTML:{__html:nt.parse(i)}})})})]}):y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsxs("div",{className:"text-center",children:[y.jsx(LP,{size:48,className:"mx-auto mb-3 text-zinc-800"}),y.jsx("p",{className:"font-mono text-[11px] text-zinc-700",children:"Select a page to view"})]})})})]})}function Lne({children:t}){const{session:e,supabase:r,loading:n}=tp();return n?y.jsx("div",{className:"min-h-screen flex items-center justify-center text-[var(--color-muted-foreground)]",children:"Loading..."}):r?e?y.jsx(y.Fragment,{children:t}):y.jsx(uq,{}):y.jsx(y.Fragment,{children:t})}function Dne(){const{pathname:t}=ti(),e=t==="/"||t==="/chat"||t.startsWith("/chat/");return y.jsxs(y.Fragment,{children:[y.jsx(lD,{children:y.jsxs(nn,{element:y.jsx(BU,{}),children:[y.jsx(nn,{index:!0,element:y.jsx(qU,{})}),y.jsx(nn,{path:"squads",element:y.jsx(Cg,{})}),y.jsx(nn,{path:"squads/:name",element:y.jsx(Cg,{})}),y.jsx(nn,{path:"squads/:name/instances/:instanceId",element:y.jsx(Cg,{})}),y.jsx(nn,{path:"feed",element:y.jsx(cq,{})}),y.jsx(nn,{path:"skills",element:y.jsx(wq,{})}),y.jsx(nn,{path:"schedules",element:y.jsx(hq,{})}),y.jsx(nn,{path:"wiki",element:y.jsx(Mne,{})}),y.jsx(nn,{path:"settings",element:y.jsx(yq,{})}),y.jsx(nn,{path:"usage",element:y.jsx(Rne,{})}),y.jsx(nn,{path:"*",element:y.jsx(aD,{to:"/",replace:!0})})]})}),!e&&y.jsx(qz,{})]})}function zne(){return y.jsx(LU,{children:y.jsx(Lne,{children:y.jsx(ez,{children:y.jsx(Dne,{})})})})}aL.createRoot(document.getElementById("root")).render(y.jsx(N.StrictMode,{children:y.jsxs(ND,{children:[y.jsx(zne,{}),y.jsx(m5,{theme:"dark",position:"bottom-right"})]})}));
|
|
505
|
-
//# sourceMappingURL=index-C4oirMTi.js.map
|