heyio 3.3.4 → 3.3.5

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.
@@ -48,7 +48,7 @@ Error generating stack: `+k.message+`
48
48
  * @license MIT
49
49
  */var Pk="popstate";function Rk(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function bL(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 Db("",{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:Uc(i)}return wL(e,r,null,t)}function Mt(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 xL(){return Math.random().toString(36).substring(2,10)}function Ik(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 Db(t,e,r=null,n,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ml(e):e,state:r,key:e&&e.key||n||xL(),mask:i}}function Uc({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 ml(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 wL(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 f(){c="POP";let b=p(),S=b==null?null:b-d;d=b,u&&u({action:c,location:w.location,delta:S})}function y(b,S){c="PUSH";let A=Rk(b)?b:Db(w.location,b,S);d=p()+1;let O=Ik(A,d),C=w.createHref(A.mask||A);try{o.pushState(O,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(C)}a&&u&&u({action:c,location:w.location,delta:1})}function v(b,S){c="REPLACE";let A=Rk(b)?b:Db(w.location,b,S);d=p();let O=Ik(A,d),C=w.createHref(A.mask||A);o.replaceState(O,"",C),a&&u&&u({action:c,location:w.location,delta:0})}function x(b){return _L(i,b)}let w={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(Pk,f),u=b,()=>{i.removeEventListener(Pk,f),u=null}},createHref(b){return e(i,b)},createURL:x,encodeLocation(b){let S=x(b);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:v,go(b){return o.go(b)}};return w}function _L(t,e,r=!1){let n="http://localhost";t&&(n=t.location.origin!=="null"?t.location.origin:t.location.href),Mt(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Uc(e);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function CN(t,e,r="/"){return SL(t,e,r,!1)}function SL(t,e,r,n,i){let a=typeof e=="string"?ml(e):e,o=Xi(a.pathname||"/",r);if(o==null)return null;let c=kL(t),u=null,d=ML(o);for(let p=0;u==null&&p<c.length;++p)u=IL(c[p],d,n);return u}function kL(t){let e=jN(t);return EL(e),e}function jN(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;Mt(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 f=Qn([n,p.relativePath]),y=r.concat(p);o.children&&o.children.length>0&&(Mt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),jN(o.children,e,y,f,u)),!(o.path==null&&!o.index)&&e.push({path:f,score:PL(f,o.index),routesMeta:y})};return t.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,c);else for(let d of NN(o.path))a(o,c,!0,d)}),e}function NN(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=NN(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 EL(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:RL(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var OL=/^:[\w-]+$/,AL=3,TL=2,CL=1,jL=10,NL=-2,$k=t=>t==="*";function PL(t,e){let r=t.split("/"),n=r.length;return r.some($k)&&(n+=NL),e&&(n+=TL),r.filter(i=>!$k(i)).reduce((i,a)=>i+(OL.test(a)?AL:a===""?CL:jL),n)}function RL(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 IL(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)||"/",f=If({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},p),y=u.route;if(!f&&d&&r&&!n[n.length-1].route.index&&(f=If({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:Qn([a,f.pathname]),pathnameBase:BL(Qn([a,f.pathnameBase])),route:y}),f.pathnameBase!=="/"&&(a=Qn([a,f.pathnameBase]))}return o}function If(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:f},y)=>{if(p==="*"){let x=c[y]||"";o=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const v=c[y];return f&&!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 f=p.charAt(d+o.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 ML(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 LL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function DL(t,e="/"){let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?ml(t):t,a;return r?(r=PN(r),r.startsWith("/")?a=Mk(r.substring(1),"/"):a=Mk(r,e)):a=e,{pathname:a,search:UL(n),hash:qL(i)}}function Mk(t,e){let r=$f(e).split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Ag(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 zL(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Cw(t){let e=zL(t);return e.map((r,n)=>n===e.length-1?r.pathname:r.pathnameBase)}function Zh(t,e,r,n=!1){let i;typeof t=="string"?i=ml(t):(i={...t},Mt(!i.pathname||!i.pathname.includes("?"),Ag("?","pathname","search",i)),Mt(!i.pathname||!i.pathname.includes("#"),Ag("#","pathname","hash",i)),Mt(!i.search||!i.search.includes("#"),Ag("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,c;if(o==null)c=r;else{let f=e.length-1;if(!n&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),f-=1;i.pathname=y.join("/")}c=f>=0?e[f]:"/"}let u=DL(i,c),d=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||p)&&(u.pathname+="/"),u}var PN=t=>t.replace(/\/\/+/g,"/"),Qn=t=>PN(t.join("/")),$f=t=>t.replace(/\/+$/,""),BL=t=>$f(t).replace(/^\/*/,"/"),UL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,qL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,FL=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 HL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function WL(t){let e=t.map(r=>r.route.path).filter(Boolean);return Qn(e)||"/"}var RN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function IN(t,e){let r=t;if(typeof r!="string"||!LL.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(RN)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 $N=["POST","PUT","PATCH","DELETE"];new Set($N);var GL=["GET",...$N];new Set(GL);var gl=j.createContext(null);gl.displayName="DataRouter";var Qh=j.createContext(null);Qh.displayName="DataRouterState";var MN=j.createContext(!1);function KL(){return j.useContext(MN)}var LN=j.createContext({isTransitioning:!1});LN.displayName="ViewTransition";var VL=j.createContext(new Map);VL.displayName="Fetchers";var XL=j.createContext(null);XL.displayName="Await";var fn=j.createContext(null);fn.displayName="Navigation";var Nu=j.createContext(null);Nu.displayName="Location";var Nn=j.createContext({outlet:null,matches:[],isDataRoute:!1});Nn.displayName="Route";var jw=j.createContext(null);jw.displayName="RouteError";var DN="REACT_ROUTER_ERROR",YL="REDIRECT",JL="ROUTE_ERROR_RESPONSE";function ZL(t){if(t.startsWith(`${DN}:${YL}:{`))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 QL(t){if(t.startsWith(`${DN}:${JL}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new FL(e.status,e.statusText,e.data)}catch{}}function eD(t,{relative:e}={}){Mt(yl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=j.useContext(fn),{hash:i,pathname:a,search:o}=Pu(t,{relative:e}),c=a;return r!=="/"&&(c=a==="/"?r:Qn([r,a])),n.createHref({pathname:c,search:o,hash:i})}function yl(){return j.useContext(Nu)!=null}function ti(){return Mt(yl(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Nu).location}var zN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function BN(t){j.useContext(fn).static||j.useLayoutEffect(t)}function vl(){let{isDataRoute:t}=j.useContext(Nn);return t?gD():tD()}function tD(){Mt(yl(),"useNavigate() may be used only in the context of a <Router> component.");let t=j.useContext(gl),{basename:e,navigator:r}=j.useContext(fn),{matches:n}=j.useContext(Nn),{pathname:i}=ti(),a=JSON.stringify(Cw(n)),o=j.useRef(!1);return BN(()=>{o.current=!0}),j.useCallback((u,d={})=>{if(ei(o.current,zN),!o.current)return;if(typeof u=="number"){r.go(u);return}let p=Zh(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 rD=j.createContext(null);function nD(t){let e=j.useContext(Nn).outlet;return j.useMemo(()=>e&&j.createElement(rD.Provider,{value:t},e),[e,t])}function iD(){let{matches:t}=j.useContext(Nn),e=t[t.length-1];return(e==null?void 0:e.params)??{}}function Pu(t,{relative:e}={}){let{matches:r}=j.useContext(Nn),{pathname:n}=ti(),i=JSON.stringify(Cw(r));return j.useMemo(()=>Zh(t,JSON.parse(i),n,e==="path"),[t,i,n,e])}function aD(t,e){return UN(t,e)}function UN(t,e,r){var b;Mt(yl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=j.useContext(fn),{matches:i}=j.useContext(Nn),a=i[i.length-1],o=a?a.params:{},c=a?a.pathname:"/",u=a?a.pathnameBase:"/",d=a&&a.route;{let S=d&&d.path||"";FN(c,!d||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
50
 
51
- Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=ti(),f;if(e){let S=typeof e=="string"?ml(e):e;Mt(u==="/"||((b=S.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 "${S.pathname}" was given in the \`location\` prop.`),f=S}else f=p;let y=f.pathname||"/",v=y;if(u!=="/"){let S=u.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=r&&r.state.matches.length?r.state.matches.map(S=>Object.assign(S,{route:r.manifest[S.route.id]||S.route})):CN(t,{pathname:v});ei(d||x!=null,`No routes matched location "${f.pathname}${f.search}${f.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 "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=uD(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:Qn([u,n.encodeLocation?n.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Qn([u,n.encodeLocation?n.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,r);return e&&w?j.createElement(Nu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},w):w}function oD(){let t=mD(),e=HL(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=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:a},"ErrorBoundary")," or"," ",j.createElement("code",{style:a},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},e),r?j.createElement("pre",{style:i},r):null,o)}var sD=j.createElement(oD,null),qN=class extends j.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=QL(t.digest);r&&(t=r)}let e=t!==void 0?j.createElement(Nn.Provider,{value:this.props.routeContext},j.createElement(jw.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?j.createElement(lD,{error:t},e):e}};qN.contextType=MN;var Tg=new WeakMap;function lD({children:t,error:e}){let{basename:r}=j.useContext(fn);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=ZL(e.digest);if(n){let i=Tg.get(e);if(i)throw i;let a=IN(n.location,r);if(RN&&!Tg.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 Tg.set(e,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return t}function cD({routeContext:t,match:e,children:r}){let n=j.useContext(gl);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),j.createElement(Nn.Provider,{value:t},r)}function uD(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(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);Mt(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 f=i[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=p),f.route.id){let{loaderData:y,errors:v}=n,x=f.route.loader&&!y.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.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,f)=>{var y,v;u(p,{location:n.location,params:((v=(y=n.matches)==null?void 0:y[0])==null?void 0:v.params)??{},pattern:WL(n.matches),errorInfo:f})}:void 0;return i.reduceRight((p,f,y)=>{let v,x=!1,w=null,b=null;n&&(v=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||sD,o&&(c<0&&y===0?(FN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,b=null):c===y&&(x=!0,b=f.route.hydrateFallbackElement||null)));let S=e.concat(i.slice(0,y+1)),A=()=>{let O;return v?O=w:x?O=b:f.route.Component?O=j.createElement(f.route.Component,null):f.route.element?O=f.route.element:O=p,j.createElement(cD,{match:f,routeContext:{outlet:p,matches:S,isDataRoute:n!=null},children:O})};return n&&(f.route.ErrorBoundary||f.route.errorElement||y===0)?j.createElement(qN,{location:n.location,revalidation:n.revalidation,component:w,error:v,children:A(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):A()},null)}function Nw(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dD(t){let e=j.useContext(gl);return Mt(e,Nw(t)),e}function fD(t){let e=j.useContext(Qh);return Mt(e,Nw(t)),e}function hD(t){let e=j.useContext(Nn);return Mt(e,Nw(t)),e}function Pw(t){let e=hD(t),r=e.matches[e.matches.length-1];return Mt(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function pD(){return Pw("useRouteId")}function mD(){var n;let t=j.useContext(jw),e=fD("useRouteError"),r=Pw("useRouteError");return t!==void 0?t:(n=e.errors)==null?void 0:n[r]}function gD(){let{router:t}=dD("useNavigate"),e=Pw("useNavigate"),r=j.useRef(!1);return BN(()=>{r.current=!0}),j.useCallback(async(i,a={})=>{ei(r.current,zN),r.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...a}))},[t,e])}var Lk={};function FN(t,e,r){!e&&!Lk[t]&&(Lk[t]=!0,ei(!1,r))}j.memo(yD);function yD({routes:t,manifest:e,future:r,state:n,isStatic:i,onError:a}){return UN(t,void 0,{manifest:e,state:n,isStatic:i,onError:a})}function vD({to:t,replace:e,state:r,relative:n}){Mt(yl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=j.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}=j.useContext(Nn),{pathname:o}=ti(),c=vl(),u=Zh(t,Cw(a),o,n==="path"),d=JSON.stringify(u);return j.useEffect(()=>{c(JSON.parse(d),{replace:e,state:r,relative:n})},[c,d,n,e,r]),null}function bD(t){return nD(t.context)}function Yr(t){Mt(!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 xD({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:i,static:a=!1,useTransitions:o}){Mt(!yl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:o,future:{}}),[c,i,a,o]);typeof r=="string"&&(r=ml(r));let{pathname:d="/",search:p="",hash:f="",state:y=null,key:v="default",mask:x}=r,w=j.useMemo(()=>{let b=Xi(d,c);return b==null?null:{location:{pathname:b,search:p,hash:f,state:y,key:v,mask:x},navigationType:n}},[c,d,p,f,y,v,n,x]);return ei(w!=null,`<Router basename="${c}"> is not able to match the URL "${d}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:j.createElement(fn.Provider,{value:u},j.createElement(Nu.Provider,{children:e,value:w}))}function wD({children:t,location:e}){return aD(zb(t),e)}function zb(t,e=[]){let r=[];return j.Children.forEach(t,(n,i)=>{if(!j.isValidElement(n))return;let a=[...e,i];if(n.type===j.Fragment){r.push.apply(r,zb(n.props.children,a));return}Mt(n.type===Yr,`[${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>`),Mt(!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=zb(n.props.children,a)),r.push(o)}),r}var jf="get",Nf="application/x-www-form-urlencoded";function ep(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function _D(t){return ep(t)&&t.tagName.toLowerCase()==="button"}function SD(t){return ep(t)&&t.tagName.toLowerCase()==="form"}function kD(t){return ep(t)&&t.tagName.toLowerCase()==="input"}function ED(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function OD(t,e){return t.button===0&&(!e||e==="_self")&&!ED(t)}var tf=null;function AD(){if(tf===null)try{new FormData(document.createElement("form"),0),tf=!1}catch{tf=!0}return tf}var TD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cg(t){return t!=null&&!TD.has(t)?(ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nf}"`),null):t}function CD(t,e){let r,n,i,a,o;if(SD(t)){let c=t.getAttribute("action");n=c?Xi(c,e):null,r=t.getAttribute("method")||jf,i=Cg(t.getAttribute("enctype"))||Nf,a=new FormData(t)}else if(_D(t)||kD(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")||jf,i=Cg(t.getAttribute("formenctype"))||Cg(c.getAttribute("enctype"))||Nf,a=new FormData(c,t),!AD()){let{name:d,type:p,value:f}=t;if(p==="image"){let y=d?`${d}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else d&&a.append(d,f)}}else{if(ep(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=jf,n=null,i=Nf,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 Rw(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function HN(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=`${$f(e)}/_root.${n}`:i.pathname=`${$f(i.pathname)}.${n}`,i}async function jD(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 ND(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 PD(t,e,r){let n=await Promise.all(t.map(async i=>{let a=e.routes[i.route.id];if(a){let o=await jD(a,r);return o.links?o.links():[]}return[]}));return MD(n.flat(1).filter(ND).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Dk(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 f;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 y=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function RD(t,e,{includeHydrateFallback:r}={}){return ID(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 ID(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 MD(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 Iw(){let t=j.useContext(gl);return Rw(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function LD(){let t=j.useContext(Qh);return Rw(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var $w=j.createContext(void 0);$w.displayName="FrameworkContext";function Mw(){let t=j.useContext($w);return Rw(t,"You must render this element inside a <HydratedRouter> element"),t}function DD(t,e){let r=j.useContext($w),[n,i]=j.useState(!1),[a,o]=j.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:p,onTouchStart:f}=e,y=j.useRef(null);j.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let w=S=>{S.forEach(A=>{o(A.isIntersecting)})},b=new IntersectionObserver(w,{threshold:.5});return y.current&&b.observe(y.current),()=>{b.disconnect()}}},[t]),j.useEffect(()=>{if(n){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[n]);let v=()=>{i(!0)},x=()=>{i(!1),o(!1)};return r?t!=="intent"?[a,y,{}]:[a,y,{onFocus:fc(c,v),onBlur:fc(u,x),onMouseEnter:fc(d,v),onMouseLeave:fc(p,x),onTouchStart:fc(f,v)}]:[!1,y,{}]}function fc(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function zD({page:t,...e}){let r=KL(),{router:n}=Iw(),i=j.useMemo(()=>CN(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?r?j.createElement(UD,{page:t,matches:i,...e}):j.createElement(qD,{page:t,matches:i,...e}):null}function BD(t){let{manifest:e,routeModules:r}=Mw(),[n,i]=j.useState([]);return j.useEffect(()=>{let a=!1;return PD(t,e,r).then(o=>{a||i(o)}),()=>{a=!0}},[t,e,r]),n}function UD({page:t,matches:e,...r}){let n=ti(),{future:i}=Mw(),{basename:a}=Iw(),o=j.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let c=HN(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 j.createElement(j.Fragment,null,o.map(c=>j.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function qD({page:t,matches:e,...r}){let n=ti(),{future:i,manifest:a,routeModules:o}=Mw(),{basename:c}=Iw(),{loaderData:u,matches:d}=LD(),p=j.useMemo(()=>Dk(t,e,d,a,n,"data"),[t,e,d,a,n]),f=j.useMemo(()=>Dk(t,e,d,a,n,"assets"),[t,e,d,a,n]),y=j.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let w=new Set,b=!1;if(e.forEach(A=>{var C;let O=a.routes[A.route.id];!O||!O.hasLoader||(!p.some(E=>E.route.id===A.route.id)&&A.route.id in u&&((C=o[A.route.id])!=null&&C.shouldRevalidate)||O.hasClientLoader?b=!0:w.add(A.route.id))}),w.size===0)return[];let S=HN(t,c,i.v8_trailingSlashAwareDataRequests,"data");return b&&w.size>0&&S.searchParams.set("_routes",e.filter(A=>w.has(A.route.id)).map(A=>A.route.id).join(",")),[S.pathname+S.search]},[c,i.v8_trailingSlashAwareDataRequests,u,n,a,p,e,t,o]),v=j.useMemo(()=>RD(f,a),[f,a]),x=BD(f);return j.createElement(j.Fragment,null,y.map(w=>j.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),v.map(w=>j.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),x.map(({key:w,link:b})=>j.createElement("link",{key:w,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function FD(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var HD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{HD&&(window.__reactRouterVersion="7.16.0")}catch{}function WD({basename:t,children:e,useTransitions:r,window:n}){let i=j.useRef();i.current==null&&(i.current=bL({window:n,v5Compat:!0}));let a=i.current,[o,c]=j.useState({action:a.action,location:a.location}),u=j.useCallback(d=>{r===!1?c(d):j.startTransition(()=>c(d))},[r]);return j.useLayoutEffect(()=>a.listen(u),[a,u]),j.createElement(xD,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:a,useTransitions:r})}var WN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,GN=j.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:f,viewTransition:y,defaultShouldRevalidate:v,...x},w){let{basename:b,navigator:S,useTransitions:A}=j.useContext(fn),O=typeof p=="string"&&WN.test(p),C=IN(p,b);p=C.to;let E=eD(p,{relative:i}),T=ti(),N=null;if(c){let Y=Zh(c,[],T.mask?T.mask.pathname:"/",!0);b!=="/"&&(Y.pathname=Y.pathname==="/"?b:Qn([b,Y.pathname])),N=S.createHref(Y)}let[R,I,K]=DD(n,x),B=VD(p,{replace:o,mask:c,state:u,target:d,preventScrollReset:f,relative:i,viewTransition:y,defaultShouldRevalidate:v,useTransitions:A});function U(Y){e&&e(Y),Y.defaultPrevented||B(Y)}let V=!(C.isExternal||a),H=j.createElement("a",{...x,...K,href:(V?N:void 0)||C.absoluteURL||E,onClick:V?U:e,ref:FD(w,I),target:d,"data-discover":!O&&r==="render"?"true":void 0});return R&&!O?j.createElement(j.Fragment,null,H,j.createElement(zD,{page:E})):H});GN.displayName="Link";var KN=j.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 f=Pu(o,{relative:d.relative}),y=ti(),v=j.useContext(Qh),{navigator:x,basename:w}=j.useContext(fn),b=v!=null&&QD(f)&&c===!0,S=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,A=y.pathname,O=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(A=A.toLowerCase(),O=O?O.toLowerCase():null,S=S.toLowerCase()),O&&w&&(O=Xi(O,w)||O);const C=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let E=A===S||!i&&A.startsWith(S)&&A.charAt(C)==="/",T=O!=null&&(O===S||!i&&O.startsWith(S)&&O.charAt(S.length)==="/"),N={isActive:E,isPending:T,isTransitioning:b},R=E?e:void 0,I;typeof n=="function"?I=n(N):I=[n,E?"active":null,T?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let K=typeof a=="function"?a(N):a;return j.createElement(GN,{...d,"aria-current":R,className:I,ref:p,style:K,to:o,viewTransition:c},typeof u=="function"?u(N):u)});KN.displayName="NavLink";var GD=j.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:i,state:a,method:o=jf,action:c,onSubmit:u,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:y,...v},x)=>{let{useTransitions:w}=j.useContext(fn),b=JD(),S=ZD(c,{relative:d}),A=o.toLowerCase()==="get"?"get":"post",O=typeof c=="string"&&WN.test(c),C=E=>{if(u&&u(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,N=(T==null?void 0:T.getAttribute("formmethod"))||o,R=()=>b(T||E.currentTarget,{fetcherKey:e,method:N,navigate:r,replace:i,state:a,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:y});w&&r!==!1?j.startTransition(()=>R()):R()};return j.createElement("form",{ref:x,method:A,action:S,onSubmit:n?u:C,...v,"data-discover":!O&&t==="render"?"true":void 0})});GD.displayName="Form";function KD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VN(t){let e=j.useContext(gl);return Mt(e,KD(t)),e}function VD(t,{target:e,replace:r,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let p=vl(),f=ti(),y=Pu(t,{relative:o});return j.useCallback(v=>{if(OD(v,e)){v.preventDefault();let x=r!==void 0?r:Uc(f)===Uc(y),w=()=>p(t,{replace:x,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u});d?j.startTransition(()=>w()):w()}},[f,p,y,r,n,i,e,t,a,o,c,u,d])}var XD=0,YD=()=>`__${String(++XD)}__`;function JD(){let{router:t}=VN("useSubmit"),{basename:e}=j.useContext(fn),r=pD(),n=t.fetch,i=t.navigate;return j.useCallback(async(a,o={})=>{let{action:c,method:u,encType:d,formData:p,body:f}=CD(a,e);if(o.navigate===!1){let y=o.fetcherKey||YD();await n(y,r,o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:f,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:f,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}=j.useContext(fn),n=j.useContext(Nn);Mt(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),a={...Pu(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(f=>f).forEach(f=>c.append("index",f));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])),Uc(a)}function QD(t,{relative:e}={}){let r=j.useContext(LN);Mt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=VN("useViewTransitionState"),i=Pu(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 If(i.pathname,o)!=null||If(i.pathname,a)!=null}var e5=TN();const t5=vt(e5);function r5(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 n5=t=>{switch(t){case"success":return o5;case"info":return l5;case"warning":return s5;case"error":return c5;default:return null}},i5=Array(12).fill(0),a5=({visible:t,className:e})=>L.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},L.createElement("div",{className:"sonner-spinner"},i5.map((r,n)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),o5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),s5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.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"})),l5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),c5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),u5=L.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"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),d5=()=>{const[t,e]=L.useState(document.hidden);return L.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let Bb=1;class f5{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:Bb++,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],L.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(p5(d)&&!d.ok){a=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,y=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:y,...x})}else if(d instanceof Error){a=!1;const f=typeof r.error=="function"?await r.error(d):r.error,y=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:y,...x})}else if(r.success!==void 0){a=!1;const f=typeof r.success=="function"?await r.success(d):r.success,y=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:y,...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,f=typeof r.description=="function"?await r.description(d):r.description,v=typeof p=="object"&&!L.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:f,...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)||Bb++;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 Jr=new f5,h5=(t,e)=>{const r=(e==null?void 0:e.id)||Bb++;return Jr.addToast({title:t,...e,id:r}),r},p5=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",m5=h5,g5=()=>Jr.toasts,y5=()=>Jr.getActiveToasts(),tt=Object.assign(m5,{success:Jr.success,info:Jr.info,warning:Jr.warning,error:Jr.error,custom:Jr.custom,message:Jr.message,promise:Jr.promise,dismiss:Jr.dismiss,loading:Jr.loading},{getHistory:g5,getToasts:y5});r5("[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 rf(t){return t.label!==void 0}const v5=3,b5="24px",x5="16px",zk=4e3,w5=356,_5=14,S5=45,k5=200;function mi(...t){return t.filter(Boolean).join(" ")}function E5(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const O5=t=>{var e,r,n,i,a,o,c,u,d;const{invert:p,toast:f,unstyled:y,interacting:v,setHeights:x,visibleToasts:w,heights:b,index:S,toasts:A,expanded:O,removeToast:C,defaultRichColors:E,closeButton:T,style:N,cancelButtonStyle:R,actionButtonStyle:I,className:K="",descriptionClassName:B="",duration:U,position:V,gap:H,expandByDefault:Y,classNames:G,icons:Q,closeButtonAriaLabel:W="Close toast"}=t,[ee,q]=L.useState(null),[$,M]=L.useState(null),[J,oe]=L.useState(!1),[le,ve]=L.useState(!1),[qe,xe]=L.useState(!1),[ae,Se]=L.useState(!1),[Me,se]=L.useState(!1),[rt,Fe]=L.useState(0),[kt,wt]=L.useState(0),Et=L.useRef(f.duration||U||zk),Sr=L.useRef(null),Ut=L.useRef(null),Rr=S===0,lr=S+1<=w,_t=f.type,kr=f.dismissible!==!1,Ir=f.className||"",ni=f.descriptionClassName||"",Ur=L.useMemo(()=>b.findIndex(D=>D.toastId===f.id)||0,[b,f.id]),ii=L.useMemo(()=>{var D;return(D=f.closeButton)!=null?D:T},[f.closeButton,T]),ai=L.useMemo(()=>f.duration||U||zk,[f.duration,U]),aa=L.useRef(0),qr=L.useRef(0),oi=L.useRef(0),si=L.useRef(null),[Wo,Xa]=V.split("-"),Go=L.useMemo(()=>b.reduce((D,ne,de)=>de>=Ur?D:D+ne.height,0),[b,Ur]),oa=d5(),Ya=f.invert||p,Rn=_t==="loading";qr.current=L.useMemo(()=>Ur*H+Go,[Ur,Go]),L.useEffect(()=>{Et.current=ai},[ai]),L.useEffect(()=>{oe(!0)},[]),L.useEffect(()=>{const D=Ut.current;if(D){const ne=D.getBoundingClientRect().height;return wt(ne),x(de=>[{toastId:f.id,height:ne,position:f.position},...de]),()=>x(de=>de.filter(Re=>Re.toastId!==f.id))}},[x,f.id]),L.useLayoutEffect(()=>{if(!J)return;const D=Ut.current,ne=D.style.height;D.style.height="auto";const de=D.getBoundingClientRect().height;D.style.height=ne,wt(de),x(Re=>Re.find(Ve=>Ve.toastId===f.id)?Re.map(Ve=>Ve.toastId===f.id?{...Ve,height:de}:Ve):[{toastId:f.id,height:de,position:f.position},...Re])},[J,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const $r=L.useCallback(()=>{ve(!0),Fe(qr.current),x(D=>D.filter(ne=>ne.toastId!==f.id)),setTimeout(()=>{C(f)},k5)},[f,C,x,qr]);L.useEffect(()=>{if(f.promise&&_t==="loading"||f.duration===1/0||f.type==="loading")return;let D;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(),D=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),$r()},Et.current))})(),()=>clearTimeout(D)},[O,v,f,_t,oa,$r]),L.useEffect(()=>{f.delete&&($r(),f.onDismiss==null||f.onDismiss.call(f,f))},[$r,f.delete]);function sa(){var D;if(Q!=null&&Q.loading){var ne;return L.createElement("div",{className:mi(G==null?void 0:G.loader,f==null||(ne=f.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":_t==="loading"},Q.loading)}return L.createElement(a5,{className:mi(G==null?void 0:G.loader,f==null||(D=f.classNames)==null?void 0:D.loader),visible:_t==="loading"})}const li=f.icon||(Q==null?void 0:Q[_t])||n5(_t);var hn,pn;return L.createElement("li",{tabIndex:0,ref:Ut,className:mi(K,Ir,G==null?void 0:G.toast,f==null||(e=f.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[_t],f==null||(r=f.classNames)==null?void 0:r[_t]),"data-sonner-toast":"","data-rich-colors":(hn=f.richColors)!=null?hn:E,"data-styled":!(f.jsx||f.unstyled||y),"data-mounted":J,"data-promise":!!f.promise,"data-swiped":Me,"data-removed":le,"data-visible":lr,"data-y-position":Wo,"data-x-position":Xa,"data-index":S,"data-front":Rr,"data-swiping":qe,"data-dismissible":kr,"data-type":_t,"data-invert":Ya,"data-swipe-out":ae,"data-swipe-direction":$,"data-expanded":!!(O||Y&&J),"data-testid":f.testId,style:{"--index":S,"--toasts-before":S,"--z-index":A.length-S,"--offset":`${le?rt:qr.current}px`,"--initial-height":Y?"auto":`${kt}px`,...N,...f.style},onDragEnd:()=>{xe(!1),q(null),si.current=null},onPointerDown:D=>{D.button!==2&&(Rn||!kr||(Sr.current=new Date,Fe(qr.current),D.target.setPointerCapture(D.pointerId),D.target.tagName!=="BUTTON"&&(xe(!0),si.current={x:D.clientX,y:D.clientY})))},onPointerUp:()=>{var D,ne,de;if(ae||!kr)return;si.current=null;const Re=Number(((D=Ut.current)==null?void 0:D.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ht=Number(((ne=Ut.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ve=new Date().getTime()-((de=Sr.current)==null?void 0:de.getTime()),ye=ee==="x"?Re:ht,we=Math.abs(ye)/Ve;if(Math.abs(ye)>=S5||we>.11){Fe(qr.current),f.onDismiss==null||f.onDismiss.call(f,f),M(ee==="x"?Re>0?"right":"left":ht>0?"down":"up"),$r(),Se(!0);return}else{var Ce,ut;(Ce=Ut.current)==null||Ce.style.setProperty("--swipe-amount-x","0px"),(ut=Ut.current)==null||ut.style.setProperty("--swipe-amount-y","0px")}se(!1),xe(!1),q(null)},onPointerMove:D=>{var ne,de,Re;if(!si.current||!kr||((ne=window.getSelection())==null?void 0:ne.toString().length)>0)return;const Ve=D.clientY-si.current.y,ye=D.clientX-si.current.x;var we;const Ce=(we=t.swipeDirections)!=null?we:E5(V);!ee&&(Math.abs(ye)>1||Math.abs(Ve)>1)&&q(Math.abs(ye)>Math.abs(Ve)?"x":"y");let ut={x:0,y:0};const gt=cr=>1/(1.5+Math.abs(cr)/20);if(ee==="y"){if(Ce.includes("top")||Ce.includes("bottom"))if(Ce.includes("top")&&Ve<0||Ce.includes("bottom")&&Ve>0)ut.y=Ve;else{const cr=Ve*gt(Ve);ut.y=Math.abs(cr)<Math.abs(Ve)?cr:Ve}}else if(ee==="x"&&(Ce.includes("left")||Ce.includes("right")))if(Ce.includes("left")&&ye<0||Ce.includes("right")&&ye>0)ut.x=ye;else{const cr=ye*gt(ye);ut.x=Math.abs(cr)<Math.abs(ye)?cr:ye}(Math.abs(ut.x)>0||Math.abs(ut.y)>0)&&se(!0),(de=Ut.current)==null||de.style.setProperty("--swipe-amount-x",`${ut.x}px`),(Re=Ut.current)==null||Re.style.setProperty("--swipe-amount-y",`${ut.y}px`)}},ii&&!f.jsx&&_t!=="loading"?L.createElement("button",{"aria-label":W,"data-disabled":Rn,"data-close-button":!0,onClick:Rn||!kr?()=>{}:()=>{$r(),f.onDismiss==null||f.onDismiss.call(f,f)},className:mi(G==null?void 0:G.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(pn=Q==null?void 0:Q.close)!=null?pn:u5):null,(_t||f.icon||f.promise)&&f.icon!==null&&((Q==null?void 0:Q[_t])!==null||f.icon)?L.createElement("div",{"data-icon":"",className:mi(G==null?void 0:G.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||sa():null,f.type!=="loading"?li:null):null,L.createElement("div",{"data-content":"",className:mi(G==null?void 0:G.content,f==null||(a=f.classNames)==null?void 0:a.content)},L.createElement("div",{"data-title":"",className:mi(G==null?void 0:G.title,f==null||(o=f.classNames)==null?void 0:o.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?L.createElement("div",{"data-description":"",className:mi(B,ni,G==null?void 0:G.description,f==null||(c=f.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),L.isValidElement(f.cancel)?f.cancel:f.cancel&&rf(f.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:D=>{rf(f.cancel)&&kr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,D),$r())},className:mi(G==null?void 0:G.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,L.isValidElement(f.action)?f.action:f.action&&rf(f.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||I,onClick:D=>{rf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,D),!D.defaultPrevented&&$r())},className:mi(G==null?void 0:G.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function Bk(){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 A5(t,e){const r={};return[t,e].forEach((n,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",c=a?x5:b5;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 T5=L.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:f,theme:y="light",richColors:v,duration:x,style:w,visibleToasts:b=v5,toastOptions:S,dir:A=Bk(),gap:O=_5,icons:C,containerAriaLabel:E="Notifications"}=e,[T,N]=L.useState([]),R=L.useMemo(()=>n?T.filter(J=>J.toasterId===n):T.filter(J=>!J.toasterId),[T,n]),I=L.useMemo(()=>Array.from(new Set([a].concat(R.filter(J=>J.position).map(J=>J.position)))),[R,a]),[K,B]=L.useState([]),[U,V]=L.useState(!1),[H,Y]=L.useState(!1),[G,Q]=L.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=L.useRef(null),ee=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=L.useRef(null),$=L.useRef(!1),M=L.useCallback(J=>{N(oe=>{var le;return(le=oe.find(ve=>ve.id===J.id))!=null&&le.delete||Jr.dismiss(J.id),oe.filter(({id:ve})=>ve!==J.id)})},[]);return L.useEffect(()=>Jr.subscribe(J=>{if(J.dismiss){requestAnimationFrame(()=>{N(oe=>oe.map(le=>le.id===J.id?{...le,delete:!0}:le))});return}setTimeout(()=>{t5.flushSync(()=>{N(oe=>{const le=oe.findIndex(ve=>ve.id===J.id);return le!==-1?[...oe.slice(0,le),{...oe[le],...J},...oe.slice(le+1)]:[J,...oe]})})})}),[T]),L.useEffect(()=>{if(y!=="system"){Q(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:oe})=>{Q(oe?"dark":"light")})}catch{J.addListener(({matches:le})=>{try{Q(le?"dark":"light")}catch(ve){console.error(ve)}})}},[y]),L.useEffect(()=>{T.length<=1&&V(!1)},[T]),L.useEffect(()=>{const J=oe=>{var le;if(o.every(xe=>oe[xe]||oe.code===xe)){var qe;V(!0),(qe=W.current)==null||qe.focus()}oe.code==="Escape"&&(document.activeElement===W.current||(le=W.current)!=null&&le.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[o]),L.useEffect(()=>{if(W.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,$.current=!1)}},[W.current]),L.createElement("section",{ref:r,"aria-label":`${E} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((J,oe)=>{var le;const[ve,qe]=J.split("-");return R.length?L.createElement("ol",{key:J,dir:A==="auto"?Bk():A,tabIndex:-1,ref:W,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":ve,"data-x-position":qe,style:{"--front-toast-height":`${((le=K[0])==null?void 0:le.height)||0}px`,"--width":`${w5}px`,"--gap":`${O}px`,...w,...A5(p,f)},onBlur:xe=>{$.current&&!xe.currentTarget.contains(xe.relatedTarget)&&($.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||$.current||($.current=!0,q.current=xe.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{H||V(!1)},onDragEnd:()=>V(!1),onPointerDown:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},R.filter(xe=>!xe.position&&oe===0||xe.position===J).map((xe,ae)=>{var Se,Me;return L.createElement(O5,{key:xe.id,icons:C,index:ae,toast:xe,defaultRichColors:v,duration:(Se=S==null?void 0:S.duration)!=null?Se:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:i,visibleToasts:b,closeButton:(Me=S==null?void 0:S.closeButton)!=null?Me:u,interacting:H,position:J,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:M,toasts:R.filter(se=>se.position==xe.position),heights:K.filter(se=>se.position==xe.position),setHeights:B,expandByDefault:c,gap:O,expanded:U,swipeDirections:e.swipeDirections})})):null}))}),C5="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 g.jsxs("svg",{width:e,height:t,viewBox:"0 0 480 480",fill:"none","aria-hidden":!0,children:[g.jsx("path",{d:C5,fill:"url(#io-grad)"}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"io-grad",x1:"0",x2:"450.529",y1:"402",y2:"69.3087",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#D83333"}),g.jsx("stop",{offset:"0.515",stopColor:"#E43A9C"}),g.jsx("stop",{offset:"1",stopColor:"#F041FF"})]})})]})}/**
51
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=ti(),f;if(e){let S=typeof e=="string"?ml(e):e;Mt(u==="/"||((b=S.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 "${S.pathname}" was given in the \`location\` prop.`),f=S}else f=p;let y=f.pathname||"/",v=y;if(u!=="/"){let S=u.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=r&&r.state.matches.length?r.state.matches.map(S=>Object.assign(S,{route:r.manifest[S.route.id]||S.route})):CN(t,{pathname:v});ei(d||x!=null,`No routes matched location "${f.pathname}${f.search}${f.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 "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=uD(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:Qn([u,n.encodeLocation?n.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Qn([u,n.encodeLocation?n.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,r);return e&&w?j.createElement(Nu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},w):w}function oD(){let t=mD(),e=HL(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=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:a},"ErrorBoundary")," or"," ",j.createElement("code",{style:a},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},e),r?j.createElement("pre",{style:i},r):null,o)}var sD=j.createElement(oD,null),qN=class extends j.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=QL(t.digest);r&&(t=r)}let e=t!==void 0?j.createElement(Nn.Provider,{value:this.props.routeContext},j.createElement(jw.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?j.createElement(lD,{error:t},e):e}};qN.contextType=MN;var Tg=new WeakMap;function lD({children:t,error:e}){let{basename:r}=j.useContext(fn);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=ZL(e.digest);if(n){let i=Tg.get(e);if(i)throw i;let a=IN(n.location,r);if(RN&&!Tg.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 Tg.set(e,o),o}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return t}function cD({routeContext:t,match:e,children:r}){let n=j.useContext(gl);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),j.createElement(Nn.Provider,{value:t},r)}function uD(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(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);Mt(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 f=i[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=p),f.route.id){let{loaderData:y,errors:v}=n,x=f.route.loader&&!y.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.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,f)=>{var y,v;u(p,{location:n.location,params:((v=(y=n.matches)==null?void 0:y[0])==null?void 0:v.params)??{},pattern:WL(n.matches),errorInfo:f})}:void 0;return i.reduceRight((p,f,y)=>{let v,x=!1,w=null,b=null;n&&(v=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||sD,o&&(c<0&&y===0?(FN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,b=null):c===y&&(x=!0,b=f.route.hydrateFallbackElement||null)));let S=e.concat(i.slice(0,y+1)),A=()=>{let O;return v?O=w:x?O=b:f.route.Component?O=j.createElement(f.route.Component,null):f.route.element?O=f.route.element:O=p,j.createElement(cD,{match:f,routeContext:{outlet:p,matches:S,isDataRoute:n!=null},children:O})};return n&&(f.route.ErrorBoundary||f.route.errorElement||y===0)?j.createElement(qN,{location:n.location,revalidation:n.revalidation,component:w,error:v,children:A(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):A()},null)}function Nw(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dD(t){let e=j.useContext(gl);return Mt(e,Nw(t)),e}function fD(t){let e=j.useContext(Qh);return Mt(e,Nw(t)),e}function hD(t){let e=j.useContext(Nn);return Mt(e,Nw(t)),e}function Pw(t){let e=hD(t),r=e.matches[e.matches.length-1];return Mt(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function pD(){return Pw("useRouteId")}function mD(){var n;let t=j.useContext(jw),e=fD("useRouteError"),r=Pw("useRouteError");return t!==void 0?t:(n=e.errors)==null?void 0:n[r]}function gD(){let{router:t}=dD("useNavigate"),e=Pw("useNavigate"),r=j.useRef(!1);return BN(()=>{r.current=!0}),j.useCallback(async(i,a={})=>{ei(r.current,zN),r.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...a}))},[t,e])}var Lk={};function FN(t,e,r){!e&&!Lk[t]&&(Lk[t]=!0,ei(!1,r))}j.memo(yD);function yD({routes:t,manifest:e,future:r,state:n,isStatic:i,onError:a}){return UN(t,void 0,{manifest:e,state:n,isStatic:i,onError:a})}function vD({to:t,replace:e,state:r,relative:n}){Mt(yl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=j.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}=j.useContext(Nn),{pathname:o}=ti(),c=vl(),u=Zh(t,Cw(a),o,n==="path"),d=JSON.stringify(u);return j.useEffect(()=>{c(JSON.parse(d),{replace:e,state:r,relative:n})},[c,d,n,e,r]),null}function bD(t){return nD(t.context)}function Yr(t){Mt(!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 xD({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:i,static:a=!1,useTransitions:o}){Mt(!yl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:o,future:{}}),[c,i,a,o]);typeof r=="string"&&(r=ml(r));let{pathname:d="/",search:p="",hash:f="",state:y=null,key:v="default",mask:x}=r,w=j.useMemo(()=>{let b=Xi(d,c);return b==null?null:{location:{pathname:b,search:p,hash:f,state:y,key:v,mask:x},navigationType:n}},[c,d,p,f,y,v,n,x]);return ei(w!=null,`<Router basename="${c}"> is not able to match the URL "${d}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:j.createElement(fn.Provider,{value:u},j.createElement(Nu.Provider,{children:e,value:w}))}function wD({children:t,location:e}){return aD(zb(t),e)}function zb(t,e=[]){let r=[];return j.Children.forEach(t,(n,i)=>{if(!j.isValidElement(n))return;let a=[...e,i];if(n.type===j.Fragment){r.push.apply(r,zb(n.props.children,a));return}Mt(n.type===Yr,`[${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>`),Mt(!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=zb(n.props.children,a)),r.push(o)}),r}var jf="get",Nf="application/x-www-form-urlencoded";function ep(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function _D(t){return ep(t)&&t.tagName.toLowerCase()==="button"}function SD(t){return ep(t)&&t.tagName.toLowerCase()==="form"}function kD(t){return ep(t)&&t.tagName.toLowerCase()==="input"}function ED(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function OD(t,e){return t.button===0&&(!e||e==="_self")&&!ED(t)}var tf=null;function AD(){if(tf===null)try{new FormData(document.createElement("form"),0),tf=!1}catch{tf=!0}return tf}var TD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cg(t){return t!=null&&!TD.has(t)?(ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nf}"`),null):t}function CD(t,e){let r,n,i,a,o;if(SD(t)){let c=t.getAttribute("action");n=c?Xi(c,e):null,r=t.getAttribute("method")||jf,i=Cg(t.getAttribute("enctype"))||Nf,a=new FormData(t)}else if(_D(t)||kD(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")||jf,i=Cg(t.getAttribute("formenctype"))||Cg(c.getAttribute("enctype"))||Nf,a=new FormData(c,t),!AD()){let{name:d,type:p,value:f}=t;if(p==="image"){let y=d?`${d}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else d&&a.append(d,f)}}else{if(ep(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=jf,n=null,i=Nf,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 Rw(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function HN(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=`${$f(e)}/_root.${n}`:i.pathname=`${$f(i.pathname)}.${n}`,i}async function jD(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 ND(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 PD(t,e,r){let n=await Promise.all(t.map(async i=>{let a=e.routes[i.route.id];if(a){let o=await jD(a,r);return o.links?o.links():[]}return[]}));return MD(n.flat(1).filter(ND).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Dk(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 f;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 y=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function RD(t,e,{includeHydrateFallback:r}={}){return ID(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 ID(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 MD(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 Iw(){let t=j.useContext(gl);return Rw(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function LD(){let t=j.useContext(Qh);return Rw(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var $w=j.createContext(void 0);$w.displayName="FrameworkContext";function Mw(){let t=j.useContext($w);return Rw(t,"You must render this element inside a <HydratedRouter> element"),t}function DD(t,e){let r=j.useContext($w),[n,i]=j.useState(!1),[a,o]=j.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:p,onTouchStart:f}=e,y=j.useRef(null);j.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let w=S=>{S.forEach(A=>{o(A.isIntersecting)})},b=new IntersectionObserver(w,{threshold:.5});return y.current&&b.observe(y.current),()=>{b.disconnect()}}},[t]),j.useEffect(()=>{if(n){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[n]);let v=()=>{i(!0)},x=()=>{i(!1),o(!1)};return r?t!=="intent"?[a,y,{}]:[a,y,{onFocus:fc(c,v),onBlur:fc(u,x),onMouseEnter:fc(d,v),onMouseLeave:fc(p,x),onTouchStart:fc(f,v)}]:[!1,y,{}]}function fc(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function zD({page:t,...e}){let r=KL(),{router:n}=Iw(),i=j.useMemo(()=>CN(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?r?j.createElement(UD,{page:t,matches:i,...e}):j.createElement(qD,{page:t,matches:i,...e}):null}function BD(t){let{manifest:e,routeModules:r}=Mw(),[n,i]=j.useState([]);return j.useEffect(()=>{let a=!1;return PD(t,e,r).then(o=>{a||i(o)}),()=>{a=!0}},[t,e,r]),n}function UD({page:t,matches:e,...r}){let n=ti(),{future:i}=Mw(),{basename:a}=Iw(),o=j.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let c=HN(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 j.createElement(j.Fragment,null,o.map(c=>j.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function qD({page:t,matches:e,...r}){let n=ti(),{future:i,manifest:a,routeModules:o}=Mw(),{basename:c}=Iw(),{loaderData:u,matches:d}=LD(),p=j.useMemo(()=>Dk(t,e,d,a,n,"data"),[t,e,d,a,n]),f=j.useMemo(()=>Dk(t,e,d,a,n,"assets"),[t,e,d,a,n]),y=j.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let w=new Set,b=!1;if(e.forEach(A=>{var C;let O=a.routes[A.route.id];!O||!O.hasLoader||(!p.some(E=>E.route.id===A.route.id)&&A.route.id in u&&((C=o[A.route.id])!=null&&C.shouldRevalidate)||O.hasClientLoader?b=!0:w.add(A.route.id))}),w.size===0)return[];let S=HN(t,c,i.v8_trailingSlashAwareDataRequests,"data");return b&&w.size>0&&S.searchParams.set("_routes",e.filter(A=>w.has(A.route.id)).map(A=>A.route.id).join(",")),[S.pathname+S.search]},[c,i.v8_trailingSlashAwareDataRequests,u,n,a,p,e,t,o]),v=j.useMemo(()=>RD(f,a),[f,a]),x=BD(f);return j.createElement(j.Fragment,null,y.map(w=>j.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),v.map(w=>j.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),x.map(({key:w,link:b})=>j.createElement("link",{key:w,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function FD(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var HD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{HD&&(window.__reactRouterVersion="7.16.0")}catch{}function WD({basename:t,children:e,useTransitions:r,window:n}){let i=j.useRef();i.current==null&&(i.current=bL({window:n,v5Compat:!0}));let a=i.current,[o,c]=j.useState({action:a.action,location:a.location}),u=j.useCallback(d=>{r===!1?c(d):j.startTransition(()=>c(d))},[r]);return j.useLayoutEffect(()=>a.listen(u),[a,u]),j.createElement(xD,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:a,useTransitions:r})}var WN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,GN=j.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:f,viewTransition:y,defaultShouldRevalidate:v,...x},w){let{basename:b,navigator:S,useTransitions:A}=j.useContext(fn),O=typeof p=="string"&&WN.test(p),C=IN(p,b);p=C.to;let E=eD(p,{relative:i}),T=ti(),N=null;if(c){let Y=Zh(c,[],T.mask?T.mask.pathname:"/",!0);b!=="/"&&(Y.pathname=Y.pathname==="/"?b:Qn([b,Y.pathname])),N=S.createHref(Y)}let[R,I,K]=DD(n,x),B=VD(p,{replace:o,mask:c,state:u,target:d,preventScrollReset:f,relative:i,viewTransition:y,defaultShouldRevalidate:v,useTransitions:A});function U(Y){e&&e(Y),Y.defaultPrevented||B(Y)}let V=!(C.isExternal||a),H=j.createElement("a",{...x,...K,href:(V?N:void 0)||C.absoluteURL||E,onClick:V?U:e,ref:FD(w,I),target:d,"data-discover":!O&&r==="render"?"true":void 0});return R&&!O?j.createElement(j.Fragment,null,H,j.createElement(zD,{page:E})):H});GN.displayName="Link";var KN=j.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 f=Pu(o,{relative:d.relative}),y=ti(),v=j.useContext(Qh),{navigator:x,basename:w}=j.useContext(fn),b=v!=null&&QD(f)&&c===!0,S=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,A=y.pathname,O=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(A=A.toLowerCase(),O=O?O.toLowerCase():null,S=S.toLowerCase()),O&&w&&(O=Xi(O,w)||O);const C=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let E=A===S||!i&&A.startsWith(S)&&A.charAt(C)==="/",T=O!=null&&(O===S||!i&&O.startsWith(S)&&O.charAt(S.length)==="/"),N={isActive:E,isPending:T,isTransitioning:b},R=E?e:void 0,I;typeof n=="function"?I=n(N):I=[n,E?"active":null,T?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let K=typeof a=="function"?a(N):a;return j.createElement(GN,{...d,"aria-current":R,className:I,ref:p,style:K,to:o,viewTransition:c},typeof u=="function"?u(N):u)});KN.displayName="NavLink";var GD=j.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:i,state:a,method:o=jf,action:c,onSubmit:u,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:y,...v},x)=>{let{useTransitions:w}=j.useContext(fn),b=JD(),S=ZD(c,{relative:d}),A=o.toLowerCase()==="get"?"get":"post",O=typeof c=="string"&&WN.test(c),C=E=>{if(u&&u(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,N=(T==null?void 0:T.getAttribute("formmethod"))||o,R=()=>b(T||E.currentTarget,{fetcherKey:e,method:N,navigate:r,replace:i,state:a,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:y});w&&r!==!1?j.startTransition(()=>R()):R()};return j.createElement("form",{ref:x,method:A,action:S,onSubmit:n?u:C,...v,"data-discover":!O&&t==="render"?"true":void 0})});GD.displayName="Form";function KD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VN(t){let e=j.useContext(gl);return Mt(e,KD(t)),e}function VD(t,{target:e,replace:r,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let p=vl(),f=ti(),y=Pu(t,{relative:o});return j.useCallback(v=>{if(OD(v,e)){v.preventDefault();let x=r!==void 0?r:Uc(f)===Uc(y),w=()=>p(t,{replace:x,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u});d?j.startTransition(()=>w()):w()}},[f,p,y,r,n,i,e,t,a,o,c,u,d])}var XD=0,YD=()=>`__${String(++XD)}__`;function JD(){let{router:t}=VN("useSubmit"),{basename:e}=j.useContext(fn),r=pD(),n=t.fetch,i=t.navigate;return j.useCallback(async(a,o={})=>{let{action:c,method:u,encType:d,formData:p,body:f}=CD(a,e);if(o.navigate===!1){let y=o.fetcherKey||YD();await n(y,r,o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:f,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:f,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}=j.useContext(fn),n=j.useContext(Nn);Mt(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),a={...Pu(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(f=>f).forEach(f=>c.append("index",f));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])),Uc(a)}function QD(t,{relative:e}={}){let r=j.useContext(LN);Mt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=VN("useViewTransitionState"),i=Pu(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 If(i.pathname,o)!=null||If(i.pathname,a)!=null}var e5=TN();const t5=vt(e5);function r5(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 n5=t=>{switch(t){case"success":return o5;case"info":return l5;case"warning":return s5;case"error":return c5;default:return null}},i5=Array(12).fill(0),a5=({visible:t,className:e})=>L.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},L.createElement("div",{className:"sonner-spinner"},i5.map((r,n)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),o5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),s5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.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"})),l5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),c5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),u5=L.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"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),d5=()=>{const[t,e]=L.useState(document.hidden);return L.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let Bb=1;class f5{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:Bb++,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],L.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(p5(d)&&!d.ok){a=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,y=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:y,...x})}else if(d instanceof Error){a=!1;const f=typeof r.error=="function"?await r.error(d):r.error,y=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:y,...x})}else if(r.success!==void 0){a=!1;const f=typeof r.success=="function"?await r.success(d):r.success,y=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:y,...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,f=typeof r.description=="function"?await r.description(d):r.description,v=typeof p=="object"&&!L.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:f,...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)||Bb++;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 Jr=new f5,h5=(t,e)=>{const r=(e==null?void 0:e.id)||Bb++;return Jr.addToast({title:t,...e,id:r}),r},p5=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",m5=h5,g5=()=>Jr.toasts,y5=()=>Jr.getActiveToasts(),et=Object.assign(m5,{success:Jr.success,info:Jr.info,warning:Jr.warning,error:Jr.error,custom:Jr.custom,message:Jr.message,promise:Jr.promise,dismiss:Jr.dismiss,loading:Jr.loading},{getHistory:g5,getToasts:y5});r5("[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 rf(t){return t.label!==void 0}const v5=3,b5="24px",x5="16px",zk=4e3,w5=356,_5=14,S5=45,k5=200;function mi(...t){return t.filter(Boolean).join(" ")}function E5(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const O5=t=>{var e,r,n,i,a,o,c,u,d;const{invert:p,toast:f,unstyled:y,interacting:v,setHeights:x,visibleToasts:w,heights:b,index:S,toasts:A,expanded:O,removeToast:C,defaultRichColors:E,closeButton:T,style:N,cancelButtonStyle:R,actionButtonStyle:I,className:K="",descriptionClassName:B="",duration:U,position:V,gap:H,expandByDefault:Y,classNames:G,icons:Q,closeButtonAriaLabel:W="Close toast"}=t,[ee,q]=L.useState(null),[$,M]=L.useState(null),[J,oe]=L.useState(!1),[le,ve]=L.useState(!1),[qe,xe]=L.useState(!1),[ae,Se]=L.useState(!1),[Me,se]=L.useState(!1),[rt,Fe]=L.useState(0),[kt,wt]=L.useState(0),Et=L.useRef(f.duration||U||zk),Sr=L.useRef(null),Ut=L.useRef(null),Rr=S===0,lr=S+1<=w,_t=f.type,kr=f.dismissible!==!1,Ir=f.className||"",ni=f.descriptionClassName||"",Ur=L.useMemo(()=>b.findIndex(D=>D.toastId===f.id)||0,[b,f.id]),ii=L.useMemo(()=>{var D;return(D=f.closeButton)!=null?D:T},[f.closeButton,T]),ai=L.useMemo(()=>f.duration||U||zk,[f.duration,U]),aa=L.useRef(0),qr=L.useRef(0),oi=L.useRef(0),si=L.useRef(null),[Wo,Xa]=V.split("-"),Go=L.useMemo(()=>b.reduce((D,ne,de)=>de>=Ur?D:D+ne.height,0),[b,Ur]),oa=d5(),Ya=f.invert||p,Rn=_t==="loading";qr.current=L.useMemo(()=>Ur*H+Go,[Ur,Go]),L.useEffect(()=>{Et.current=ai},[ai]),L.useEffect(()=>{oe(!0)},[]),L.useEffect(()=>{const D=Ut.current;if(D){const ne=D.getBoundingClientRect().height;return wt(ne),x(de=>[{toastId:f.id,height:ne,position:f.position},...de]),()=>x(de=>de.filter(Re=>Re.toastId!==f.id))}},[x,f.id]),L.useLayoutEffect(()=>{if(!J)return;const D=Ut.current,ne=D.style.height;D.style.height="auto";const de=D.getBoundingClientRect().height;D.style.height=ne,wt(de),x(Re=>Re.find(Ve=>Ve.toastId===f.id)?Re.map(Ve=>Ve.toastId===f.id?{...Ve,height:de}:Ve):[{toastId:f.id,height:de,position:f.position},...Re])},[J,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const $r=L.useCallback(()=>{ve(!0),Fe(qr.current),x(D=>D.filter(ne=>ne.toastId!==f.id)),setTimeout(()=>{C(f)},k5)},[f,C,x,qr]);L.useEffect(()=>{if(f.promise&&_t==="loading"||f.duration===1/0||f.type==="loading")return;let D;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(),D=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),$r()},Et.current))})(),()=>clearTimeout(D)},[O,v,f,_t,oa,$r]),L.useEffect(()=>{f.delete&&($r(),f.onDismiss==null||f.onDismiss.call(f,f))},[$r,f.delete]);function sa(){var D;if(Q!=null&&Q.loading){var ne;return L.createElement("div",{className:mi(G==null?void 0:G.loader,f==null||(ne=f.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":_t==="loading"},Q.loading)}return L.createElement(a5,{className:mi(G==null?void 0:G.loader,f==null||(D=f.classNames)==null?void 0:D.loader),visible:_t==="loading"})}const li=f.icon||(Q==null?void 0:Q[_t])||n5(_t);var hn,pn;return L.createElement("li",{tabIndex:0,ref:Ut,className:mi(K,Ir,G==null?void 0:G.toast,f==null||(e=f.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[_t],f==null||(r=f.classNames)==null?void 0:r[_t]),"data-sonner-toast":"","data-rich-colors":(hn=f.richColors)!=null?hn:E,"data-styled":!(f.jsx||f.unstyled||y),"data-mounted":J,"data-promise":!!f.promise,"data-swiped":Me,"data-removed":le,"data-visible":lr,"data-y-position":Wo,"data-x-position":Xa,"data-index":S,"data-front":Rr,"data-swiping":qe,"data-dismissible":kr,"data-type":_t,"data-invert":Ya,"data-swipe-out":ae,"data-swipe-direction":$,"data-expanded":!!(O||Y&&J),"data-testid":f.testId,style:{"--index":S,"--toasts-before":S,"--z-index":A.length-S,"--offset":`${le?rt:qr.current}px`,"--initial-height":Y?"auto":`${kt}px`,...N,...f.style},onDragEnd:()=>{xe(!1),q(null),si.current=null},onPointerDown:D=>{D.button!==2&&(Rn||!kr||(Sr.current=new Date,Fe(qr.current),D.target.setPointerCapture(D.pointerId),D.target.tagName!=="BUTTON"&&(xe(!0),si.current={x:D.clientX,y:D.clientY})))},onPointerUp:()=>{var D,ne,de;if(ae||!kr)return;si.current=null;const Re=Number(((D=Ut.current)==null?void 0:D.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ht=Number(((ne=Ut.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ve=new Date().getTime()-((de=Sr.current)==null?void 0:de.getTime()),ye=ee==="x"?Re:ht,we=Math.abs(ye)/Ve;if(Math.abs(ye)>=S5||we>.11){Fe(qr.current),f.onDismiss==null||f.onDismiss.call(f,f),M(ee==="x"?Re>0?"right":"left":ht>0?"down":"up"),$r(),Se(!0);return}else{var Ce,ut;(Ce=Ut.current)==null||Ce.style.setProperty("--swipe-amount-x","0px"),(ut=Ut.current)==null||ut.style.setProperty("--swipe-amount-y","0px")}se(!1),xe(!1),q(null)},onPointerMove:D=>{var ne,de,Re;if(!si.current||!kr||((ne=window.getSelection())==null?void 0:ne.toString().length)>0)return;const Ve=D.clientY-si.current.y,ye=D.clientX-si.current.x;var we;const Ce=(we=t.swipeDirections)!=null?we:E5(V);!ee&&(Math.abs(ye)>1||Math.abs(Ve)>1)&&q(Math.abs(ye)>Math.abs(Ve)?"x":"y");let ut={x:0,y:0};const gt=cr=>1/(1.5+Math.abs(cr)/20);if(ee==="y"){if(Ce.includes("top")||Ce.includes("bottom"))if(Ce.includes("top")&&Ve<0||Ce.includes("bottom")&&Ve>0)ut.y=Ve;else{const cr=Ve*gt(Ve);ut.y=Math.abs(cr)<Math.abs(Ve)?cr:Ve}}else if(ee==="x"&&(Ce.includes("left")||Ce.includes("right")))if(Ce.includes("left")&&ye<0||Ce.includes("right")&&ye>0)ut.x=ye;else{const cr=ye*gt(ye);ut.x=Math.abs(cr)<Math.abs(ye)?cr:ye}(Math.abs(ut.x)>0||Math.abs(ut.y)>0)&&se(!0),(de=Ut.current)==null||de.style.setProperty("--swipe-amount-x",`${ut.x}px`),(Re=Ut.current)==null||Re.style.setProperty("--swipe-amount-y",`${ut.y}px`)}},ii&&!f.jsx&&_t!=="loading"?L.createElement("button",{"aria-label":W,"data-disabled":Rn,"data-close-button":!0,onClick:Rn||!kr?()=>{}:()=>{$r(),f.onDismiss==null||f.onDismiss.call(f,f)},className:mi(G==null?void 0:G.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(pn=Q==null?void 0:Q.close)!=null?pn:u5):null,(_t||f.icon||f.promise)&&f.icon!==null&&((Q==null?void 0:Q[_t])!==null||f.icon)?L.createElement("div",{"data-icon":"",className:mi(G==null?void 0:G.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||sa():null,f.type!=="loading"?li:null):null,L.createElement("div",{"data-content":"",className:mi(G==null?void 0:G.content,f==null||(a=f.classNames)==null?void 0:a.content)},L.createElement("div",{"data-title":"",className:mi(G==null?void 0:G.title,f==null||(o=f.classNames)==null?void 0:o.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?L.createElement("div",{"data-description":"",className:mi(B,ni,G==null?void 0:G.description,f==null||(c=f.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),L.isValidElement(f.cancel)?f.cancel:f.cancel&&rf(f.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:D=>{rf(f.cancel)&&kr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,D),$r())},className:mi(G==null?void 0:G.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,L.isValidElement(f.action)?f.action:f.action&&rf(f.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||I,onClick:D=>{rf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,D),!D.defaultPrevented&&$r())},className:mi(G==null?void 0:G.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function Bk(){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 A5(t,e){const r={};return[t,e].forEach((n,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",c=a?x5:b5;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 T5=L.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:f,theme:y="light",richColors:v,duration:x,style:w,visibleToasts:b=v5,toastOptions:S,dir:A=Bk(),gap:O=_5,icons:C,containerAriaLabel:E="Notifications"}=e,[T,N]=L.useState([]),R=L.useMemo(()=>n?T.filter(J=>J.toasterId===n):T.filter(J=>!J.toasterId),[T,n]),I=L.useMemo(()=>Array.from(new Set([a].concat(R.filter(J=>J.position).map(J=>J.position)))),[R,a]),[K,B]=L.useState([]),[U,V]=L.useState(!1),[H,Y]=L.useState(!1),[G,Q]=L.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=L.useRef(null),ee=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=L.useRef(null),$=L.useRef(!1),M=L.useCallback(J=>{N(oe=>{var le;return(le=oe.find(ve=>ve.id===J.id))!=null&&le.delete||Jr.dismiss(J.id),oe.filter(({id:ve})=>ve!==J.id)})},[]);return L.useEffect(()=>Jr.subscribe(J=>{if(J.dismiss){requestAnimationFrame(()=>{N(oe=>oe.map(le=>le.id===J.id?{...le,delete:!0}:le))});return}setTimeout(()=>{t5.flushSync(()=>{N(oe=>{const le=oe.findIndex(ve=>ve.id===J.id);return le!==-1?[...oe.slice(0,le),{...oe[le],...J},...oe.slice(le+1)]:[J,...oe]})})})}),[T]),L.useEffect(()=>{if(y!=="system"){Q(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:oe})=>{Q(oe?"dark":"light")})}catch{J.addListener(({matches:le})=>{try{Q(le?"dark":"light")}catch(ve){console.error(ve)}})}},[y]),L.useEffect(()=>{T.length<=1&&V(!1)},[T]),L.useEffect(()=>{const J=oe=>{var le;if(o.every(xe=>oe[xe]||oe.code===xe)){var qe;V(!0),(qe=W.current)==null||qe.focus()}oe.code==="Escape"&&(document.activeElement===W.current||(le=W.current)!=null&&le.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[o]),L.useEffect(()=>{if(W.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,$.current=!1)}},[W.current]),L.createElement("section",{ref:r,"aria-label":`${E} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((J,oe)=>{var le;const[ve,qe]=J.split("-");return R.length?L.createElement("ol",{key:J,dir:A==="auto"?Bk():A,tabIndex:-1,ref:W,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":ve,"data-x-position":qe,style:{"--front-toast-height":`${((le=K[0])==null?void 0:le.height)||0}px`,"--width":`${w5}px`,"--gap":`${O}px`,...w,...A5(p,f)},onBlur:xe=>{$.current&&!xe.currentTarget.contains(xe.relatedTarget)&&($.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||$.current||($.current=!0,q.current=xe.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{H||V(!1)},onDragEnd:()=>V(!1),onPointerDown:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},R.filter(xe=>!xe.position&&oe===0||xe.position===J).map((xe,ae)=>{var Se,Me;return L.createElement(O5,{key:xe.id,icons:C,index:ae,toast:xe,defaultRichColors:v,duration:(Se=S==null?void 0:S.duration)!=null?Se:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:i,visibleToasts:b,closeButton:(Me=S==null?void 0:S.closeButton)!=null?Me:u,interacting:H,position:J,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:M,toasts:R.filter(se=>se.position==xe.position),heights:K.filter(se=>se.position==xe.position),setHeights:B,expandByDefault:c,gap:O,expanded:U,swipeDirections:e.swipeDirections})})):null}))}),C5="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 g.jsxs("svg",{width:e,height:t,viewBox:"0 0 480 480",fill:"none","aria-hidden":!0,children:[g.jsx("path",{d:C5,fill:"url(#io-grad)"}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"io-grad",x1:"0",x2:"450.529",y1:"402",y2:"69.3087",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#D83333"}),g.jsx("stop",{offset:"0.515",stopColor:"#E43A9C"}),g.jsx("stop",{offset:"1",stopColor:"#F041FF"})]})})]})}/**
52
52
  * @license lucide-react v0.487.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
@@ -435,8 +435,8 @@ Resources:`;for(const O of d){if(!O||typeof O!="string")throw new Error(`@supaba
435
435
  ${S}`}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 Xf extends Zt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function CU({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(yR(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 jU({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(yR(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 NU{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 sx=new NU;function CE(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=op(t,["challenge","user","excludeCredentials"]),a=Ds(e).buffer,o=Object.assign(Object.assign({},r),{id:Ds(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:Ds(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return c}function jE(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=op(t,["challenge","allowCredentials"]),i=Ds(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:Ds(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function NE(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:ko(new Uint8Array(t.response.attestationObject)),clientDataJSON:ko(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function PE(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:ko(new Uint8Array(i.authenticatorData)),clientDataJSON:ko(new Uint8Array(i.clientDataJSON)),signature:ko(new Uint8Array(i.signature)),userHandle:i.userHandle?ko(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function yR(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Yf(){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 vR(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Xf("Browser returned unexpected credential type",e)}:{data:null,error:new Xf("Empty credential response",e)}}catch(e){return{data:null,error:CU({error:e,options:t})}}}async function bR(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Xf("Browser returned unexpected credential type",e)}:{data:null,error:new Xf("Empty credential response",e)}}catch(e){return{data:null,error:jU({error:e,options:t})}}}const PU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},RU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Jf(...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]=Jf(c,o):n[a]=Jf(o)}else n[a]=o}return n}function IU(t,e){return Jf(PU,t,e||{})}function $U(t,e){return Jf(RU,t,e||{})}class MU{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??sx.createNewAbortSignal();if(c.webauthn.type==="create"){const{user:p}=c.webauthn.credential_options.publicKey;if(!p.name){const f=n;if(f)p.name=`${p.id}:${f}`;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=IU(c.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:f,error:y}=await vR({publicKey:p,signal:d});return f?{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:f}},error:null}:{data:null,error:y}}case"request":{const p=$U(c.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:f,error:y}=await bR(Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:p,signal:d}));return f?{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:f}},error:null}:{data:null,error:y}}}}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 Ws("rpId is required for WebAuthn authentication")};try{if(!Yf())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 Ws("rpId is required for WebAuthn registration")};try{if(!Yf())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 f;return(f=p.data)===null||f===void 0?void 0:f.all.find(y=>y.factor_type==="webauthn"&&y.friendly_name===e&&y.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)}}}}EU();const LU={url:U8,storageKey:q8,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:F8,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function RE(t,e,r){return await r()}const Ss={};class Kc{get jwks(){var e,r;return(r=(e=Ss[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Ss[this.storageKey]=Object.assign(Object.assign({},Ss[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Ss[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Ss[this.storageKey]=Object.assign(Object.assign({},Ss[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({},LU),e);if(this.storageKey=o.storageKey,this.instanceID=(r=Kc.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Kc.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 SU({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=pR(o.fetch),this.lock=o.lock||RE,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=kU:this.lock=RE,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 MU(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:hR()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=AE(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=AE(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} (${uR}) ${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=nU(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),V8(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 Ne(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:On}),{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:f,options:y}=e;let v=null,x=null;this.flowType==="pkce"&&([v,x]=await _s(this.storage,this.storageKey)),a=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:y==null?void 0:y.emailRedirectTo,body:{email:p,password:f,data:(r=y==null?void 0:y.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken},code_challenge:v,code_challenge_method:x},xform:On})}else if("phone"in e){const{phone:p,password:f,options:y}=e;a=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:f,data:(n=y==null?void 0:y.data)!==null&&n!==void 0?n:{},channel:(i=y==null?void 0:y.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken}},xform:On})}else throw new ff("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 Ne(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:EE})}else if("phone"in e){const{phone:a,password:o,options:c}=e;r=await Ne(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:EE})}else throw new ff("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 ws;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,f,y;let v,x;if("message"in e)v=e.message,x=e.signature;else{const{chain:w,wallet:b,statement:S,options:A}=e;let O;if(xr())if(typeof b=="object")O=b;else{const I=window;if("ethereum"in I&&typeof I.ethereum=="object"&&"request"in I.ethereum&&typeof I.ethereum.request=="function")O=I.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"||!(A!=null&&A.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=b}const C=new URL((r=A==null?void 0:A.url)!==null&&r!==void 0?r:window.location.href),E=await O.request({method:"eth_requestAccounts"}).then(I=>I).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!E||E.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const T=gR(E[0]);let N=(n=A==null?void 0:A.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!N){const I=await O.request({method:"eth_chainId"});N=OU(I)}const R={domain:C.host,address:T,statement:S,uri:C.href,version:"1",chainId:N,nonce:(i=A==null?void 0:A.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=A==null?void 0:A.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(c=A==null?void 0:A.signInWithEthereum)===null||c===void 0?void 0:c.expirationTime,notBefore:(u=A==null?void 0:A.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(d=A==null?void 0:A.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(p=A==null?void 0:A.signInWithEthereum)===null||p===void 0?void 0:p.resources};v=TU(R),x=await O.request({method:"personal_sign",params:[AU(v),T]})}try{const{data:w,error:b}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:x},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:On});if(b)throw b;if(!w||!w.session||!w.user){const S=new ws;return this._returnResult({data:{user:null,session:null},error:S})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:b})}catch(w){if(be(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async signInWithSolana(e){var r,n,i,a,o,c,u,d,p,f,y,v;let x,w;if("message"in e)x=e.message,w=e.signature;else{const{chain:b,wallet:S,statement:A,options:O}=e;let C;if(xr())if(typeof S=="object")C=S;else{const T=window;if("solana"in T&&typeof T.solana=="object"&&("signIn"in T.solana&&typeof T.solana.signIn=="function"||"signMessage"in T.solana&&typeof T.solana.signMessage=="function"))C=T.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 S!="object"||!(O!=null&&O.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");C=S}const E=new URL((r=O==null?void 0:O.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in C&&C.signIn){const T=await C.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},O==null?void 0:O.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),A?{statement:A}:null));let N;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")N=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)N=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)x=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),w=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in C)||typeof C.signMessage!="function"||!("publicKey"in C)||typeof C!="object"||!C.publicKey||!("toBase58"in C.publicKey)||typeof C.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${E.host} wants you to sign in with your Solana account:`,C.publicKey.toBase58(),...A?["",A,""]:[""],"Version: 1",`URI: ${E.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}`]:[],...!((f=(p=O==null?void 0:O.signInWithSolana)===null||p===void 0?void 0:p.resources)===null||f===void 0)&&f.length?["Resources",...O.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(`
436
436
  `);const T=await C.signMessage(new TextEncoder().encode(x),"utf8");if(!T||!(T instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=T}}try{const{data:b,error:S}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:ko(w)},!((y=e.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(v=e.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:On});if(S)throw S;if(!b||!b.session||!b.user){const A=new ws;return this._returnResult({data:{user:null,session:null},error:A})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:S})}catch(b){if(be(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await vo(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new X8;const{data:a,error:o}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:On});if(await br(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const c=new ws;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 Ne(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:On}),{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 ws;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 _s(this.storage,this.storageKey));const{error:f}=await Ne(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:f})}if("phone"in e){const{phone:c,options:u}=e,{data:d,error:p}=await Ne(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 ff("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 Ne(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:On});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 _s(this.storage,this.storageKey));const d=await Ne(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:xU});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 Ne(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 Ne(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 Ne(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 ff("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 vo(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()<Pg:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await vo(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Ig()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=gU(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 Ne(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Na}):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 Ne(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:Na})})}catch(r){if(be(r))return df(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 _s(this.storage,this.storageKey));const{data:d,error:p}=await Ne(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:Na});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}=pf(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 hf("No browser detected.");if(e.error||e.error_description||e.error_code)throw new hf(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 vE("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new hf("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 vE("No code detected.");const{data:O,error:C}=await this._exchangeCodeForSession(e.code);if(C)throw C;const E=new URL(window.location.href);return E.searchParams.delete("code"),window.history.replaceState(window.history.state,"",E.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 hf("No session defined in URL");const f=Math.round(Date.now()/1e3),y=parseInt(u);let v=f+y;d&&(v=parseInt(d));const x=v-f;x*1e3<=Ns&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${y}s`);const w=v-y;f-w>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",w,v,f):f-w<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",w,v,f);const{data:b,error:S}=await this._getUser(o);if(S)throw S;const A={provider_token:i,provider_refresh_token:a,access_token:o,expires_in:y,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:A,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 vo(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&&!df(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&&!(K8(c)&&(c.status===404||c.status===401||c.status===403)||df(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=rU(),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),df(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await _s(this.storage,this.storageKey,!0));try{return await Ne(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:f,error:y}=a;if(y)throw y;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 Ne(this.fetch,"GET",v,{headers:this.headers,jwt:(p=(d=f.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,f=await Ne(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:On}),{data:y,error:v}=f;return v?this._returnResult({data:{user:null,session:null},error:v}):!y||!y.session||!y.user?this._returnResult({data:{user:null,session:null},error:new ws}):(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("USER_UPDATED",y.session)),this._returnResult({data:y,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 Ne(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 oU(async i=>(i>0&&await aU(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await Ne(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:On})),(i,a)=>{const o=200*Math.pow(2,i);return a&&Rg(a)&&Date.now()+o-n<Ns})}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 vo(this.storage,this.storageKey);if(i&&this.userStorage){let o=await vo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await Ps(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Ig()}else if(i&&!i.user&&!i.user){const o=await vo(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await br(this.storage,this.storageKey+"-user"),await Ps(this.storage,this.storageKey,i)):i.user=Ig()}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()<Pg;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${Pg}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),Rg(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 cp;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 Rg(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 Ps(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=SE(i);await Ps(this.storage,this.storageKey,a)}else{const i=SE(r);await Ps(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(),Ns);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)/Ns);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ns}ms, refresh threshold is ${nx} ticks`),i<=nx&&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 mR)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 _s(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 Ne(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 Ne(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"?NE(e.webauthn.credential_response):PE(e.webauthn.credential_response)})}:{code:e.code}),{data:c,error:u}=await Ne(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 Ne(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:CE(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:jE(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}=pf(e);let x=null;v.aal&&(x=v.aal);let w=x;const{data:{user:b},error:S}=await this.getUser(e);if(S)return this._returnResult({data:null,error:S});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(C=>C.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(w="aal2");const O=v.amr||[];return{data:{currentLevel:x,nextLevel:w,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}=pf(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 y=u.amr||[];return{data:{currentLevel:d,nextLevel:p,currentAuthenticationMethods:y},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 Ne(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 Ne(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 Ne(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 Ne(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 Ne(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+W8>i)return n;const{data:a,error:o}=await Ne(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}}=pf(n);r!=null&&r.allowExpired||hU(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=pU(i.alg),f=await crypto.subtle.importKey("jwk",d,p,!0,["verify"]);if(!await crypto.subtle.verify(p,f,o,eU(`${c}.${u}`)))throw new ox("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(!Yf())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=jE(a.options),u=(i=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&i!==void 0?i:sx.createNewAbortSignal(),{data:d,error:p}=await bR({publicKey:c,signal:u});if(p||!d)return this._returnResult({data:null,error:p??new Xn("WebAuthn ceremony failed",null)});const f=PE(d);return this._verifyPasskeyAuthentication({challengeId:a.challenge_id,credential:f})}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(!Yf())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=CE(i.options),c=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:sx.createNewAbortSignal(),{data:u,error:d}=await vR({publicKey:o,signal:c});if(d||!u)return this._returnResult({data:null,error:d??new Xn("WebAuthn ceremony failed",null)});const p=NE(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 Ne(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 Ne(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 Ne(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 Ne(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:On});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 Ne(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 Ne(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 Ne(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}}}Kc.nextInstanceID={};const DU=Kc,zU="2.106.2";let Cc="";typeof Deno<"u"?Cc="deno":typeof document<"u"?Cc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Cc="react-native":Cc="node";const BU={"X-Client-Info":`supabase-js-${Cc}/${zU}`},UU={headers:BU},qU={schema:"public"},FU={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},HU={},WU={enabled:!1,respectSamplingDecision:!0};function GU(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(f){o(f)}}function u(p){try{d(n.throw(p))}catch(f){o(f)}}function d(p){p.done?a(p.value):i(p.value).then(c,u)}d((n=n.apply(t,[])).next())})}let Mg=null;const KU="@opentelemetry/api";function VU(){return Mg===null&&(Mg=import(KU).catch(()=>null)),Mg}function XU(){return GU(this,void 0,void 0,function*(){try{const t=yield VU();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 YU(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 JU(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(ZU(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 ZU(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 QU(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 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 eq(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)}function tq(t){var e=eq(t,"string");return Vc(e)=="symbol"?e:e+""}function rq(t,e,r){return(e=tq(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IE(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?IE(Object(r),!0).forEach(function(n){rq(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const nq=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),iq=()=>Headers,aq=(t,e,r,n,i)=>{const a=nq(n),o=iq(),c=(i==null?void 0:i.enabled)===!0,u=(i==null?void 0:i.respectSamplingDecision)!==!1,d=c?QU(e):null;return async(p,f)=>{var y;const v=(y=await r())!==null&&y!==void 0?y:t;let x=new o(f==null?void 0:f.headers);if(x.has("apikey")||x.set("apikey",t),x.has("Authorization")||x.set("Authorization",`Bearer ${v}`),d){const w=await oq(p,d,u);w&&(w.traceparent&&!x.has("traceparent")&&x.set("traceparent",w.traceparent),w.tracestate&&!x.has("tracestate")&&x.set("tracestate",w.tracestate),w.baggage&&!x.has("baggage")&&x.set("baggage",w.baggage))}return a(p,Ht(Ht({},f),{},{headers:x}))}};async function oq(t,e,r){if(!JU(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await XU();if(!n||!n.traceparent)return null;if(r){const i=YU(n.traceparent);if(i&&!i.isSampled)return null}return n}function $E(t){return typeof t=="boolean"?{enabled:t}:t}function sq(t){return t.endsWith("/")?t:t+"/"}function lq(t,e){var r,n,i,a,o,c;const{db:u,auth:d,realtime:p,global:f}=t,{db:y,auth:v,realtime:x,global:w}=e,b=$E(t.tracePropagation),S=$E(e.tracePropagation),A={db:Ht(Ht({},y),u),auth:Ht(Ht({},v),d),realtime:Ht(Ht({},x),p),storage:{},global:Ht(Ht(Ht({},w),f),{},{headers:Ht(Ht({},(r=w==null?void 0:w.headers)!==null&&r!==void 0?r:{}),(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(i=(a=b==null?void 0:b.enabled)!==null&&a!==void 0?a:S==null?void 0:S.enabled)!==null&&i!==void 0?i:!1,respectSamplingDecision:(o=(c=b==null?void 0:b.respectSamplingDecision)!==null&&c!==void 0?c:S==null?void 0:S.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return t.accessToken?A.accessToken=t.accessToken:delete A.accessToken,A}function cq(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(sq(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var uq=class extends DU{constructor(t){super(t)}},dq=class{constructor(t,e,r){var n,i;this.supabaseUrl=t,this.supabaseKey=e;const a=cq(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:qU,realtime:HU,auth:Ht(Ht({},FU),{},{storageKey:o}),global:UU,tracePropagation:WU},u=lq(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,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} 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=aq(e,t,this._getAccessToken.bind(this),u.global.fetch,u.tracePropagation),this.realtime=this._initRealtimeClient(Ht({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 A6(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 B8(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new y6(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:f,skipAutoInitialize:y},v,x){const w={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new uq({url:this.authUrl.href,headers:Ht(Ht({},w),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:f,skipAutoInitialize:y,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new c8(this.realtimeUrl.href,Ht(Ht({},t),{},{params:Ht(Ht({},{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 fq=(t,e,r)=>new dq(t,e,r);function hq(){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}hq()&&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 xR=j.createContext({session:null,supabase:null,loading:!0,signIn:async()=>({error:"Not initialized"}),signOut:async()=>{}});function up(){return j.useContext(xR)}function pq({children:t}){const[e,r]=j.useState(null),[n,i]=j.useState(null),[a,o]=j.useState(!0),c=j.useRef(null);j.useEffect(()=>{ez(()=>{var f;return((f=c.current)==null?void 0:f.access_token)??null})},[]);const u=j.useRef(null);j.useEffect(()=>{tz(async()=>{const f=u.current;if(!f)return null;const{data:y,error:v}=await f.auth.refreshSession();return v||!y.session?null:(c.current=y.session,i(y.session),y.session.access_token)})},[]),j.useEffect(()=>{Ke.get("/config").then(({config:f})=>{if(f.supabase.projectUrl&&f.supabase.anonKey){const y=fq(f.supabase.projectUrl,f.supabase.anonKey);r(y),u.current=y,y.auth.getSession().then(({data:x})=>{c.current=x.session,i(x.session),o(!1)});const{data:{subscription:v}}=y.auth.onAuthStateChange((x,w)=>{c.current=w,i(w)});return()=>v.unsubscribe()}o(!1)}).catch(()=>{o(!1)})},[]);async function d(f,y){if(!e)return{error:"Supabase not configured"};const{error:v}=await e.auth.signInWithPassword({email:f,password:y});return{error:(v==null?void 0:v.message)??null}}async function p(){e&&(await e.auth.signOut(),c.current=null,i(null))}return g.jsx(xR.Provider,{value:{session:n,supabase:e,loading:a,signIn:d,signOut:p},children:t})}const mq=[{to:"/squads",icon:qw,label:"Squads"},{to:"/skills",icon:Fb,label:"Skills"},{to:"/schedules",icon:H5,label:"Schedules"},{to:"/wiki",icon:YN,label:"Wiki"},{to:"/usage",icon:G5,label:"Usage"}],gq=[{to:"/",icon:Bw,label:"Chat"},{to:"/feed",icon:qb,label:"Inbox"},{to:"/settings",icon:F4,label:"Settings"}];function ME({to:t,icon:e,label:r,collapsed:n,badge:i}){return g.jsxs(KN,{to:t,end:t==="/",title:n?r:void 0,className:({isActive:a})=>Ac("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:[g.jsx(e,{className:"w-3.5 h-3.5 flex-shrink-0"}),!n&&r,i!=null&&i>0&&g.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 yq(){const[t,e]=j.useState(!1),[r,n]=j.useState("..."),[i,a]=j.useState(0),{supabase:o}=up();return j.useEffect(()=>{let c=!0;Ke.get("/version").then(({version:d})=>{c&&n(d)}).catch(()=>{c&&n("unknown")}),Ke.get("/inbox/unread-count").then(({count:d})=>{c&&a(d)}).catch(()=>{});const u=setInterval(()=>{Ke.get("/inbox/unread-count").then(({count:d})=>{c&&a(d)}).catch(()=>{})},3e4);return()=>{c=!1,clearInterval(u)}},[]),g.jsxs("div",{className:"flex h-screen overflow-hidden bg-background relative",children:[g.jsxs("div",{className:Ac("flex-shrink-0 flex flex-col border-r border-white/[0.06] bg-[#181818] transition-all duration-200",t?"w-[52px]":"w-[210px]"),children:[g.jsx("div",{className:Ac("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?g.jsx(Ra,{height:26}):g.jsxs("div",{className:"flex items-center gap-2.5",children:[g.jsx(Ra,{height:26}),g.jsx("span",{className:"text-2xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"})]})}),g.jsx("nav",{className:"flex-1 py-2 px-1.5 space-y-0.5 overflow-y-auto",children:mq.map(c=>g.jsx(ME,{collapsed:t,...c},c.to))}),g.jsxs("div",{className:"flex-shrink-0 border-t border-white/[0.06]",children:[g.jsx("div",{className:"py-1.5 px-1.5 space-y-0.5",children:gq.map(c=>g.jsx(ME,{collapsed:t,badge:c.to==="/feed"?i:void 0,...c},c.to))}),g.jsxs("div",{className:"border-t border-white/[0.05] py-1.5 px-1.5 space-y-0.5",children:[g.jsxs("a",{href:`https://github.com/michaeljolley/io/releases/tag/v${r}`,target:"_blank",rel:"noreferrer",title:"GitHub",className:Ac("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:[g.jsx(g4,{className:"w-3.5 h-3.5 flex-shrink-0"}),!t&&g.jsxs("span",{className:"text-zinc-700",children:["v",r]})]}),g.jsx("button",{type:"button",onClick:()=>e(!t),title:t?"Expand sidebar":"Collapse sidebar",className:Ac("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?g.jsx(Lw,{className:"w-3.5 h-3.5 flex-shrink-0"}):g.jsx(bl,{className:"w-3.5 h-3.5 flex-shrink-0"})})]})]})]}),g.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[g.jsxs("div",{className:"h-[52px] flex-shrink-0 flex items-center justify-between px-4 border-b border-white/[0.06] bg-[#181818]",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(d6,{status:"connected"}),g.jsx("span",{className:"text-[11px] font-mono text-green-400",children:"connected"})]}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx(lz,{}),o&&g.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:g.jsx(k4,{className:"w-3.5 h-3.5"})})]})]}),g.jsxs("main",{className:"flex-1 overflow-hidden flex flex-col min-h-0 relative",children:[g.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",style:{zIndex:0},children:[g.jsx("div",{className:"orb orb-pink"}),g.jsx("div",{className:"orb orb-gray"})]}),g.jsx(bD,{})]})]})]})}function vq(){const{session:t}=up(),e=qa(),{messages:r,streaming:n,isStreaming:i,isThinking:a,sendChatMessage:o,addUserMessage:c,uploadAttachment:u}=dP(),[d,p]=j.useState(""),[f,y]=j.useState(null),[v,x]=j.useState(null),w=j.useRef(null),b=j.useRef(null),S=j.useRef(null);j.useLayoutEffect(()=>{const E=w.current;E&&(E.scrollTop=E.scrollHeight)},[r,n,a]);async function A(){const E=d.trim();if(!E&&!f||i||a)return;const T=crypto.randomUUID(),N=f==null?void 0:f.name,R=[E,N?`Attachment: ${N}`:""].filter(Boolean).join(`
437
437
 
438
- `);c({id:T,role:"user",content:E,timestamp:new Date().toISOString(),attachmentName:N}),p(""),y(null),S.current&&(S.current.value=""),b.current&&(b.current.style.height="auto");try{f&&await u(f,T),o(R)}catch{}}function O(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),A())}function C(E){p(E.target.value),b.current&&(b.current.style.height="auto",b.current.style.height=`${Math.min(b.current.scrollHeight,160)}px`)}return g.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[g.jsxs("div",{ref:w,className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[r.map(E=>{var T,N;return g.jsxs("div",{className:`flex gap-3 ${E.role==="user"?"flex-row-reverse":""}`,children:[g.jsx("div",{className:`flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center text-[10px] font-mono mt-0.5 ${E.role==="user"?"border border-[#E43A9C]/30 text-[#E43A9C]":"bg-[#282828] border border-white/[0.07] text-zinc-500"}`,style:E.role==="user"?{background:"rgba(228,58,156,0.12)"}:void 0,children:E.role==="user"?((N=(T=t==null?void 0:t.user)==null?void 0:T.email)==null?void 0:N.charAt(0).toUpperCase())??"U":g.jsx(Ra,{height:12})}),g.jsxs("div",{className:`flex flex-col gap-1.5 max-w-[72%] ${E.role==="user"?"items-end":"items-start"}`,children:[E.toolCall&&g.jsxs("button",{type:"button",onClick:()=>x(v===E.id?null:E.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:[g.jsx(Mf,{className:"w-3 h-3 text-[#E43A9C] flex-shrink-0"}),g.jsx("span",{className:"text-[11px] font-mono text-zinc-400 flex-1",children:E.toolCall.name}),g.jsx(Pt,{variant:E.toolCall.status==="done"?"success":E.toolCall.status==="error"?"error":"warning",children:E.toolCall.status}),g.jsx(V5,{className:`w-3 h-3 text-zinc-600 transition-transform flex-shrink-0 ${v===E.id?"rotate-180":""}`})]}),E.toolCall&&v===E.id&&g.jsx("div",{className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl px-3 py-2",children:g.jsx("p",{className:"text-[11px] font-mono text-zinc-500",children:E.toolCall.result})}),E.attachmentName&&g.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:E.attachmentName}),E.content&&g.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${E.role==="user"?"text-white rounded-tr-sm":"bg-[#222222] border border-white/[0.07] text-zinc-200 rounded-tl-sm"}`,style:E.role==="user"?{background:"linear-gradient(135deg, #D83333 0%, #C0285E 100%)"}:void 0,children:E.role==="user"?g.jsx("p",{className:"whitespace-pre-wrap",children:E.content}):g.jsx("div",{className:"prose-io",dangerouslySetInnerHTML:{__html:it.parse(E.content)}})}),g.jsx("span",{className:"text-[11px] text-zinc-700 font-mono px-0.5",children:np(E.timestamp,e)})]})]},E.id)}),a&&g.jsxs("div",{className:"flex gap-3",children:[g.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:g.jsx(Ra,{height:12})}),g.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(E=>g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]}),i&&n&&g.jsxs("div",{className:"flex gap-3",children:[g.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:g.jsx(Ra,{height:12})}),g.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-2.5 max-w-[72%]",children:g.jsx("div",{className:"prose-io text-sm",dangerouslySetInnerHTML:{__html:it.parse(n)}})})]}),i&&!n&&g.jsxs("div",{className:"flex gap-3",children:[g.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:g.jsx(Ra,{height:12})}),g.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(E=>g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]})]}),g.jsxs("div",{className:"border-t border-white/[0.06] p-4 flex-shrink-0",children:[g.jsxs("div",{className:"bg-[#1e1e1e] border border-white/[0.08] rounded-2xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[g.jsx("input",{ref:S,type:"file",className:"hidden",onChange:E=>{var T;return y(((T=E.target.files)==null?void 0:T[0])??null)}}),f&&g.jsxs("div",{className:"px-4 pt-3 text-[11px] font-mono text-zinc-400",children:["Attached: ",f.name]}),g.jsx("textarea",{ref:b,value:d,onChange:C,onKeyDown:O,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"}}),g.jsxs("div",{className:"flex items-center justify-between px-3 pb-2.5",children:[g.jsx("button",{type:"button",onClick:()=>{var E;return(E=S.current)==null?void 0:E.click()},className:"p-1.5 rounded-lg hover:bg-white/[0.05] text-zinc-700 hover:text-zinc-400 transition-colors",children:g.jsx(rP,{className:"w-4 h-4"})}),g.jsx("div",{className:"flex items-center gap-2",children:i?g.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:[g.jsx(rp,{className:"w-3 h-3"})," Stop"]}):g.jsx("button",{type:"button",onClick:A,disabled:!d.trim()&&!f||a,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:g.jsx(iP,{className:"w-3.5 h-3.5"})})})]})]}),g.jsx("p",{className:"text-center text-[11px] text-zinc-800 font-mono mt-2",children:"IO may make mistakes. Verify important outputs."})]})]})}const LE=["#38bdf8","#a78bfa","#34d399","#f59e0b","#f87171","#E43A9C"];function bq(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);return LE[Math.abs(e)%LE.length]}function DE({name:t,color:e}){const r=t.toLowerCase(),n=e??(r==="orchestrator"||r==="io"?"#71717a":bq(t));return g.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${n}15`,color:n,borderColor:`${n}30`},children:t})}function xq(){const[t,e]=j.useState([]),[r,n]=j.useState(null),[i,a]=j.useState(new Set),[o,c]=j.useState("all"),u=qa();j.useEffect(()=>{Ke.get("/inbox").then(O=>e(O.entries)).catch(()=>{})},[]);const d=t.filter(O=>O.status==="unread").length,p=o==="unread"?t.filter(O=>O.status==="unread"):t,f=p.length>0&&p.every(O=>i.has(O.id)),y=i.size>0;function v(O){y||(n(O),O.status==="unread"&&(Ke.post(`/inbox/${O.id}/read`).catch(()=>{}),e(C=>C.map(E=>E.id===O.id?{...E,status:"read"}:E))))}function x(O,C){O.stopPropagation(),a(E=>{const T=new Set(E);return T.has(C)?T.delete(C):T.add(C),T})}function w(){a(f?new Set:new Set(p.map(O=>O.id)))}function b(){const O=Array.from(i);Ke.post("/inbox/bulk/read",{ids:O}).catch(()=>{}),e(C=>C.map(E=>i.has(E.id)?{...E,status:"read"}:E)),a(new Set)}function S(){const O=Array.from(i);Ke.post("/inbox/bulk/delete",{ids:O}).catch(()=>{}),e(C=>C.filter(E=>!i.has(E.id))),r&&i.has(r.id)&&n(null),a(new Set)}function A(O){Ke.delete(`/inbox/${O}`).catch(()=>{}),e(C=>C.filter(E=>E.id!==O)),(r==null?void 0:r.id)===O&&n(null)}return g.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[g.jsxs("div",{className:"w-72 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[g.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex-shrink-0 space-y-2",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("span",{className:"text-lg tracking-wide text-zinc-200",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Inbox"}),d>0&&g.jsxs(Pt,{variant:"default",children:[d," unread"]})]}),g.jsx("div",{className:"flex gap-1",children:["all","unread"].map(O=>g.jsx("button",{type:"button",onClick:()=>{c(O),a(new Set)},className:`flex-1 py-1 text-[11px] font-mono rounded-lg transition-colors cursor-pointer ${o===O?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300"}`,style:o===O?{background:"rgba(228,58,156,0.12)"}:void 0,children:O},O))})]}),y&&g.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:[g.jsxs("span",{className:"text-[10px] font-mono text-zinc-500 flex-1",children:[i.size," selected"]}),g.jsxs("button",{type:"button",onClick:b,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:[g.jsx(Ub,{className:"w-3 h-3"}),"Mark read"]}),g.jsxs("button",{type:"button",onClick:S,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:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]}),p.length>0&&g.jsxs("div",{className:"px-4 py-1.5 border-b border-white/[0.04] flex items-center gap-2 flex-shrink-0",children:[g.jsx("button",{type:"button",onClick:w,className:`w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${f?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/40"}`,children:f&&g.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:g.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),g.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:"Select all"})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p.map(O=>{const C=i.has(O.id),E=(r==null?void 0:r.id)===O.id&&!y;return g.jsxs("div",{onClick:()=>v(O),onKeyDown:T=>T.key==="Enter"&&v(O),className:`flex items-start gap-2.5 px-3 py-3 border-b border-white/[0.04] cursor-pointer transition-colors ${E?"border-l-2 border-l-[#E43A9C] pl-2.5":"hover:bg-white/[0.025]"} ${C?"bg-[#E43A9C]/5":""}`,style:E?{background:"rgba(228,58,156,0.05)"}:void 0,children:[g.jsx("button",{type:"button",onClick:T=>x(T,O.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 ${C?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/50"}`,children:C&&g.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:g.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[O.status==="unread"&&g.jsx("div",{className:"w-1 h-1 rounded-full bg-[#E43A9C] flex-shrink-0"}),g.jsx(DE,{name:O.squadName??(O.squadId?O.squadId.slice(0,8):"Orchestrator"),color:O.squadColor})]}),g.jsx("p",{className:`text-[11px] truncate ${O.status==="unread"?"text-zinc-200":"text-zinc-500"}`,children:O.title}),g.jsx("p",{className:"text-[10px] text-zinc-700 font-mono mt-1",children:Hs(O.createdAt,u)})]})]},O.id)}),p.length===0&&g.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[g.jsx(qb,{size:32,className:"text-zinc-800 mb-2"}),g.jsx("p",{className:"text-[11px] font-mono text-zinc-700",children:o==="unread"?"All caught up":"No items yet"})]})]})]}),g.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:r&&!y?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"px-6 py-4 border-b border-white/[0.06] flex items-start justify-between flex-shrink-0",children:[g.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[g.jsx(DE,{name:r.squadName??(r.squadId?r.squadId.slice(0,8):"Orchestrator"),color:r.squadColor}),g.jsx("h3",{className:"text-sm font-mono text-zinc-100 mt-1.5",children:r.title}),g.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:Hs(r.createdAt,u)})]}),g.jsxs("button",{type:"button",onClick:()=>A(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:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]}),g.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:g.jsx(Iu,{content:r.content})})]}):y?g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 text-center px-8",children:[g.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:g.jsx(qb,{className:"w-4 h-4 text-[#E43A9C]"})}),g.jsxs("div",{children:[g.jsxs("p",{className:"text-sm font-mono text-zinc-300",children:[i.size," message",i.size!==1?"s":""," selected"]}),g.jsx("p",{className:"text-[11px] text-zinc-600 mt-1",children:"Use the actions above to mark as read or delete"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.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-zinc-300 border border-white/[0.1] hover:bg-white/[0.05] transition-colors cursor-pointer",children:[g.jsx(Ub,{className:"w-3 h-3"}),"Mark read"]}),g.jsxs("button",{type:"button",onClick:S,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:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete selected"]})]})]}):g.jsx("div",{className:"flex-1 flex items-center justify-center text-zinc-700 font-mono text-xs",children:"Select an item to read"})})]})}function wq(){const{signIn:t}=up(),[e,r]=j.useState(""),[n,i]=j.useState(""),[a,o]=j.useState(null),[c,u]=j.useState(!1);async function d(p){p.preventDefault(),o(null),u(!0);const{error:f}=await t(e,n);f&&o(f),u(!1)}return g.jsxs("div",{className:"min-h-screen bg-[#161616] flex items-center justify-center relative overflow-hidden",children:[g.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"radial-gradient(circle, #E43A9C 1px, transparent 1px)",backgroundSize:"32px 32px"}}),g.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%)"}}),g.jsxs("div",{className:"relative z-10 w-full max-w-[360px] mx-4",children:[g.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[g.jsx(Ra,{height:52}),g.jsx("div",{className:"text-center",children:g.jsx("p",{className:"text-[11px] font-mono text-zinc-600 tracking-widest uppercase mt-1",children:"personal ai orchestrator"})})]}),g.jsxs("form",{onSubmit:d,className:"glass-card border border-white/[0.07] rounded-2xl p-6 space-y-4",children:[g.jsxs("div",{className:"space-y-1",children:[g.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Email"}),g.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"})]}),g.jsxs("div",{className:"space-y-1",children:[g.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Password"}),g.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&&g.jsx("p",{className:"text-[11px] font-mono text-red-400",children:a}),g.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?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Authenticating…"]}):"Sign In"})]}),g.jsx("p",{className:"text-center text-[11px] text-zinc-700 font-mono mt-4",children:"Secured by Supabase Auth"})]})]})}const wR="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",zs="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 qi({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 g.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:[g.jsxs("div",{className:"w-[140px] shrink-0",children:[g.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:t}),e&&g.jsxs("span",{className:"text-[10px] font-mono text-zinc-700 ml-1.5",children:["(",e,")"]})]}),g.jsx("div",{className:i,children:n})]})}function _q({onSave:t,onCancel:e,squads:r}){var x;const[n,i]=j.useState("io"),[a,o]=j.useState(((x=r[0])==null?void 0:x.id)??""),[c,u]=j.useState(""),[d,p]=j.useState(""),[f,y]=j.useState(""),v=()=>{!d.trim()||!f.trim()||!c.trim()||t({name:c.trim(),targetType:n==="io"?"orchestrator":"squad",targetId:n==="squad"?a:void 0,cron:d.trim(),prompt:f.trim()})};return g.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:g.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:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/[0.06] flex-shrink-0",children:[g.jsx("h3",{className:"text-lg tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"New Schedule"}),g.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:g.jsx(oP,{className:"w-4 h-4"})})]}),g.jsxs("div",{className:"overflow-y-auto flex-1 px-5 py-4 space-y-2",children:[g.jsx(qi,{label:"Name",children:g.jsx("input",{value:c,onChange:w=>u(w.target.value),placeholder:"Daily triage",className:`${zs} w-48`})}),g.jsx(qi,{label:"Type",children:g.jsx("div",{className:"flex gap-2",children:["io","squad"].map(w=>g.jsx("button",{type:"button",onClick:()=>i(w),className:`px-4 py-1.5 rounded-xl text-[11px] font-mono capitalize transition-colors border cursor-pointer ${n===w?"text-[#E43A9C] border-[#E43A9C]/30":"text-zinc-500 border-white/[0.08] hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:n===w?{background:"rgba(228,58,156,0.08)"}:void 0,children:w==="io"?"IO":"Squad"},w))})}),n==="squad"&&g.jsx(qi,{label:"Squad",children:g.jsx("select",{value:a,onChange:w=>o(w.target.value),className:`${zs} w-48`,children:r.map(w=>g.jsx("option",{value:w.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:w.name},w.id))})}),g.jsx(qi,{label:"Cron Expression",children:g.jsx("input",{value:d,onChange:w=>p(w.target.value),placeholder:"0 9 * * 1-5",className:`${zs} w-40`})}),g.jsx(qi,{label:"Prompt",hint:"supports Markdown",align:"start",children:g.jsx("textarea",{value:f,onChange:w=>y(w.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",rows:8,className:`${wR} resize-none leading-relaxed`})})]}),g.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:[g.jsx(_i,{onClick:e,children:"Cancel"}),g.jsxs(za,{onClick:v,className:"px-4 py-1.5",children:[g.jsx(tp,{className:"w-3 h-3"}),"Create Schedule"]})]})]})})}function Sq({sched:t,squads:e,onSave:r,onBack:n}){var x,w;const[i,a]=j.useState(t.name),[o,c]=j.useState(t.cron),[u,d]=j.useState(t.prompt),[p,f]=j.useState(t.targetId??((x=e[0])==null?void 0:x.id)??""),y=()=>{!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 — ${((w=e.find(b=>b.id===t.targetId))==null?void 0:w.name)??"Unknown"}`;return g.jsxs("div",{className:"flex-1 overflow-y-auto p-6 max-w-3xl",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[g.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:[g.jsx(bl,{className:"w-3.5 h-3.5"}),"Schedules"]}),g.jsx("span",{className:"text-zinc-700 text-[11px]",children:"/"}),g.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:"Edit"})]}),g.jsxs("div",{className:"flex items-start justify-between mb-6",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Edit Schedule"}),g.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mt-0.5",children:v})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(_i,{onClick:n,children:"Cancel"}),g.jsxs(za,{onClick:y,className:"px-4 py-1.5",children:[g.jsx(tp,{className:"w-3 h-3"}),"Save Changes"]})]})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsx(qi,{label:"Name",children:g.jsx("input",{value:i,onChange:b=>a(b.target.value),placeholder:"Schedule name",className:`${zs} w-48`})}),t.targetType==="squad"&&g.jsx(qi,{label:"Squad",children:g.jsx("select",{value:p,onChange:b=>f(b.target.value),className:`${zs} w-48`,children:e.map(b=>g.jsx("option",{value:b.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:b.name},b.id))})}),g.jsx(qi,{label:"Cron Expression",children:g.jsx("input",{value:o,onChange:b=>c(b.target.value),placeholder:"0 9 * * 1-5",className:`${zs} w-40`})}),g.jsx(qi,{label:"Prompt",hint:"supports Markdown",align:"start",children:g.jsxs("div",{className:"space-y-1.5",children:[g.jsx("textarea",{value:u,onChange:b=>d(b.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",className:`${wR} leading-relaxed resize-y`,style:{minHeight:"360px"}}),g.jsx("p",{className:"text-[10px] font-mono text-zinc-700",children:"Tip: use # headings and - lists to structure multi-step instructions."})]})})]})]})}function kq(){const[t,e]=j.useState("squad"),[r,n]=j.useState([]),[i,a]=j.useState([]),[o,c]=j.useState(!1),[u,d]=j.useState(null),p=qa();j.useEffect(()=>{f(),y()},[]);function f(){Ke.get("/schedules").then(R=>n(R.schedules)).catch(()=>{})}function y(){Ke.get("/squads").then(R=>a(R.squads)).catch(()=>{})}const v=r.filter(R=>R.targetType==="squad"),x=r.filter(R=>R.targetType==="orchestrator"),w=t==="squad"?v:x;async function b(R){try{await Ke.post("/schedules",R),tt.success("Schedule created"),c(!1),f()}catch(I){tt.error(I instanceof Error?I.message:"Failed to create")}}async function S(R){if(u)try{await Ke.patch(`/schedules/${u.id}`,R),tt.success("Schedule saved"),d(null),f()}catch{tt.error("Failed to save schedule")}}const[A,O]=j.useState(null);async function C(R,I){O(R);try{await Ke.patch(`/schedules/${R}`,{enabled:!I}),tt.success(I?"Schedule paused":"Schedule resumed"),f()}catch{tt.error("Failed to toggle schedule")}finally{O(null)}}async function E(R){O(R);try{await Ke.post(`/schedules/${R}/run`,{}),tt.success("Schedule triggered")}catch{tt.error("Failed to trigger schedule")}finally{O(null)}}async function T(R){O(R);try{await Ke.delete(`/schedules/${R}`),tt.success("Schedule deleted"),f()}catch{tt.error("Failed to delete")}finally{O(null)}}if(u)return g.jsx(Sq,{sched:u,squads:i,onSave:S,onBack:()=>d(null)});const N=t==="squad"?["Squad","Name","Cron","Next Run","Status",""]:["Name","Cron","Next Run","Status",""];return g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o&&g.jsx(_q,{onSave:b,onCancel:()=>c(!1),squads:i}),g.jsxs("div",{className:"flex items-center justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Schedules"}),g.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[r.filter(R=>R.enabled).length," active · ",r.filter(R=>!R.enabled).length," paused"]})]}),g.jsxs(za,{onClick:()=>c(!0),className:"px-3 py-1.5",children:[g.jsx(Uw,{className:"w-3.5 h-3.5"}),"Add Schedule"]})]}),g.jsx("div",{className:"flex gap-1 mb-4",children:[["squad","Squad Schedules"],["io","IO Schedules"]].map(([R,I])=>g.jsx("button",{type:"button",onClick:()=>e(R),className:`px-4 py-2 text-[11px] font-mono rounded-xl transition-colors cursor-pointer ${t===R?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===R?{background:"rgba(228,58,156,0.12)"}:void 0,children:I},R))}),g.jsx("div",{className:"overflow-x-auto rounded-2xl border border-white/[0.07] glass-card",children:w.length===0?g.jsx("div",{className:"px-4 py-12 text-center text-zinc-600 font-mono text-sm",children:"No schedules for this category"}):g.jsxs("table",{className:"w-full text-[11px] font-mono min-w-[640px]",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:N.map(R=>g.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:R},R))})}),g.jsx("tbody",{children:w.map(R=>{var I,K;return g.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${R.enabled?"":"opacity-50"}`,children:[t==="squad"?g.jsx("td",{className:"px-4 py-3",children:g.jsx(f6,{name:((I=i.find(B=>B.id===R.targetId))==null?void 0:I.name)??"Unknown",color:(K=i.find(B=>B.id===R.targetId))==null?void 0:K.color})}):null,g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:R.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-600 text-[10px]",children:R.cron}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx(Dw,{className:"w-3 h-3"}),R.enabled&&R.nextRun?Hs(R.nextRun,p):"—"]})}),g.jsx("td",{className:"px-4 py-3",children:g.jsx(Pt,{variant:R.enabled?"success":"muted",children:R.enabled?"active":"paused"})}),g.jsx("td",{className:"px-4 py-3",children:g.jsxs("div",{className:`flex items-center gap-1 ${A===R.id?"opacity-50 pointer-events-none":""}`,children:[g.jsxs(_i,{onClick:()=>E(R.id),children:[g.jsx($4,{className:"w-3 h-3"}),"Run now"]}),g.jsx(h6,{onClick:()=>C(R.id,R.enabled),children:R.enabled?g.jsxs(g.Fragment,{children:[g.jsx(j4,{className:"w-3 h-3"}),"Pause"]}):g.jsxs(g.Fragment,{children:[g.jsx(Mf,{className:"w-3 h-3"}),"Resume"]})}),g.jsxs(_i,{onClick:()=>d(R),children:[g.jsx(P4,{className:"w-3 h-3"}),"Edit"]}),g.jsxs(Wf,{onClick:()=>T(R.id),children:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]})})]},R.id)})})]})})]})}const Eq=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"}],Bo="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",zE=`${Bo} w-[72px]`,Oq=`${Bo} w-[100px]`,BE=`${Bo} w-[200px]`,UE=`${Bo} w-[320px]`,Aq=`${Bo} 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 Tq(){const[t,e]=j.useState(null),[r,n]=j.useState("general");j.useEffect(()=>{Ke.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 Ke.patch("/config",c),tt.success("Settings saved")}catch{tt.error("Failed to save settings")}}return t?g.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:g.jsxs("div",{className:"max-w-3xl",children:[g.jsx("h2",{className:"mb-6 text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Settings"}),g.jsx("div",{className:"mb-6 flex gap-6 border-b border-white/[0.07]",children:Eq.map(o=>g.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))}),g.jsxs("div",{className:"glass-card rounded-2xl border border-white/[0.07] p-5",children:[r==="general"&&g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Log Level",children:g.jsx("select",{value:t.logLevel,onChange:o=>i({logLevel:o.target.value}),className:Aq,children:["trace","debug","info","warn","error","fatal"].map(o=>g.jsx("option",{value:o,children:o},o))})}),g.jsx(_n,{label:"Default Model",children:g.jsx("input",{type:"text",value:t.defaultModel,onChange:o=>i({defaultModel:o.target.value}),className:BE})}),g.jsx(_n,{label:"Timezone",children:g.jsx("select",{value:t.timezone,onChange:o=>i({timezone:o.target.value}),className:`${Bo} w-[200px] 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`,children:nz.map(o=>g.jsx("option",{value:o.value,children:o.label},o.value))})}),g.jsx(_n,{label:"Max Instances",children:g.jsx("input",{type:"number",value:t.maxInstancesPerSquad,onChange:o=>i({maxInstancesPerSquad:Number(o.target.value)}),className:zE,min:1,max:10})}),g.jsx(_n,{label:"API Port",children:g.jsx("input",{type:"number",value:t.apiPort,onChange:o=>i({apiPort:Number(o.target.value)}),className:zE})}),g.jsx(_n,{label:"Pricing Refresh (hrs)",children:g.jsx("input",{type:"number",value:t.pricing.refreshIntervalHours,onChange:o=>i({pricing:{refreshIntervalHours:Number(o.target.value)}}),className:Oq,min:1})}),g.jsx(_n,{label:"Data Dir",children:g.jsx("input",{type:"text",value:t.dataDir,readOnly:!0,className:`${UE} cursor-default text-zinc-500`})})]}),r==="telegram"&&g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Bot Token",children:g.jsx(Lg,{value:t.telegram.botToken??"",onChange:o=>i({telegram:{...t.telegram,botToken:o||null}}),size:"lg"})}),g.jsx(_n,{label:"Allowed Chat IDs",children:g.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:BE})})]}),r==="auth"&&g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Project URL",children:g.jsx("input",{type:"text",value:t.supabase.projectUrl??"",onChange:o=>i({supabase:{...t.supabase,projectUrl:o.target.value||null}}),className:UE})}),g.jsx(_n,{label:"Anon Key",children:g.jsx(Lg,{value:t.supabase.anonKey??"",onChange:o=>i({supabase:{...t.supabase,anonKey:o||null}}),size:"lg"})}),g.jsx(_n,{label:"JWT Secret",children:g.jsx(Lg,{value:t.supabase.jwtSecret??"",onChange:o=>i({supabase:{...t.supabase,jwtSecret:o||null}}),size:"lg"})})]}),g.jsx("div",{className:"flex justify-end pt-6",children:g.jsx(za,{onClick:a,className:"px-4 py-2.5",children:"Save Settings"})})]})]})}):g.jsx("div",{className:"flex h-full items-center justify-center text-zinc-600",children:"Loading..."})}function _n({label:t,children:e}){return g.jsxs("div",{className:"flex items-center justify-between gap-6 border-b border-white/[0.07] py-3",children:[g.jsx("label",{className:"text-[11px] font-mono text-zinc-400 shrink-0",children:t}),g.jsx("div",{className:"flex justify-end",children:e})]})}function Lg({value:t,onChange:e,size:r="lg"}){const[n,i]=j.useState(!1),a=r==="lg"?"w-[320px]":"w-[200px]";return g.jsxs("div",{className:"relative",children:[g.jsx("input",{type:n?"text":"password",value:t,onChange:o=>e(o.target.value),className:`${Bo} ${a} pr-9`}),g.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?g.jsx(s4,{size:14}):g.jsx(Ub,{size:14})})]})}const Cq=[{id:"installed",label:"Installed"},{id:"awesome-copilot",label:"Awesome Copilot"},{id:"skillssh",label:"skills.sh"}];function qE(t){return t==="awesome-copilot"?"Awesome Copilot":"skills.sh"}function FE(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 jq(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(`
439
- `)){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 HE=["name","description","version","author","license","argument_hint","argument-hint","use_when","use-when","enhancements","metadata","tags"];function Nq({content:t}){const{frontMatter:e,body:r}=jq(t),n=HE.filter(o=>e[o]!==void 0),i=Object.keys(e).filter(o=>!HE.includes(o)),a=[...n,...i];return g.jsxs("div",{children:[a.length>0&&g.jsxs("div",{className:"border-b border-white/[0.05] pb-4 mb-4",children:[g.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Front Matter"}),g.jsx("div",{className:"space-y-2",children:a.map(o=>{const c=e[o];return c==null||Array.isArray(c)&&c.length===0?null:g.jsxs("div",{className:"flex gap-3 items-start",children:[g.jsx("span",{className:"text-[10px] font-mono text-zinc-600 w-28 flex-shrink-0 pt-0.5",children:o}),g.jsx("div",{className:"flex-1 min-w-0",children:Array.isArray(c)?g.jsx("div",{className:"flex flex-wrap gap-1",children:c.map((u,d)=>g.jsx(Pt,{variant:"muted",children:u},d))}):typeof c=="object"?g.jsx("div",{className:"space-y-0.5",children:Object.entries(c).map(([u,d])=>g.jsxs("p",{className:"text-[11px] font-mono text-zinc-400",children:[g.jsxs("span",{className:"text-zinc-600",children:[u,":"]})," ",d]},u))}):o==="use_when"||o==="use-when"?g.jsx("p",{className:"text-[11px] text-zinc-300 leading-relaxed",children:c}):o==="argument_hint"||o==="argument-hint"?g.jsx("code",{className:"text-[11px] font-mono text-[#E43A9C] bg-[#2d1a24] px-1.5 py-0.5 rounded",children:c}):g.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:c})})]},o)})})]}),r.trim()&&g.jsxs("div",{children:[g.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Body"}),g.jsx(Iu,{content:r})]})]})}function Pq(){const[t,e]=j.useState("installed"),[r,n]=j.useState([]),[i,a]=j.useState([]),[o,c]=j.useState(null);function u(M){return"url"in M&&M.url?M.url:M.name}const[d,p]=j.useState(null),[f,y]=j.useState(""),[v,x]=j.useState(!1),[w,b]=j.useState(!1),[S,A]=j.useState(!1),[O,C]=j.useState(""),[E,T]=j.useState(null),[N,R]=j.useState(null),I=j.useCallback(async()=>{try{const M=await Ke.get("/skills"),J=new Set(M.skills.map(oe=>oe.name.toLowerCase()));n(M.skills),a(oe=>oe.map(le=>({...le,installed:J.has(le.name.toLowerCase())})))}catch(M){tt.error(M instanceof Error?M.message:"Failed to load skills")}},[]),K=j.useCallback(async M=>{b(!0);try{const J=await Ke.get(`/skills/${encodeURIComponent(M)}`);p(J),C(J.content)}catch(J){tt.error(J instanceof Error?J.message:"Failed to load skill"),p(null)}finally{b(!1)}},[]);j.useEffect(()=>{I()},[I]),j.useEffect(()=>{if(t==="installed"){R(null);return}const M=f.trim();if(t==="skillssh"&&!M){a([]),R(null),x(!1);return}let J=!1;x(!0);const oe=window.setTimeout(async()=>{try{const le=await Ke.get(`/skills/discover?source=${t}&q=${encodeURIComponent(M)}`);if(J)return;a(le.skills),R(null)}catch(le){if(J)return;a([]),R(le instanceof Error?le.message:"Discovery failed")}finally{J||x(!1)}},250);return()=>{J=!0,window.clearTimeout(oe)}},[f,t]);const B=j.useMemo(()=>{const M=f.trim().toLowerCase();return M?r.filter(J=>[J.name,J.description,J.preview].some(oe=>oe.toLowerCase().includes(M))):r},[r,f]),U=t==="installed"?B:i,V=B.find(M=>M.name===o)??null,H=i.find(M=>u(M)===o)??null,Y=(V==null?void 0:V.name)??(H==null?void 0:H.name)??null;j.useEffect(()=>{if(A(!1),!U.length){c(null),t!=="installed"&&p(null);return}if(!o||!U.some(M=>u(M)===o)){const M=U[0];M&&c(u(M))}},[o,t,U]),j.useEffect(()=>{if(t!=="installed"||!Y){p(null);return}K(Y)},[K,Y,t]);async function G(M){if(!M.url&&!M.registrySource){tt.error("Install source is not available for this skill yet");return}T(M.name);try{await Ke.post("/skills/install",{name:M.name,source:M.source,url:M.url,registrySource:M.registrySource,skillId:M.skillId}),tt.success(`Installed ${M.title||M.name}`),await I(),a(J=>J.map(oe=>oe.name===M.name?{...oe,installed:!0}:oe))}catch(J){tt.error(J instanceof Error?J.message:"Install failed")}finally{T(null)}}async function Q(M){T(M);try{await Ke.delete(`/skills/${encodeURIComponent(M)}`),tt.success(`Removed ${M}`),await I(),a(J=>J.map(oe=>oe.name===M?{...oe,installed:!1}:oe))}catch(J){tt.error(J instanceof Error?J.message:"Failed to remove skill")}finally{T(null)}}async function W(){if(d){T(d.name);try{await Ke.put(`/skills/${encodeURIComponent(d.name)}`,{content:O}),tt.success(`Updated ${d.name}`),A(!1),await Promise.all([I(),K(d.name)])}catch(M){tt.error(M instanceof Error?M.message:"Failed to save skill")}finally{T(null)}}}const ee=!!(V!=null&&V.activatedForOrchestrator),q=E===(d==null?void 0:d.name),$=E===(H==null?void 0:H.name);return g.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[g.jsxs("div",{className:"w-64 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[g.jsxs("div",{className:"px-2.5 pt-2.5 pb-2 flex-shrink-0 border-b border-white/[0.06] space-y-2",children:[g.jsxs("div",{className:"relative",children:[g.jsx(nP,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-zinc-700"}),g.jsx("input",{type:"text",value:f,onChange:M=>y(M.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"})]}),g.jsx("div",{className:"flex flex-col gap-0.5",children:Cq.map(M=>g.jsxs("button",{type:"button",onClick:()=>e(M.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===M.id?"text-[#E43A9C]":"text-zinc-500 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===M.id?{background:"rgba(228,58,156,0.10)"}:void 0,children:[g.jsx("span",{children:M.label}),M.id==="installed"&&g.jsx("span",{className:"text-[10px] text-zinc-600",children:r.length})]},M.id))})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto py-1.5",children:[v&&t!=="installed"?g.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:[g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"})," Searching registry..."]}):null,U.map(M=>{const J=u(M),oe=o===J,le=M.description||("preview"in M?M.preview:"No description available.");return g.jsxs("button",{type:"button",onClick:()=>{A(!1),c(J)},className:`w-full text-left px-3 py-2.5 border-b border-white/[0.03] transition-colors cursor-pointer ${oe?"border-l-2 border-l-[#E43A9C] bg-[#E43A9C]/5":"hover:bg-white/[0.03]"}`,children:[g.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[g.jsx("span",{className:"truncate font-mono text-[11px] text-zinc-200",children:M.name}),"installed"in M&&M.installed?g.jsx(Pt,{variant:"success",children:"installed"}):null]}),g.jsx("p",{className:"line-clamp-2 font-mono text-[10px] leading-relaxed text-zinc-600",children:le})]},`${t}:${J}`)}),!v&&U.length===0?g.jsx("div",{className:"px-4 py-8",children:g.jsx("p",{className:"font-mono text-[11px] leading-relaxed text-zinc-500",children:N||(t==="skillssh"&&!f.trim()?"Start typing to search the skills.sh registry.":f.trim()?"No skills match your search.":"No skills available in this source.")})}):null]})]}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-5",children:t==="installed"&&V?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-4",children:[g.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:g.jsx(Fb,{className:"h-6 w-6"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:V.name}),g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[g.jsx(Pt,{variant:"success",children:"installed"}),ee?g.jsx(Pt,{variant:"warning",children:"active"}):g.jsx(Pt,{variant:"muted",children:"inactive"}),g.jsx(Pt,{variant:"muted",children:"local skill"})]}),g.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[g.jsxs("p",{children:["path: ",V.filePath]}),g.jsxs("p",{children:["orchestrator: ",ee?"enabled":"disabled"]})]})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[S?g.jsxs(za,{onClick:W,disabled:q||O===(d==null?void 0:d.content),className:"px-3 py-2",children:[q?g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"}):g.jsx(Lf,{className:"h-3.5 w-3.5"}),"Save"]}):g.jsxs(_i,{onClick:()=>A(!0),className:"px-3 py-2",children:[g.jsx(Lf,{className:"h-3.5 w-3.5"})," Edit"]}),g.jsxs(Wf,{onClick:()=>Q(V.name),className:"px-3 py-2",children:[q?g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"}):g.jsx(Ma,{className:"h-3.5 w-3.5"}),"Remove"]})]})]}),g.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:w&&!d?g.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-zinc-500",children:[g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"})," Loading skill..."]}):S?g.jsxs("div",{className:"space-y-3",children:[g.jsx("textarea",{value:O,onChange:M=>C(M.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"}),g.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-zinc-500",children:[g.jsx("span",{children:"Editing raw SKILL.md"}),g.jsx(_i,{onClick:()=>{A(!1),C((d==null?void 0:d.content)??"")},className:"px-3 py-2",children:"Cancel"})]})]}):d?g.jsx(Nq,{content:d.content}):g.jsx("p",{className:"font-mono text-[11px] text-zinc-500",children:"Select an installed skill to inspect it."})})]}):t!=="installed"&&H?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-4",children:[g.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:g.jsx(W4,{className:"h-6 w-6"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:H.title||H.name}),g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[g.jsx(Pt,{variant:H.installed?"success":"default",children:H.installed?"installed":"available"}),g.jsx(Pt,{variant:"muted",children:qE(H.source)}),FE(H.installs)?g.jsx(Pt,{variant:"info",children:FE(H.installs)}):null]}),g.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[g.jsxs("p",{children:["registry: ",qE(H.source)]}),H.registrySource?g.jsxs("p",{children:["source: ",H.registrySource]}):null,H.url?g.jsxs("p",{children:["url: ",H.url]}):null]})]})]}),g.jsx("div",{className:"flex items-center gap-2",children:H.installed?g.jsx(_i,{onClick:()=>{e("installed"),c(H.name)},className:"px-3 py-2",children:"Open installed"}):g.jsxs(za,{onClick:()=>G(H),disabled:$||!H.url&&!H.registrySource,className:"px-3 py-2",children:[$?g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"}):g.jsx(i4,{className:"h-3.5 w-3.5"}),"Install"]})})]}),g.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[g.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.02] p-5",children:g.jsx("p",{className:"font-mono text-[12px] leading-7 text-zinc-300",children:H.description||"No registry description is available for this skill yet."})}),g.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."})]})]}):g.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:g.jsxs("div",{children:[g.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:g.jsx(Fb,{className:"h-6 w-6"})}),g.jsx("h3",{className:"text-[28px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Select a Skill"}),g.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."})]})})})]})}function Rf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return`hsl(${(e%360+360)%360}, 70%, 65%)`}function mf(){const{name:t,instanceId:e,role:r}=iD();return t&&r?g.jsx(Bq,{squadName:t,role:r}):t&&e?g.jsx(zq,{squadName:t,instanceId:e}):t?g.jsx($q,{name:t}):g.jsx(Rq,{})}function Rq(){const[t,e]=j.useState([]),[r,n]=j.useState(null),i=vl();return j.useEffect(()=>{Promise.all([Ke.get("/squads"),Ke.get("/config")]).then(([a,o])=>{e(a.squads),n(o.config.maxInstancesPerSquad)}).catch(()=>{})},[]),g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[g.jsx("div",{className:"mb-6",children:g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Squads"}),g.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"]})]})}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[t.map(a=>{const o=a.color||"#38bdf8";return g.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 ${o}30`,background:`${o}08`,backdropFilter:"blur(20px)"},onMouseEnter:c=>{c.currentTarget.style.borderColor=`${o}70`,c.currentTarget.style.background=`${o}12`},onMouseLeave:c=>{c.currentTarget.style.borderColor=`${o}30`,c.currentTarget.style.background=`${o}08`},children:[g.jsxs("div",{className:"flex items-start justify-between mb-1",children:[g.jsx("h3",{className:"text-sm font-mono transition-colors",style:{color:o},children:a.name}),g.jsx(Pt,{variant:Ls(a.status),children:a.status})]}),g.jsxs("div",{className:"flex items-center justify-between mb-3",children:[g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono",children:a.universe}),g.jsxs("span",{className:"text-[11px] text-zinc-600 font-mono flex items-center gap-1",children:[g.jsx(t4,{className:"w-3 h-3"}),a.activeInstances,"/",r??(a.totalInstances||a.memberCount)]})]}),a.repoUrl&&g.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-zinc-700 font-mono mb-4",children:[g.jsx(QN,{className:"w-3 h-3 flex-shrink-0"}),g.jsx("span",{className:"truncate",children:a.repoUrl.replace("https://github.com/","")})]}),a.recentActivity&&a.recentActivity.length>0&&g.jsxs("div",{className:"border-t pt-3",style:{borderColor:`${o}15`},children:[g.jsx("p",{className:"text-[10px] font-mono uppercase tracking-wider mb-2",style:{color:`${o}80`},children:"Recent Work"}),g.jsx("ul",{className:"space-y-1.5",children:a.recentActivity.map(c=>{const u={className:"w-3.5 h-3.5 flex-shrink-0 mt-px"},d=Iq(c.status,u),p=c.objective?c.objective.length>60?`${c.objective.slice(0,60)}…`:c.objective:c.issueRef||"Instance";return g.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] font-mono text-zinc-600",children:[d,g.jsx("span",{className:"truncate",children:p})]},c.id)})})]})]},a.id)}),t.length===0&&g.jsxs("div",{className:"col-span-full text-center py-12 text-zinc-600",children:[g.jsx(qw,{size:48,className:"mx-auto mb-3 opacity-30"}),g.jsx("p",{className:"text-[11px] font-mono",children:"No squads hired yet. Ask IO to hire a squad for a project."})]})]})]})}function Iq(t,e){const r=t.toLowerCase();return r.includes("complete")||r.includes("success")||r.includes("done")?g.jsx(JN,{...e,style:{color:"#34d399"}}):r.includes("warning")||r.includes("review")?g.jsx(Y4,{...e,style:{color:"#fbbf24"}}):r.includes("error")||r.includes("fail")?g.jsx(ZN,{...e,style:{color:"#f87171"}}):r.includes("working")||r.includes("progress")||r.includes("running")?g.jsx(tP,{...e,style:{color:"#E43A9C"}}):g.jsx(x4,{...e,style:{color:"#60a5fa"}})}function Gs(t,e){const r="w-4 h-4",n={color:e},i=t.toLowerCase();return i.includes("lead")||i.includes("pm")||i.includes("technical")?g.jsx(zw,{className:r,style:n}):i.includes("qa")||i.includes("test")?g.jsx(q5,{className:r,style:n}):i.includes("scribe")?g.jsx(z4,{className:r,style:n}):g.jsx(qc,{className:r,style:n})}function $q({name:t}){const[e,r]=j.useState(null),[n,i]=j.useState("agents"),[a,o]=j.useState([]),[c,u]=j.useState(0),[d,p]=j.useState(null),[f,y]=j.useState([]),v=vl(),x=qa();j.useEffect(()=>{Ke.get(`/squads/${t}`).then(r).catch(()=>{})},[t]),j.useEffect(()=>{n==="history"&&Ke.get(`/squads/${t}/history`).then(S=>{o(S.items),u(S.total)}).catch(()=>{}),n==="schedules"&&e&&Ke.get(`/schedules?targetId=${e.squad.id}`).then(S=>y(S.schedules)).catch(()=>{})},[n,t,e]);const w=S=>{Ke.get(`/squads/${t}/history/${S.id}`).then(p).catch(()=>tt.error("Failed to load activity detail"))};if(!e)return g.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const b=e.squad.color||"#38bdf8";return d?g.jsx(Mq,{activity:d,squadColor:b,squadName:e.squad.name,onBack:()=>p(null)}):g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${b}06`},children:[g.jsxs("button",{type:"button",onClick:()=>v("/squads"),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[g.jsx(bl,{className:"w-3.5 h-3.5"})," All Squads"]}),g.jsxs("div",{className:"flex items-start justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-3xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:b},children:e.squad.name}),g.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono",children:[e.squad.universe," · ",e.squad.autonomyTier||"standard"," autonomy"]}),e.squad.repoUrl&&g.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:[g.jsx(QN,{className:"w-3 h-3"}),e.squad.repoUrl.replace("https://github.com/","")]})]}),g.jsx(Pt,{variant:Ls(e.squad.status),children:e.squad.status})]}),g.jsx("div",{className:"flex gap-0 mb-5 border-b border-white/[0.06]",children:["agents","instances","schedules","history"].map(S=>g.jsx("button",{type:"button",onClick:()=>i(S),className:`px-4 py-2 text-[11px] font-mono capitalize transition-colors border-b-2 -mb-px ${n===S?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:S},S))}),n==="agents"&&g.jsx("div",{className:"space-y-2",children:e.members.map(S=>g.jsxs("button",{type:"button",onClick:()=>v(`/squads/${t}/agents/${S.roleName||S.role}`),className:"w-full glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3 hover:bg-white/[0.03] transition-colors cursor-pointer text-left",children:[g.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${b}30`,background:`${b}12`},children:Gs(S.roleName||S.role,b)}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm font-mono text-zinc-200",children:S.displayName}),g.jsx(Pt,{variant:Ls(S.status),children:S.status})]}),g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:S.role}),S.currentTask&&g.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:S.currentTask})]})]},S.id))}),n==="instances"&&g.jsx("div",{className:"space-y-2",children:e.instances.length===0?g.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No active instances"}):e.instances.map(S=>g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-4",children:[g.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 text-[11px] font-mono",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"ID"}),g.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:S.id.slice(0,8)})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"Branch"}),g.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:S.branch||"—"})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"Status"}),g.jsx("p",{className:"text-zinc-300 mt-0.5",children:g.jsx(Pt,{variant:Ls(S.status),children:S.status})})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"Tasks"}),g.jsxs("p",{className:"text-zinc-300 mt-0.5",children:[S.tasksComplete,"/",S.taskCount]})]})]}),g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[g.jsx("button",{type:"button",onClick:()=>v(`/squads/${t}/instances/${S.id}`),title:"View instance agents",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:b},children:g.jsx(Mf,{className:"w-4 h-4"})}),g.jsx("button",{type:"button",onClick:()=>tt.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:g.jsx(rp,{className:"w-4 h-4"})})]})]},S.id))}),n==="schedules"&&g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:f.length===0?g.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No schedules for this squad"}):g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:["Schedule","Next Run","Status"].map(S=>g.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:S},S))})}),g.jsx("tbody",{children:f.map(S=>g.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${S.enabled?"":"opacity-50"}`,children:[g.jsxs("td",{className:"px-4 py-3",children:[g.jsx("div",{className:"text-zinc-300",children:S.name||S.prompt}),g.jsx("div",{className:"text-zinc-700 text-[10px] mt-0.5",children:S.cron})]}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx(Dw,{className:"w-3 h-3"}),S.enabled&&S.nextRun?Hs(S.nextRun,x):"—"]})}),g.jsx("td",{className:"px-4 py-3",children:g.jsx(Pt,{variant:S.enabled?"success":"muted",children:S.enabled?"active":"paused"})})]},S.id))})]})}),n==="history"&&g.jsxs("div",{className:"space-y-2",children:[a.length===0?g.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No history yet"}):a.map(S=>g.jsxs("button",{type:"button",onClick:()=>w(S),className:"w-full glass-card border border-white/[0.07] rounded-2xl px-4 py-3.5 flex items-center gap-3 hover:bg-white/[0.03] transition-colors cursor-pointer text-left",children:[g.jsx("div",{className:"flex-shrink-0",children:S.status==="completed"?g.jsx(JN,{className:"w-4 h-4",style:{color:"#34d399"}}):g.jsx(ZN,{className:"w-4 h-4",style:{color:"#f87171"}})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("p",{className:"text-[12px] text-zinc-300 font-mono truncate",children:S.title}),g.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[g.jsx("span",{className:"text-[10px] text-zinc-700 font-mono",children:Hs(S.completedAt||S.createdAt,x)}),g.jsxs("span",{className:"text-[10px] text-zinc-700 font-mono flex items-center gap-1",children:[g.jsx(Mf,{className:"w-2.5 h-2.5"}),S.duration||"—"]}),g.jsxs("span",{className:"text-[10px] text-zinc-700 font-mono flex items-center gap-1",children:[g.jsx(qc,{className:"w-2.5 h-2.5"}),S.agentCount," agent",S.agentCount!==1?"s":""]})]})]}),g.jsx(Pt,{variant:S.status==="completed"?"success":"error",children:S.status})]},S.id)),a.length<c&&g.jsx("button",{type:"button",onClick:()=>{Ke.get(`/squads/${t}/history?offset=${a.length}`).then(S=>{o(A=>[...A,...S.items])}).catch(()=>{})},className:"w-full text-center py-3 text-[11px] font-mono text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:"Load more"})]})]})}function Mq({activity:t,squadColor:e,squadName:r,onBack:n}){const i=qa(),[a,o]=j.useState(new Set),c=j.useMemo(()=>{const v={};for(const x of t.agentEntries)v[x.agentId]=Rf(x.agentName);return v},[t]),u={thought:{label:"Thinking",icon:Bw},tool_call:{label:"Tool Call",icon:aP},tool_result:{label:"Tool Result",icon:eP},message:{label:"Message",icon:qc},decision:{label:"Decision",icon:zw}},d={label:"Message",icon:qc},p=v=>u[v]??d,f=v=>{o(x=>{const w=new Set(x);return w.has(v)?w.delete(v):w.add(v),w})},y=j.useMemo(()=>{const v=t.agentEntries.flatMap(x=>x.events.map(w=>({ev:w,entry:x})));return v.sort((x,w)=>x.ev.timestamp.localeCompare(w.ev.timestamp)),a.size>0?v.filter(({entry:x})=>a.has(x.agentId)):v},[t,a]);return g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${e}06`},children:[g.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors cursor-pointer",children:[g.jsx(bl,{className:"w-3.5 h-3.5"})," Back to ",r]}),g.jsxs("div",{className:"flex items-start justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:e},children:t.title}),g.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[g.jsx("span",{className:"text-[11px] text-zinc-600 font-mono",children:Hs(t.completedAt||t.createdAt,i)}),g.jsxs("span",{className:"text-[11px] text-zinc-700 font-mono flex items-center gap-1",children:[g.jsx(Dw,{className:"w-3 h-3"}),t.duration||"—"]})]})]}),g.jsx(Pt,{variant:t.status==="completed"?"success":"error",children:t.status})]}),g.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[t.agentEntries.map(v=>{const x=c[v.agentId],w=a.has(v.agentId),S=!(a.size>0)||w;return g.jsxs("button",{type:"button",onClick:()=>f(v.agentId),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-xl border transition-all cursor-pointer",style:{borderColor:S?`${x}30`:"rgba(255,255,255,0.05)",background:S?`${x}10`:"transparent",opacity:S?1:.4},children:[Gs(v.roleType||v.role,x),g.jsx("span",{className:"text-[11px] font-mono",style:{color:S?x:"#71717a"},children:v.agentName}),g.jsxs("span",{className:"text-[10px] font-mono text-zinc-500",children:["— ",v.role]})]},v.agentId)}),a.size>0&&g.jsx("button",{type:"button",onClick:()=>o(new Set),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-xl border border-white/[0.1] text-[11px] font-mono text-zinc-400 hover:text-zinc-200 transition-colors cursor-pointer",children:"Show all"})]}),g.jsxs("div",{className:"relative pl-10",children:[g.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),g.jsx("div",{className:"space-y-3",children:y.map(({ev:v,entry:x})=>{const w=c[x.agentId],{label:b,icon:S}=p(v.kind),A=v.kind==="tool_call"||v.kind==="tool_result";return g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${w}15`,border:`1px solid ${w}35`},children:g.jsx(S,{className:"w-3.5 h-3.5",style:{color:w}})}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsxs("div",{className:"flex items-center gap-1",children:[Gs(x.roleType||x.role,w),g.jsx("span",{className:"text-[10px] font-mono",style:{color:w},children:x.agentName})]}),g.jsx("span",{className:"text-zinc-700 text-[10px]",children:"·"}),g.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-zinc-500",children:b}),v.label&&g.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:v.label}),v.status==="error"&&g.jsx(Pt,{variant:"error",children:"failed"}),v.status==="ok"&&v.kind==="tool_result"&&g.jsx(Pt,{variant:"success",children:"ok"})]}),g.jsx("span",{className:"text-[10px] font-mono text-zinc-700 flex-shrink-0 ml-2",children:np(v.timestamp,i)})]}),A?g.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2 mt-1 bg-black/20",children:v.content}):g.jsx(Iu,{content:v.content,className:"text-[12px] [&_pre]:text-[10px]"})]})]},v.id)})})]})]})}const Lq={thought:{label:"Thinking",icon:Bw,color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool_call:{label:"Tool Call",icon:aP,color:"#38bdf8",bg:"rgba(56,189,248,0.1)"},tool_result:{label:"Tool Result",icon:eP,color:"#34d399",bg:"rgba(52,211,153,0.1)"},message:{label:"Message",icon:qc,color:"#E43A9C",bg:"rgba(228,58,156,0.15)"},decision:{label:"Decision",icon:zw,color:"#fbbf24",bg:"rgba(251,191,36,0.1)"},meeting:{label:"Meeting",icon:qw,color:"#818cf8",bg:"rgba(129,140,248,0.1)"}};function Dq(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 zq({squadName:t,instanceId:e}){const[r,n]=j.useState(null),[i,a]=j.useState([]),[o,c]=j.useState(null),[u,d]=j.useState("running"),[p,f]=j.useState(0),y=vl(),v=qa(),x=j.useRef(null),w=j.useRef(null),b=j.useRef(!0),S=j.useCallback(()=>{const I=x.current;if(!I)return;const K=100;b.current=I.scrollHeight-I.scrollTop-I.clientHeight<K,b.current&&f(0)},[]);if(j.useEffect(()=>{Ke.get(`/squads/${t}/instances/${e}`).then(I=>{n(I),d(I.instance.status)}).catch(()=>{tt.error("Failed to load instance")})},[t,e]),cP({onEvent:I=>{if(!I.event)return;const K=I.event;if((K.type==="instance:completed"||K.type==="instance:failed")&&K.instanceId===e){d(K.type==="instance:completed"?"completed":"failed");return}if(K.type.startsWith("agent:")&&K.instanceId===e){const B=K.data,U=(B==null?void 0:B.tool)||null,V=typeof(B==null?void 0:B.success)=="boolean"?B.success:null;let H="";if(U&&(B!=null&&B.arguments)){const G=B.arguments;if(typeof G=="string")H=G;else if(typeof G=="object"&&G!==null){const Q=G;Q.command?H=String(Q.command):H=JSON.stringify(G,null,2)}}else B!=null&&B.result?H=String(B.result):B!=null&&B.error?H=String(B.error):H=(B==null?void 0:B.content)||"";try{const G=JSON.parse(H);typeof G=="object"&&G!==null&&(H=G.message??G.content??G.response??G.decision??JSON.stringify(G,null,2))}catch{}const Y={id:K.id,agent:K.agentRole||(B==null?void 0:B.agentRole)||"unknown",type:K.type.replace("agent:",""),content:H,toolName:U,success:V,model:K.model||(B==null?void 0:B.model)||null,tokensUsed:null,timestamp:K.timestamp};a(G=>[...G,Y]),b.current?setTimeout(()=>{var G;return(G=w.current)==null?void 0:G.scrollIntoView({behavior:"smooth"})},50):f(G=>G+1)}}}),!r)return g.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const A=r.squadColor||"#38bdf8",O=[...r.activity,...i],C=Array.from(new Map(O.map(I=>[I.id,I])).values());C.sort((I,K)=>I.timestamp.localeCompare(K.timestamp));const E=o?C.filter(I=>I.agent===o):C,T=[...new Set(C.map(I=>I.agent))],N={};for(const I of T)N[I]=Rf(I);const R=u==="running"||u==="working"||u==="meeting"||u==="planning";return g.jsxs("div",{ref:x,onScroll:S,className:"flex-1 overflow-y-auto p-6",style:{background:`${A}06`},children:[g.jsxs("button",{type:"button",onClick:()=>y(`/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:[g.jsx(bl,{className:"w-3.5 h-3.5"})," Back to ",t]}),g.jsxs("div",{className:"flex items-start justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:A},children:"Instance"}),g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:r.instance.id.slice(0,8)}),r.instance.branch&&g.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:r.instance.branch})]}),g.jsx(Pt,{variant:Ls(u),children:u})]}),g.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[r.members.map(I=>{const K=I.roleName||I.role,B=N[K]||Rf(K),U=o===K;return g.jsxs("button",{type:"button",onClick:()=>c(U?null:K),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-xl border transition-all cursor-pointer",style:{borderColor:U?B:`${B}30`,background:U?`${B}25`:`${B}10`,opacity:o&&!U?.5:1},children:[Gs(K,B),g.jsx("span",{className:"text-[11px] font-mono",style:{color:B},children:I.displayName}),g.jsx(Pt,{variant:Ls(I.status),children:I.status}),I.status==="working"&&g.jsx("button",{type:"button",onClick:V=>{V.stopPropagation(),tt.success(`${I.displayName} stopped`)},title:"Stop agent",className:"ml-1 p-1 rounded-lg hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:g.jsx(rp,{className:"w-3 h-3"})})]},I.id)}),o&&g.jsx("button",{type:"button",onClick:()=>c(null),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-xl border border-white/[0.1] text-[11px] font-mono text-zinc-400 hover:text-zinc-200 transition-colors cursor-pointer",children:"Show all"})]}),g.jsxs("div",{className:"relative pl-10",children:[g.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),g.jsxs("div",{className:"space-y-3",children:[E.length===0&&g.jsx("div",{className:"text-center py-12 text-zinc-700 font-mono text-sm",children:"No activity recorded yet"}),E.map(I=>{const K=Dq(I.type),B=Lq[K],U=B.icon,V=N[I.agent]||Rf(I.agent),H=K==="tool_call"||K==="tool_result",Y=I.type.toLowerCase().includes("error")||I.type.toLowerCase().includes("fail");return g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${V}15`,border:`1px solid ${V}35`},children:g.jsx(U,{className:"w-3.5 h-3.5",style:{color:V}})}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsxs("div",{className:"flex items-center gap-1",children:[Gs(I.agent,V),g.jsx("span",{className:"text-[10px] font-mono",style:{color:V},children:I.agent})]}),g.jsx("span",{className:"text-zinc-700 text-[10px]",children:"·"}),g.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-zinc-500",children:B.label}),I.toolName&&g.jsxs("span",{className:"text-[10px] font-mono text-sky-400 border border-sky-400/20 rounded px-1.5 py-px bg-sky-400/[0.06]",children:["[",I.toolName,"]"]}),I.model&&g.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:I.model}),I.success===!0&&g.jsx("span",{className:"text-[10px] font-mono text-emerald-400 border border-emerald-400/20 rounded px-1.5 py-px bg-emerald-400/[0.08]",children:"success"}),I.success===!1&&g.jsx("span",{className:"text-[10px] font-mono text-red-400 border border-red-400/20 rounded px-1.5 py-px bg-red-400/[0.08]",children:"failed"}),Y&&I.success===null&&g.jsx(Pt,{variant:"error",children:"failed"})]}),g.jsx("span",{className:"text-[10px] font-mono text-zinc-700 flex-shrink-0 ml-2",children:np(I.timestamp,v)})]}),H?g.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2 mt-1 bg-black/20",children:I.content}):g.jsx(Iu,{content:I.content,className:"text-[12px] [&_pre]:text-[10px]"})]})]},I.id)}),R&&g.jsxs("div",{className:"relative",children:[g.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:g.jsx(tP,{className:"w-3.5 h-3.5 animate-spin",style:{color:A}})}),g.jsx("div",{className:"glass-card border rounded-2xl px-4 py-3",style:{borderColor:`${A}20`},children:g.jsx("span",{className:"text-[11px] font-mono",style:{color:A},children:"Working…"})})]})]})]}),g.jsx("div",{ref:w}),p>0&&g.jsxs("button",{type:"button",onClick:()=>{var I;(I=w.current)==null||I.scrollIntoView({behavior:"smooth"}),f(0)},className:"fixed bottom-6 left-1/2 -translate-x-1/2 flex items-center gap-1.5 px-4 py-2 rounded-full border border-white/[0.1] bg-zinc-900/90 backdrop-blur-sm text-[11px] font-mono text-zinc-300 hover:text-white shadow-lg transition-all cursor-pointer z-50",children:[g.jsx(M5,{className:"w-3.5 h-3.5"}),p," new event",p!==1?"s":""]})]})}function Bq({squadName:t,role:e}){const r=vl(),[n,i]=j.useState(null),[a,o]=j.useState(""),[c,u]=j.useState(!1),[d,p]=j.useState(""),[f,y]=j.useState(!1),[v,x]=j.useState("#38bdf8");j.useEffect(()=>{Ke.get(`/squads/${t}`).then(b=>{x(b.squad.color||"#38bdf8");const S=b.members.find(A=>A.roleName===e||A.role===e);S&&i(S)}).catch(()=>{}),Ke.get(`/squads/${t}/members/${e}/skill`).then(b=>{o(b.content)}).catch(()=>{})},[t,e]);const w=async()=>{y(!0);try{await Ke.put(`/squads/${t}/members/${e}/skill`,{content:d}),o(d),u(!1),tt.success("Skill file saved")}catch{tt.error("Failed to save skill file")}finally{y(!1)}};return n?g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${v}06`},children:[g.jsxs("button",{type:"button",onClick:()=>r(`/squads/${t}`),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors cursor-pointer",children:[g.jsx(bl,{className:"w-3.5 h-3.5"})," Back to ",t]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5 mb-5",children:[g.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[g.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center",style:{border:`1px solid ${v}30`,background:`${v}12`},children:Gs(n.roleName,v)}),g.jsxs("div",{children:[g.jsx("h2",{className:"text-xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:v},children:n.displayName}),g.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[g.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:n.roleName}),n.veto&&g.jsx("span",{className:"text-[10px] font-mono text-amber-400 border border-amber-400/20 rounded px-1.5 py-px bg-amber-400/[0.06]",children:"veto"})]})]})]}),n.persona&&g.jsx("p",{className:"text-[12px] text-zinc-400 font-mono leading-relaxed mt-2",children:n.persona}),n.tools.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:n.tools.map(b=>g.jsx("span",{className:"text-[10px] font-mono text-zinc-500 border border-white/[0.08] rounded px-1.5 py-px bg-white/[0.03]",children:b},b))})]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsx("h3",{className:"text-sm font-mono text-zinc-300",children:"Skill File"}),c?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{type:"button",onClick:()=>u(!1),className:"px-3 py-1.5 rounded-lg text-[11px] font-mono text-zinc-500 hover:text-zinc-300 border border-white/[0.1] transition-colors cursor-pointer",children:"Cancel"}),g.jsxs("button",{type:"button",onClick:w,disabled:f,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-emerald-400 border border-emerald-400/30 hover:bg-emerald-400/10 transition-colors cursor-pointer disabled:opacity-50",children:[g.jsx(tp,{className:"w-3 h-3"})," ",f?"Saving...":"Save"]})]}):g.jsxs("button",{type:"button",onClick:()=>{p(a),u(!0)},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-zinc-400 hover:text-zinc-200 border border-white/[0.1] hover:border-white/[0.2] transition-colors cursor-pointer",children:[g.jsx(Lf,{className:"w-3 h-3"})," Edit"]})]}),c?g.jsx("textarea",{value:d,onChange:b=>p(b.target.value),className:"w-full h-[500px] bg-black/30 border border-white/[0.08] rounded-xl p-4 text-[12px] font-mono text-zinc-300 resize-y focus:outline-none focus:border-white/[0.2] leading-relaxed",spellCheck:!1}):a?g.jsx(Iu,{content:a,className:"text-[12px] [&_pre]:text-[11px]"}):g.jsx("p",{className:"text-zinc-700 text-[12px] font-mono py-8 text-center",children:"No skill file configured for this agent"})]})]}):g.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."})}var Dg,WE;function Qr(){if(WE)return Dg;WE=1;var t=Array.isArray;return Dg=t,Dg}var zg,GE;function _R(){if(GE)return zg;GE=1;var t=typeof Qd=="object"&&Qd&&Qd.Object===Object&&Qd;return zg=t,zg}var Bg,KE;function Oi(){if(KE)return Bg;KE=1;var t=_R(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Bg=r,Bg}var Ug,VE;function Mu(){if(VE)return Ug;VE=1;var t=Oi(),e=t.Symbol;return Ug=e,Ug}var qg,XE;function Uq(){if(XE)return qg;XE=1;var t=Mu(),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 qg=a,qg}var Fg,YE;function qq(){if(YE)return Fg;YE=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Fg=r,Fg}var Hg,JE;function ra(){if(JE)return Hg;JE=1;var t=Mu(),e=Uq(),r=qq(),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 Hg=o,Hg}var Wg,ZE;function na(){if(ZE)return Wg;ZE=1;function t(e){return e!=null&&typeof e=="object"}return Wg=t,Wg}var Gg,QE;function _l(){if(QE)return Gg;QE=1;var t=ra(),e=na(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return Gg=n,Gg}var Kg,eO;function n1(){if(eO)return Kg;eO=1;var t=Qr(),e=_l(),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 Kg=i,Kg}var Vg,tO;function Ha(){if(tO)return Vg;tO=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Vg=t,Vg}var Xg,rO;function i1(){if(rO)return Xg;rO=1;var t=ra(),e=Ha(),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 Xg=o,Xg}var Yg,nO;function Fq(){if(nO)return Yg;nO=1;var t=Oi(),e=t["__core-js_shared__"];return Yg=e,Yg}var Jg,iO;function Hq(){if(iO)return Jg;iO=1;var t=Fq(),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 Jg=r,Jg}var Zg,aO;function SR(){if(aO)return Zg;aO=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 Zg=r,Zg}var Qg,oO;function Wq(){if(oO)return Qg;oO=1;var t=i1(),e=Hq(),r=Ha(),n=SR(),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 f(y){if(!r(y)||e(y))return!1;var v=t(y)?p:a;return v.test(n(y))}return Qg=f,Qg}var ey,sO;function Gq(){if(sO)return ey;sO=1;function t(e,r){return e==null?void 0:e[r]}return ey=t,ey}var ty,lO;function Uo(){if(lO)return ty;lO=1;var t=Wq(),e=Gq();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return ty=r,ty}var ry,cO;function dp(){if(cO)return ry;cO=1;var t=Uo(),e=t(Object,"create");return ry=e,ry}var ny,uO;function Kq(){if(uO)return ny;uO=1;var t=dp();function e(){this.__data__=t?t(null):{},this.size=0}return ny=e,ny}var iy,dO;function Vq(){if(dO)return iy;dO=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return iy=t,iy}var ay,fO;function Xq(){if(fO)return ay;fO=1;var t=dp(),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 ay=i,ay}var oy,hO;function Yq(){if(hO)return oy;hO=1;var t=dp(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return oy=n,oy}var sy,pO;function Jq(){if(pO)return sy;pO=1;var t=dp(),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 sy=r,sy}var ly,mO;function Zq(){if(mO)return ly;mO=1;var t=Kq(),e=Vq(),r=Xq(),n=Yq(),i=Jq();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,gO;function Qq(){if(gO)return cy;gO=1;function t(){this.__data__=[],this.size=0}return cy=t,cy}var uy,yO;function a1(){if(yO)return uy;yO=1;function t(e,r){return e===r||e!==e&&r!==r}return uy=t,uy}var dy,vO;function fp(){if(vO)return dy;vO=1;var t=a1();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return dy=e,dy}var fy,bO;function e9(){if(bO)return fy;bO=1;var t=fp(),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 fy=n,fy}var hy,xO;function t9(){if(xO)return hy;xO=1;var t=fp();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return hy=e,hy}var py,wO;function r9(){if(wO)return py;wO=1;var t=fp();function e(r){return t(this.__data__,r)>-1}return py=e,py}var my,_O;function n9(){if(_O)return my;_O=1;var t=fp();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 my=e,my}var gy,SO;function hp(){if(SO)return gy;SO=1;var t=Qq(),e=e9(),r=t9(),n=r9(),i=n9();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,gy=a,gy}var yy,kO;function o1(){if(kO)return yy;kO=1;var t=Uo(),e=Oi(),r=t(e,"Map");return yy=r,yy}var vy,EO;function i9(){if(EO)return vy;EO=1;var t=Zq(),e=hp(),r=o1();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return vy=n,vy}var by,OO;function a9(){if(OO)return by;OO=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return by=t,by}var xy,AO;function pp(){if(AO)return xy;AO=1;var t=a9();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return xy=e,xy}var wy,TO;function o9(){if(TO)return wy;TO=1;var t=pp();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return wy=e,wy}var _y,CO;function s9(){if(CO)return _y;CO=1;var t=pp();function e(r){return t(this,r).get(r)}return _y=e,_y}var Sy,jO;function l9(){if(jO)return Sy;jO=1;var t=pp();function e(r){return t(this,r).has(r)}return Sy=e,Sy}var ky,NO;function c9(){if(NO)return ky;NO=1;var t=pp();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 ky=e,ky}var Ey,PO;function s1(){if(PO)return Ey;PO=1;var t=i9(),e=o9(),r=s9(),n=l9(),i=c9();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 Oy,RO;function kR(){if(RO)return Oy;RO=1;var t=s1(),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,Oy=r,Oy}var Ay,IO;function u9(){if(IO)return Ay;IO=1;var t=kR(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return Ay=r,Ay}var Ty,$O;function d9(){if($O)return Ty;$O=1;var t=u9(),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 Ty=n,Ty}var Cy,MO;function l1(){if(MO)return Cy;MO=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 Cy=t,Cy}var jy,LO;function f9(){if(LO)return jy;LO=1;var t=Mu(),e=l1(),r=Qr(),n=_l(),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 jy=o,jy}var Ny,DO;function ER(){if(DO)return Ny;DO=1;var t=f9();function e(r){return r==null?"":t(r)}return Ny=e,Ny}var Py,zO;function OR(){if(zO)return Py;zO=1;var t=Qr(),e=n1(),r=d9(),n=ER();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return Py=i,Py}var Ry,BO;function mp(){if(BO)return Ry;BO=1;var t=_l();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ry=e,Ry}var Iy,UO;function c1(){if(UO)return Iy;UO=1;var t=OR(),e=mp();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 Iy=r,Iy}var $y,qO;function AR(){if(qO)return $y;qO=1;var t=c1();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return $y=e,$y}var h9=AR();const Tn=vt(h9);var My,FO;function p9(){if(FO)return My;FO=1;function t(e){return e==null}return My=t,My}var m9=p9();const et=vt(m9);var Ly,HO;function g9(){if(HO)return Ly;HO=1;var t=ra(),e=Qr(),r=na(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return Ly=i,Ly}var y9=g9();const Ro=vt(y9);var v9=i1();const Je=vt(v9);var b9=Ha();const Sl=vt(b9);var Dy={exports:{}},pt={};/**
438
+ `);c({id:T,role:"user",content:E,timestamp:new Date().toISOString(),attachmentName:N}),p(""),y(null),S.current&&(S.current.value=""),b.current&&(b.current.style.height="auto");try{f&&await u(f,T),o(R)}catch{}}function O(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),A())}function C(E){p(E.target.value),b.current&&(b.current.style.height="auto",b.current.style.height=`${Math.min(b.current.scrollHeight,160)}px`)}return g.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[g.jsxs("div",{ref:w,className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[r.map(E=>{var T,N;return g.jsxs("div",{className:`flex gap-3 ${E.role==="user"?"flex-row-reverse":""}`,children:[g.jsx("div",{className:`flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center text-[10px] font-mono mt-0.5 ${E.role==="user"?"border border-[#E43A9C]/30 text-[#E43A9C]":"bg-[#282828] border border-white/[0.07] text-zinc-500"}`,style:E.role==="user"?{background:"rgba(228,58,156,0.12)"}:void 0,children:E.role==="user"?((N=(T=t==null?void 0:t.user)==null?void 0:T.email)==null?void 0:N.charAt(0).toUpperCase())??"U":g.jsx(Ra,{height:12})}),g.jsxs("div",{className:`flex flex-col gap-1.5 max-w-[72%] ${E.role==="user"?"items-end":"items-start"}`,children:[E.toolCall&&g.jsxs("button",{type:"button",onClick:()=>x(v===E.id?null:E.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:[g.jsx(Mf,{className:"w-3 h-3 text-[#E43A9C] flex-shrink-0"}),g.jsx("span",{className:"text-[11px] font-mono text-zinc-400 flex-1",children:E.toolCall.name}),g.jsx(Pt,{variant:E.toolCall.status==="done"?"success":E.toolCall.status==="error"?"error":"warning",children:E.toolCall.status}),g.jsx(V5,{className:`w-3 h-3 text-zinc-600 transition-transform flex-shrink-0 ${v===E.id?"rotate-180":""}`})]}),E.toolCall&&v===E.id&&g.jsx("div",{className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl px-3 py-2",children:g.jsx("p",{className:"text-[11px] font-mono text-zinc-500",children:E.toolCall.result})}),E.attachmentName&&g.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:E.attachmentName}),E.content&&g.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${E.role==="user"?"text-white rounded-tr-sm":"bg-[#222222] border border-white/[0.07] text-zinc-200 rounded-tl-sm"}`,style:E.role==="user"?{background:"linear-gradient(135deg, #D83333 0%, #C0285E 100%)"}:void 0,children:E.role==="user"?g.jsx("p",{className:"whitespace-pre-wrap",children:E.content}):g.jsx("div",{className:"prose-io",dangerouslySetInnerHTML:{__html:it.parse(E.content)}})}),g.jsx("span",{className:"text-[11px] text-zinc-700 font-mono px-0.5",children:np(E.timestamp,e)})]})]},E.id)}),a&&g.jsxs("div",{className:"flex gap-3",children:[g.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:g.jsx(Ra,{height:12})}),g.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(E=>g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]}),i&&n&&g.jsxs("div",{className:"flex gap-3",children:[g.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:g.jsx(Ra,{height:12})}),g.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-2.5 max-w-[72%]",children:g.jsx("div",{className:"prose-io text-sm",dangerouslySetInnerHTML:{__html:it.parse(n)}})})]}),i&&!n&&g.jsxs("div",{className:"flex gap-3",children:[g.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:g.jsx(Ra,{height:12})}),g.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(E=>g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]})]}),g.jsxs("div",{className:"border-t border-white/[0.06] p-4 flex-shrink-0",children:[g.jsxs("div",{className:"bg-[#1e1e1e] border border-white/[0.08] rounded-2xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[g.jsx("input",{ref:S,type:"file",className:"hidden",onChange:E=>{var T;return y(((T=E.target.files)==null?void 0:T[0])??null)}}),f&&g.jsxs("div",{className:"px-4 pt-3 text-[11px] font-mono text-zinc-400",children:["Attached: ",f.name]}),g.jsx("textarea",{ref:b,value:d,onChange:C,onKeyDown:O,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"}}),g.jsxs("div",{className:"flex items-center justify-between px-3 pb-2.5",children:[g.jsx("button",{type:"button",onClick:()=>{var E;return(E=S.current)==null?void 0:E.click()},className:"p-1.5 rounded-lg hover:bg-white/[0.05] text-zinc-700 hover:text-zinc-400 transition-colors",children:g.jsx(rP,{className:"w-4 h-4"})}),g.jsx("div",{className:"flex items-center gap-2",children:i?g.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:[g.jsx(rp,{className:"w-3 h-3"})," Stop"]}):g.jsx("button",{type:"button",onClick:A,disabled:!d.trim()&&!f||a,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:g.jsx(iP,{className:"w-3.5 h-3.5"})})})]})]}),g.jsx("p",{className:"text-center text-[11px] text-zinc-800 font-mono mt-2",children:"IO may make mistakes. Verify important outputs."})]})]})}const LE=["#38bdf8","#a78bfa","#34d399","#f59e0b","#f87171","#E43A9C"];function bq(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);return LE[Math.abs(e)%LE.length]}function DE({name:t,color:e}){const r=t.toLowerCase(),n=e??(r==="orchestrator"||r==="io"?"#71717a":bq(t));return g.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${n}15`,color:n,borderColor:`${n}30`},children:t})}function xq(){const[t,e]=j.useState([]),[r,n]=j.useState(null),[i,a]=j.useState(new Set),[o,c]=j.useState("all"),u=qa();j.useEffect(()=>{Ke.get("/inbox").then(O=>e(O.entries)).catch(()=>{})},[]);const d=t.filter(O=>O.status==="unread").length,p=o==="unread"?t.filter(O=>O.status==="unread"):t,f=p.length>0&&p.every(O=>i.has(O.id)),y=i.size>0;function v(O){y||(n(O),O.status==="unread"&&(Ke.post(`/inbox/${O.id}/read`).catch(()=>{}),e(C=>C.map(E=>E.id===O.id?{...E,status:"read"}:E))))}function x(O,C){O.stopPropagation(),a(E=>{const T=new Set(E);return T.has(C)?T.delete(C):T.add(C),T})}function w(){a(f?new Set:new Set(p.map(O=>O.id)))}function b(){const O=Array.from(i);Ke.post("/inbox/bulk/read",{ids:O}).catch(()=>{}),e(C=>C.map(E=>i.has(E.id)?{...E,status:"read"}:E)),a(new Set)}function S(){const O=Array.from(i);Ke.post("/inbox/bulk/delete",{ids:O}).catch(()=>{}),e(C=>C.filter(E=>!i.has(E.id))),r&&i.has(r.id)&&n(null),a(new Set)}function A(O){Ke.delete(`/inbox/${O}`).catch(()=>{}),e(C=>C.filter(E=>E.id!==O)),(r==null?void 0:r.id)===O&&n(null)}return g.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[g.jsxs("div",{className:"w-72 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[g.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex-shrink-0 space-y-2",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("span",{className:"text-lg tracking-wide text-zinc-200",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Inbox"}),d>0&&g.jsxs(Pt,{variant:"default",children:[d," unread"]})]}),g.jsx("div",{className:"flex gap-1",children:["all","unread"].map(O=>g.jsx("button",{type:"button",onClick:()=>{c(O),a(new Set)},className:`flex-1 py-1 text-[11px] font-mono rounded-lg transition-colors cursor-pointer ${o===O?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300"}`,style:o===O?{background:"rgba(228,58,156,0.12)"}:void 0,children:O},O))})]}),y&&g.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:[g.jsxs("span",{className:"text-[10px] font-mono text-zinc-500 flex-1",children:[i.size," selected"]}),g.jsxs("button",{type:"button",onClick:b,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:[g.jsx(Ub,{className:"w-3 h-3"}),"Mark read"]}),g.jsxs("button",{type:"button",onClick:S,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:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]}),p.length>0&&g.jsxs("div",{className:"px-4 py-1.5 border-b border-white/[0.04] flex items-center gap-2 flex-shrink-0",children:[g.jsx("button",{type:"button",onClick:w,className:`w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${f?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/40"}`,children:f&&g.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:g.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),g.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:"Select all"})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p.map(O=>{const C=i.has(O.id),E=(r==null?void 0:r.id)===O.id&&!y;return g.jsxs("div",{onClick:()=>v(O),onKeyDown:T=>T.key==="Enter"&&v(O),className:`flex items-start gap-2.5 px-3 py-3 border-b border-white/[0.04] cursor-pointer transition-colors ${E?"border-l-2 border-l-[#E43A9C] pl-2.5":"hover:bg-white/[0.025]"} ${C?"bg-[#E43A9C]/5":""}`,style:E?{background:"rgba(228,58,156,0.05)"}:void 0,children:[g.jsx("button",{type:"button",onClick:T=>x(T,O.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 ${C?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/50"}`,children:C&&g.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:g.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[O.status==="unread"&&g.jsx("div",{className:"w-1 h-1 rounded-full bg-[#E43A9C] flex-shrink-0"}),g.jsx(DE,{name:O.squadName??(O.squadId?O.squadId.slice(0,8):"Orchestrator"),color:O.squadColor})]}),g.jsx("p",{className:`text-[11px] truncate ${O.status==="unread"?"text-zinc-200":"text-zinc-500"}`,children:O.title}),g.jsx("p",{className:"text-[10px] text-zinc-700 font-mono mt-1",children:Hs(O.createdAt,u)})]})]},O.id)}),p.length===0&&g.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[g.jsx(qb,{size:32,className:"text-zinc-800 mb-2"}),g.jsx("p",{className:"text-[11px] font-mono text-zinc-700",children:o==="unread"?"All caught up":"No items yet"})]})]})]}),g.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:r&&!y?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"px-6 py-4 border-b border-white/[0.06] flex items-start justify-between flex-shrink-0",children:[g.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[g.jsx(DE,{name:r.squadName??(r.squadId?r.squadId.slice(0,8):"Orchestrator"),color:r.squadColor}),g.jsx("h3",{className:"text-sm font-mono text-zinc-100 mt-1.5",children:r.title}),g.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:Hs(r.createdAt,u)})]}),g.jsxs("button",{type:"button",onClick:()=>A(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:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]}),g.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:g.jsx(Iu,{content:r.content})})]}):y?g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 text-center px-8",children:[g.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:g.jsx(qb,{className:"w-4 h-4 text-[#E43A9C]"})}),g.jsxs("div",{children:[g.jsxs("p",{className:"text-sm font-mono text-zinc-300",children:[i.size," message",i.size!==1?"s":""," selected"]}),g.jsx("p",{className:"text-[11px] text-zinc-600 mt-1",children:"Use the actions above to mark as read or delete"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.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-zinc-300 border border-white/[0.1] hover:bg-white/[0.05] transition-colors cursor-pointer",children:[g.jsx(Ub,{className:"w-3 h-3"}),"Mark read"]}),g.jsxs("button",{type:"button",onClick:S,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:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete selected"]})]})]}):g.jsx("div",{className:"flex-1 flex items-center justify-center text-zinc-700 font-mono text-xs",children:"Select an item to read"})})]})}function wq(){const{signIn:t}=up(),[e,r]=j.useState(""),[n,i]=j.useState(""),[a,o]=j.useState(null),[c,u]=j.useState(!1);async function d(p){p.preventDefault(),o(null),u(!0);const{error:f}=await t(e,n);f&&o(f),u(!1)}return g.jsxs("div",{className:"min-h-screen bg-[#161616] flex items-center justify-center relative overflow-hidden",children:[g.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"radial-gradient(circle, #E43A9C 1px, transparent 1px)",backgroundSize:"32px 32px"}}),g.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%)"}}),g.jsxs("div",{className:"relative z-10 w-full max-w-[360px] mx-4",children:[g.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[g.jsx(Ra,{height:52}),g.jsx("div",{className:"text-center",children:g.jsx("p",{className:"text-[11px] font-mono text-zinc-600 tracking-widest uppercase mt-1",children:"personal ai orchestrator"})})]}),g.jsxs("form",{onSubmit:d,className:"glass-card border border-white/[0.07] rounded-2xl p-6 space-y-4",children:[g.jsxs("div",{className:"space-y-1",children:[g.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Email"}),g.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"})]}),g.jsxs("div",{className:"space-y-1",children:[g.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Password"}),g.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&&g.jsx("p",{className:"text-[11px] font-mono text-red-400",children:a}),g.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?g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Authenticating…"]}):"Sign In"})]}),g.jsx("p",{className:"text-center text-[11px] text-zinc-700 font-mono mt-4",children:"Secured by Supabase Auth"})]})]})}const wR="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",zs="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 qi({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 g.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:[g.jsxs("div",{className:"w-[140px] shrink-0",children:[g.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:t}),e&&g.jsxs("span",{className:"text-[10px] font-mono text-zinc-700 ml-1.5",children:["(",e,")"]})]}),g.jsx("div",{className:i,children:n})]})}function _q({onSave:t,onCancel:e,squads:r}){var x;const[n,i]=j.useState("io"),[a,o]=j.useState(((x=r[0])==null?void 0:x.id)??""),[c,u]=j.useState(""),[d,p]=j.useState(""),[f,y]=j.useState(""),v=()=>{!d.trim()||!f.trim()||!c.trim()||t({name:c.trim(),targetType:n==="io"?"orchestrator":"squad",targetId:n==="squad"?a:void 0,cron:d.trim(),prompt:f.trim()})};return g.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:g.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:[g.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/[0.06] flex-shrink-0",children:[g.jsx("h3",{className:"text-lg tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"New Schedule"}),g.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:g.jsx(oP,{className:"w-4 h-4"})})]}),g.jsxs("div",{className:"overflow-y-auto flex-1 px-5 py-4 space-y-2",children:[g.jsx(qi,{label:"Name",children:g.jsx("input",{value:c,onChange:w=>u(w.target.value),placeholder:"Daily triage",className:`${zs} w-48`})}),g.jsx(qi,{label:"Type",children:g.jsx("div",{className:"flex gap-2",children:["io","squad"].map(w=>g.jsx("button",{type:"button",onClick:()=>i(w),className:`px-4 py-1.5 rounded-xl text-[11px] font-mono capitalize transition-colors border cursor-pointer ${n===w?"text-[#E43A9C] border-[#E43A9C]/30":"text-zinc-500 border-white/[0.08] hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:n===w?{background:"rgba(228,58,156,0.08)"}:void 0,children:w==="io"?"IO":"Squad"},w))})}),n==="squad"&&g.jsx(qi,{label:"Squad",children:g.jsx("select",{value:a,onChange:w=>o(w.target.value),className:`${zs} w-48`,children:r.map(w=>g.jsx("option",{value:w.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:w.name},w.id))})}),g.jsx(qi,{label:"Cron Expression",children:g.jsx("input",{value:d,onChange:w=>p(w.target.value),placeholder:"0 9 * * 1-5",className:`${zs} w-40`})}),g.jsx(qi,{label:"Prompt",hint:"supports Markdown",align:"start",children:g.jsx("textarea",{value:f,onChange:w=>y(w.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",rows:8,className:`${wR} resize-none leading-relaxed`})})]}),g.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:[g.jsx(_i,{onClick:e,children:"Cancel"}),g.jsxs(za,{onClick:v,className:"px-4 py-1.5",children:[g.jsx(tp,{className:"w-3 h-3"}),"Create Schedule"]})]})]})})}function Sq({sched:t,squads:e,onSave:r,onBack:n}){var x,w;const[i,a]=j.useState(t.name),[o,c]=j.useState(t.cron),[u,d]=j.useState(t.prompt),[p,f]=j.useState(t.targetId??((x=e[0])==null?void 0:x.id)??""),y=()=>{!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 — ${((w=e.find(b=>b.id===t.targetId))==null?void 0:w.name)??"Unknown"}`;return g.jsxs("div",{className:"flex-1 overflow-y-auto p-6 max-w-3xl",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[g.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:[g.jsx(bl,{className:"w-3.5 h-3.5"}),"Schedules"]}),g.jsx("span",{className:"text-zinc-700 text-[11px]",children:"/"}),g.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:"Edit"})]}),g.jsxs("div",{className:"flex items-start justify-between mb-6",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Edit Schedule"}),g.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mt-0.5",children:v})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(_i,{onClick:n,children:"Cancel"}),g.jsxs(za,{onClick:y,className:"px-4 py-1.5",children:[g.jsx(tp,{className:"w-3 h-3"}),"Save Changes"]})]})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsx(qi,{label:"Name",children:g.jsx("input",{value:i,onChange:b=>a(b.target.value),placeholder:"Schedule name",className:`${zs} w-48`})}),t.targetType==="squad"&&g.jsx(qi,{label:"Squad",children:g.jsx("select",{value:p,onChange:b=>f(b.target.value),className:`${zs} w-48`,children:e.map(b=>g.jsx("option",{value:b.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:b.name},b.id))})}),g.jsx(qi,{label:"Cron Expression",children:g.jsx("input",{value:o,onChange:b=>c(b.target.value),placeholder:"0 9 * * 1-5",className:`${zs} w-40`})}),g.jsx(qi,{label:"Prompt",hint:"supports Markdown",align:"start",children:g.jsxs("div",{className:"space-y-1.5",children:[g.jsx("textarea",{value:u,onChange:b=>d(b.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",className:`${wR} leading-relaxed resize-y`,style:{minHeight:"360px"}}),g.jsx("p",{className:"text-[10px] font-mono text-zinc-700",children:"Tip: use # headings and - lists to structure multi-step instructions."})]})})]})]})}function kq(){const[t,e]=j.useState("squad"),[r,n]=j.useState([]),[i,a]=j.useState([]),[o,c]=j.useState(!1),[u,d]=j.useState(null),p=qa();j.useEffect(()=>{f(),y()},[]);function f(){Ke.get("/schedules").then(R=>n(R.schedules)).catch(()=>{})}function y(){Ke.get("/squads").then(R=>a(R.squads)).catch(()=>{})}const v=r.filter(R=>R.targetType==="squad"),x=r.filter(R=>R.targetType==="orchestrator"),w=t==="squad"?v:x;async function b(R){try{await Ke.post("/schedules",R),et.success("Schedule created"),c(!1),f()}catch(I){et.error(I instanceof Error?I.message:"Failed to create")}}async function S(R){if(u)try{await Ke.patch(`/schedules/${u.id}`,R),et.success("Schedule saved"),d(null),f()}catch{et.error("Failed to save schedule")}}const[A,O]=j.useState(null);async function C(R,I){O(R);try{await Ke.patch(`/schedules/${R}`,{enabled:!I}),et.success(I?"Schedule paused":"Schedule resumed"),f()}catch{et.error("Failed to toggle schedule")}finally{O(null)}}async function E(R){O(R);try{await Ke.post(`/schedules/${R}/run`,{}),et.success("Schedule triggered")}catch{et.error("Failed to trigger schedule")}finally{O(null)}}async function T(R){O(R);try{await Ke.delete(`/schedules/${R}`),et.success("Schedule deleted"),f()}catch{et.error("Failed to delete")}finally{O(null)}}if(u)return g.jsx(Sq,{sched:u,squads:i,onSave:S,onBack:()=>d(null)});const N=t==="squad"?["Squad","Name","Cron","Next Run","Status",""]:["Name","Cron","Next Run","Status",""];return g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o&&g.jsx(_q,{onSave:b,onCancel:()=>c(!1),squads:i}),g.jsxs("div",{className:"flex items-center justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Schedules"}),g.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[r.filter(R=>R.enabled).length," active · ",r.filter(R=>!R.enabled).length," paused"]})]}),g.jsxs(za,{onClick:()=>c(!0),className:"px-3 py-1.5",children:[g.jsx(Uw,{className:"w-3.5 h-3.5"}),"Add Schedule"]})]}),g.jsx("div",{className:"flex gap-1 mb-4",children:[["squad","Squad Schedules"],["io","IO Schedules"]].map(([R,I])=>g.jsx("button",{type:"button",onClick:()=>e(R),className:`px-4 py-2 text-[11px] font-mono rounded-xl transition-colors cursor-pointer ${t===R?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===R?{background:"rgba(228,58,156,0.12)"}:void 0,children:I},R))}),g.jsx("div",{className:"overflow-x-auto rounded-2xl border border-white/[0.07] glass-card",children:w.length===0?g.jsx("div",{className:"px-4 py-12 text-center text-zinc-600 font-mono text-sm",children:"No schedules for this category"}):g.jsxs("table",{className:"w-full text-[11px] font-mono min-w-[640px]",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:N.map(R=>g.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:R},R))})}),g.jsx("tbody",{children:w.map(R=>{var I,K;return g.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${R.enabled?"":"opacity-50"}`,children:[t==="squad"?g.jsx("td",{className:"px-4 py-3",children:g.jsx(f6,{name:((I=i.find(B=>B.id===R.targetId))==null?void 0:I.name)??"Unknown",color:(K=i.find(B=>B.id===R.targetId))==null?void 0:K.color})}):null,g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:R.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-600 text-[10px]",children:R.cron}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx(Dw,{className:"w-3 h-3"}),R.enabled&&R.nextRun?Hs(R.nextRun,p):"—"]})}),g.jsx("td",{className:"px-4 py-3",children:g.jsx(Pt,{variant:R.enabled?"success":"muted",children:R.enabled?"active":"paused"})}),g.jsx("td",{className:"px-4 py-3",children:g.jsxs("div",{className:`flex items-center gap-1 ${A===R.id?"opacity-50 pointer-events-none":""}`,children:[g.jsxs(_i,{onClick:()=>E(R.id),children:[g.jsx($4,{className:"w-3 h-3"}),"Run now"]}),g.jsx(h6,{onClick:()=>C(R.id,R.enabled),children:R.enabled?g.jsxs(g.Fragment,{children:[g.jsx(j4,{className:"w-3 h-3"}),"Pause"]}):g.jsxs(g.Fragment,{children:[g.jsx(Mf,{className:"w-3 h-3"}),"Resume"]})}),g.jsxs(_i,{onClick:()=>d(R),children:[g.jsx(P4,{className:"w-3 h-3"}),"Edit"]}),g.jsxs(Wf,{onClick:()=>T(R.id),children:[g.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]})})]},R.id)})})]})})]})}const Eq=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"}],Bo="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",zE=`${Bo} w-[72px]`,Oq=`${Bo} w-[100px]`,BE=`${Bo} w-[200px]`,UE=`${Bo} w-[320px]`,Aq=`${Bo} 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 Tq(){const[t,e]=j.useState(null),[r,n]=j.useState("general");j.useEffect(()=>{Ke.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 Ke.patch("/config",c),et.success("Settings saved")}catch{et.error("Failed to save settings")}}return t?g.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:g.jsxs("div",{className:"max-w-3xl",children:[g.jsx("h2",{className:"mb-6 text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Settings"}),g.jsx("div",{className:"mb-6 flex gap-6 border-b border-white/[0.07]",children:Eq.map(o=>g.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))}),g.jsxs("div",{className:"glass-card rounded-2xl border border-white/[0.07] p-5",children:[r==="general"&&g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Log Level",children:g.jsx("select",{value:t.logLevel,onChange:o=>i({logLevel:o.target.value}),className:Aq,children:["trace","debug","info","warn","error","fatal"].map(o=>g.jsx("option",{value:o,children:o},o))})}),g.jsx(_n,{label:"Default Model",children:g.jsx("input",{type:"text",value:t.defaultModel,onChange:o=>i({defaultModel:o.target.value}),className:BE})}),g.jsx(_n,{label:"Timezone",children:g.jsx("select",{value:t.timezone,onChange:o=>i({timezone:o.target.value}),className:`${Bo} w-[200px] 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`,children:nz.map(o=>g.jsx("option",{value:o.value,children:o.label},o.value))})}),g.jsx(_n,{label:"Max Instances",children:g.jsx("input",{type:"number",value:t.maxInstancesPerSquad,onChange:o=>i({maxInstancesPerSquad:Number(o.target.value)}),className:zE,min:1,max:10})}),g.jsx(_n,{label:"API Port",children:g.jsx("input",{type:"number",value:t.apiPort,onChange:o=>i({apiPort:Number(o.target.value)}),className:zE})}),g.jsx(_n,{label:"Pricing Refresh (hrs)",children:g.jsx("input",{type:"number",value:t.pricing.refreshIntervalHours,onChange:o=>i({pricing:{refreshIntervalHours:Number(o.target.value)}}),className:Oq,min:1})}),g.jsx(_n,{label:"Data Dir",children:g.jsx("input",{type:"text",value:t.dataDir,readOnly:!0,className:`${UE} cursor-default text-zinc-500`})})]}),r==="telegram"&&g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Bot Token",children:g.jsx(Lg,{value:t.telegram.botToken??"",onChange:o=>i({telegram:{...t.telegram,botToken:o||null}}),size:"lg"})}),g.jsx(_n,{label:"Allowed Chat IDs",children:g.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:BE})})]}),r==="auth"&&g.jsxs(g.Fragment,{children:[g.jsx(_n,{label:"Project URL",children:g.jsx("input",{type:"text",value:t.supabase.projectUrl??"",onChange:o=>i({supabase:{...t.supabase,projectUrl:o.target.value||null}}),className:UE})}),g.jsx(_n,{label:"Anon Key",children:g.jsx(Lg,{value:t.supabase.anonKey??"",onChange:o=>i({supabase:{...t.supabase,anonKey:o||null}}),size:"lg"})}),g.jsx(_n,{label:"JWT Secret",children:g.jsx(Lg,{value:t.supabase.jwtSecret??"",onChange:o=>i({supabase:{...t.supabase,jwtSecret:o||null}}),size:"lg"})})]}),g.jsx("div",{className:"flex justify-end pt-6",children:g.jsx(za,{onClick:a,className:"px-4 py-2.5",children:"Save Settings"})})]})]})}):g.jsx("div",{className:"flex h-full items-center justify-center text-zinc-600",children:"Loading..."})}function _n({label:t,children:e}){return g.jsxs("div",{className:"flex items-center justify-between gap-6 border-b border-white/[0.07] py-3",children:[g.jsx("label",{className:"text-[11px] font-mono text-zinc-400 shrink-0",children:t}),g.jsx("div",{className:"flex justify-end",children:e})]})}function Lg({value:t,onChange:e,size:r="lg"}){const[n,i]=j.useState(!1),a=r==="lg"?"w-[320px]":"w-[200px]";return g.jsxs("div",{className:"relative",children:[g.jsx("input",{type:n?"text":"password",value:t,onChange:o=>e(o.target.value),className:`${Bo} ${a} pr-9`}),g.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?g.jsx(s4,{size:14}):g.jsx(Ub,{size:14})})]})}const Cq=[{id:"installed",label:"Installed"},{id:"awesome-copilot",label:"Awesome Copilot"},{id:"skillssh",label:"skills.sh"}];function qE(t){return t==="awesome-copilot"?"Awesome Copilot":"skills.sh"}function FE(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 jq(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(`
439
+ `)){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 HE=["name","description","version","author","license","argument_hint","argument-hint","use_when","use-when","enhancements","metadata","tags"];function Nq({content:t}){const{frontMatter:e,body:r}=jq(t),n=HE.filter(o=>e[o]!==void 0),i=Object.keys(e).filter(o=>!HE.includes(o)),a=[...n,...i];return g.jsxs("div",{children:[a.length>0&&g.jsxs("div",{className:"border-b border-white/[0.05] pb-4 mb-4",children:[g.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Front Matter"}),g.jsx("div",{className:"space-y-2",children:a.map(o=>{const c=e[o];return c==null||Array.isArray(c)&&c.length===0?null:g.jsxs("div",{className:"flex gap-3 items-start",children:[g.jsx("span",{className:"text-[10px] font-mono text-zinc-600 w-28 flex-shrink-0 pt-0.5",children:o}),g.jsx("div",{className:"flex-1 min-w-0",children:Array.isArray(c)?g.jsx("div",{className:"flex flex-wrap gap-1",children:c.map((u,d)=>g.jsx(Pt,{variant:"muted",children:u},d))}):typeof c=="object"?g.jsx("div",{className:"space-y-0.5",children:Object.entries(c).map(([u,d])=>g.jsxs("p",{className:"text-[11px] font-mono text-zinc-400",children:[g.jsxs("span",{className:"text-zinc-600",children:[u,":"]})," ",d]},u))}):o==="use_when"||o==="use-when"?g.jsx("p",{className:"text-[11px] text-zinc-300 leading-relaxed",children:c}):o==="argument_hint"||o==="argument-hint"?g.jsx("code",{className:"text-[11px] font-mono text-[#E43A9C] bg-[#2d1a24] px-1.5 py-0.5 rounded",children:c}):g.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:c})})]},o)})})]}),r.trim()&&g.jsxs("div",{children:[g.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Body"}),g.jsx(Iu,{content:r})]})]})}function Pq(){const[t,e]=j.useState("installed"),[r,n]=j.useState([]),[i,a]=j.useState([]),[o,c]=j.useState(null);function u(M){return"url"in M&&M.url?M.url:M.name}const[d,p]=j.useState(null),[f,y]=j.useState(""),[v,x]=j.useState(!1),[w,b]=j.useState(!1),[S,A]=j.useState(!1),[O,C]=j.useState(""),[E,T]=j.useState(null),[N,R]=j.useState(null),I=j.useCallback(async()=>{try{const M=await Ke.get("/skills"),J=new Set(M.skills.map(oe=>oe.name.toLowerCase()));n(M.skills),a(oe=>oe.map(le=>({...le,installed:J.has(le.name.toLowerCase())})))}catch(M){et.error(M instanceof Error?M.message:"Failed to load skills")}},[]),K=j.useCallback(async M=>{b(!0);try{const J=await Ke.get(`/skills/${encodeURIComponent(M)}`);p(J),C(J.content)}catch(J){et.error(J instanceof Error?J.message:"Failed to load skill"),p(null)}finally{b(!1)}},[]);j.useEffect(()=>{I()},[I]),j.useEffect(()=>{if(t==="installed"){R(null);return}const M=f.trim();if(t==="skillssh"&&!M){a([]),R(null),x(!1);return}let J=!1;x(!0);const oe=window.setTimeout(async()=>{try{const le=await Ke.get(`/skills/discover?source=${t}&q=${encodeURIComponent(M)}`);if(J)return;a(le.skills),R(null)}catch(le){if(J)return;a([]),R(le instanceof Error?le.message:"Discovery failed")}finally{J||x(!1)}},250);return()=>{J=!0,window.clearTimeout(oe)}},[f,t]);const B=j.useMemo(()=>{const M=f.trim().toLowerCase();return M?r.filter(J=>[J.name,J.description,J.preview].some(oe=>oe.toLowerCase().includes(M))):r},[r,f]),U=t==="installed"?B:i,V=B.find(M=>M.name===o)??null,H=i.find(M=>u(M)===o)??null,Y=(V==null?void 0:V.name)??(H==null?void 0:H.name)??null;j.useEffect(()=>{if(A(!1),!U.length){c(null),t!=="installed"&&p(null);return}if(!o||!U.some(M=>u(M)===o)){const M=U[0];M&&c(u(M))}},[o,t,U]),j.useEffect(()=>{if(t!=="installed"||!Y){p(null);return}K(Y)},[K,Y,t]);async function G(M){if(!M.url&&!M.registrySource){et.error("Install source is not available for this skill yet");return}T(M.name);try{await Ke.post("/skills/install",{name:M.name,source:M.source,url:M.url,registrySource:M.registrySource,skillId:M.skillId}),et.success(`Installed ${M.title||M.name}`),await I(),a(J=>J.map(oe=>oe.name===M.name?{...oe,installed:!0}:oe))}catch(J){et.error(J instanceof Error?J.message:"Install failed")}finally{T(null)}}async function Q(M){T(M);try{await Ke.delete(`/skills/${encodeURIComponent(M)}`),et.success(`Removed ${M}`),await I(),a(J=>J.map(oe=>oe.name===M?{...oe,installed:!1}:oe))}catch(J){et.error(J instanceof Error?J.message:"Failed to remove skill")}finally{T(null)}}async function W(){if(d){T(d.name);try{await Ke.put(`/skills/${encodeURIComponent(d.name)}`,{content:O}),et.success(`Updated ${d.name}`),A(!1),await Promise.all([I(),K(d.name)])}catch(M){et.error(M instanceof Error?M.message:"Failed to save skill")}finally{T(null)}}}const ee=!!(V!=null&&V.activatedForOrchestrator),q=E===(d==null?void 0:d.name),$=E===(H==null?void 0:H.name);return g.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[g.jsxs("div",{className:"w-64 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[g.jsxs("div",{className:"px-2.5 pt-2.5 pb-2 flex-shrink-0 border-b border-white/[0.06] space-y-2",children:[g.jsxs("div",{className:"relative",children:[g.jsx(nP,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-zinc-700"}),g.jsx("input",{type:"text",value:f,onChange:M=>y(M.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"})]}),g.jsx("div",{className:"flex flex-col gap-0.5",children:Cq.map(M=>g.jsxs("button",{type:"button",onClick:()=>e(M.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===M.id?"text-[#E43A9C]":"text-zinc-500 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===M.id?{background:"rgba(228,58,156,0.10)"}:void 0,children:[g.jsx("span",{children:M.label}),M.id==="installed"&&g.jsx("span",{className:"text-[10px] text-zinc-600",children:r.length})]},M.id))})]}),g.jsxs("div",{className:"flex-1 overflow-y-auto py-1.5",children:[v&&t!=="installed"?g.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:[g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"})," Searching registry..."]}):null,U.map(M=>{const J=u(M),oe=o===J,le=M.description||("preview"in M?M.preview:"No description available.");return g.jsxs("button",{type:"button",onClick:()=>{A(!1),c(J)},className:`w-full text-left px-3 py-2.5 border-b border-white/[0.03] transition-colors cursor-pointer ${oe?"border-l-2 border-l-[#E43A9C] bg-[#E43A9C]/5":"hover:bg-white/[0.03]"}`,children:[g.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[g.jsx("span",{className:"truncate font-mono text-[11px] text-zinc-200",children:M.name}),"installed"in M&&M.installed?g.jsx(Pt,{variant:"success",children:"installed"}):null]}),g.jsx("p",{className:"line-clamp-2 font-mono text-[10px] leading-relaxed text-zinc-600",children:le})]},`${t}:${J}`)}),!v&&U.length===0?g.jsx("div",{className:"px-4 py-8",children:g.jsx("p",{className:"font-mono text-[11px] leading-relaxed text-zinc-500",children:N||(t==="skillssh"&&!f.trim()?"Start typing to search the skills.sh registry.":f.trim()?"No skills match your search.":"No skills available in this source.")})}):null]})]}),g.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-5",children:t==="installed"&&V?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-4",children:[g.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:g.jsx(Fb,{className:"h-6 w-6"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:V.name}),g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[g.jsx(Pt,{variant:"success",children:"installed"}),ee?g.jsx(Pt,{variant:"warning",children:"active"}):g.jsx(Pt,{variant:"muted",children:"inactive"}),g.jsx(Pt,{variant:"muted",children:"local skill"})]}),g.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[g.jsxs("p",{children:["path: ",V.filePath]}),g.jsxs("p",{children:["orchestrator: ",ee?"enabled":"disabled"]})]})]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[S?g.jsxs(za,{onClick:W,disabled:q||O===(d==null?void 0:d.content),className:"px-3 py-2",children:[q?g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"}):g.jsx(Lf,{className:"h-3.5 w-3.5"}),"Save"]}):g.jsxs(_i,{onClick:()=>A(!0),className:"px-3 py-2",children:[g.jsx(Lf,{className:"h-3.5 w-3.5"})," Edit"]}),g.jsxs(Wf,{onClick:()=>Q(V.name),className:"px-3 py-2",children:[q?g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"}):g.jsx(Ma,{className:"h-3.5 w-3.5"}),"Remove"]})]})]}),g.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:w&&!d?g.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-zinc-500",children:[g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"})," Loading skill..."]}):S?g.jsxs("div",{className:"space-y-3",children:[g.jsx("textarea",{value:O,onChange:M=>C(M.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"}),g.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-zinc-500",children:[g.jsx("span",{children:"Editing raw SKILL.md"}),g.jsx(_i,{onClick:()=>{A(!1),C((d==null?void 0:d.content)??"")},className:"px-3 py-2",children:"Cancel"})]})]}):d?g.jsx(Nq,{content:d.content}):g.jsx("p",{className:"font-mono text-[11px] text-zinc-500",children:"Select an installed skill to inspect it."})})]}):t!=="installed"&&H?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[g.jsxs("div",{className:"flex min-w-0 gap-4",children:[g.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:g.jsx(W4,{className:"h-6 w-6"})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:H.title||H.name}),g.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[g.jsx(Pt,{variant:H.installed?"success":"default",children:H.installed?"installed":"available"}),g.jsx(Pt,{variant:"muted",children:qE(H.source)}),FE(H.installs)?g.jsx(Pt,{variant:"info",children:FE(H.installs)}):null]}),g.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[g.jsxs("p",{children:["registry: ",qE(H.source)]}),H.registrySource?g.jsxs("p",{children:["source: ",H.registrySource]}):null,H.url?g.jsxs("p",{children:["url: ",H.url]}):null]})]})]}),g.jsx("div",{className:"flex items-center gap-2",children:H.installed?g.jsx(_i,{onClick:()=>{e("installed"),c(H.name)},className:"px-3 py-2",children:"Open installed"}):g.jsxs(za,{onClick:()=>G(H),disabled:$||!H.url&&!H.registrySource,className:"px-3 py-2",children:[$?g.jsx(Ts,{className:"h-3.5 w-3.5 animate-spin"}):g.jsx(i4,{className:"h-3.5 w-3.5"}),"Install"]})})]}),g.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[g.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.02] p-5",children:g.jsx("p",{className:"font-mono text-[12px] leading-7 text-zinc-300",children:H.description||"No registry description is available for this skill yet."})}),g.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."})]})]}):g.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:g.jsxs("div",{children:[g.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:g.jsx(Fb,{className:"h-6 w-6"})}),g.jsx("h3",{className:"text-[28px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Select a Skill"}),g.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."})]})})})]})}function Rf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return`hsl(${(e%360+360)%360}, 70%, 65%)`}function mf(){const{name:t,instanceId:e,role:r}=iD();return t&&r?g.jsx(Bq,{squadName:t,role:r}):t&&e?g.jsx(zq,{squadName:t,instanceId:e}):t?g.jsx($q,{name:t}):g.jsx(Rq,{})}function Rq(){const[t,e]=j.useState([]),[r,n]=j.useState(null),i=vl();return j.useEffect(()=>{Promise.all([Ke.get("/squads"),Ke.get("/config")]).then(([a,o])=>{e(a.squads),n(o.config.maxInstancesPerSquad)}).catch(()=>{})},[]),g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[g.jsx("div",{className:"mb-6",children:g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Squads"}),g.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"]})]})}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[t.map(a=>{const o=a.color||"#38bdf8";return g.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 ${o}30`,background:`${o}08`,backdropFilter:"blur(20px)"},onMouseEnter:c=>{c.currentTarget.style.borderColor=`${o}70`,c.currentTarget.style.background=`${o}12`},onMouseLeave:c=>{c.currentTarget.style.borderColor=`${o}30`,c.currentTarget.style.background=`${o}08`},children:[g.jsxs("div",{className:"flex items-start justify-between mb-1",children:[g.jsx("h3",{className:"text-sm font-mono transition-colors",style:{color:o},children:a.name}),g.jsx(Pt,{variant:Ls(a.status),children:a.status})]}),g.jsxs("div",{className:"flex items-center justify-between mb-3",children:[g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono",children:a.universe}),g.jsxs("span",{className:"text-[11px] text-zinc-600 font-mono flex items-center gap-1",children:[g.jsx(t4,{className:"w-3 h-3"}),a.activeInstances,"/",r??(a.totalInstances||a.memberCount)]})]}),a.repoUrl&&g.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-zinc-700 font-mono mb-4",children:[g.jsx(QN,{className:"w-3 h-3 flex-shrink-0"}),g.jsx("span",{className:"truncate",children:a.repoUrl.replace("https://github.com/","")})]}),a.recentActivity&&a.recentActivity.length>0&&g.jsxs("div",{className:"border-t pt-3",style:{borderColor:`${o}15`},children:[g.jsx("p",{className:"text-[10px] font-mono uppercase tracking-wider mb-2",style:{color:`${o}80`},children:"Recent Work"}),g.jsx("ul",{className:"space-y-1.5",children:a.recentActivity.map(c=>{const u={className:"w-3.5 h-3.5 flex-shrink-0 mt-px"},d=Iq(c.status,u),p=c.objective?c.objective.length>60?`${c.objective.slice(0,60)}…`:c.objective:c.issueRef||"Instance";return g.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] font-mono text-zinc-600",children:[d,g.jsx("span",{className:"truncate",children:p})]},c.id)})})]})]},a.id)}),t.length===0&&g.jsxs("div",{className:"col-span-full text-center py-12 text-zinc-600",children:[g.jsx(qw,{size:48,className:"mx-auto mb-3 opacity-30"}),g.jsx("p",{className:"text-[11px] font-mono",children:"No squads hired yet. Ask IO to hire a squad for a project."})]})]})]})}function Iq(t,e){const r=t.toLowerCase();return r.includes("complete")||r.includes("success")||r.includes("done")?g.jsx(JN,{...e,style:{color:"#34d399"}}):r.includes("warning")||r.includes("review")?g.jsx(Y4,{...e,style:{color:"#fbbf24"}}):r.includes("error")||r.includes("fail")?g.jsx(ZN,{...e,style:{color:"#f87171"}}):r.includes("working")||r.includes("progress")||r.includes("running")?g.jsx(tP,{...e,style:{color:"#E43A9C"}}):g.jsx(x4,{...e,style:{color:"#60a5fa"}})}function Gs(t,e){const r="w-4 h-4",n={color:e},i=t.toLowerCase();return i.includes("lead")||i.includes("pm")||i.includes("technical")?g.jsx(zw,{className:r,style:n}):i.includes("qa")||i.includes("test")?g.jsx(q5,{className:r,style:n}):i.includes("scribe")?g.jsx(z4,{className:r,style:n}):g.jsx(qc,{className:r,style:n})}function $q({name:t}){const[e,r]=j.useState(null),[n,i]=j.useState("agents"),[a,o]=j.useState([]),[c,u]=j.useState(0),[d,p]=j.useState(null),[f,y]=j.useState([]),v=vl(),x=qa();j.useEffect(()=>{Ke.get(`/squads/${t}`).then(r).catch(()=>{})},[t]),j.useEffect(()=>{n==="history"&&Ke.get(`/squads/${t}/history`).then(S=>{o(S.items),u(S.total)}).catch(()=>{}),n==="schedules"&&e&&Ke.get(`/schedules?targetId=${e.squad.id}`).then(S=>y(S.schedules)).catch(()=>{})},[n,t,e]);const w=S=>{Ke.get(`/squads/${t}/history/${S.id}`).then(p).catch(()=>et.error("Failed to load activity detail"))};if(!e)return g.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const b=e.squad.color||"#38bdf8";return d?g.jsx(Mq,{activity:d,squadColor:b,squadName:e.squad.name,onBack:()=>p(null)}):g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${b}06`},children:[g.jsxs("button",{type:"button",onClick:()=>v("/squads"),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[g.jsx(bl,{className:"w-3.5 h-3.5"})," All Squads"]}),g.jsxs("div",{className:"flex items-start justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-3xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:b},children:e.squad.name}),g.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono",children:[e.squad.universe," · ",e.squad.autonomyTier||"standard"," autonomy"]}),e.squad.repoUrl&&g.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:[g.jsx(QN,{className:"w-3 h-3"}),e.squad.repoUrl.replace("https://github.com/","")]})]}),g.jsx(Pt,{variant:Ls(e.squad.status),children:e.squad.status})]}),g.jsx("div",{className:"flex gap-0 mb-5 border-b border-white/[0.06]",children:["agents","instances","schedules","history"].map(S=>g.jsx("button",{type:"button",onClick:()=>i(S),className:`px-4 py-2 text-[11px] font-mono capitalize transition-colors border-b-2 -mb-px ${n===S?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:S},S))}),n==="agents"&&g.jsx("div",{className:"space-y-2",children:e.members.map(S=>g.jsxs("button",{type:"button",onClick:()=>v(`/squads/${t}/agents/${S.roleName||S.role}`),className:"w-full glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3 hover:bg-white/[0.03] transition-colors cursor-pointer text-left",children:[g.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${b}30`,background:`${b}12`},children:Gs(S.roleName||S.role,b)}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-sm font-mono text-zinc-200",children:S.displayName}),g.jsx(Pt,{variant:Ls(S.status),children:S.status})]}),g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:S.role}),S.currentTask&&g.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:S.currentTask})]})]},S.id))}),n==="instances"&&g.jsx("div",{className:"space-y-2",children:e.instances.length===0?g.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No active instances"}):e.instances.map(S=>g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-4",children:[g.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 text-[11px] font-mono",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"ID"}),g.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:S.id.slice(0,8)})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"Branch"}),g.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:S.branch||"—"})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"Status"}),g.jsx("p",{className:"text-zinc-300 mt-0.5",children:g.jsx(Pt,{variant:Ls(S.status),children:S.status})})]}),g.jsxs("div",{children:[g.jsx("span",{className:"text-zinc-700",children:"Tasks"}),g.jsxs("p",{className:"text-zinc-300 mt-0.5",children:[S.tasksComplete,"/",S.taskCount]})]})]}),g.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[g.jsx("button",{type:"button",onClick:()=>v(`/squads/${t}/instances/${S.id}`),title:"View instance agents",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:b},children:g.jsx(Mf,{className:"w-4 h-4"})}),g.jsx("button",{type:"button",onClick:()=>et.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:g.jsx(rp,{className:"w-4 h-4"})})]})]},S.id))}),n==="schedules"&&g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:f.length===0?g.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No schedules for this squad"}):g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:["Schedule","Next Run","Status"].map(S=>g.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:S},S))})}),g.jsx("tbody",{children:f.map(S=>g.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${S.enabled?"":"opacity-50"}`,children:[g.jsxs("td",{className:"px-4 py-3",children:[g.jsx("div",{className:"text-zinc-300",children:S.name||S.prompt}),g.jsx("div",{className:"text-zinc-700 text-[10px] mt-0.5",children:S.cron})]}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:g.jsxs("span",{className:"flex items-center gap-1",children:[g.jsx(Dw,{className:"w-3 h-3"}),S.enabled&&S.nextRun?Hs(S.nextRun,x):"—"]})}),g.jsx("td",{className:"px-4 py-3",children:g.jsx(Pt,{variant:S.enabled?"success":"muted",children:S.enabled?"active":"paused"})})]},S.id))})]})}),n==="history"&&g.jsxs("div",{className:"space-y-2",children:[a.length===0?g.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No history yet"}):a.map(S=>g.jsxs("button",{type:"button",onClick:()=>w(S),className:"w-full glass-card border border-white/[0.07] rounded-2xl px-4 py-3.5 flex items-center gap-3 hover:bg-white/[0.03] transition-colors cursor-pointer text-left",children:[g.jsx("div",{className:"flex-shrink-0",children:S.status==="completed"?g.jsx(JN,{className:"w-4 h-4",style:{color:"#34d399"}}):g.jsx(ZN,{className:"w-4 h-4",style:{color:"#f87171"}})}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("p",{className:"text-[12px] text-zinc-300 font-mono truncate",children:S.title}),g.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[g.jsx("span",{className:"text-[10px] text-zinc-700 font-mono",children:Hs(S.completedAt||S.createdAt,x)}),g.jsxs("span",{className:"text-[10px] text-zinc-700 font-mono flex items-center gap-1",children:[g.jsx(Mf,{className:"w-2.5 h-2.5"}),S.duration||"—"]}),g.jsxs("span",{className:"text-[10px] text-zinc-700 font-mono flex items-center gap-1",children:[g.jsx(qc,{className:"w-2.5 h-2.5"}),S.agentCount," agent",S.agentCount!==1?"s":""]})]})]}),g.jsx(Pt,{variant:S.status==="completed"?"success":"error",children:S.status})]},S.id)),a.length<c&&g.jsx("button",{type:"button",onClick:()=>{Ke.get(`/squads/${t}/history?offset=${a.length}`).then(S=>{o(A=>[...A,...S.items])}).catch(()=>{})},className:"w-full text-center py-3 text-[11px] font-mono text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:"Load more"})]})]})}function Mq({activity:t,squadColor:e,squadName:r,onBack:n}){const i=qa(),[a,o]=j.useState(new Set),c=j.useMemo(()=>{const v={};for(const x of t.agentEntries)v[x.agentId]=Rf(x.agentName);return v},[t]),u={thought:{label:"Thinking",icon:Bw},tool_call:{label:"Tool Call",icon:aP},tool_result:{label:"Tool Result",icon:eP},message:{label:"Message",icon:qc},decision:{label:"Decision",icon:zw}},d={label:"Message",icon:qc},p=v=>u[v]??d,f=v=>{o(x=>{const w=new Set(x);return w.has(v)?w.delete(v):w.add(v),w})},y=j.useMemo(()=>{const v=t.agentEntries.flatMap(x=>x.events.map(w=>({ev:w,entry:x})));return v.sort((x,w)=>x.ev.timestamp.localeCompare(w.ev.timestamp)),a.size>0?v.filter(({entry:x})=>a.has(x.agentId)):v},[t,a]);return g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${e}06`},children:[g.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors cursor-pointer",children:[g.jsx(bl,{className:"w-3.5 h-3.5"})," Back to ",r]}),g.jsxs("div",{className:"flex items-start justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:e},children:t.title}),g.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[g.jsx("span",{className:"text-[11px] text-zinc-600 font-mono",children:Hs(t.completedAt||t.createdAt,i)}),g.jsxs("span",{className:"text-[11px] text-zinc-700 font-mono flex items-center gap-1",children:[g.jsx(Dw,{className:"w-3 h-3"}),t.duration||"—"]})]})]}),g.jsx(Pt,{variant:t.status==="completed"?"success":"error",children:t.status})]}),g.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[t.agentEntries.map(v=>{const x=c[v.agentId],w=a.has(v.agentId),S=!(a.size>0)||w;return g.jsxs("button",{type:"button",onClick:()=>f(v.agentId),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-xl border transition-all cursor-pointer",style:{borderColor:S?`${x}30`:"rgba(255,255,255,0.05)",background:S?`${x}10`:"transparent",opacity:S?1:.4},children:[Gs(v.roleType||v.role,x),g.jsx("span",{className:"text-[11px] font-mono",style:{color:S?x:"#71717a"},children:v.agentName}),g.jsxs("span",{className:"text-[10px] font-mono text-zinc-500",children:["— ",v.role]})]},v.agentId)}),a.size>0&&g.jsx("button",{type:"button",onClick:()=>o(new Set),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-xl border border-white/[0.1] text-[11px] font-mono text-zinc-400 hover:text-zinc-200 transition-colors cursor-pointer",children:"Show all"})]}),g.jsxs("div",{className:"relative pl-10",children:[g.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),g.jsx("div",{className:"space-y-3",children:y.map(({ev:v,entry:x})=>{const w=c[x.agentId],{label:b,icon:S}=p(v.kind),A=v.kind==="tool_call"||v.kind==="tool_result";return g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${w}15`,border:`1px solid ${w}35`},children:g.jsx(S,{className:"w-3.5 h-3.5",style:{color:w}})}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsxs("div",{className:"flex items-center gap-1",children:[Gs(x.roleType||x.role,w),g.jsx("span",{className:"text-[10px] font-mono",style:{color:w},children:x.agentName})]}),g.jsx("span",{className:"text-zinc-700 text-[10px]",children:"·"}),g.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-zinc-500",children:b}),v.label&&g.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:v.label}),v.status==="error"&&g.jsx(Pt,{variant:"error",children:"failed"}),v.status==="ok"&&v.kind==="tool_result"&&g.jsx(Pt,{variant:"success",children:"ok"})]}),g.jsx("span",{className:"text-[10px] font-mono text-zinc-700 flex-shrink-0 ml-2",children:np(v.timestamp,i)})]}),A?g.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2 mt-1 bg-black/20",children:v.content}):g.jsx(Iu,{content:v.content,className:"text-[12px] [&_pre]:text-[10px]"})]})]},v.id)})})]})]})}const Lq={thought:{label:"Thinking",icon:Bw,color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool_call:{label:"Tool Call",icon:aP,color:"#38bdf8",bg:"rgba(56,189,248,0.1)"},tool_result:{label:"Tool Result",icon:eP,color:"#34d399",bg:"rgba(52,211,153,0.1)"},message:{label:"Message",icon:qc,color:"#E43A9C",bg:"rgba(228,58,156,0.15)"},decision:{label:"Decision",icon:zw,color:"#fbbf24",bg:"rgba(251,191,36,0.1)"},meeting:{label:"Meeting",icon:qw,color:"#818cf8",bg:"rgba(129,140,248,0.1)"}};function Dq(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 zq({squadName:t,instanceId:e}){const[r,n]=j.useState(null),[i,a]=j.useState([]),[o,c]=j.useState(null),[u,d]=j.useState("running"),[p,f]=j.useState(0),y=vl(),v=qa(),x=j.useRef(null),w=j.useRef(null),b=j.useRef(!0),S=j.useCallback(()=>{const I=x.current;if(!I)return;const K=100;b.current=I.scrollHeight-I.scrollTop-I.clientHeight<K,b.current&&f(0)},[]);if(j.useEffect(()=>{Ke.get(`/squads/${t}/instances/${e}`).then(I=>{n(I),d(I.instance.status)}).catch(()=>{et.error("Failed to load instance")})},[t,e]),cP({onEvent:I=>{if(!I.event)return;const K=I.event;if((K.type==="instance:completed"||K.type==="instance:failed")&&K.instanceId===e){d(K.type==="instance:completed"?"completed":"failed");return}if(K.type.startsWith("agent:")&&K.instanceId===e){const B=K.data,U=(B==null?void 0:B.tool)||null,V=typeof(B==null?void 0:B.success)=="boolean"?B.success:null;let H="";if(U&&(B!=null&&B.arguments)){const G=B.arguments;if(typeof G=="string")H=G;else if(typeof G=="object"&&G!==null){const Q=G;Q.command?H=String(Q.command):H=JSON.stringify(G,null,2)}}else B!=null&&B.result?H=String(B.result):B!=null&&B.error?H=String(B.error):H=(B==null?void 0:B.content)||"";try{const G=JSON.parse(H);typeof G=="object"&&G!==null&&(H=G.message??G.content??G.response??G.decision??JSON.stringify(G,null,2))}catch{}const Y={id:K.id,agent:K.agentRole||(B==null?void 0:B.agentRole)||"unknown",type:K.type.replace("agent:",""),content:H,toolName:U,success:V,model:K.model||(B==null?void 0:B.model)||null,tokensUsed:null,timestamp:K.timestamp};a(G=>[...G,Y]),b.current?setTimeout(()=>{var G;return(G=w.current)==null?void 0:G.scrollIntoView({behavior:"smooth"})},50):f(G=>G+1)}}}),!r)return g.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const A=r.squadColor||"#38bdf8",O=[...r.activity,...i],C=Array.from(new Map(O.map(I=>[I.id,I])).values());C.sort((I,K)=>I.timestamp.localeCompare(K.timestamp));const E=o?C.filter(I=>I.agent===o):C,T=[...new Set(C.map(I=>I.agent))],N={};for(const I of T)N[I]=Rf(I);const R=u==="running"||u==="working"||u==="meeting"||u==="planning";return g.jsxs("div",{ref:x,onScroll:S,className:"flex-1 overflow-y-auto p-6",style:{background:`${A}06`},children:[g.jsxs("button",{type:"button",onClick:()=>y(`/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:[g.jsx(bl,{className:"w-3.5 h-3.5"})," Back to ",t]}),g.jsxs("div",{className:"flex items-start justify-between mb-5",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:A},children:"Instance"}),g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:r.instance.id.slice(0,8)}),r.instance.branch&&g.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:r.instance.branch})]}),g.jsx(Pt,{variant:Ls(u),children:u})]}),g.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[r.members.map(I=>{const K=I.roleName||I.role,B=N[K]||Rf(K),U=o===K;return g.jsxs("button",{type:"button",onClick:()=>c(U?null:K),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-xl border transition-all cursor-pointer",style:{borderColor:U?B:`${B}30`,background:U?`${B}25`:`${B}10`,opacity:o&&!U?.5:1},children:[Gs(K,B),g.jsx("span",{className:"text-[11px] font-mono",style:{color:B},children:I.displayName}),g.jsx(Pt,{variant:Ls(I.status),children:I.status}),I.status==="working"&&g.jsx("button",{type:"button",onClick:async V=>{V.stopPropagation();try{await Ke.post(`/squads/${t}/instances/${e}/cancel`),et.success("Instance cancelled")}catch{et.error("Failed to cancel instance")}},title:"Cancel instance",className:"ml-1 p-1 rounded-lg hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:g.jsx(rp,{className:"w-3 h-3"})})]},I.id)}),o&&g.jsx("button",{type:"button",onClick:()=>c(null),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-xl border border-white/[0.1] text-[11px] font-mono text-zinc-400 hover:text-zinc-200 transition-colors cursor-pointer",children:"Show all"})]}),g.jsxs("div",{className:"relative pl-10",children:[g.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),g.jsxs("div",{className:"space-y-3",children:[E.length===0&&g.jsx("div",{className:"text-center py-12 text-zinc-700 font-mono text-sm",children:"No activity recorded yet"}),E.map(I=>{const K=Dq(I.type),B=Lq[K],U=B.icon,V=N[I.agent]||Rf(I.agent),H=K==="tool_call"||K==="tool_result",Y=I.type.toLowerCase().includes("error")||I.type.toLowerCase().includes("fail");return g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${V}15`,border:`1px solid ${V}35`},children:g.jsx(U,{className:"w-3.5 h-3.5",style:{color:V}})}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[g.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsxs("div",{className:"flex items-center gap-1",children:[Gs(I.agent,V),g.jsx("span",{className:"text-[10px] font-mono",style:{color:V},children:I.agent})]}),g.jsx("span",{className:"text-zinc-700 text-[10px]",children:"·"}),g.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-zinc-500",children:B.label}),I.toolName&&g.jsx("span",{className:"text-[10px] font-mono text-sky-400 border border-sky-400/20 rounded px-1.5 py-px bg-sky-400/[0.06]",children:I.toolName}),I.model&&g.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:I.model}),I.success===!0&&g.jsx("span",{className:"text-[10px] font-mono text-emerald-400 border border-emerald-400/20 rounded px-1.5 py-px bg-emerald-400/[0.08]",children:"success"}),I.success===!1&&g.jsx("span",{className:"text-[10px] font-mono text-red-400 border border-red-400/20 rounded px-1.5 py-px bg-red-400/[0.08]",children:"failed"}),Y&&I.success===null&&g.jsx(Pt,{variant:"error",children:"failed"})]}),g.jsx("span",{className:"text-[10px] font-mono text-zinc-700 flex-shrink-0 ml-2",children:np(I.timestamp,v)})]}),H?g.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2 mt-1 bg-black/20",children:I.content}):g.jsx(Iu,{content:I.content,className:"text-[12px] [&_pre]:text-[10px]"})]})]},I.id)}),R&&g.jsxs("div",{className:"relative",children:[g.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:g.jsx(tP,{className:"w-3.5 h-3.5 animate-spin",style:{color:A}})}),g.jsx("div",{className:"glass-card border rounded-2xl px-4 py-3",style:{borderColor:`${A}20`},children:g.jsx("span",{className:"text-[11px] font-mono",style:{color:A},children:"Working…"})})]})]})]}),g.jsx("div",{ref:w}),p>0&&g.jsxs("button",{type:"button",onClick:()=>{var I;(I=w.current)==null||I.scrollIntoView({behavior:"smooth"}),f(0)},className:"fixed bottom-6 left-1/2 -translate-x-1/2 flex items-center gap-1.5 px-4 py-2 rounded-full border border-white/[0.1] bg-zinc-900/90 backdrop-blur-sm text-[11px] font-mono text-zinc-300 hover:text-white shadow-lg transition-all cursor-pointer z-50",children:[g.jsx(M5,{className:"w-3.5 h-3.5"}),p," new event",p!==1?"s":""]})]})}function Bq({squadName:t,role:e}){const r=vl(),[n,i]=j.useState(null),[a,o]=j.useState(""),[c,u]=j.useState(!1),[d,p]=j.useState(""),[f,y]=j.useState(!1),[v,x]=j.useState("#38bdf8");j.useEffect(()=>{Ke.get(`/squads/${t}`).then(b=>{x(b.squad.color||"#38bdf8");const S=b.members.find(A=>A.roleName===e||A.role===e);S&&i(S)}).catch(()=>{}),Ke.get(`/squads/${t}/members/${e}/skill`).then(b=>{o(b.content)}).catch(()=>{})},[t,e]);const w=async()=>{y(!0);try{await Ke.put(`/squads/${t}/members/${e}/skill`,{content:d}),o(d),u(!1),et.success("Skill file saved")}catch{et.error("Failed to save skill file")}finally{y(!1)}};return n?g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${v}06`},children:[g.jsxs("button",{type:"button",onClick:()=>r(`/squads/${t}`),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors cursor-pointer",children:[g.jsx(bl,{className:"w-3.5 h-3.5"})," Back to ",t]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5 mb-5",children:[g.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[g.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center",style:{border:`1px solid ${v}30`,background:`${v}12`},children:Gs(n.roleName,v)}),g.jsxs("div",{children:[g.jsx("h2",{className:"text-xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:v},children:n.displayName}),g.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[g.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:n.roleName}),n.veto&&g.jsx("span",{className:"text-[10px] font-mono text-amber-400 border border-amber-400/20 rounded px-1.5 py-px bg-amber-400/[0.06]",children:"veto"})]})]})]}),n.persona&&g.jsx("p",{className:"text-[12px] text-zinc-400 font-mono leading-relaxed mt-2",children:n.persona}),n.tools.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:n.tools.map(b=>g.jsx("span",{className:"text-[10px] font-mono text-zinc-500 border border-white/[0.08] rounded px-1.5 py-px bg-white/[0.03]",children:b},b))})]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[g.jsxs("div",{className:"flex items-center justify-between mb-4",children:[g.jsx("h3",{className:"text-sm font-mono text-zinc-300",children:"Skill File"}),c?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("button",{type:"button",onClick:()=>u(!1),className:"px-3 py-1.5 rounded-lg text-[11px] font-mono text-zinc-500 hover:text-zinc-300 border border-white/[0.1] transition-colors cursor-pointer",children:"Cancel"}),g.jsxs("button",{type:"button",onClick:w,disabled:f,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-emerald-400 border border-emerald-400/30 hover:bg-emerald-400/10 transition-colors cursor-pointer disabled:opacity-50",children:[g.jsx(tp,{className:"w-3 h-3"})," ",f?"Saving...":"Save"]})]}):g.jsxs("button",{type:"button",onClick:()=>{p(a),u(!0)},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-zinc-400 hover:text-zinc-200 border border-white/[0.1] hover:border-white/[0.2] transition-colors cursor-pointer",children:[g.jsx(Lf,{className:"w-3 h-3"})," Edit"]})]}),c?g.jsx("textarea",{value:d,onChange:b=>p(b.target.value),className:"w-full h-[500px] bg-black/30 border border-white/[0.08] rounded-xl p-4 text-[12px] font-mono text-zinc-300 resize-y focus:outline-none focus:border-white/[0.2] leading-relaxed",spellCheck:!1}):a?g.jsx(Iu,{content:a,className:"text-[12px] [&_pre]:text-[11px]"}):g.jsx("p",{className:"text-zinc-700 text-[12px] font-mono py-8 text-center",children:"No skill file configured for this agent"})]})]}):g.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."})}var Dg,WE;function Qr(){if(WE)return Dg;WE=1;var t=Array.isArray;return Dg=t,Dg}var zg,GE;function _R(){if(GE)return zg;GE=1;var t=typeof Qd=="object"&&Qd&&Qd.Object===Object&&Qd;return zg=t,zg}var Bg,KE;function Oi(){if(KE)return Bg;KE=1;var t=_R(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Bg=r,Bg}var Ug,VE;function Mu(){if(VE)return Ug;VE=1;var t=Oi(),e=t.Symbol;return Ug=e,Ug}var qg,XE;function Uq(){if(XE)return qg;XE=1;var t=Mu(),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 qg=a,qg}var Fg,YE;function qq(){if(YE)return Fg;YE=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Fg=r,Fg}var Hg,JE;function ra(){if(JE)return Hg;JE=1;var t=Mu(),e=Uq(),r=qq(),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 Hg=o,Hg}var Wg,ZE;function na(){if(ZE)return Wg;ZE=1;function t(e){return e!=null&&typeof e=="object"}return Wg=t,Wg}var Gg,QE;function _l(){if(QE)return Gg;QE=1;var t=ra(),e=na(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return Gg=n,Gg}var Kg,eO;function n1(){if(eO)return Kg;eO=1;var t=Qr(),e=_l(),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 Kg=i,Kg}var Vg,tO;function Ha(){if(tO)return Vg;tO=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Vg=t,Vg}var Xg,rO;function i1(){if(rO)return Xg;rO=1;var t=ra(),e=Ha(),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 Xg=o,Xg}var Yg,nO;function Fq(){if(nO)return Yg;nO=1;var t=Oi(),e=t["__core-js_shared__"];return Yg=e,Yg}var Jg,iO;function Hq(){if(iO)return Jg;iO=1;var t=Fq(),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 Jg=r,Jg}var Zg,aO;function SR(){if(aO)return Zg;aO=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 Zg=r,Zg}var Qg,oO;function Wq(){if(oO)return Qg;oO=1;var t=i1(),e=Hq(),r=Ha(),n=SR(),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 f(y){if(!r(y)||e(y))return!1;var v=t(y)?p:a;return v.test(n(y))}return Qg=f,Qg}var ey,sO;function Gq(){if(sO)return ey;sO=1;function t(e,r){return e==null?void 0:e[r]}return ey=t,ey}var ty,lO;function Uo(){if(lO)return ty;lO=1;var t=Wq(),e=Gq();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return ty=r,ty}var ry,cO;function dp(){if(cO)return ry;cO=1;var t=Uo(),e=t(Object,"create");return ry=e,ry}var ny,uO;function Kq(){if(uO)return ny;uO=1;var t=dp();function e(){this.__data__=t?t(null):{},this.size=0}return ny=e,ny}var iy,dO;function Vq(){if(dO)return iy;dO=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return iy=t,iy}var ay,fO;function Xq(){if(fO)return ay;fO=1;var t=dp(),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 ay=i,ay}var oy,hO;function Yq(){if(hO)return oy;hO=1;var t=dp(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return oy=n,oy}var sy,pO;function Jq(){if(pO)return sy;pO=1;var t=dp(),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 sy=r,sy}var ly,mO;function Zq(){if(mO)return ly;mO=1;var t=Kq(),e=Vq(),r=Xq(),n=Yq(),i=Jq();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,gO;function Qq(){if(gO)return cy;gO=1;function t(){this.__data__=[],this.size=0}return cy=t,cy}var uy,yO;function a1(){if(yO)return uy;yO=1;function t(e,r){return e===r||e!==e&&r!==r}return uy=t,uy}var dy,vO;function fp(){if(vO)return dy;vO=1;var t=a1();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return dy=e,dy}var fy,bO;function e9(){if(bO)return fy;bO=1;var t=fp(),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 fy=n,fy}var hy,xO;function t9(){if(xO)return hy;xO=1;var t=fp();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return hy=e,hy}var py,wO;function r9(){if(wO)return py;wO=1;var t=fp();function e(r){return t(this.__data__,r)>-1}return py=e,py}var my,_O;function n9(){if(_O)return my;_O=1;var t=fp();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 my=e,my}var gy,SO;function hp(){if(SO)return gy;SO=1;var t=Qq(),e=e9(),r=t9(),n=r9(),i=n9();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,gy=a,gy}var yy,kO;function o1(){if(kO)return yy;kO=1;var t=Uo(),e=Oi(),r=t(e,"Map");return yy=r,yy}var vy,EO;function i9(){if(EO)return vy;EO=1;var t=Zq(),e=hp(),r=o1();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return vy=n,vy}var by,OO;function a9(){if(OO)return by;OO=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return by=t,by}var xy,AO;function pp(){if(AO)return xy;AO=1;var t=a9();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return xy=e,xy}var wy,TO;function o9(){if(TO)return wy;TO=1;var t=pp();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return wy=e,wy}var _y,CO;function s9(){if(CO)return _y;CO=1;var t=pp();function e(r){return t(this,r).get(r)}return _y=e,_y}var Sy,jO;function l9(){if(jO)return Sy;jO=1;var t=pp();function e(r){return t(this,r).has(r)}return Sy=e,Sy}var ky,NO;function c9(){if(NO)return ky;NO=1;var t=pp();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 ky=e,ky}var Ey,PO;function s1(){if(PO)return Ey;PO=1;var t=i9(),e=o9(),r=s9(),n=l9(),i=c9();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 Oy,RO;function kR(){if(RO)return Oy;RO=1;var t=s1(),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,Oy=r,Oy}var Ay,IO;function u9(){if(IO)return Ay;IO=1;var t=kR(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return Ay=r,Ay}var Ty,$O;function d9(){if($O)return Ty;$O=1;var t=u9(),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 Ty=n,Ty}var Cy,MO;function l1(){if(MO)return Cy;MO=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 Cy=t,Cy}var jy,LO;function f9(){if(LO)return jy;LO=1;var t=Mu(),e=l1(),r=Qr(),n=_l(),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 jy=o,jy}var Ny,DO;function ER(){if(DO)return Ny;DO=1;var t=f9();function e(r){return r==null?"":t(r)}return Ny=e,Ny}var Py,zO;function OR(){if(zO)return Py;zO=1;var t=Qr(),e=n1(),r=d9(),n=ER();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return Py=i,Py}var Ry,BO;function mp(){if(BO)return Ry;BO=1;var t=_l();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ry=e,Ry}var Iy,UO;function c1(){if(UO)return Iy;UO=1;var t=OR(),e=mp();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 Iy=r,Iy}var $y,qO;function AR(){if(qO)return $y;qO=1;var t=c1();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return $y=e,$y}var h9=AR();const Tn=vt(h9);var My,FO;function p9(){if(FO)return My;FO=1;function t(e){return e==null}return My=t,My}var m9=p9();const tt=vt(m9);var Ly,HO;function g9(){if(HO)return Ly;HO=1;var t=ra(),e=Qr(),r=na(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return Ly=i,Ly}var y9=g9();const Ro=vt(y9);var v9=i1();const Je=vt(v9);var b9=Ha();const Sl=vt(b9);var Dy={exports:{}},pt={};/**
440
440
  * @license React
441
441
  * react-is.production.min.js
442
442
  *
@@ -444,27 +444,27 @@ ${S}`}class Zt extends Error{constructor({message:e,code:r,cause:n,name:i}){var
444
444
  *
445
445
  * This source code is licensed under the MIT license found in the
446
446
  * LICENSE file in the root directory of this source tree.
447
- */var WO;function x9(){if(WO)return pt;WO=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"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),x;x=Symbol.for("react.module.reference");function w(b){if(typeof b=="object"&&b!==null){var S=b.$$typeof;switch(S){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 y:case f:case a:return b;default:return S}}case e:return S}}}return pt.ContextConsumer=o,pt.ContextProvider=a,pt.Element=t,pt.ForwardRef=u,pt.Fragment=r,pt.Lazy=y,pt.Memo=f,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 w(b)===o},pt.isContextProvider=function(b){return w(b)===a},pt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},pt.isForwardRef=function(b){return w(b)===u},pt.isFragment=function(b){return w(b)===r},pt.isLazy=function(b){return w(b)===y},pt.isMemo=function(b){return w(b)===f},pt.isPortal=function(b){return w(b)===e},pt.isProfiler=function(b){return w(b)===i},pt.isStrictMode=function(b){return w(b)===n},pt.isSuspense=function(b){return w(b)===d},pt.isSuspenseList=function(b){return w(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===y||b.$$typeof===f||b.$$typeof===a||b.$$typeof===o||b.$$typeof===u||b.$$typeof===x||b.getModuleId!==void 0)},pt.typeOf=w,pt}var GO;function w9(){return GO||(GO=1,Dy.exports=x9()),Dy.exports}var _9=w9(),zy,KO;function TR(){if(KO)return zy;KO=1;var t=ra(),e=na(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return zy=n,zy}var By,VO;function S9(){if(VO)return By;VO=1;var t=TR();function e(r){return t(r)&&r!=+r}return By=e,By}var k9=S9();const Lu=vt(k9);var E9=TR();const O9=vt(E9);var Jn=function(e){return e===0?0:e>0?1:-1},Eo=function(e){return Ro(e)&&e.indexOf("%")===e.length-1},ge=function(e){return O9(e)&&!Lu(e)},A9=function(e){return et(e)},or=function(e){return ge(e)||Ro(e)},T9=0,Du=function(e){var r=++T9;return"".concat(e||"").concat(r)},Io=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)&&!Ro(e))return n;var a;if(Eo(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Lu(a)&&(a=n),i&&a>r&&(a=r),a},Pa=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},C9=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 Zf(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):Tn(n,e))===r})}var j9=function(e,r){return ge(e)&&ge(r)?e-r:Ro(e)&&Ro(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Bs(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 lx(t){"@babel/helpers - typeof";return lx=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},lx(t)}var N9=["viewBox","children"],P9=["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"],XO=["points","pathLength"],Uy={svg:N9,polygon:XO,polyline:XO},u1=["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"],Qf=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(j.isValidElement(e)&&(n=e.props),!Sl(n))return null;var i={};return Object.keys(n).forEach(function(a){u1.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},R9=function(e,r,n){return function(i){return e(r,n,i),null}},eh=function(e,r,n){if(!Sl(e)||lx(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];u1.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=R9(o,r,n))}),i},I9=["children"],$9=["children"];function YO(t,e){if(t==null)return{};var r=M9(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 M9(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 cx(t){"@babel/helpers - typeof";return cx=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},cx(t)}var JO={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,qy=null,d1=function t(e){if(e===ZO&&Array.isArray(qy))return qy;var r=[];return j.Children.forEach(e,function(n){et(n)||(_9.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),qy=r,ZO=e,r};function Cn(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return Gi(i)}):n=[Gi(e)],d1(t).forEach(function(i){var a=Tn(i,"type.displayName")||Tn(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function sn(t,e){var r=Cn(t,e);return r&&r[0]}var QO=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)},L9=["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"],D9=function(e){return e&&e.type&&Ro(e.type)&&L9.indexOf(e.type)>=0},z9=function(e){return e&&cx(e)==="object"&&"clipDot"in e},B9=function(e,r,n,i){var a,o=(a=Uy==null?void 0:Uy[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Je(e)&&(i&&o.includes(r)||P9.includes(r))||n&&u1.includes(r)},at=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(j.isValidElement(e)&&(i=e.props),!Sl(i))return null;var a={};return Object.keys(i).forEach(function(o){var c;B9((c=i)===null||c===void 0?void 0:c[o],o,r,n)&&(a[o]=i[o])}),a},ux=function t(e,r){if(e===r)return!0;var n=j.Children.count(e);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return eA(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(!eA(a,o))return!1}return!0},eA=function(e,r){if(et(e)&&et(r))return!0;if(!et(e)&&!et(r)){var n=e.props||{},i=n.children,a=YO(n,I9),o=r.props||{},c=o.children,u=YO(o,$9);return i&&c?Bs(a,u)&&ux(i,c):!i&&!c?Bs(a,u):!1}return!1},tA=function(e,r){var n=[],i={};return d1(e).forEach(function(a,o){if(D9(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 f=d(a,c,o);n.push(f),i[c]=!0}}}),n},U9=function(e){var r=e&&e.type;return r&&JO[r]?JO[r]:null},q9=function(e,r){return d1(r).indexOf(e)},F9=["children","width","height","viewBox","className","style","title","desc"];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 H9(t,e){if(t==null)return{};var r=W9(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 W9(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 fx(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=H9(t,F9),p=i||{width:r,height:n,x:0,y:0},f=ot("recharts-surface",a);return L.createElement("svg",dx({},at(d,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),L.createElement("title",null,c),L.createElement("desc",null,u),e)}var G9=["children","className"];function hx(){return hx=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},hx.apply(this,arguments)}function K9(t,e){if(t==null)return{};var r=V9(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 V9(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=L.forwardRef(function(t,e){var r=t.children,n=t.className,i=K9(t,G9),a=ot("recharts-layer",n);return L.createElement("g",hx({className:a},at(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]},Fy,rA;function X9(){if(rA)return Fy;rA=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 Fy=t,Fy}var Hy,nA;function Y9(){if(nA)return Hy;nA=1;var t=X9();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 Hy=e,Hy}var Wy,iA;function CR(){if(iA)return Wy;iA=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 Wy=u,Wy}var Gy,aA;function J9(){if(aA)return Gy;aA=1;function t(e){return e.split("")}return Gy=t,Gy}var Ky,oA;function Z9(){if(oA)return Ky;oA=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+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",x=d+"?",w="["+a+"]?",b="(?:"+v+"(?:"+[p,f,y].join("|")+")"+w+x+")*",S=w+x+b,A="(?:"+[p+c+"?",c,f,y,o].join("|")+")",O=RegExp(u+"(?="+u+")|"+A+S,"g");function C(E){return E.match(O)||[]}return Ky=C,Ky}var Vy,sA;function Q9(){if(sA)return Vy;sA=1;var t=J9(),e=CR(),r=Z9();function n(i){return e(i)?r(i):t(i)}return Vy=n,Vy}var Xy,lA;function eF(){if(lA)return Xy;lA=1;var t=Y9(),e=CR(),r=Q9(),n=ER();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 Xy=i,Xy}var Yy,cA;function tF(){if(cA)return Yy;cA=1;var t=eF(),e=t("toUpperCase");return Yy=e,Yy}var rF=tF();const gp=vt(rF);function Tt(t){return function(){return t}}const jR=Math.cos,th=Math.sin,ri=Math.sqrt,rh=Math.PI,yp=2*rh,px=Math.PI,mx=2*px,wo=1e-6,nF=mx-wo;function NR(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function iF(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return NR;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 aF{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?NR:iF(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,f=c-r,y=p*p+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(y>wo)if(!(Math.abs(f*u-d*p)>wo)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let v=n-o,x=i-c,w=u*u+d*d,b=v*v+x*x,S=Math.sqrt(w),A=Math.sqrt(y),O=a*Math.tan((px-Math.acos((w+y-b)/(2*S*A)))/2),C=O/A,E=O/S;Math.abs(C-1)>wo&&this._append`L${e+C*p},${r+C*f}`,this._append`A${a},${a},0,0,${+(f*v>p*x)},${this._x1=e+E*u},${this._y1=r+E*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,f=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${d},${p}`:(Math.abs(this._x1-d)>wo||Math.abs(this._y1-p)>wo)&&this._append`L${d},${p}`,n&&(y<0&&(y=y%mx+mx),y>nF?this._append`A${n},${n},0,1,${f},${e-c},${r-u}A${n},${n},0,1,${f},${this._x1=d},${this._y1=p}`:y>wo&&this._append`A${n},${n},0,${+(y>=px)},${f},${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 f1(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 aF(e)}function h1(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function PR(t){this._context=t}PR.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 vp(t){return new PR(t)}function RR(t){return t[0]}function IR(t){return t[1]}function $R(t,e){var r=Tt(!0),n=null,i=vp,a=null,o=f1(c);t=typeof t=="function"?t:t===void 0?RR:Tt(t),e=typeof e=="function"?e:e===void 0?IR:Tt(e);function c(u){var d,p=(u=h1(u)).length,f,y=!1,v;for(n==null&&(a=i(v=o())),d=0;d<=p;++d)!(d<p&&r(f=u[d],d,u))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+t(f,d,u),+e(f,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 gf(t,e,r){var n=null,i=Tt(!0),a=null,o=vp,c=null,u=f1(d);t=typeof t=="function"?t:t===void 0?RR:Tt(+t),e=typeof e=="function"?e:Tt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?IR:Tt(+r);function d(f){var y,v,x,w=(f=h1(f)).length,b,S=!1,A,O=new Array(w),C=new Array(w);for(a==null&&(c=o(A=u())),y=0;y<=w;++y){if(!(y<w&&i(b=f[y],y,f))===S)if(S=!S)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),x=y-1;x>=v;--x)c.point(O[x],C[x]);c.lineEnd(),c.areaEnd()}S&&(O[y]=+t(b,y,f),C[y]=+e(b,y,f),c.point(n?+n(b,y,f):O[y],r?+r(b,y,f):C[y]))}if(A)return c=null,A+""||null}function p(){return $R().defined(i).curve(o).context(a)}return d.x=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),n=null,d):t},d.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),d):t},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Tt(+f),d):n},d.y=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),r=null,d):e},d.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),d):e},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Tt(+f),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(f){return arguments.length?(i=typeof f=="function"?f:Tt(!!f),d):i},d.curve=function(f){return arguments.length?(o=f,a!=null&&(c=o(a)),d):o},d.context=function(f){return arguments.length?(f==null?a=c=null:c=o(a=f),d):a},d}class MR{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 oF(t){return new MR(t,!0)}function sF(t){return new MR(t,!1)}const p1={draw(t,e){const r=ri(e/rh);t.moveTo(r,0),t.arc(0,0,r,0,yp)}},lF={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()}},LR=ri(1/3),cF=LR*2,uF={draw(t,e){const r=ri(e/cF),n=r*LR;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},dF={draw(t,e){const r=ri(e),n=-r/2;t.rect(n,n,r,r)}},fF=.8908130915292852,DR=th(rh/10)/th(7*rh/10),hF=th(yp/10)*DR,pF=-jR(yp/10)*DR,mF={draw(t,e){const r=ri(e*fF),n=hF*r,i=pF*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=yp*a/5,c=jR(o),u=th(o);t.lineTo(u*r,-c*r),t.lineTo(c*n-u*i,u*n+c*i)}t.closePath()}},Jy=ri(3),gF={draw(t,e){const r=-ri(e/(Jy*3));t.moveTo(0,r*2),t.lineTo(-Jy*r,-r),t.lineTo(Jy*r,-r),t.closePath()}},Sn=-.5,kn=ri(3)/2,gx=1/ri(12),yF=(gx/2+1)*3,vF={draw(t,e){const r=ri(e/yF),n=r/2,i=r*gx,a=n,o=r*gx+r,c=-a,u=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(c,u),t.lineTo(Sn*n-kn*i,kn*n+Sn*i),t.lineTo(Sn*a-kn*o,kn*a+Sn*o),t.lineTo(Sn*c-kn*u,kn*c+Sn*u),t.lineTo(Sn*n+kn*i,Sn*i-kn*n),t.lineTo(Sn*a+kn*o,Sn*o-kn*a),t.lineTo(Sn*c+kn*u,Sn*u-kn*c),t.closePath()}};function bF(t,e){let r=null,n=f1(i);t=typeof t=="function"?t:Tt(t||p1),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 nh(){}function ih(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 zR(t){this._context=t}zR.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:ih(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:ih(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function xF(t){return new zR(t)}function BR(t){this._context=t}BR.prototype={areaStart:nh,areaEnd:nh,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:ih(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function wF(t){return new BR(t)}function UR(t){this._context=t}UR.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:ih(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function _F(t){return new UR(t)}function qR(t){this._context=t}qR.prototype={areaStart:nh,areaEnd:nh,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 SF(t){return new qR(t)}function uA(t){return t<0?-1:1}function dA(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(uA(a)+uA(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function fA(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Zy(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 ah(t){this._context=t}ah.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:Zy(this,this._t0,fA(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,Zy(this,fA(this,r=dA(this,t,e)),r);break;default:Zy(this,this._t0,r=dA(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function FR(t){this._context=new HR(t)}(FR.prototype=Object.create(ah.prototype)).point=function(t,e){ah.prototype.point.call(this,e,t)};function HR(t){this._context=t}HR.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 kF(t){return new ah(t)}function EF(t){return new FR(t)}function WR(t){this._context=t}WR.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=hA(t),i=hA(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 hA(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 OF(t){return new WR(t)}function bp(t,e){this._context=t,this._t=e}bp.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 AF(t){return new bp(t,.5)}function TF(t){return new bp(t,0)}function CF(t){return new bp(t,1)}function Ks(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 yx(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function jF(t,e){return t[e]}function NF(t){const e=[];return e.key=t,e}function PF(){var t=Tt([]),e=yx,r=Ks,n=jF;function i(a){var o=Array.from(t.apply(this,arguments),NF),c,u=o.length,d=-1,p;for(const f of a)for(c=0,++d;c<u;++c)(o[c][d]=[0,+n(f,o[c].key,d,a)]).data=f;for(c=0,p=h1(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?yx:typeof a=="function"?a:Tt(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??Ks,i):r},i}function RF(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}Ks(t,e)}}function IF(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}Ks(t,e)}}function $F(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]],f=p[n][1]||0,y=p[n-1][1]||0,v=(f-y)/2,x=0;x<c;++x){var w=t[e[x]],b=w[n][1]||0,S=w[n-1][1]||0;v+=b-S}u+=f,d+=v*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=d/u)}i[n-1][1]+=i[n-1][0]=r,Ks(t,e)}}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)}var MF=["type","size","sizeType"];function vx(){return vx=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},vx.apply(this,arguments)}function pA(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 mA(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pA(Object(r),!0).forEach(function(n){LF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function LF(t,e,r){return e=DF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function DF(t){var e=zF(t,"string");return Xc(e)=="symbol"?e:e+""}function zF(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(e==="string"?String:Number)(t)}function BF(t,e){if(t==null)return{};var r=UF(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 UF(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 GR={symbolCircle:p1,symbolCross:lF,symbolDiamond:uF,symbolSquare:dF,symbolStar:mF,symbolTriangle:gF,symbolWye:vF},qF=Math.PI/180,FF=function(e){var r="symbol".concat(gp(e));return GR[r]||p1},HF=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*qF;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}},WF=function(e,r){GR["symbol".concat(gp(e))]=r},m1=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=BF(e,MF),d=mA(mA({},u),{},{type:n,size:a,sizeType:c}),p=function(){var b=FF(n),S=bF().type(b).size(HF(a,c,n));return S()},f=d.className,y=d.cx,v=d.cy,x=at(d,!0);return y===+y&&v===+v&&a===+a?L.createElement("path",vx({},x,{className:ot("recharts-symbols",f),transform:"translate(".concat(y,", ").concat(v,")"),d:p()})):null};m1.registerSymbol=WF;function Vs(t){"@babel/helpers - typeof";return Vs=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},Vs(t)}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 gA(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 GF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gA(Object(r),!0).forEach(function(n){Yc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function VF(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,VR(n.key),n)}}function XF(t,e,r){return e&&VF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function YF(t,e,r){return e=oh(e),JF(t,KR()?Reflect.construct(e,r||[],oh(t).constructor):e.apply(t,r))}function JF(t,e){if(e&&(Vs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZF(t)}function ZF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KR=function(){return!!t})()}function oh(t){return oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},oh(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&&xx(t,e)}function xx(t,e){return xx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},xx(t,e)}function Yc(t,e,r){return e=VR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VR(t){var e=e7(t,"string");return Vs(e)=="symbol"?e:e+""}function e7(t,e){if(Vs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var En=32,g1=(function(t){function e(){return KF(this,e),YF(this,e,arguments)}return QF(e,t),XF(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=En/2,o=En/6,c=En/3,u=n.inactive?i:n.color;if(n.type==="plainline")return L.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:En,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return L.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(a,"h").concat(c,`
447
+ */var WO;function x9(){if(WO)return pt;WO=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"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),x;x=Symbol.for("react.module.reference");function w(b){if(typeof b=="object"&&b!==null){var S=b.$$typeof;switch(S){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 y:case f:case a:return b;default:return S}}case e:return S}}}return pt.ContextConsumer=o,pt.ContextProvider=a,pt.Element=t,pt.ForwardRef=u,pt.Fragment=r,pt.Lazy=y,pt.Memo=f,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 w(b)===o},pt.isContextProvider=function(b){return w(b)===a},pt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},pt.isForwardRef=function(b){return w(b)===u},pt.isFragment=function(b){return w(b)===r},pt.isLazy=function(b){return w(b)===y},pt.isMemo=function(b){return w(b)===f},pt.isPortal=function(b){return w(b)===e},pt.isProfiler=function(b){return w(b)===i},pt.isStrictMode=function(b){return w(b)===n},pt.isSuspense=function(b){return w(b)===d},pt.isSuspenseList=function(b){return w(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===y||b.$$typeof===f||b.$$typeof===a||b.$$typeof===o||b.$$typeof===u||b.$$typeof===x||b.getModuleId!==void 0)},pt.typeOf=w,pt}var GO;function w9(){return GO||(GO=1,Dy.exports=x9()),Dy.exports}var _9=w9(),zy,KO;function TR(){if(KO)return zy;KO=1;var t=ra(),e=na(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return zy=n,zy}var By,VO;function S9(){if(VO)return By;VO=1;var t=TR();function e(r){return t(r)&&r!=+r}return By=e,By}var k9=S9();const Lu=vt(k9);var E9=TR();const O9=vt(E9);var Jn=function(e){return e===0?0:e>0?1:-1},Eo=function(e){return Ro(e)&&e.indexOf("%")===e.length-1},ge=function(e){return O9(e)&&!Lu(e)},A9=function(e){return tt(e)},or=function(e){return ge(e)||Ro(e)},T9=0,Du=function(e){var r=++T9;return"".concat(e||"").concat(r)},Io=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)&&!Ro(e))return n;var a;if(Eo(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Lu(a)&&(a=n),i&&a>r&&(a=r),a},Pa=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},C9=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 Zf(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):Tn(n,e))===r})}var j9=function(e,r){return ge(e)&&ge(r)?e-r:Ro(e)&&Ro(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Bs(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 lx(t){"@babel/helpers - typeof";return lx=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},lx(t)}var N9=["viewBox","children"],P9=["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"],XO=["points","pathLength"],Uy={svg:N9,polygon:XO,polyline:XO},u1=["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"],Qf=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(j.isValidElement(e)&&(n=e.props),!Sl(n))return null;var i={};return Object.keys(n).forEach(function(a){u1.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},R9=function(e,r,n){return function(i){return e(r,n,i),null}},eh=function(e,r,n){if(!Sl(e)||lx(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];u1.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=R9(o,r,n))}),i},I9=["children"],$9=["children"];function YO(t,e){if(t==null)return{};var r=M9(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 M9(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 cx(t){"@babel/helpers - typeof";return cx=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},cx(t)}var JO={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,qy=null,d1=function t(e){if(e===ZO&&Array.isArray(qy))return qy;var r=[];return j.Children.forEach(e,function(n){tt(n)||(_9.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),qy=r,ZO=e,r};function Cn(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return Gi(i)}):n=[Gi(e)],d1(t).forEach(function(i){var a=Tn(i,"type.displayName")||Tn(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function sn(t,e){var r=Cn(t,e);return r&&r[0]}var QO=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)},L9=["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"],D9=function(e){return e&&e.type&&Ro(e.type)&&L9.indexOf(e.type)>=0},z9=function(e){return e&&cx(e)==="object"&&"clipDot"in e},B9=function(e,r,n,i){var a,o=(a=Uy==null?void 0:Uy[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Je(e)&&(i&&o.includes(r)||P9.includes(r))||n&&u1.includes(r)},at=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(j.isValidElement(e)&&(i=e.props),!Sl(i))return null;var a={};return Object.keys(i).forEach(function(o){var c;B9((c=i)===null||c===void 0?void 0:c[o],o,r,n)&&(a[o]=i[o])}),a},ux=function t(e,r){if(e===r)return!0;var n=j.Children.count(e);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return eA(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(!eA(a,o))return!1}return!0},eA=function(e,r){if(tt(e)&&tt(r))return!0;if(!tt(e)&&!tt(r)){var n=e.props||{},i=n.children,a=YO(n,I9),o=r.props||{},c=o.children,u=YO(o,$9);return i&&c?Bs(a,u)&&ux(i,c):!i&&!c?Bs(a,u):!1}return!1},tA=function(e,r){var n=[],i={};return d1(e).forEach(function(a,o){if(D9(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 f=d(a,c,o);n.push(f),i[c]=!0}}}),n},U9=function(e){var r=e&&e.type;return r&&JO[r]?JO[r]:null},q9=function(e,r){return d1(r).indexOf(e)},F9=["children","width","height","viewBox","className","style","title","desc"];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 H9(t,e){if(t==null)return{};var r=W9(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 W9(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 fx(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=H9(t,F9),p=i||{width:r,height:n,x:0,y:0},f=ot("recharts-surface",a);return L.createElement("svg",dx({},at(d,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),L.createElement("title",null,c),L.createElement("desc",null,u),e)}var G9=["children","className"];function hx(){return hx=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},hx.apply(this,arguments)}function K9(t,e){if(t==null)return{};var r=V9(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 V9(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=L.forwardRef(function(t,e){var r=t.children,n=t.className,i=K9(t,G9),a=ot("recharts-layer",n);return L.createElement("g",hx({className:a},at(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]},Fy,rA;function X9(){if(rA)return Fy;rA=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 Fy=t,Fy}var Hy,nA;function Y9(){if(nA)return Hy;nA=1;var t=X9();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 Hy=e,Hy}var Wy,iA;function CR(){if(iA)return Wy;iA=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 Wy=u,Wy}var Gy,aA;function J9(){if(aA)return Gy;aA=1;function t(e){return e.split("")}return Gy=t,Gy}var Ky,oA;function Z9(){if(oA)return Ky;oA=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+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",x=d+"?",w="["+a+"]?",b="(?:"+v+"(?:"+[p,f,y].join("|")+")"+w+x+")*",S=w+x+b,A="(?:"+[p+c+"?",c,f,y,o].join("|")+")",O=RegExp(u+"(?="+u+")|"+A+S,"g");function C(E){return E.match(O)||[]}return Ky=C,Ky}var Vy,sA;function Q9(){if(sA)return Vy;sA=1;var t=J9(),e=CR(),r=Z9();function n(i){return e(i)?r(i):t(i)}return Vy=n,Vy}var Xy,lA;function eF(){if(lA)return Xy;lA=1;var t=Y9(),e=CR(),r=Q9(),n=ER();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 Xy=i,Xy}var Yy,cA;function tF(){if(cA)return Yy;cA=1;var t=eF(),e=t("toUpperCase");return Yy=e,Yy}var rF=tF();const gp=vt(rF);function Tt(t){return function(){return t}}const jR=Math.cos,th=Math.sin,ri=Math.sqrt,rh=Math.PI,yp=2*rh,px=Math.PI,mx=2*px,wo=1e-6,nF=mx-wo;function NR(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function iF(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return NR;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 aF{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?NR:iF(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,f=c-r,y=p*p+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(y>wo)if(!(Math.abs(f*u-d*p)>wo)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let v=n-o,x=i-c,w=u*u+d*d,b=v*v+x*x,S=Math.sqrt(w),A=Math.sqrt(y),O=a*Math.tan((px-Math.acos((w+y-b)/(2*S*A)))/2),C=O/A,E=O/S;Math.abs(C-1)>wo&&this._append`L${e+C*p},${r+C*f}`,this._append`A${a},${a},0,0,${+(f*v>p*x)},${this._x1=e+E*u},${this._y1=r+E*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,f=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${d},${p}`:(Math.abs(this._x1-d)>wo||Math.abs(this._y1-p)>wo)&&this._append`L${d},${p}`,n&&(y<0&&(y=y%mx+mx),y>nF?this._append`A${n},${n},0,1,${f},${e-c},${r-u}A${n},${n},0,1,${f},${this._x1=d},${this._y1=p}`:y>wo&&this._append`A${n},${n},0,${+(y>=px)},${f},${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 f1(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 aF(e)}function h1(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function PR(t){this._context=t}PR.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 vp(t){return new PR(t)}function RR(t){return t[0]}function IR(t){return t[1]}function $R(t,e){var r=Tt(!0),n=null,i=vp,a=null,o=f1(c);t=typeof t=="function"?t:t===void 0?RR:Tt(t),e=typeof e=="function"?e:e===void 0?IR:Tt(e);function c(u){var d,p=(u=h1(u)).length,f,y=!1,v;for(n==null&&(a=i(v=o())),d=0;d<=p;++d)!(d<p&&r(f=u[d],d,u))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+t(f,d,u),+e(f,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 gf(t,e,r){var n=null,i=Tt(!0),a=null,o=vp,c=null,u=f1(d);t=typeof t=="function"?t:t===void 0?RR:Tt(+t),e=typeof e=="function"?e:Tt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?IR:Tt(+r);function d(f){var y,v,x,w=(f=h1(f)).length,b,S=!1,A,O=new Array(w),C=new Array(w);for(a==null&&(c=o(A=u())),y=0;y<=w;++y){if(!(y<w&&i(b=f[y],y,f))===S)if(S=!S)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),x=y-1;x>=v;--x)c.point(O[x],C[x]);c.lineEnd(),c.areaEnd()}S&&(O[y]=+t(b,y,f),C[y]=+e(b,y,f),c.point(n?+n(b,y,f):O[y],r?+r(b,y,f):C[y]))}if(A)return c=null,A+""||null}function p(){return $R().defined(i).curve(o).context(a)}return d.x=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),n=null,d):t},d.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),d):t},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Tt(+f),d):n},d.y=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),r=null,d):e},d.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),d):e},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Tt(+f),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(f){return arguments.length?(i=typeof f=="function"?f:Tt(!!f),d):i},d.curve=function(f){return arguments.length?(o=f,a!=null&&(c=o(a)),d):o},d.context=function(f){return arguments.length?(f==null?a=c=null:c=o(a=f),d):a},d}class MR{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 oF(t){return new MR(t,!0)}function sF(t){return new MR(t,!1)}const p1={draw(t,e){const r=ri(e/rh);t.moveTo(r,0),t.arc(0,0,r,0,yp)}},lF={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()}},LR=ri(1/3),cF=LR*2,uF={draw(t,e){const r=ri(e/cF),n=r*LR;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},dF={draw(t,e){const r=ri(e),n=-r/2;t.rect(n,n,r,r)}},fF=.8908130915292852,DR=th(rh/10)/th(7*rh/10),hF=th(yp/10)*DR,pF=-jR(yp/10)*DR,mF={draw(t,e){const r=ri(e*fF),n=hF*r,i=pF*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=yp*a/5,c=jR(o),u=th(o);t.lineTo(u*r,-c*r),t.lineTo(c*n-u*i,u*n+c*i)}t.closePath()}},Jy=ri(3),gF={draw(t,e){const r=-ri(e/(Jy*3));t.moveTo(0,r*2),t.lineTo(-Jy*r,-r),t.lineTo(Jy*r,-r),t.closePath()}},Sn=-.5,kn=ri(3)/2,gx=1/ri(12),yF=(gx/2+1)*3,vF={draw(t,e){const r=ri(e/yF),n=r/2,i=r*gx,a=n,o=r*gx+r,c=-a,u=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(c,u),t.lineTo(Sn*n-kn*i,kn*n+Sn*i),t.lineTo(Sn*a-kn*o,kn*a+Sn*o),t.lineTo(Sn*c-kn*u,kn*c+Sn*u),t.lineTo(Sn*n+kn*i,Sn*i-kn*n),t.lineTo(Sn*a+kn*o,Sn*o-kn*a),t.lineTo(Sn*c+kn*u,Sn*u-kn*c),t.closePath()}};function bF(t,e){let r=null,n=f1(i);t=typeof t=="function"?t:Tt(t||p1),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 nh(){}function ih(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 zR(t){this._context=t}zR.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:ih(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:ih(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function xF(t){return new zR(t)}function BR(t){this._context=t}BR.prototype={areaStart:nh,areaEnd:nh,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:ih(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function wF(t){return new BR(t)}function UR(t){this._context=t}UR.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:ih(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function _F(t){return new UR(t)}function qR(t){this._context=t}qR.prototype={areaStart:nh,areaEnd:nh,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 SF(t){return new qR(t)}function uA(t){return t<0?-1:1}function dA(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(uA(a)+uA(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function fA(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Zy(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 ah(t){this._context=t}ah.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:Zy(this,this._t0,fA(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,Zy(this,fA(this,r=dA(this,t,e)),r);break;default:Zy(this,this._t0,r=dA(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function FR(t){this._context=new HR(t)}(FR.prototype=Object.create(ah.prototype)).point=function(t,e){ah.prototype.point.call(this,e,t)};function HR(t){this._context=t}HR.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 kF(t){return new ah(t)}function EF(t){return new FR(t)}function WR(t){this._context=t}WR.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=hA(t),i=hA(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 hA(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 OF(t){return new WR(t)}function bp(t,e){this._context=t,this._t=e}bp.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 AF(t){return new bp(t,.5)}function TF(t){return new bp(t,0)}function CF(t){return new bp(t,1)}function Ks(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 yx(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function jF(t,e){return t[e]}function NF(t){const e=[];return e.key=t,e}function PF(){var t=Tt([]),e=yx,r=Ks,n=jF;function i(a){var o=Array.from(t.apply(this,arguments),NF),c,u=o.length,d=-1,p;for(const f of a)for(c=0,++d;c<u;++c)(o[c][d]=[0,+n(f,o[c].key,d,a)]).data=f;for(c=0,p=h1(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?yx:typeof a=="function"?a:Tt(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??Ks,i):r},i}function RF(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}Ks(t,e)}}function IF(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}Ks(t,e)}}function $F(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]],f=p[n][1]||0,y=p[n-1][1]||0,v=(f-y)/2,x=0;x<c;++x){var w=t[e[x]],b=w[n][1]||0,S=w[n-1][1]||0;v+=b-S}u+=f,d+=v*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=d/u)}i[n-1][1]+=i[n-1][0]=r,Ks(t,e)}}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)}var MF=["type","size","sizeType"];function vx(){return vx=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},vx.apply(this,arguments)}function pA(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 mA(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pA(Object(r),!0).forEach(function(n){LF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function LF(t,e,r){return e=DF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function DF(t){var e=zF(t,"string");return Xc(e)=="symbol"?e:e+""}function zF(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(e==="string"?String:Number)(t)}function BF(t,e){if(t==null)return{};var r=UF(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 UF(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 GR={symbolCircle:p1,symbolCross:lF,symbolDiamond:uF,symbolSquare:dF,symbolStar:mF,symbolTriangle:gF,symbolWye:vF},qF=Math.PI/180,FF=function(e){var r="symbol".concat(gp(e));return GR[r]||p1},HF=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*qF;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}},WF=function(e,r){GR["symbol".concat(gp(e))]=r},m1=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=BF(e,MF),d=mA(mA({},u),{},{type:n,size:a,sizeType:c}),p=function(){var b=FF(n),S=bF().type(b).size(HF(a,c,n));return S()},f=d.className,y=d.cx,v=d.cy,x=at(d,!0);return y===+y&&v===+v&&a===+a?L.createElement("path",vx({},x,{className:ot("recharts-symbols",f),transform:"translate(".concat(y,", ").concat(v,")"),d:p()})):null};m1.registerSymbol=WF;function Vs(t){"@babel/helpers - typeof";return Vs=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},Vs(t)}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 gA(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 GF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gA(Object(r),!0).forEach(function(n){Yc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function VF(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,VR(n.key),n)}}function XF(t,e,r){return e&&VF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function YF(t,e,r){return e=oh(e),JF(t,KR()?Reflect.construct(e,r||[],oh(t).constructor):e.apply(t,r))}function JF(t,e){if(e&&(Vs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZF(t)}function ZF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KR=function(){return!!t})()}function oh(t){return oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},oh(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&&xx(t,e)}function xx(t,e){return xx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},xx(t,e)}function Yc(t,e,r){return e=VR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VR(t){var e=e7(t,"string");return Vs(e)=="symbol"?e:e+""}function e7(t,e){if(Vs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var En=32,g1=(function(t){function e(){return KF(this,e),YF(this,e,arguments)}return QF(e,t),XF(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=En/2,o=En/6,c=En/3,u=n.inactive?i:n.color;if(n.type==="plainline")return L.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:En,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return L.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(a,"h").concat(c,`
448
448
  A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(a,`
449
449
  H`).concat(En,"M").concat(2*c,",").concat(a,`
450
450
  A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return L.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(En/8,"h").concat(En,"v").concat(En*3/4,"h").concat(-En,"z"),className:"recharts-legend-icon"});if(L.isValidElement(n.legendIcon)){var d=GF({},n);return delete d.legendIcon,L.cloneElement(n.legendIcon,d)}return L.createElement(m1,{fill:u,cx:a,cy:a,size:En,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:En,height:En},f={display:c==="horizontal"?"inline-block":"block",marginRight:10},y={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(v,x){var w=v.formatter||u,b=ot(Yc(Yc({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",v.inactive));if(v.type==="none")return null;var S=Je(v.value)?null:v.value;Ki(!Je(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 A=v.inactive?d:v.color;return L.createElement("li",bx({className:b,style:f,key:"legend-item-".concat(x)},eh(n.props,v,x)),L.createElement(fx,{width:o,height:o,viewBox:p,style:y},n.renderIcon(v)),L.createElement("span",{className:"recharts-legend-item-text",style:{color:A}},w?w(S,v,x):S))})}},{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 L.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(j.PureComponent);Yc(g1,"displayName","Legend");Yc(g1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Qy,yA;function t7(){if(yA)return Qy;yA=1;var t=hp();function e(){this.__data__=new t,this.size=0}return Qy=e,Qy}var ev,vA;function r7(){if(vA)return ev;vA=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return ev=t,ev}var tv,bA;function n7(){if(bA)return tv;bA=1;function t(e){return this.__data__.get(e)}return tv=t,tv}var rv,xA;function i7(){if(xA)return rv;xA=1;function t(e){return this.__data__.has(e)}return rv=t,rv}var nv,wA;function a7(){if(wA)return nv;wA=1;var t=hp(),e=o1(),r=s1(),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 nv=i,nv}var iv,_A;function XR(){if(_A)return iv;_A=1;var t=hp(),e=t7(),r=r7(),n=n7(),i=i7(),a=a7();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,iv=o,iv}var av,SA;function o7(){if(SA)return av;SA=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return av=e,av}var ov,kA;function s7(){if(kA)return ov;kA=1;function t(e){return this.__data__.has(e)}return ov=t,ov}var sv,EA;function YR(){if(EA)return sv;EA=1;var t=s1(),e=o7(),r=s7();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,sv=n,sv}var lv,OA;function JR(){if(OA)return lv;OA=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 lv=t,lv}var cv,AA;function ZR(){if(AA)return cv;AA=1;function t(e,r){return e.has(r)}return cv=t,cv}var uv,TA;function QR(){if(TA)return uv;TA=1;var t=YR(),e=JR(),r=ZR(),n=1,i=2;function a(o,c,u,d,p,f){var y=u&n,v=o.length,x=c.length;if(v!=x&&!(y&&x>v))return!1;var w=f.get(o),b=f.get(c);if(w&&b)return w==c&&b==o;var S=-1,A=!0,O=u&i?new t:void 0;for(f.set(o,c),f.set(c,o);++S<v;){var C=o[S],E=c[S];if(d)var T=y?d(E,C,S,c,o,f):d(C,E,S,o,c,f);if(T!==void 0){if(T)continue;A=!1;break}if(O){if(!e(c,function(N,R){if(!r(O,R)&&(C===N||p(C,N,u,d,f)))return O.push(R)})){A=!1;break}}else if(!(C===E||p(C,E,u,d,f))){A=!1;break}}return f.delete(o),f.delete(c),A}return uv=a,uv}var dv,CA;function l7(){if(CA)return dv;CA=1;var t=Oi(),e=t.Uint8Array;return dv=e,dv}var fv,jA;function c7(){if(jA)return fv;jA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,a){n[++r]=[a,i]}),n}return fv=t,fv}var hv,NA;function y1(){if(NA)return hv;NA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return hv=t,hv}var pv,PA;function u7(){if(PA)return pv;PA=1;var t=Mu(),e=l7(),r=a1(),n=QR(),i=c7(),a=y1(),o=1,c=2,u="[object Boolean]",d="[object Date]",p="[object Error]",f="[object Map]",y="[object Number]",v="[object RegExp]",x="[object Set]",w="[object String]",b="[object Symbol]",S="[object ArrayBuffer]",A="[object DataView]",O=t?t.prototype:void 0,C=O?O.valueOf:void 0;function E(T,N,R,I,K,B,U){switch(R){case A:if(T.byteLength!=N.byteLength||T.byteOffset!=N.byteOffset)return!1;T=T.buffer,N=N.buffer;case S:return!(T.byteLength!=N.byteLength||!B(new e(T),new e(N)));case u:case d:case y:return r(+T,+N);case p:return T.name==N.name&&T.message==N.message;case v:case w:return T==N+"";case f:var V=i;case x:var H=I&o;if(V||(V=a),T.size!=N.size&&!H)return!1;var Y=U.get(T);if(Y)return Y==N;I|=c,U.set(T,N);var G=n(V(T),V(N),I,K,B,U);return U.delete(T),G;case b:if(C)return C.call(T)==C.call(N)}return!1}return pv=E,pv}var mv,RA;function eI(){if(RA)return mv;RA=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 mv=t,mv}var gv,IA;function d7(){if(IA)return gv;IA=1;var t=eI(),e=Qr();function r(n,i,a){var o=i(n);return e(n)?o:t(o,a(n))}return gv=r,gv}var yv,$A;function f7(){if($A)return yv;$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 yv=t,yv}var vv,MA;function h7(){if(MA)return vv;MA=1;function t(){return[]}return vv=t,vv}var bv,LA;function p7(){if(LA)return bv;LA=1;var t=f7(),e=h7(),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 bv=a,bv}var xv,DA;function m7(){if(DA)return xv;DA=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return xv=t,xv}var wv,zA;function g7(){if(zA)return wv;zA=1;var t=ra(),e=na(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return wv=n,wv}var _v,BA;function v1(){if(BA)return _v;BA=1;var t=g7(),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 _v=a,_v}var jc={exports:{}},Sv,UA;function y7(){if(UA)return Sv;UA=1;function t(){return!1}return Sv=t,Sv}jc.exports;var qA;function tI(){return qA||(qA=1,(function(t,e){var r=Oi(),n=y7(),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})(jc,jc.exports)),jc.exports}var kv,FA;function b1(){if(FA)return kv;FA=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 kv=r,kv}var Ev,HA;function x1(){if(HA)return Ev;HA=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Ev=e,Ev}var Ov,WA;function v7(){if(WA)return Ov;WA=1;var t=ra(),e=x1(),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]",f="[object Object]",y="[object RegExp]",v="[object Set]",x="[object String]",w="[object WeakMap]",b="[object ArrayBuffer]",S="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",C="[object Int8Array]",E="[object Int16Array]",T="[object Int32Array]",N="[object Uint8Array]",R="[object Uint8ClampedArray]",I="[object Uint16Array]",K="[object Uint32Array]",B={};B[A]=B[O]=B[C]=B[E]=B[T]=B[N]=B[R]=B[I]=B[K]=!0,B[n]=B[i]=B[b]=B[a]=B[S]=B[o]=B[c]=B[u]=B[d]=B[p]=B[f]=B[y]=B[v]=B[x]=B[w]=!1;function U(V){return r(V)&&e(V.length)&&!!B[t(V)]}return Ov=U,Ov}var Av,GA;function rI(){if(GA)return Av;GA=1;function t(e){return function(r){return e(r)}}return Av=t,Av}var Nc={exports:{}};Nc.exports;var KA;function b7(){return KA||(KA=1,(function(t,e){var r=_R(),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})(Nc,Nc.exports)),Nc.exports}var Tv,VA;function nI(){if(VA)return Tv;VA=1;var t=v7(),e=rI(),r=b7(),n=r&&r.isTypedArray,i=n?e(n):t;return Tv=i,Tv}var Cv,XA;function x7(){if(XA)return Cv;XA=1;var t=m7(),e=v1(),r=Qr(),n=tI(),i=b1(),a=nI(),o=Object.prototype,c=o.hasOwnProperty;function u(d,p){var f=r(d),y=!f&&e(d),v=!f&&!y&&n(d),x=!f&&!y&&!v&&a(d),w=f||y||v||x,b=w?t(d.length,String):[],S=b.length;for(var A in d)(p||c.call(d,A))&&!(w&&(A=="length"||v&&(A=="offset"||A=="parent")||x&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||i(A,S)))&&b.push(A);return b}return Cv=u,Cv}var jv,YA;function w7(){if(YA)return jv;YA=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return jv=e,jv}var Nv,JA;function iI(){if(JA)return Nv;JA=1;function t(e,r){return function(n){return e(r(n))}}return Nv=t,Nv}var Pv,ZA;function _7(){if(ZA)return Pv;ZA=1;var t=iI(),e=t(Object.keys,Object);return Pv=e,Pv}var Rv,QA;function S7(){if(QA)return Rv;QA=1;var t=w7(),e=_7(),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 Rv=i,Rv}var Iv,eT;function zu(){if(eT)return Iv;eT=1;var t=i1(),e=x1();function r(n){return n!=null&&e(n.length)&&!t(n)}return Iv=r,Iv}var $v,tT;function xp(){if(tT)return $v;tT=1;var t=x7(),e=S7(),r=zu();function n(i){return r(i)?t(i):e(i)}return $v=n,$v}var Mv,rT;function k7(){if(rT)return Mv;rT=1;var t=d7(),e=p7(),r=xp();function n(i){return t(i,r,e)}return Mv=n,Mv}var Lv,nT;function E7(){if(nT)return Lv;nT=1;var t=k7(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,c,u,d,p){var f=c&e,y=t(a),v=y.length,x=t(o),w=x.length;if(v!=w&&!f)return!1;for(var b=v;b--;){var S=y[b];if(!(f?S in o:n.call(o,S)))return!1}var A=p.get(a),O=p.get(o);if(A&&O)return A==o&&O==a;var C=!0;p.set(a,o),p.set(o,a);for(var E=f;++b<v;){S=y[b];var T=a[S],N=o[S];if(u)var R=f?u(N,T,S,o,a,p):u(T,N,S,a,o,p);if(!(R===void 0?T===N||d(T,N,c,u,p):R)){C=!1;break}E||(E=S=="constructor")}if(C&&!E){var I=a.constructor,K=o.constructor;I!=K&&"constructor"in a&&"constructor"in o&&!(typeof I=="function"&&I instanceof I&&typeof K=="function"&&K instanceof K)&&(C=!1)}return p.delete(a),p.delete(o),C}return Lv=i,Lv}var Dv,iT;function O7(){if(iT)return Dv;iT=1;var t=Uo(),e=Oi(),r=t(e,"DataView");return Dv=r,Dv}var zv,aT;function A7(){if(aT)return zv;aT=1;var t=Uo(),e=Oi(),r=t(e,"Promise");return zv=r,zv}var Bv,oT;function aI(){if(oT)return Bv;oT=1;var t=Uo(),e=Oi(),r=t(e,"Set");return Bv=r,Bv}var Uv,sT;function T7(){if(sT)return Uv;sT=1;var t=Uo(),e=Oi(),r=t(e,"WeakMap");return Uv=r,Uv}var qv,lT;function C7(){if(lT)return qv;lT=1;var t=O7(),e=o1(),r=A7(),n=aI(),i=T7(),a=ra(),o=SR(),c="[object Map]",u="[object Object]",d="[object Promise]",p="[object Set]",f="[object WeakMap]",y="[object DataView]",v=o(t),x=o(e),w=o(r),b=o(n),S=o(i),A=a;return(t&&A(new t(new ArrayBuffer(1)))!=y||e&&A(new e)!=c||r&&A(r.resolve())!=d||n&&A(new n)!=p||i&&A(new i)!=f)&&(A=function(O){var C=a(O),E=C==u?O.constructor:void 0,T=E?o(E):"";if(T)switch(T){case v:return y;case x:return c;case w:return d;case b:return p;case S:return f}return C}),qv=A,qv}var Fv,cT;function j7(){if(cT)return Fv;cT=1;var t=XR(),e=QR(),r=u7(),n=E7(),i=C7(),a=Qr(),o=tI(),c=nI(),u=1,d="[object Arguments]",p="[object Array]",f="[object Object]",y=Object.prototype,v=y.hasOwnProperty;function x(w,b,S,A,O,C){var E=a(w),T=a(b),N=E?p:i(w),R=T?p:i(b);N=N==d?f:N,R=R==d?f:R;var I=N==f,K=R==f,B=N==R;if(B&&o(w)){if(!o(b))return!1;E=!0,I=!1}if(B&&!I)return C||(C=new t),E||c(w)?e(w,b,S,A,O,C):r(w,b,N,S,A,O,C);if(!(S&u)){var U=I&&v.call(w,"__wrapped__"),V=K&&v.call(b,"__wrapped__");if(U||V){var H=U?w.value():w,Y=V?b.value():b;return C||(C=new t),O(H,Y,S,A,C)}}return B?(C||(C=new t),n(w,b,S,A,O,C)):!1}return Fv=x,Fv}var Hv,uT;function w1(){if(uT)return Hv;uT=1;var t=j7(),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 Hv=r,Hv}var Wv,dT;function N7(){if(dT)return Wv;dT=1;var t=XR(),e=w1(),r=1,n=2;function i(a,o,c,u){var d=c.length,p=d,f=!u;if(a==null)return!p;for(a=Object(a);d--;){var y=c[d];if(f&&y[2]?y[1]!==a[y[0]]:!(y[0]in a))return!1}for(;++d<p;){y=c[d];var v=y[0],x=a[v],w=y[1];if(f&&y[2]){if(x===void 0&&!(v in a))return!1}else{var b=new t;if(u)var S=u(x,w,v,a,o,b);if(!(S===void 0?e(w,x,r|n,u,b):S))return!1}}return!0}return Wv=i,Wv}var Gv,fT;function oI(){if(fT)return Gv;fT=1;var t=Ha();function e(r){return r===r&&!t(r)}return Gv=e,Gv}var Kv,hT;function P7(){if(hT)return Kv;hT=1;var t=oI(),e=xp();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 Kv=r,Kv}var Vv,pT;function sI(){if(pT)return Vv;pT=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return Vv=t,Vv}var Xv,mT;function R7(){if(mT)return Xv;mT=1;var t=N7(),e=P7(),r=sI();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 Xv=n,Xv}var Yv,gT;function I7(){if(gT)return Yv;gT=1;function t(e,r){return e!=null&&r in Object(e)}return Yv=t,Yv}var Jv,yT;function $7(){if(yT)return Jv;yT=1;var t=OR(),e=v1(),r=Qr(),n=b1(),i=x1(),a=mp();function o(c,u,d){u=t(u,c);for(var p=-1,f=u.length,y=!1;++p<f;){var v=a(u[p]);if(!(y=c!=null&&d(c,v)))break;c=c[v]}return y||++p!=f?y:(f=c==null?0:c.length,!!f&&i(f)&&n(v,f)&&(r(c)||e(c)))}return Jv=o,Jv}var Zv,vT;function M7(){if(vT)return Zv;vT=1;var t=I7(),e=$7();function r(n,i){return n!=null&&e(n,i,t)}return Zv=r,Zv}var Qv,bT;function L7(){if(bT)return Qv;bT=1;var t=w1(),e=AR(),r=M7(),n=n1(),i=oI(),a=sI(),o=mp(),c=1,u=2;function d(p,f){return n(p)&&i(f)?a(o(p),f):function(y){var v=e(y,p);return v===void 0&&v===f?r(y,p):t(f,v,c|u)}}return Qv=d,Qv}var e0,xT;function kl(){if(xT)return e0;xT=1;function t(e){return e}return e0=t,e0}var t0,wT;function D7(){if(wT)return t0;wT=1;function t(e){return function(r){return r==null?void 0:r[e]}}return t0=t,t0}var r0,_T;function z7(){if(_T)return r0;_T=1;var t=c1();function e(r){return function(n){return t(n,r)}}return r0=e,r0}var n0,ST;function B7(){if(ST)return n0;ST=1;var t=D7(),e=z7(),r=n1(),n=mp();function i(a){return r(a)?t(n(a)):e(a)}return n0=i,n0}var i0,kT;function Wa(){if(kT)return i0;kT=1;var t=R7(),e=L7(),r=kl(),n=Qr(),i=B7();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 i0=a,i0}var a0,ET;function lI(){if(ET)return a0;ET=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 a0=t,a0}var o0,OT;function U7(){if(OT)return o0;OT=1;function t(e){return e!==e}return o0=t,o0}var s0,AT;function q7(){if(AT)return s0;AT=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 s0=t,s0}var l0,TT;function F7(){if(TT)return l0;TT=1;var t=lI(),e=U7(),r=q7();function n(i,a,o){return a===a?r(i,a,o):t(i,e,o)}return l0=n,l0}var c0,CT;function H7(){if(CT)return c0;CT=1;var t=F7();function e(r,n){var i=r==null?0:r.length;return!!i&&t(r,n,0)>-1}return c0=e,c0}var u0,jT;function W7(){if(jT)return u0;jT=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 u0=t,u0}var d0,NT;function G7(){if(NT)return d0;NT=1;function t(){}return d0=t,d0}var f0,PT;function K7(){if(PT)return f0;PT=1;var t=aI(),e=G7(),r=y1(),n=1/0,i=t&&1/r(new t([,-0]))[1]==n?function(a){return new t(a)}:e;return f0=i,f0}var h0,RT;function V7(){if(RT)return h0;RT=1;var t=YR(),e=H7(),r=W7(),n=ZR(),i=K7(),a=y1(),o=200;function c(u,d,p){var f=-1,y=e,v=u.length,x=!0,w=[],b=w;if(p)x=!1,y=r;else if(v>=o){var S=d?null:i(u);if(S)return a(S);x=!1,y=n,b=new t}else b=d?[]:w;e:for(;++f<v;){var A=u[f],O=d?d(A):A;if(A=p||A!==0?A:0,x&&O===O){for(var C=b.length;C--;)if(b[C]===O)continue e;d&&b.push(O),w.push(A)}else y(b,O,p)||(b!==w&&b.push(O),w.push(A))}return w}return h0=c,h0}var p0,IT;function X7(){if(IT)return p0;IT=1;var t=Wa(),e=V7();function r(n,i){return n&&n.length?e(n,t(i,2)):[]}return p0=r,p0}var Y7=X7();const $T=vt(Y7);function cI(t,e,r){return e===!0?$T(t,r):Je(e)?$T(t,e):t}function Xs(t){"@babel/helpers - typeof";return Xs=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},Xs(t)}var J7=["ref"];function MT(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 zi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?MT(Object(r),!0).forEach(function(n){wp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):MT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Z7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function LT(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,dI(n.key),n)}}function Q7(t,e,r){return e&&LT(t.prototype,e),r&&LT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function eH(t,e,r){return e=sh(e),tH(t,uI()?Reflect.construct(e,r||[],sh(t).constructor):e.apply(t,r))}function tH(t,e){if(e&&(Xs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rH(t)}function rH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uI=function(){return!!t})()}function sh(t){return sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sh(t)}function nH(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&&wx(t,e)}function wx(t,e){return wx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},wx(t,e)}function wp(t,e,r){return e=dI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dI(t){var e=iH(t,"string");return Xs(e)=="symbol"?e:e+""}function iH(t,e){if(Xs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Xs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function aH(t,e){if(t==null)return{};var r=oH(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 oH(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 sH(t){return t.value}function lH(t,e){if(L.isValidElement(t))return L.cloneElement(t,e);if(typeof t=="function")return L.createElement(t,e);e.ref;var r=aH(e,J7);return L.createElement(g1,r)}var DT=1,Us=(function(t){function e(){var r;Z7(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=eH(this,e,[].concat(i)),wp(r,"lastBoundingBox",{width:-1,height:-1}),r}return nH(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)>DT||Math.abs(i.height-this.lastBoundingBox.height)>DT)&&(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?zi({},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,f,y;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();f={left:((d||0)-v.width)/2}}else f=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();y={top:((p||0)-x.height)/2}}else y=c==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return zi(zi({},f),y)}},{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,f=zi(zi({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(u)),u);return L.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(v){n.wrapperNode=v}},lH(a,zi(zi({},this.props),{},{payload:cI(p,d,sH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=zi(zi({},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}}])})(j.PureComponent);wp(Us,"displayName","Legend");wp(Us,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var m0,zT;function cH(){if(zT)return m0;zT=1;var t=Mu(),e=v1(),r=Qr(),n=t?t.isConcatSpreadable:void 0;function i(a){return r(a)||e(a)||!!(n&&a&&a[n])}return m0=i,m0}var g0,BT;function fI(){if(BT)return g0;BT=1;var t=eI(),e=cH();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 g0=r,g0}var y0,UT;function uH(){if(UT)return y0;UT=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 y0=t,y0}var v0,qT;function dH(){if(qT)return v0;qT=1;var t=uH(),e=t();return v0=e,v0}var b0,FT;function hI(){if(FT)return b0;FT=1;var t=dH(),e=xp();function r(n,i){return n&&t(n,i,e)}return b0=r,b0}var x0,HT;function fH(){if(HT)return x0;HT=1;var t=zu();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 x0=e,x0}var w0,WT;function _1(){if(WT)return w0;WT=1;var t=hI(),e=fH(),r=e(t);return w0=r,w0}var _0,GT;function pI(){if(GT)return _0;GT=1;var t=_1(),e=zu();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 _0=r,_0}var S0,KT;function hH(){if(KT)return S0;KT=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return S0=t,S0}var k0,VT;function pH(){if(VT)return k0;VT=1;var t=_l();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,f=t(n);if(!d&&!f&&!c&&r>n||c&&u&&p&&!d&&!f||a&&u&&p||!i&&p||!o)return 1;if(!a&&!c&&!f&&r<n||f&&i&&o&&!a&&!c||d&&i&&o||!u&&o||!p)return-1}return 0}return k0=e,k0}var E0,XT;function mH(){if(XT)return E0;XT=1;var t=pH();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 f=i[a];return p*(f=="desc"?-1:1)}}return r.index-n.index}return E0=e,E0}var O0,YT;function gH(){if(YT)return O0;YT=1;var t=l1(),e=c1(),r=Wa(),n=pI(),i=hH(),a=rI(),o=mH(),c=kl(),u=Qr();function d(p,f,y){f.length?f=t(f,function(w){return u(w)?function(b){return e(b,w.length===1?w[0]:w)}:w}):f=[c];var v=-1;f=t(f,a(r));var x=n(p,function(w,b,S){var A=t(f,function(O){return O(w)});return{criteria:A,index:++v,value:w}});return i(x,function(w,b){return o(w,b,y)})}return O0=d,O0}var A0,JT;function yH(){if(JT)return A0;JT=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 A0=t,A0}var T0,ZT;function vH(){if(ZT)return T0;ZT=1;var t=yH(),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 T0=r,T0}var C0,QT;function bH(){if(QT)return C0;QT=1;function t(e){return function(){return e}}return C0=t,C0}var j0,e2;function mI(){if(e2)return j0;e2=1;var t=Uo(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return j0=e,j0}var N0,t2;function xH(){if(t2)return N0;t2=1;var t=bH(),e=mI(),r=kl(),n=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(a),writable:!0})}:r;return N0=n,N0}var P0,r2;function wH(){if(r2)return P0;r2=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 P0=n,P0}var R0,n2;function _H(){if(n2)return R0;n2=1;var t=xH(),e=wH(),r=e(t);return R0=r,R0}var I0,i2;function SH(){if(i2)return I0;i2=1;var t=kl(),e=vH(),r=_H();function n(i,a){return r(e(i,a,t),i+"")}return I0=n,I0}var $0,a2;function _p(){if(a2)return $0;a2=1;var t=a1(),e=zu(),r=b1(),n=Ha();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 $0=i,$0}var M0,o2;function kH(){if(o2)return M0;o2=1;var t=fI(),e=gH(),r=SH(),n=_p(),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 M0=i,M0}var EH=kH();const S1=vt(EH);function Jc(t){"@babel/helpers - typeof";return Jc=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},Jc(t)}function _x(){return _x=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},_x.apply(this,arguments)}function OH(t,e){return jH(t)||CH(t,e)||TH(t,e)||AH()}function AH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
451
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TH(t,e){if(t){if(typeof t=="string")return s2(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 s2(t,e)}}function s2(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 CH(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 jH(t){if(Array.isArray(t))return 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 L0(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){NH(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 NH(t,e,r){return e=PH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PH(t){var e=RH(t,"string");return Jc(e)=="symbol"?e:e+""}function RH(t,e){if(Jc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IH(t){return Array.isArray(t)&&or(t[0])&&or(t[1])?t.join(" ~ "):t}var $H=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,f=e.formatter,y=e.itemSorter,v=e.wrapperClassName,x=e.labelClassName,w=e.label,b=e.labelFormatter,S=e.accessibilityLayer,A=S===void 0?!1:S,O=function(){if(p&&p.length){var U={padding:0,margin:0},V=(y?S1(p,y):p).map(function(H,Y){if(H.type==="none")return null;var G=L0({display:"block",paddingTop:4,paddingBottom:4,color:H.color||"#000"},c),Q=H.formatter||f||IH,W=H.value,ee=H.name,q=W,$=ee;if(Q&&q!=null&&$!=null){var M=Q(W,ee,H,Y,p);if(Array.isArray(M)){var J=OH(M,2);q=J[0],$=J[1]}else q=M}return L.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Y),style:G},or($)?L.createElement("span",{className:"recharts-tooltip-item-name"},$):null,or($)?L.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,L.createElement("span",{className:"recharts-tooltip-item-value"},q),L.createElement("span",{className:"recharts-tooltip-item-unit"},H.unit||""))});return L.createElement("ul",{className:"recharts-tooltip-item-list",style:U},V)}return null},C=L0({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),E=L0({margin:0},d),T=!et(w),N=T?w:"",R=ot("recharts-default-tooltip",v),I=ot("recharts-tooltip-label",x);T&&b&&p!==void 0&&p!==null&&(N=b(w,p));var K=A?{role:"status","aria-live":"assertive"}:{};return L.createElement("div",_x({className:R,style:C},K),L.createElement("p",{className:I,style:E},L.isValidElement(N)?N:"".concat(N)),O())};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 yf(t,e,r){return e=MH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MH(t){var e=LH(t,"string");return Zc(e)=="symbol"?e:e+""}function LH(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)}var yc="recharts-tooltip-wrapper",DH={visibility:"hidden"};function zH(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return ot(yc,yf(yf(yf(yf({},"".concat(yc,"-right"),ge(r)&&e&&ge(e.x)&&r>=e.x),"".concat(yc,"-left"),ge(r)&&e&&ge(e.x)&&r<e.x),"".concat(yc,"-bottom"),ge(n)&&e&&ge(e.y)&&n>=e.y),"".concat(yc,"-top"),ge(n)&&e&&ge(e.y)&&n<e.y))}function c2(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,f=r[n]+i;if(e[n])return o[n]?p:f;if(o[n]){var y=p,v=u[n];return y<v?Math.max(f,u[n]):Math.max(p,u[n])}var x=f+c,w=u[n]+d;return x>w?Math.max(p,u[n]):Math.max(f,u[n])}function BH(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 UH(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,f;return o.height>0&&o.width>0&&r?(p=c2({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),f=c2({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=BH({translateX:p,translateY:f,useTranslate3d:c})):d=DH,{cssProperties:d,cssClasses:zH({translateX:p,translateY:f,coordinate:r})}}function Ys(t){"@babel/helpers - typeof";return Ys=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},Ys(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 d2(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){kx(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 qH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FH(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,yI(n.key),n)}}function HH(t,e,r){return e&&FH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function WH(t,e,r){return e=lh(e),GH(t,gI()?Reflect.construct(e,r||[],lh(t).constructor):e.apply(t,r))}function GH(t,e){if(e&&(Ys(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KH(t)}function KH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gI=function(){return!!t})()}function lh(t){return lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lh(t)}function VH(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&&Sx(t,e)}function Sx(t,e){return Sx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Sx(t,e)}function kx(t,e,r){return e=yI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yI(t){var e=XH(t,"string");return Ys(e)=="symbol"?e:e+""}function XH(t,e){if(Ys(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ys(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var f2=1,YH=(function(t){function e(){var r;qH(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=WH(this,e,[].concat(i)),kx(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),kx(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 VH(e,t),HH(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>f2||Math.abs(n.height-this.state.lastBoundingBox.height)>f2)&&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,f=i.hasPayload,y=i.isAnimationActive,v=i.offset,x=i.position,w=i.reverseDirection,b=i.useTranslate3d,S=i.viewBox,A=i.wrapperStyle,O=UH({allowEscapeViewBox:o,coordinate:p,offsetTopLeft:v,position:x,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:S}),C=O.cssClasses,E=O.cssProperties,T=d2(d2({transition:y&&a?"transform ".concat(c,"ms ").concat(u):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},A);return L.createElement("div",{tabIndex:-1,className:C,style:T,ref:function(R){n.wrapperNode=R}},d)}}])})(j.PureComponent),JH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},El={isSsr:JH()};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 h2(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 p2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?h2(Object(r),!0).forEach(function(n){k1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ZH(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,bI(n.key),n)}}function eW(t,e,r){return e&&QH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function tW(t,e,r){return e=ch(e),rW(t,vI()?Reflect.construct(e,r||[],ch(t).constructor):e.apply(t,r))}function rW(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 nW(t)}function nW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vI=function(){return!!t})()}function ch(t){return ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ch(t)}function iW(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&&Ex(t,e)}function Ex(t,e){return Ex=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ex(t,e)}function k1(t,e,r){return e=bI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bI(t){var e=aW(t,"string");return Js(e)=="symbol"?e:e+""}function aW(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)}function oW(t){return t.dataKey}function sW(t,e){return L.isValidElement(t)?L.cloneElement(t,e):typeof t=="function"?L.createElement(t,e):L.createElement($H,e)}var ln=(function(t){function e(){return ZH(this,e),tW(this,e,arguments)}return iW(e,t),eW(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,f=i.filterNull,y=i.isAnimationActive,v=i.offset,x=i.payload,w=i.payloadUniqBy,b=i.position,S=i.reverseDirection,A=i.useTranslate3d,O=i.viewBox,C=i.wrapperStyle,E=x??[];f&&E.length&&(E=cI(x.filter(function(N){return N.value!=null&&(N.hide!==!0||n.props.includeHidden)}),w,oW));var T=E.length>0;return L.createElement(YH,{allowEscapeViewBox:o,animationDuration:c,animationEasing:u,isAnimationActive:y,active:a,coordinate:p,hasPayload:T,offset:v,position:b,reverseDirection:S,useTranslate3d:A,viewBox:O,wrapperStyle:C},sW(d,p2(p2({},this.props),{},{payload:E})))}}])})(j.PureComponent);k1(ln,"displayName","Tooltip");k1(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:!El.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 D0,m2;function lW(){if(m2)return D0;m2=1;var t=Oi(),e=function(){return t.Date.now()};return D0=e,D0}var z0,g2;function cW(){if(g2)return z0;g2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return z0=e,z0}var B0,y2;function uW(){if(y2)return B0;y2=1;var t=cW(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return B0=r,B0}var U0,v2;function xI(){if(v2)return U0;v2=1;var t=uW(),e=Ha(),r=_l(),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 f=a.test(d);return f||o.test(d)?c(d.slice(2),f?2:8):i.test(d)?n:+d}return U0=u,U0}var q0,b2;function dW(){if(b2)return q0;b2=1;var t=Ha(),e=lW(),r=xI(),n="Expected a function",i=Math.max,a=Math.min;function o(c,u,d){var p,f,y,v,x,w,b=0,S=!1,A=!1,O=!0;if(typeof c!="function")throw new TypeError(n);u=r(u)||0,t(d)&&(S=!!d.leading,A="maxWait"in d,y=A?i(r(d.maxWait)||0,u):y,O="trailing"in d?!!d.trailing:O);function C(V){var H=p,Y=f;return p=f=void 0,b=V,v=c.apply(Y,H),v}function E(V){return b=V,x=setTimeout(R,u),S?C(V):v}function T(V){var H=V-w,Y=V-b,G=u-H;return A?a(G,y-Y):G}function N(V){var H=V-w,Y=V-b;return w===void 0||H>=u||H<0||A&&Y>=y}function R(){var V=e();if(N(V))return I(V);x=setTimeout(R,T(V))}function I(V){return x=void 0,O&&p?C(V):(p=f=void 0,v)}function K(){x!==void 0&&clearTimeout(x),b=0,p=w=f=x=void 0}function B(){return x===void 0?v:I(e())}function U(){var V=e(),H=N(V);if(p=arguments,f=this,w=V,H){if(x===void 0)return E(w);if(A)return clearTimeout(x),x=setTimeout(R,u),C(w)}return x===void 0&&(x=setTimeout(R,u)),v}return U.cancel=K,U.flush=B,U}return q0=o,q0}var F0,x2;function fW(){if(x2)return F0;x2=1;var t=dW(),e=Ha(),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 F0=n,F0}var hW=fW();const wI=vt(hW);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 w2(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 vf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?w2(Object(r),!0).forEach(function(n){pW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pW(t,e,r){return e=mW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mW(t){var e=gW(t,"string");return Qc(e)=="symbol"?e:e+""}function gW(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 yW(t,e){return wW(t)||xW(t,e)||bW(t,e)||vW()}function vW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
451
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TH(t,e){if(t){if(typeof t=="string")return s2(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 s2(t,e)}}function s2(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 CH(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 jH(t){if(Array.isArray(t))return 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 L0(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){NH(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 NH(t,e,r){return e=PH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PH(t){var e=RH(t,"string");return Jc(e)=="symbol"?e:e+""}function RH(t,e){if(Jc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IH(t){return Array.isArray(t)&&or(t[0])&&or(t[1])?t.join(" ~ "):t}var $H=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,f=e.formatter,y=e.itemSorter,v=e.wrapperClassName,x=e.labelClassName,w=e.label,b=e.labelFormatter,S=e.accessibilityLayer,A=S===void 0?!1:S,O=function(){if(p&&p.length){var U={padding:0,margin:0},V=(y?S1(p,y):p).map(function(H,Y){if(H.type==="none")return null;var G=L0({display:"block",paddingTop:4,paddingBottom:4,color:H.color||"#000"},c),Q=H.formatter||f||IH,W=H.value,ee=H.name,q=W,$=ee;if(Q&&q!=null&&$!=null){var M=Q(W,ee,H,Y,p);if(Array.isArray(M)){var J=OH(M,2);q=J[0],$=J[1]}else q=M}return L.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Y),style:G},or($)?L.createElement("span",{className:"recharts-tooltip-item-name"},$):null,or($)?L.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,L.createElement("span",{className:"recharts-tooltip-item-value"},q),L.createElement("span",{className:"recharts-tooltip-item-unit"},H.unit||""))});return L.createElement("ul",{className:"recharts-tooltip-item-list",style:U},V)}return null},C=L0({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),E=L0({margin:0},d),T=!tt(w),N=T?w:"",R=ot("recharts-default-tooltip",v),I=ot("recharts-tooltip-label",x);T&&b&&p!==void 0&&p!==null&&(N=b(w,p));var K=A?{role:"status","aria-live":"assertive"}:{};return L.createElement("div",_x({className:R,style:C},K),L.createElement("p",{className:I,style:E},L.isValidElement(N)?N:"".concat(N)),O())};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 yf(t,e,r){return e=MH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MH(t){var e=LH(t,"string");return Zc(e)=="symbol"?e:e+""}function LH(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)}var yc="recharts-tooltip-wrapper",DH={visibility:"hidden"};function zH(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return ot(yc,yf(yf(yf(yf({},"".concat(yc,"-right"),ge(r)&&e&&ge(e.x)&&r>=e.x),"".concat(yc,"-left"),ge(r)&&e&&ge(e.x)&&r<e.x),"".concat(yc,"-bottom"),ge(n)&&e&&ge(e.y)&&n>=e.y),"".concat(yc,"-top"),ge(n)&&e&&ge(e.y)&&n<e.y))}function c2(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,f=r[n]+i;if(e[n])return o[n]?p:f;if(o[n]){var y=p,v=u[n];return y<v?Math.max(f,u[n]):Math.max(p,u[n])}var x=f+c,w=u[n]+d;return x>w?Math.max(p,u[n]):Math.max(f,u[n])}function BH(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 UH(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,f;return o.height>0&&o.width>0&&r?(p=c2({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),f=c2({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=BH({translateX:p,translateY:f,useTranslate3d:c})):d=DH,{cssProperties:d,cssClasses:zH({translateX:p,translateY:f,coordinate:r})}}function Ys(t){"@babel/helpers - typeof";return Ys=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},Ys(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 d2(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){kx(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 qH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FH(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,yI(n.key),n)}}function HH(t,e,r){return e&&FH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function WH(t,e,r){return e=lh(e),GH(t,gI()?Reflect.construct(e,r||[],lh(t).constructor):e.apply(t,r))}function GH(t,e){if(e&&(Ys(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KH(t)}function KH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gI=function(){return!!t})()}function lh(t){return lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lh(t)}function VH(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&&Sx(t,e)}function Sx(t,e){return Sx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Sx(t,e)}function kx(t,e,r){return e=yI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yI(t){var e=XH(t,"string");return Ys(e)=="symbol"?e:e+""}function XH(t,e){if(Ys(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ys(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var f2=1,YH=(function(t){function e(){var r;qH(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=WH(this,e,[].concat(i)),kx(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),kx(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 VH(e,t),HH(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>f2||Math.abs(n.height-this.state.lastBoundingBox.height)>f2)&&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,f=i.hasPayload,y=i.isAnimationActive,v=i.offset,x=i.position,w=i.reverseDirection,b=i.useTranslate3d,S=i.viewBox,A=i.wrapperStyle,O=UH({allowEscapeViewBox:o,coordinate:p,offsetTopLeft:v,position:x,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:S}),C=O.cssClasses,E=O.cssProperties,T=d2(d2({transition:y&&a?"transform ".concat(c,"ms ").concat(u):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},A);return L.createElement("div",{tabIndex:-1,className:C,style:T,ref:function(R){n.wrapperNode=R}},d)}}])})(j.PureComponent),JH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},El={isSsr:JH()};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 h2(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 p2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?h2(Object(r),!0).forEach(function(n){k1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ZH(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,bI(n.key),n)}}function eW(t,e,r){return e&&QH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function tW(t,e,r){return e=ch(e),rW(t,vI()?Reflect.construct(e,r||[],ch(t).constructor):e.apply(t,r))}function rW(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 nW(t)}function nW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vI=function(){return!!t})()}function ch(t){return ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ch(t)}function iW(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&&Ex(t,e)}function Ex(t,e){return Ex=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ex(t,e)}function k1(t,e,r){return e=bI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bI(t){var e=aW(t,"string");return Js(e)=="symbol"?e:e+""}function aW(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)}function oW(t){return t.dataKey}function sW(t,e){return L.isValidElement(t)?L.cloneElement(t,e):typeof t=="function"?L.createElement(t,e):L.createElement($H,e)}var ln=(function(t){function e(){return ZH(this,e),tW(this,e,arguments)}return iW(e,t),eW(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,f=i.filterNull,y=i.isAnimationActive,v=i.offset,x=i.payload,w=i.payloadUniqBy,b=i.position,S=i.reverseDirection,A=i.useTranslate3d,O=i.viewBox,C=i.wrapperStyle,E=x??[];f&&E.length&&(E=cI(x.filter(function(N){return N.value!=null&&(N.hide!==!0||n.props.includeHidden)}),w,oW));var T=E.length>0;return L.createElement(YH,{allowEscapeViewBox:o,animationDuration:c,animationEasing:u,isAnimationActive:y,active:a,coordinate:p,hasPayload:T,offset:v,position:b,reverseDirection:S,useTranslate3d:A,viewBox:O,wrapperStyle:C},sW(d,p2(p2({},this.props),{},{payload:E})))}}])})(j.PureComponent);k1(ln,"displayName","Tooltip");k1(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:!El.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 D0,m2;function lW(){if(m2)return D0;m2=1;var t=Oi(),e=function(){return t.Date.now()};return D0=e,D0}var z0,g2;function cW(){if(g2)return z0;g2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return z0=e,z0}var B0,y2;function uW(){if(y2)return B0;y2=1;var t=cW(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return B0=r,B0}var U0,v2;function xI(){if(v2)return U0;v2=1;var t=uW(),e=Ha(),r=_l(),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 f=a.test(d);return f||o.test(d)?c(d.slice(2),f?2:8):i.test(d)?n:+d}return U0=u,U0}var q0,b2;function dW(){if(b2)return q0;b2=1;var t=Ha(),e=lW(),r=xI(),n="Expected a function",i=Math.max,a=Math.min;function o(c,u,d){var p,f,y,v,x,w,b=0,S=!1,A=!1,O=!0;if(typeof c!="function")throw new TypeError(n);u=r(u)||0,t(d)&&(S=!!d.leading,A="maxWait"in d,y=A?i(r(d.maxWait)||0,u):y,O="trailing"in d?!!d.trailing:O);function C(V){var H=p,Y=f;return p=f=void 0,b=V,v=c.apply(Y,H),v}function E(V){return b=V,x=setTimeout(R,u),S?C(V):v}function T(V){var H=V-w,Y=V-b,G=u-H;return A?a(G,y-Y):G}function N(V){var H=V-w,Y=V-b;return w===void 0||H>=u||H<0||A&&Y>=y}function R(){var V=e();if(N(V))return I(V);x=setTimeout(R,T(V))}function I(V){return x=void 0,O&&p?C(V):(p=f=void 0,v)}function K(){x!==void 0&&clearTimeout(x),b=0,p=w=f=x=void 0}function B(){return x===void 0?v:I(e())}function U(){var V=e(),H=N(V);if(p=arguments,f=this,w=V,H){if(x===void 0)return E(w);if(A)return clearTimeout(x),x=setTimeout(R,u),C(w)}return x===void 0&&(x=setTimeout(R,u)),v}return U.cancel=K,U.flush=B,U}return q0=o,q0}var F0,x2;function fW(){if(x2)return F0;x2=1;var t=dW(),e=Ha(),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 F0=n,F0}var hW=fW();const wI=vt(hW);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 w2(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 vf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?w2(Object(r),!0).forEach(function(n){pW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pW(t,e,r){return e=mW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mW(t){var e=gW(t,"string");return Qc(e)=="symbol"?e:e+""}function gW(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 yW(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
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 _2(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 _2(t,e)}}function _2(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)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}var uh=j.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,f=t.minHeight,y=t.maxHeight,v=t.children,x=t.debounce,w=x===void 0?0:x,b=t.id,S=t.className,A=t.onResize,O=t.style,C=O===void 0?{}:O,E=j.useRef(null),T=j.useRef();T.current=A,j.useImperativeHandle(e,function(){return Object.defineProperty(E.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),E.current},configurable:!0})});var N=j.useState({containerWidth:i.width,containerHeight:i.height}),R=yW(N,2),I=R[0],K=R[1],B=j.useCallback(function(V,H){K(function(Y){var G=Math.round(V),Q=Math.round(H);return Y.containerWidth===G&&Y.containerHeight===Q?Y:{containerWidth:G,containerHeight:Q}})},[]);j.useEffect(function(){var V=function(ee){var q,$=ee[0].contentRect,M=$.width,J=$.height;B(M,J),(q=T.current)===null||q===void 0||q.call(T,M,J)};w>0&&(V=wI(V,w,{trailing:!0,leading:!1}));var H=new ResizeObserver(V),Y=E.current.getBoundingClientRect(),G=Y.width,Q=Y.height;return B(G,Q),H.observe(E.current),function(){H.disconnect()}},[B,w]);var U=j.useMemo(function(){var V=I.containerWidth,H=I.containerHeight;if(V<0||H<0)return null;Ki(Eo(o)||Eo(u),`The width(%s) and height(%s) are both fixed numbers,
453
453
  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 Y=Eo(o)?V:o,G=Eo(u)?H:u;r&&r>0&&(Y?G=Y/r:G&&(Y=G*r),y&&G>y&&(G=y)),Ki(Y>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0,
454
454
  please check the style of container, or the props width(%s) and height(%s),
455
455
  or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
456
456
  height and width.`,Y,G,o,u,p,f,r);var Q=!Array.isArray(v)&&Gi(v.type).endsWith("Chart");return L.Children.map(v,function(W){return L.isValidElement(W)?j.cloneElement(W,vf({width:Y,height:G},Q?{style:vf({height:"100%",width:"100%",maxHeight:G,maxWidth:Y},W.props.style)}:{})):W})},[r,v,u,y,f,p,I,o]);return L.createElement("div",{id:b?"".concat(b):void 0,className:ot("recharts-responsive-container",S),style:vf(vf({},C),{},{width:o,height:u,minWidth:p,minHeight:f,maxHeight:y}),ref:E},U)}),_I=function(e){return null};_I.displayName="Cell";function eu(t){"@babel/helpers - typeof";return eu=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},eu(t)}function S2(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 Ox(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?S2(Object(r),!0).forEach(function(n){_W(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _W(t,e,r){return e=SW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SW(t){var e=kW(t,"string");return eu(e)=="symbol"?e:e+""}function kW(t,e){if(eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ks={widthCache:{},cacheCount:0},EW=2e3,OW={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},k2="recharts_measurement_span";function AW(t){var e=Ox({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var Mc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||El.isSsr)return{width:0,height:0};var n=AW(r),i=JSON.stringify({text:e,copyStyle:n});if(ks.widthCache[i])return ks.widthCache[i];try{var a=document.getElementById(k2);a||(a=document.createElement("span"),a.setAttribute("id",k2),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Ox(Ox({},OW),n);Object.assign(a.style,o),a.textContent="".concat(e);var c=a.getBoundingClientRect(),u={width:c.width,height:c.height};return ks.widthCache[i]=u,++ks.cacheCount>EW&&(ks.cacheCount=0,ks.widthCache={}),u}catch{return{width:0,height:0}}},TW=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function tu(t){"@babel/helpers - typeof";return tu=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},tu(t)}function dh(t,e){return PW(t)||NW(t,e)||jW(t,e)||CW()}function CW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
457
457
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jW(t,e){if(t){if(typeof t=="string")return E2(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 E2(t,e)}}function E2(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 NW(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 PW(t){if(Array.isArray(t))return t}function RW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O2(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 IW(t,e,r){return e&&O2(t.prototype,e),r&&O2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $W(t){var e=MW(t,"string");return tu(e)=="symbol"?e:e+""}function MW(t,e){if(tu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(tu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var A2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,T2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,LW=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,DW=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,SI={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},zW=Object.keys(SI),Is="NaN";function BW(t,e){return t*SI[e]}var bf=(function(){function t(e,r){RW(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!LW.test(r)&&(this.num=NaN,this.unit=""),zW.includes(r)&&(this.num=BW(e,r),this.unit="px")}return IW(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=DW.exec(r))!==null&&n!==void 0?n:[],a=dh(i,3),o=a[1],c=a[2];return new t(parseFloat(o),c??"")}}])})();function kI(t){if(t.includes(Is))return Is;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=A2.exec(e))!==null&&r!==void 0?r:[],i=dh(n,4),a=i[1],o=i[2],c=i[3],u=bf.parse(a??""),d=bf.parse(c??""),p=o==="*"?u.multiply(d):u.divide(d);if(p.isNaN())return Is;e=e.replace(A2,p.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var f,y=(f=T2.exec(e))!==null&&f!==void 0?f:[],v=dh(y,4),x=v[1],w=v[2],b=v[3],S=bf.parse(x??""),A=bf.parse(b??""),O=w==="+"?S.add(A):S.subtract(A);if(O.isNaN())return Is;e=e.replace(T2,O.toString())}return e}var C2=/\(([^()]*)\)/;function UW(t){for(var e=t;e.includes("(");){var r=C2.exec(e),n=dh(r,2),i=n[1];e=e.replace(C2,kI(i))}return e}function qW(t){var e=t.replace(/\s+/g,"");return e=UW(e),e=kI(e),e}function FW(t){try{return qW(t)}catch{return Is}}function H0(t){var e=FW(t.slice(5,-1));return e===Is?"":e}var HW=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],WW=["dx","dy","angle","className","breakAll"];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 j2(t,e){if(t==null)return{};var r=GW(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 GW(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 N2(t,e){return YW(t)||XW(t,e)||VW(t,e)||KW()}function KW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
458
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VW(t,e){if(t){if(typeof t=="string")return P2(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 P2(t,e)}}function P2(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 YW(t){if(Array.isArray(t))return t}var EI=/[ \f\n\r\t\v\u2028\u2029]+/,OI=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];et(r)||(n?a=r.toString().split(""):a=r.toString().split(EI));var o=a.map(function(u){return{word:u,width:Mc(u,i).width}}),c=n?0:Mc(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},JW=function(e,r,n,i,a){var o=e.maxLines,c=e.children,u=e.style,d=e.breakAll,p=ge(o),f=c,y=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Y.reduce(function(G,Q){var W=Q.word,ee=Q.width,q=G[G.length-1];if(q&&(i==null||a||q.width+ee+n<Number(i)))q.words.push(W),q.width+=ee+n;else{var $={words:[W],width:ee};G.push($)}return G},[])},v=y(r),x=function(Y){return Y.reduce(function(G,Q){return G.width>Q.width?G:Q})};if(!p)return v;for(var w="…",b=function(Y){var G=f.slice(0,Y),Q=OI({breakAll:d,style:u,children:G+w}).wordsWithComputedWidth,W=y(Q),ee=W.length>o||x(W).width>Number(i);return[ee,W]},S=0,A=f.length-1,O=0,C;S<=A&&O<=f.length-1;){var E=Math.floor((S+A)/2),T=E-1,N=b(T),R=N2(N,2),I=R[0],K=R[1],B=b(E),U=N2(B,1),V=U[0];if(!I&&!V&&(S=E+1),I&&V&&(A=E-1),!I&&V){C=K;break}O++}return C||v},R2=function(e){var r=et(e)?[]:e.toString().split(EI);return[{words:r}]},ZW=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,c=e.maxLines;if((r||n)&&!El.isSsr){var u,d,p=OI({breakAll:o,children:i,style:a});if(p){var f=p.wordsWithComputedWidth,y=p.spaceWidth;u=f,d=y}else return R2(i);return JW({breakAll:o,children:i,maxLines:c,style:a},u,d,r,n)}return R2(i)},I2="#808080",fh=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,f=p===void 0?!1:p,y=e.textAnchor,v=y===void 0?"start":y,x=e.verticalAnchor,w=x===void 0?"end":x,b=e.fill,S=b===void 0?I2:b,A=j2(e,HW),O=j.useMemo(function(){return ZW({breakAll:A.breakAll,children:A.children,maxLines:A.maxLines,scaleToFit:f,style:A.style,width:A.width})},[A.breakAll,A.children,A.maxLines,f,A.style,A.width]),C=A.dx,E=A.dy,T=A.angle,N=A.className,R=A.breakAll,I=j2(A,WW);if(!or(n)||!or(a))return null;var K=n+(ge(C)?C:0),B=a+(ge(E)?E:0),U;switch(w){case"start":U=H0("calc(".concat(d,")"));break;case"middle":U=H0("calc(".concat((O.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:U=H0("calc(".concat(O.length-1," * -").concat(c,")"));break}var V=[];if(f){var H=O[0].width,Y=A.width;V.push("scale(".concat((ge(Y)?Y/H:1)/H,")"))}return T&&V.push("rotate(".concat(T,", ").concat(K,", ").concat(B,")")),V.length&&(I.transform=V.join(" ")),L.createElement("text",Ax({},at(I,!0),{x:K,y:B,className:ot("recharts-text",N),textAnchor:v,fill:S.includes("url")?I2:S}),O.map(function(G,Q){var W=G.words.join(R?"":" ");return L.createElement("tspan",{x:K,dy:Q===0?U:c,key:"".concat(W,"-").concat(Q)},W)}))};function La(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 E1(t){let e,r,n;t.length!==2?(e=La,r=(c,u)=>La(t(c),u),n=(c,u)=>t(c)-u):(e=t===La||t===QW?t:eG,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 f=d+p>>>1;r(c[f],u)<0?d=f+1:p=f}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 f=d+p>>>1;r(c[f],u)<=0?d=f+1:p=f}while(d<p)}return d}function o(c,u,d=0,p=c.length){const f=i(c,u,d,p-1);return f>d&&n(c[f-1],u)>-n(c[f],u)?f-1:f}return{left:i,center:o,right:a}}function eG(){return 0}function AI(t){return t===null?NaN:+t}function*tG(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const rG=E1(La),Bu=rG.right;E1(AI).center;class $2 extends Map{constructor(e,r=aG){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(M2(this,e))}has(e){return super.has(M2(this,e))}set(e,r){return super.set(nG(this,e),r)}delete(e){return super.delete(iG(this,e))}}function M2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function nG({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function iG({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function aG(t){return t!==null&&typeof t=="object"?t.valueOf():t}function oG(t=La){if(t===La)return TI;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 TI(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const sG=Math.sqrt(50),lG=Math.sqrt(10),cG=Math.sqrt(2);function hh(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>=sG?10:a>=lG?5:a>=cG?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?hh(t,e,r*2):[c,u,d]}function Tx(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?hh(e,t,r):hh(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 Cx(t,e,r){return e=+e,t=+t,r=+r,hh(t,e,r)[2]}function jx(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?Cx(e,t,r):Cx(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function L2(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function D2(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function CI(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?TI:oG(i);n>r;){if(n-r>600){const u=n-r+1,d=e-r+1,p=Math.log(u),f=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*f*(u-f)/u)*(d-u/2<0?-1:1),v=Math.max(r,Math.floor(e-d*f/u+y)),x=Math.min(n,Math.floor(e+(u-d)*f/u+y));CI(t,e,v,x,i)}const a=t[e];let o=r,c=n;for(vc(t,r,e),i(t[n],a)>0&&vc(t,r,n);o<c;){for(vc(t,o,c),++o,--c;i(t[o],a)<0;)++o;for(;i(t[c],a)>0;)--c}i(t[r],a)===0?vc(t,r,c):(++c,vc(t,c,n)),c<=e&&(r=c+1),e<=c&&(n=c-1)}return t}function vc(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function uG(t,e,r){if(t=Float64Array.from(tG(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return D2(t);if(e>=1)return L2(t);var n,i=(n-1)*e,a=Math.floor(i),o=L2(CI(t,a).subarray(0,a+1)),c=D2(t.subarray(a+1));return o+(c-o)*(i-a)}}function dG(t,e,r=AI){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 fG(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 Nx=Symbol("implicit");function O1(){var t=new $2,e=[],r=[],n=Nx;function i(a){let o=t.get(a);if(o===void 0){if(n!==Nx)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 O1(e,r).unknown(n)},Pn.apply(i,arguments),i}function ru(){var t=O1().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 f(){var y=e().length,v=i<n,x=v?i:n,w=v?n:i;a=(w-x)/Math.max(1,y-u+d*2),c&&(a=Math.floor(a)),x+=(w-x-a*(y-u))*p,o=a*(1-u),c&&(x=Math.round(x),o=Math.round(o));var b=fG(y).map(function(S){return x+a*S});return r(v?b.reverse():b)}return t.domain=function(y){return arguments.length?(e(y),f()):e()},t.range=function(y){return arguments.length?([n,i]=y,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(y){return[n,i]=y,n=+n,i=+i,c=!0,f()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(y){return arguments.length?(c=!!y,f()):c},t.padding=function(y){return arguments.length?(u=Math.min(1,d=+y),f()):u},t.paddingInner=function(y){return arguments.length?(u=Math.min(1,y),f()):u},t.paddingOuter=function(y){return arguments.length?(d=+y,f()):d},t.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),f()):p},t.copy=function(){return ru(e(),[n,i]).round(c).paddingInner(u).paddingOuter(d).align(p)},Pn.apply(f(),arguments)}function jI(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return jI(e())},t}function Lc(){return jI(ru.apply(null,arguments).paddingInner(1))}function A1(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function NI(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Uu(){}var nu=.7,ph=1/nu,qs="\\s*([+-]?\\d+)\\s*",iu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hG=/^#([0-9a-f]{3,8})$/,pG=new RegExp(`^rgb\\(${qs},${qs},${qs}\\)$`),mG=new RegExp(`^rgb\\(${Si},${Si},${Si}\\)$`),gG=new RegExp(`^rgba\\(${qs},${qs},${qs},${iu}\\)$`),yG=new RegExp(`^rgba\\(${Si},${Si},${Si},${iu}\\)$`),vG=new RegExp(`^hsl\\(${iu},${Si},${Si}\\)$`),bG=new RegExp(`^hsla\\(${iu},${Si},${Si},${iu}\\)$`),z2={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};A1(Uu,au,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:B2,formatHex:B2,formatHex8:xG,formatHsl:wG,formatRgb:U2,toString:U2});function B2(){return this.rgb().formatHex()}function xG(){return this.rgb().formatHex8()}function wG(){return PI(this).formatHsl()}function U2(){return this.rgb().formatRgb()}function au(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=hG.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?q2(e):r===3?new Zr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?xf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?xf(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=pG.exec(t))?new Zr(e[1],e[2],e[3],1):(e=mG.exec(t))?new Zr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=gG.exec(t))?xf(e[1],e[2],e[3],e[4]):(e=yG.exec(t))?xf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=vG.exec(t))?W2(e[1],e[2]/100,e[3]/100,1):(e=bG.exec(t))?W2(e[1],e[2]/100,e[3]/100,e[4]):z2.hasOwnProperty(t)?q2(z2[t]):t==="transparent"?new Zr(NaN,NaN,NaN,0):null}function q2(t){return new Zr(t>>16&255,t>>8&255,t&255,1)}function xf(t,e,r,n){return n<=0&&(t=e=r=NaN),new Zr(t,e,r,n)}function _G(t){return t instanceof Uu||(t=au(t)),t?(t=t.rgb(),new Zr(t.r,t.g,t.b,t.opacity)):new Zr}function Px(t,e,r,n){return arguments.length===1?_G(t):new Zr(t,e,r,n??1)}function Zr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}A1(Zr,Px,NI(Uu,{brighter(t){return t=t==null?ph:Math.pow(ph,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?nu:Math.pow(nu,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zr(jo(this.r),jo(this.g),jo(this.b),mh(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:F2,formatHex:F2,formatHex8:SG,formatRgb:H2,toString:H2}));function F2(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}`}function SG(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}${Oo((isNaN(this.opacity)?1:this.opacity)*255)}`}function H2(){const t=mh(this.opacity);return`${t===1?"rgb(":"rgba("}${jo(this.r)}, ${jo(this.g)}, ${jo(this.b)}${t===1?")":`, ${t})`}`}function mh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oo(t){return t=jo(t),(t<16?"0":"")+t.toString(16)}function W2(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 PI(t){if(t instanceof Yn)return new Yn(t.h,t.s,t.l,t.opacity);if(t instanceof Uu||(t=au(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 kG(t,e,r,n){return arguments.length===1?PI(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}A1(Yn,kG,NI(Uu,{brighter(t){return t=t==null?ph:Math.pow(ph,t),new Yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?nu:Math.pow(nu,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 Zr(W0(t>=240?t-240:t+120,i,n),W0(t,i,n),W0(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Yn(G2(this.h),wf(this.s),wf(this.l),mh(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=mh(this.opacity);return`${t===1?"hsl(":"hsla("}${G2(this.h)}, ${wf(this.s)*100}%, ${wf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function G2(t){return t=(t||0)%360,t<0?t+360:t}function wf(t){return Math.max(0,Math.min(1,t||0))}function W0(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 T1=t=>()=>t;function EG(t,e){return function(r){return t+r*e}}function OG(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 AG(t){return(t=+t)==1?RI:function(e,r){return r-e?OG(e,r,t):T1(isNaN(e)?r:e)}}function RI(t,e){var r=e-t;return r?EG(t,r):T1(isNaN(t)?e:t)}const K2=(function t(e){var r=AG(e);function n(i,a){var o=r((i=Px(i)).r,(a=Px(a)).r),c=r(i.g,a.g),u=r(i.b,a.b),d=RI(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 TG(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 CG(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function jG(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]=Ol(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 NG(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function gh(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function PG(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]=Ol(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Rx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,G0=new RegExp(Rx.source,"g");function RG(t){return function(){return t}}function IG(t){return function(e){return t(e)+""}}function $G(t,e){var r=Rx.lastIndex=G0.lastIndex=0,n,i,a,o=-1,c=[],u=[];for(t=t+"",e=e+"";(n=Rx.exec(t))&&(i=G0.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:gh(n,i)})),r=G0.lastIndex;return r<e.length&&(a=e.slice(r),c[o]?c[o]+=a:c[++o]=a),c.length<2?u[0]?IG(u[0].x):RG(e):(e=u.length,function(d){for(var p=0,f;p<e;++p)c[(f=u[p]).i]=f.x(d);return c.join("")})}function Ol(t,e){var r=typeof e,n;return e==null||r==="boolean"?T1(e):(r==="number"?gh:r==="string"?(n=au(e))?(e=n,K2):$G:e instanceof au?K2:e instanceof Date?NG:CG(e)?TG:Array.isArray(e)?jG:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?PG:gh)(t,e)}function C1(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function MG(t,e){e===void 0&&(e=t,t=Ol);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 LG(t){return function(){return t}}function yh(t){return+t}var V2=[0,1];function Br(t){return t}function Ix(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:LG(isNaN(e)?NaN:.5)}function DG(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function zG(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Ix(i,n),a=r(o,a)):(n=Ix(n,i),a=r(a,o)),function(c){return a(n(c))}}function BG(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]=Ix(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(c){var u=Bu(t,c,1,n)-1;return a[u](i[u](c))}}function qu(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Sp(){var t=V2,e=V2,r=Ol,n,i,a,o=Br,c,u,d;function p(){var y=Math.min(t.length,e.length);return o!==Br&&(o=DG(t[0],t[y-1])),c=y>2?BG:zG,u=d=null,f}function f(y){return y==null||isNaN(y=+y)?a:(u||(u=c(t.map(n),e,r)))(n(o(y)))}return f.invert=function(y){return o(i((d||(d=c(e,t.map(n),gh)))(y)))},f.domain=function(y){return arguments.length?(t=Array.from(y,yh),p()):t.slice()},f.range=function(y){return arguments.length?(e=Array.from(y),p()):e.slice()},f.rangeRound=function(y){return e=Array.from(y),r=C1,p()},f.clamp=function(y){return arguments.length?(o=y?!0:Br,p()):o!==Br},f.interpolate=function(y){return arguments.length?(r=y,p()):r},f.unknown=function(y){return arguments.length?(a=y,f):a},function(y,v){return n=y,i=v,p()}}function j1(){return Sp()(Br,Br)}function UG(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function vh(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 Zs(t){return t=vh(Math.abs(t)),t?t[1]:NaN}function qG(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 FG(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var HG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ou(t){if(!(e=HG.exec(t)))throw new Error("invalid format: "+t);var e;return new N1({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]})}ou.prototype=N1.prototype;function N1(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+""}N1.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 WG(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 bh;function GG(t,e){var r=vh(t,e);if(!r)return bh=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(bh=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")+vh(t,Math.max(0,e+a-1))[0]}function X2(t,e){var r=vh(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 Y2={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:UG,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)=>X2(t*100,e),r:X2,s:GG,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function J2(t){return t}var Z2=Array.prototype.map,Q2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function KG(t){var e=t.grouping===void 0||t.thousands===void 0?J2:qG(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?J2:FG(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(f,y){f=ou(f);var v=f.fill,x=f.align,w=f.sign,b=f.symbol,S=f.zero,A=f.width,O=f.comma,C=f.precision,E=f.trim,T=f.type;T==="n"?(O=!0,T="g"):Y2[T]||(C===void 0&&(C=12),E=!0,T="g"),(S||v==="0"&&x==="=")&&(S=!0,v="0",x="=");var N=(y&&y.prefix!==void 0?y.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),R=(b==="$"?n:/[%p]/.test(T)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),I=Y2[T],K=/[defgprs%]/.test(T);C=C===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function B(U){var V=N,H=R,Y,G,Q;if(T==="c")H=I(U)+H,U="";else{U=+U;var W=U<0||1/U<0;if(U=isNaN(U)?u:I(Math.abs(U),C),E&&(U=WG(U)),W&&+U==0&&w!=="+"&&(W=!1),V=(W?w==="("?w:c:w==="-"||w==="("?"":w)+V,H=(T==="s"&&!isNaN(U)&&bh!==void 0?Q2[8+bh/3]:"")+H+(W&&w==="("?")":""),K){for(Y=-1,G=U.length;++Y<G;)if(Q=U.charCodeAt(Y),48>Q||Q>57){H=(Q===46?i+U.slice(Y+1):U.slice(Y))+H,U=U.slice(0,Y);break}}}O&&!S&&(U=e(U,1/0));var ee=V.length+U.length+H.length,q=ee<A?new Array(A-ee+1).join(v):"";switch(O&&S&&(U=e(q+U,q.length?A-H.length:1/0),q=""),x){case"<":U=V+U+H+q;break;case"=":U=V+q+U+H;break;case"^":U=q.slice(0,ee=q.length>>1)+V+U+H+q.slice(ee);break;default:U=q+V+U+H;break}return a(U)}return B.toString=function(){return f+""},B}function p(f,y){var v=Math.max(-8,Math.min(8,Math.floor(Zs(y)/3)))*3,x=Math.pow(10,-v),w=d((f=ou(f),f.type="f",f),{suffix:Q2[8+v/3]});return function(b){return w(x*b)}}return{format:d,formatPrefix:p}}var _f,P1,II;VG({thousands:",",grouping:[3],currency:["$",""]});function VG(t){return _f=KG(t),P1=_f.format,II=_f.formatPrefix,_f}function XG(t){return Math.max(0,-Zs(Math.abs(t)))}function YG(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zs(e)/3)))*3-Zs(Math.abs(t)))}function JG(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Zs(e)-Zs(t))+1}function $I(t,e,r,n){var i=jx(t,e,r),a;switch(n=ou(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=YG(i,o))&&(n.precision=a),II(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=JG(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=XG(i))&&(n.precision=a-(n.type==="%")*2);break}}return P1(n)}function Ga(t){var e=t.domain;return t.ticks=function(r){var n=e();return Tx(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=Cx(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 xh(){var t=j1();return t.copy=function(){return qu(t,xh())},Pn.apply(t,arguments),Ga(t)}function MI(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,yh),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return MI(t).unknown(e)},t=arguments.length?Array.from(t,yh):[0,1],Ga(r)}function LI(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 eC(t){return Math.log(t)}function tC(t){return Math.exp(t)}function ZG(t){return-Math.log(-t)}function QG(t){return-Math.exp(-t)}function eK(t){return isFinite(t)?+("1e"+t):t<0?0:t}function tK(t){return t===10?eK:t===Math.E?Math.exp:e=>Math.pow(t,e)}function rK(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 rC(t){return(e,r)=>-t(-e,r)}function R1(t){const e=t(eC,tC),r=e.domain;let n=10,i,a;function o(){return i=rK(n),a=tK(n),r()[0]<0?(i=rC(i),a=rC(a),t(ZG,QG)):t(eC,tC),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 f=p<d;f&&([d,p]=[p,d]);let y=i(d),v=i(p),x,w;const b=c==null?10:+c;let S=[];if(!(n%1)&&v-y<b){if(y=Math.floor(y),v=Math.ceil(v),d>0){for(;y<=v;++y)for(x=1;x<n;++x)if(w=y<0?x/a(-y):x*a(y),!(w<d)){if(w>p)break;S.push(w)}}else for(;y<=v;++y)for(x=n-1;x>=1;--x)if(w=y>0?x/a(-y):x*a(y),!(w<d)){if(w>p)break;S.push(w)}S.length*2<b&&(S=Tx(d,p,b))}else S=Tx(y,v,Math.min(v-y,b)).map(a);return f?S.reverse():S},e.tickFormat=(c,u)=>{if(c==null&&(c=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=ou(u)).precision==null&&(u.trim=!0),u=P1(u)),c===1/0)return u;const d=Math.max(1,n*c/e.ticks().length);return p=>{let f=p/a(Math.round(i(p)));return f*n<n-.5&&(f*=n),f<=d?u(p):""}},e.nice=()=>r(LI(r(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),e}function DI(){const t=R1(Sp()).domain([1,10]);return t.copy=()=>qu(t,DI()).base(t.base()),Pn.apply(t,arguments),t}function nC(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function iC(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function I1(t){var e=1,r=t(nC(e),iC(e));return r.constant=function(n){return arguments.length?t(nC(e=+n),iC(e)):e},Ga(r)}function zI(){var t=I1(Sp());return t.copy=function(){return qu(t,zI()).constant(t.constant())},Pn.apply(t,arguments)}function aC(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function nK(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function iK(t){return t<0?-t*t:t*t}function $1(t){var e=t(Br,Br),r=1;function n(){return r===1?t(Br,Br):r===.5?t(nK,iK):t(aC(r),aC(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Ga(e)}function M1(){var t=$1(Sp());return t.copy=function(){return qu(t,M1()).exponent(t.exponent())},Pn.apply(t,arguments),t}function aK(){return M1.apply(null,arguments).exponent(.5)}function oC(t){return Math.sign(t)*t*t}function oK(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function BI(){var t=j1(),e=[0,1],r=!1,n;function i(a){var o=oK(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(oC(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,yh)).map(oC)),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 BI(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Pn.apply(i,arguments),Ga(i)}function UI(){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]=dG(t,o/c);return a}function a(o){return o==null||isNaN(o=+o)?n:e[Bu(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(La),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 UI().domain(t).range(e).unknown(n)},Pn.apply(a,arguments)}function qI(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Bu(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 qI().domain([t,e]).range(i).unknown(a)},Pn.apply(Ga(o),arguments)}function FI(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[Bu(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 FI().domain(t).range(e).unknown(r)},Pn.apply(i,arguments)}const K0=new Date,V0=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)=>(K0.setTime(+a),V0.setTime(+o),t(K0),t(V0),Math.floor(r(K0,V0))),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 wh=sr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);wh.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):wh);wh.range;const Fi=1e3,An=Fi*60,Hi=An*60,Yi=Hi*24,L1=Yi*7,sC=Yi*30,X0=Yi*365,Ao=sr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Fi)},(t,e)=>(e-t)/Fi,t=>t.getUTCSeconds());Ao.range;const D1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Fi)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getMinutes());D1.range;const z1=sr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getUTCMinutes());z1.range;const B1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Fi-t.getMinutes()*An)},(t,e)=>{t.setTime(+t+e*Hi)},(t,e)=>(e-t)/Hi,t=>t.getHours());B1.range;const U1=sr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Hi)},(t,e)=>(e-t)/Hi,t=>t.getUTCHours());U1.range;const Fu=sr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*An)/Yi,t=>t.getDate()-1);Fu.range;const kp=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>t.getUTCDate()-1);kp.range;const HI=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));HI.range;function qo(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())*An)/L1)}const Ep=qo(0),_h=qo(1),sK=qo(2),lK=qo(3),Qs=qo(4),cK=qo(5),uK=qo(6);Ep.range;_h.range;sK.range;lK.range;Qs.range;cK.range;uK.range;function Fo(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)/L1)}const Op=Fo(0),Sh=Fo(1),dK=Fo(2),fK=Fo(3),el=Fo(4),hK=Fo(5),pK=Fo(6);Op.range;Sh.range;dK.range;fK.range;el.range;hK.range;pK.range;const q1=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());q1.range;const F1=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());F1.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 WI(t,e,r,n,i,a){const o=[[Ao,1,Fi],[Ao,5,5*Fi],[Ao,15,15*Fi],[Ao,30,30*Fi],[a,1,An],[a,5,5*An],[a,15,15*An],[a,30,30*An],[i,1,Hi],[i,3,3*Hi],[i,6,6*Hi],[i,12,12*Hi],[n,1,Yi],[n,2,2*Yi],[r,1,L1],[e,1,sC],[e,3,3*sC],[t,1,X0]];function c(d,p,f){const y=p<d;y&&([d,p]=[p,d]);const v=f&&typeof f.range=="function"?f:u(d,p,f),x=v?v.range(d,+p+1):[];return y?x.reverse():x}function u(d,p,f){const y=Math.abs(p-d)/f,v=E1(([,,b])=>b).right(o,y);if(v===o.length)return t.every(jx(d/X0,p/X0,f));if(v===0)return wh.every(Math.max(jx(d,p,f),1));const[x,w]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return x.every(w)}return[c,u]}const[mK,gK]=WI(Zi,F1,Op,HI,U1,z1),[yK,vK]=WI(Ji,q1,Ep,Fu,B1,D1);function Y0(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 J0(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 bc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function bK(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=xc(i),p=wc(i),f=xc(a),y=wc(a),v=xc(o),x=wc(o),w=xc(c),b=wc(c),S=xc(u),A=wc(u),O={a:Q,A:W,b:ee,B:q,c:null,d:hC,e:hC,f:qK,g:ZK,G:eV,H:zK,I:BK,j:UK,L:GI,m:FK,M:HK,p:$,q:M,Q:gC,s:yC,S:WK,u:GK,U:KK,V:VK,w:XK,W:YK,x:null,X:null,y:JK,Y:QK,Z:tV,"%":mC},C={a:J,A:oe,b:le,B:ve,c:null,d:pC,e:pC,f:aV,g:mV,G:yV,H:rV,I:nV,j:iV,L:VI,m:oV,M:sV,p:qe,q:xe,Q:gC,s:yC,S:lV,u:cV,U:uV,V:dV,w:fV,W:hV,x:null,X:null,y:pV,Y:gV,Z:vV,"%":mC},E={a:K,A:B,b:U,B:V,c:H,d:dC,e:dC,f:$K,g:uC,G:cC,H:fC,I:fC,j:NK,L:IK,m:jK,M:PK,p:I,q:CK,Q:LK,s:DK,S:RK,u:kK,U:EK,V:OK,w:SK,W:AK,x:Y,X:G,y:uC,Y:cC,Z:TK,"%":MK};O.x=T(r,O),O.X=T(n,O),O.c=T(e,O),C.x=T(r,C),C.X=T(n,C),C.c=T(e,C);function T(ae,Se){return function(Me){var se=[],rt=-1,Fe=0,kt=ae.length,wt,Et,Sr;for(Me instanceof Date||(Me=new Date(+Me));++rt<kt;)ae.charCodeAt(rt)===37&&(se.push(ae.slice(Fe,rt)),(Et=lC[wt=ae.charAt(++rt)])!=null?wt=ae.charAt(++rt):Et=wt==="e"?" ":"0",(Sr=Se[wt])&&(wt=Sr(Me,Et)),se.push(wt),Fe=rt+1);return se.push(ae.slice(Fe,rt)),se.join("")}}function N(ae,Se){return function(Me){var se=bc(1900,void 0,1),rt=R(se,ae,Me+="",0),Fe,kt;if(rt!=Me.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(Se&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(Fe=J0(bc(se.y,0,1)),kt=Fe.getUTCDay(),Fe=kt>4||kt===0?Sh.ceil(Fe):Sh(Fe),Fe=kp.offset(Fe,(se.V-1)*7),se.y=Fe.getUTCFullYear(),se.m=Fe.getUTCMonth(),se.d=Fe.getUTCDate()+(se.w+6)%7):(Fe=Y0(bc(se.y,0,1)),kt=Fe.getDay(),Fe=kt>4||kt===0?_h.ceil(Fe):_h(Fe),Fe=Fu.offset(Fe,(se.V-1)*7),se.y=Fe.getFullYear(),se.m=Fe.getMonth(),se.d=Fe.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),kt="Z"in se?J0(bc(se.y,0,1)).getUTCDay():Y0(bc(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(kt+5)%7:se.w+se.U*7-(kt+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,J0(se)):Y0(se)}}function R(ae,Se,Me,se){for(var rt=0,Fe=Se.length,kt=Me.length,wt,Et;rt<Fe;){if(se>=kt)return-1;if(wt=Se.charCodeAt(rt++),wt===37){if(wt=Se.charAt(rt++),Et=E[wt in lC?Se.charAt(rt++):wt],!Et||(se=Et(ae,Me,se))<0)return-1}else if(wt!=Me.charCodeAt(se++))return-1}return se}function I(ae,Se,Me){var se=d.exec(Se.slice(Me));return se?(ae.p=p.get(se[0].toLowerCase()),Me+se[0].length):-1}function K(ae,Se,Me){var se=v.exec(Se.slice(Me));return se?(ae.w=x.get(se[0].toLowerCase()),Me+se[0].length):-1}function B(ae,Se,Me){var se=f.exec(Se.slice(Me));return se?(ae.w=y.get(se[0].toLowerCase()),Me+se[0].length):-1}function U(ae,Se,Me){var se=S.exec(Se.slice(Me));return se?(ae.m=A.get(se[0].toLowerCase()),Me+se[0].length):-1}function V(ae,Se,Me){var se=w.exec(Se.slice(Me));return se?(ae.m=b.get(se[0].toLowerCase()),Me+se[0].length):-1}function H(ae,Se,Me){return R(ae,e,Se,Me)}function Y(ae,Se,Me){return R(ae,r,Se,Me)}function G(ae,Se,Me){return R(ae,n,Se,Me)}function Q(ae){return o[ae.getDay()]}function W(ae){return a[ae.getDay()]}function ee(ae){return u[ae.getMonth()]}function q(ae){return c[ae.getMonth()]}function $(ae){return i[+(ae.getHours()>=12)]}function M(ae){return 1+~~(ae.getMonth()/3)}function J(ae){return o[ae.getUTCDay()]}function oe(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=T(ae+="",O);return Se.toString=function(){return ae},Se},parse:function(ae){var Se=N(ae+="",!1);return Se.toString=function(){return ae},Se},utcFormat:function(ae){var Se=T(ae+="",C);return Se.toString=function(){return ae},Se},utcParse:function(ae){var Se=N(ae+="",!0);return Se.toString=function(){return ae},Se}}}var lC={"-":"",_:" ",0:"0"},gr=/^\s*\d+/,xK=/^%/,wK=/[\\^$*+?|[\]().{}]/g;function ft(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 _K(t){return t.replace(wK,"\\$&")}function xc(t){return new RegExp("^(?:"+t.map(_K).join("|")+")","i")}function wc(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function SK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function kK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function EK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function OK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function AK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function cC(t,e,r){var n=gr.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function uC(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 TK(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 CK(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 jK(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 dC(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function NK(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 fC(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function PK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function RK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function IK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function $K(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 MK(t,e,r){var n=xK.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function LK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function DK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function hC(t,e){return ft(t.getDate(),e,2)}function zK(t,e){return ft(t.getHours(),e,2)}function BK(t,e){return ft(t.getHours()%12||12,e,2)}function UK(t,e){return ft(1+Fu.count(Ji(t),t),e,3)}function GI(t,e){return ft(t.getMilliseconds(),e,3)}function qK(t,e){return GI(t,e)+"000"}function FK(t,e){return ft(t.getMonth()+1,e,2)}function HK(t,e){return ft(t.getMinutes(),e,2)}function WK(t,e){return ft(t.getSeconds(),e,2)}function GK(t){var e=t.getDay();return e===0?7:e}function KK(t,e){return ft(Ep.count(Ji(t)-1,t),e,2)}function KI(t){var e=t.getDay();return e>=4||e===0?Qs(t):Qs.ceil(t)}function VK(t,e){return t=KI(t),ft(Qs.count(Ji(t),t)+(Ji(t).getDay()===4),e,2)}function XK(t){return t.getDay()}function YK(t,e){return ft(_h.count(Ji(t)-1,t),e,2)}function JK(t,e){return ft(t.getFullYear()%100,e,2)}function ZK(t,e){return t=KI(t),ft(t.getFullYear()%100,e,2)}function QK(t,e){return ft(t.getFullYear()%1e4,e,4)}function eV(t,e){var r=t.getDay();return t=r>=4||r===0?Qs(t):Qs.ceil(t),ft(t.getFullYear()%1e4,e,4)}function tV(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ft(e/60|0,"0",2)+ft(e%60,"0",2)}function pC(t,e){return ft(t.getUTCDate(),e,2)}function rV(t,e){return ft(t.getUTCHours(),e,2)}function nV(t,e){return ft(t.getUTCHours()%12||12,e,2)}function iV(t,e){return ft(1+kp.count(Zi(t),t),e,3)}function VI(t,e){return ft(t.getUTCMilliseconds(),e,3)}function aV(t,e){return VI(t,e)+"000"}function oV(t,e){return ft(t.getUTCMonth()+1,e,2)}function sV(t,e){return ft(t.getUTCMinutes(),e,2)}function lV(t,e){return ft(t.getUTCSeconds(),e,2)}function cV(t){var e=t.getUTCDay();return e===0?7:e}function uV(t,e){return ft(Op.count(Zi(t)-1,t),e,2)}function XI(t){var e=t.getUTCDay();return e>=4||e===0?el(t):el.ceil(t)}function dV(t,e){return t=XI(t),ft(el.count(Zi(t),t)+(Zi(t).getUTCDay()===4),e,2)}function fV(t){return t.getUTCDay()}function hV(t,e){return ft(Sh.count(Zi(t)-1,t),e,2)}function pV(t,e){return ft(t.getUTCFullYear()%100,e,2)}function mV(t,e){return t=XI(t),ft(t.getUTCFullYear()%100,e,2)}function gV(t,e){return ft(t.getUTCFullYear()%1e4,e,4)}function yV(t,e){var r=t.getUTCDay();return t=r>=4||r===0?el(t):el.ceil(t),ft(t.getUTCFullYear()%1e4,e,4)}function vV(){return"+0000"}function mC(){return"%"}function gC(t){return+t}function yC(t){return Math.floor(+t/1e3)}var Es,YI,JI;bV({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 bV(t){return Es=bK(t),YI=Es.format,Es.parse,JI=Es.utcFormat,Es.utcParse,Es}function xV(t){return new Date(t)}function wV(t){return t instanceof Date?+t:+new Date(+t)}function H1(t,e,r,n,i,a,o,c,u,d){var p=j1(),f=p.invert,y=p.domain,v=d(".%L"),x=d(":%S"),w=d("%I:%M"),b=d("%I %p"),S=d("%a %d"),A=d("%b %d"),O=d("%B"),C=d("%Y");function E(T){return(u(T)<T?v:c(T)<T?x:o(T)<T?w:a(T)<T?b:n(T)<T?i(T)<T?S:A:r(T)<T?O:C)(T)}return p.invert=function(T){return new Date(f(T))},p.domain=function(T){return arguments.length?y(Array.from(T,wV)):y().map(xV)},p.ticks=function(T){var N=y();return t(N[0],N[N.length-1],T??10)},p.tickFormat=function(T,N){return N==null?E:d(N)},p.nice=function(T){var N=y();return(!T||typeof T.range!="function")&&(T=e(N[0],N[N.length-1],T??10)),T?y(LI(N,T)):p},p.copy=function(){return qu(p,H1(t,e,r,n,i,a,o,c,u,d))},p}function _V(){return Pn.apply(H1(yK,vK,Ji,q1,Ep,Fu,B1,D1,Ao,YI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function SV(){return Pn.apply(H1(mK,gK,Zi,F1,Op,kp,U1,z1,Ao,JI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ap(){var t=0,e=1,r,n,i,a,o=Br,c=!1,u;function d(f){return f==null||isNaN(f=+f)?u:o(i===0?.5:(f=(a(f)-r)*i,c?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([t,e]=f,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),d):[t,e]},d.clamp=function(f){return arguments.length?(c=!!f,d):c},d.interpolator=function(f){return arguments.length?(o=f,d):o};function p(f){return function(y){var v,x;return arguments.length?([v,x]=y,o=f(v,x),d):[o(0),o(1)]}}return d.range=p(Ol),d.rangeRound=p(C1),d.unknown=function(f){return arguments.length?(u=f,d):u},function(f){return a=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),d}}function Ka(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function ZI(){var t=Ga(Ap()(Br));return t.copy=function(){return Ka(t,ZI())},ia.apply(t,arguments)}function QI(){var t=R1(Ap()).domain([1,10]);return t.copy=function(){return Ka(t,QI()).base(t.base())},ia.apply(t,arguments)}function e$(){var t=I1(Ap());return t.copy=function(){return Ka(t,e$()).constant(t.constant())},ia.apply(t,arguments)}function W1(){var t=$1(Ap());return t.copy=function(){return Ka(t,W1()).exponent(t.exponent())},ia.apply(t,arguments)}function kV(){return W1.apply(null,arguments).exponent(.5)}function t$(){var t=[],e=Br;function r(n){if(n!=null&&!isNaN(n=+n))return e((Bu(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(La),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)=>uG(t,a/n))},r.copy=function(){return t$(e).domain(t)},ia.apply(r,arguments)}function Tp(){var t=0,e=.5,r=1,n=1,i,a,o,c,u,d=Br,p,f=!1,y;function v(w){return isNaN(w=+w)?y:(w=.5+((w=+p(w))-a)*(n*w<n*a?c:u),d(f?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([t,e,r]=w,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(w){return arguments.length?(f=!!w,v):f},v.interpolator=function(w){return arguments.length?(d=w,v):d};function x(w){return function(b){var S,A,O;return arguments.length?([S,A,O]=b,d=MG(w,[S,A,O]),v):[d(0),d(.5),d(1)]}}return v.range=x(Ol),v.rangeRound=x(C1),v.unknown=function(w){return arguments.length?(y=w,v):y},function(w){return p=w,i=w(t),a=w(e),o=w(r),c=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function r$(){var t=Ga(Tp()(Br));return t.copy=function(){return Ka(t,r$())},ia.apply(t,arguments)}function n$(){var t=R1(Tp()).domain([.1,1,10]);return t.copy=function(){return Ka(t,n$()).base(t.base())},ia.apply(t,arguments)}function i$(){var t=I1(Tp());return t.copy=function(){return Ka(t,i$()).constant(t.constant())},ia.apply(t,arguments)}function G1(){var t=$1(Tp());return t.copy=function(){return Ka(t,G1()).exponent(t.exponent())},ia.apply(t,arguments)}function EV(){return G1.apply(null,arguments).exponent(.5)}const vC=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ru,scaleDiverging:r$,scaleDivergingLog:n$,scaleDivergingPow:G1,scaleDivergingSqrt:EV,scaleDivergingSymlog:i$,scaleIdentity:MI,scaleImplicit:Nx,scaleLinear:xh,scaleLog:DI,scaleOrdinal:O1,scalePoint:Lc,scalePow:M1,scaleQuantile:UI,scaleQuantize:qI,scaleRadial:BI,scaleSequential:ZI,scaleSequentialLog:QI,scaleSequentialPow:W1,scaleSequentialQuantile:t$,scaleSequentialSqrt:kV,scaleSequentialSymlog:e$,scaleSqrt:aK,scaleSymlog:zI,scaleThreshold:FI,scaleTime:_V,scaleUtc:SV,tickFormat:$I},Symbol.toStringTag,{value:"Module"}));var Z0,bC;function a$(){if(bC)return Z0;bC=1;var t=_l();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 Z0=e,Z0}var Q0,xC;function OV(){if(xC)return Q0;xC=1;function t(e,r){return e>r}return Q0=t,Q0}var eb,wC;function AV(){if(wC)return eb;wC=1;var t=a$(),e=OV(),r=kl();function n(i){return i&&i.length?t(i,r,e):void 0}return eb=n,eb}var TV=AV();const Cp=vt(TV);var tb,_C;function CV(){if(_C)return tb;_C=1;function t(e,r){return e<r}return tb=t,tb}var rb,SC;function jV(){if(SC)return rb;SC=1;var t=a$(),e=CV(),r=kl();function n(i){return i&&i.length?t(i,r,e):void 0}return rb=n,rb}var NV=jV();const jp=vt(NV);var nb,kC;function PV(){if(kC)return nb;kC=1;var t=l1(),e=Wa(),r=pI(),n=Qr();function i(a,o){var c=n(a)?t:r;return c(a,e(o,3))}return nb=i,nb}var ib,EC;function RV(){if(EC)return ib;EC=1;var t=fI(),e=PV();function r(n,i){return t(e(n,i),1)}return ib=r,ib}var IV=RV();const $V=vt(IV);var ab,OC;function MV(){if(OC)return ab;OC=1;var t=w1();function e(r,n){return t(r,n)}return ab=e,ab}var LV=MV();const Np=vt(LV);var Al=1e9,DV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},V1,$t=!0,jn="[DecimalError] ",No=jn+"Invalid argument: ",K1=jn+"Exponent out of range: ",Tl=Math.floor,_o=Math.pow,zV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,un,mr=1e7,Nt=7,o$=9007199254740991,kh=Tl(o$/Nt),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)*Nt;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(jn+"NaN");if(r.s<1)throw Error(jn+(r.s?"NaN":"-Infinity"));return r.eq(un)?new n(0):($t=!1,e=Vi(su(r,a),su(t,a),a),$t=!0,St(e,i))};Te.minus=Te.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?c$(e,t):s$(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(jn+"NaN");return r.s?($t=!1,e=Vi(r,t,0,1).times(t),$t=!0,r.minus(e)):St(new n(r),i)};Te.naturalExponential=Te.exp=function(){return l$(this)};Te.naturalLogarithm=Te.ln=function(){return su(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?s$(e,t):c$(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(No+t);if(e=er(i)+1,n=i.d.length-1,r=n*Nt+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(jn+"NaN")}for(t=er(c),$t=!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=Tl((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 $t=!0,St(n,r)};Te.times=Te.mul=function(t){var e,r,n,i,a,o,c,u,d,p=this,f=p.constructor,y=p.d,v=(t=new f(t)).d;if(!p.s||!t.s)return new f(0);for(t.s*=p.s,r=p.e+t.e,u=y.length,d=v.length,u<d&&(a=y,y=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]*y[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,$t?St(t,f.precision):t};Te.toDecimalPlaces=Te.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Ei(t,0,Al),e===void 0?e=n.rounding:Ei(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=$o(n,!0):(Ei(t,0,Al),e===void 0?e=i.rounding:Ei(e,0,8),n=St(new i(n),t+1,e),r=$o(n,!0,t+1)),r};Te.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?$o(i):(Ei(t,0,Al),e===void 0?e=a.rounding:Ei(e,0,8),n=St(new a(i),t+er(i)+1,e),r=$o(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(jn+"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)<=o$){for(i=new u(un),e=Math.ceil(n/Nt+4),$t=!1;r%2&&(i=i.times(c),TC(i.d,e)),r=Tl(r/2),r!==0;)c=c.times(c),TC(c.d,e);return $t=!0,t.s<0?new u(un).div(i):St(i,n)}}else if(a<0)throw Error(jn+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,c.s=1,$t=!1,i=t.times(su(c,n+d)),$t=!0,i=l$(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=$o(i,r<=a.toExpNeg||r>=a.toExpPos)):(Ei(t,1,Al),e===void 0?e=a.rounding:Ei(e,0,8),i=St(new a(i),t,e),r=er(i),n=$o(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):(Ei(t,1,Al),e===void 0?e=n.rounding:Ei(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 $o(t,e<=r.toExpNeg||e>=r.toExpPos)};function s$(t,e){var r,n,i,a,o,c,u,d,p=t.constructor,f=p.precision;if(!t.s||!e.s)return e.s||(e=new p(t)),$t?St(e,f):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(f/Nt),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,$t?St(e,f):e}function Ei(t,e,r){if(t!==~~t||t<e||t>r)throw Error(No+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=Nt-n.length,r&&(a+=Ca(r)),a+=n;o=t[e],n=o+"",r=Nt-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,f,y,v,x,w,b,S,A,O,C,E,T,N,R,I=n.constructor,K=n.s==i.s?1:-1,B=n.d,U=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(jn+"Division by zero");for(u=n.e-i.e,N=U.length,E=B.length,v=new I(K),x=v.d=[],d=0;U[d]==(B[d]||0);)++d;if(U[d]>(B[d]||0)&&--u,a==null?A=a=I.precision:o?A=a+(er(n)-er(i))+1:A=a,A<0)return new I(0);if(A=A/Nt+2|0,d=0,N==1)for(p=0,U=U[0],A++;(d<E||p)&&A--;d++)O=p*mr+(B[d]||0),x[d]=O/U|0,p=O%U|0;else{for(p=mr/(U[0]+1)|0,p>1&&(U=t(U,p),B=t(B,p),N=U.length,E=B.length),C=N,w=B.slice(0,N),b=w.length;b<N;)w[b++]=0;R=U.slice(),R.unshift(0),T=U[0],U[1]>=mr/2&&++T;do p=0,c=e(U,w,N,b),c<0?(S=w[0],N!=b&&(S=S*mr+(w[1]||0)),p=S/T|0,p>1?(p>=mr&&(p=mr-1),f=t(U,p),y=f.length,b=w.length,c=e(f,w,y,b),c==1&&(p--,r(f,N<y?R:U,y))):(p==0&&(c=p=1),f=U.slice()),y=f.length,y<b&&f.unshift(0),r(w,f,b),c==-1&&(b=w.length,c=e(U,w,N,b),c<1&&(p++,r(w,N<b?R:U,b))),b=w.length):c===0&&(p++,w=[0]),x[d++]=p,c&&w[0]?w[b++]=B[C]||0:(w=[B[C]],b=1);while((C++<E||w[0]!==void 0)&&A--)}return x[0]||x.shift(),v.e=u,St(v,o?a+er(v)+1:a)}})();function l$(t,e){var r,n,i,a,o,c,u=0,d=0,p=t.constructor,f=p.precision;if(er(t)>16)throw Error(K1+er(t));if(!t.s)return new p(un);for($t=!1,c=f,o=new p(.03125);t.abs().gte(.1);)t=t.times(o),d+=5;for(n=Math.log(_o(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=f,e==null?($t=!0,St(a,f)):a}a=o}}function er(t){for(var e=t.e*Nt,r=t.d[0];r>=10;r/=10)e++;return e}function ob(t,e,r){if(e>t.LN10.sd())throw $t=!0,r&&(t.precision=r),Error(jn+"LN10 precision limit exceeded");return St(new t(t.LN10),e)}function Ca(t){for(var e="";t--;)e+="0";return e}function su(t,e){var r,n,i,a,o,c,u,d,p,f=1,y=10,v=t,x=v.d,w=v.constructor,b=w.precision;if(v.s<1)throw Error(jn+(v.s?"NaN":"-Infinity"));if(v.eq(un))return new w(0);if(e==null?($t=!1,d=b):d=e,v.eq(10))return e==null&&($t=!0),ob(w,d);if(d+=y,w.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),f++;a=er(v),n>1?(v=new w("0."+r),a++):v=new w(n+"."+r.slice(1))}else return u=ob(w,d+2,b).times(a+""),v=su(new w(n+"."+r.slice(1)),d-y).plus(u),w.precision=b,e==null?($t=!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 w(i),d)),wi(u.d).slice(0,d)===wi(c.d).slice(0,d))return c=c.times(2),a!==0&&(c=c.plus(ob(w,d+2,b).times(a+""))),c=Vi(c,new w(f),d),w.precision=b,e==null?($t=!0,St(c,b)):c;c=u,i+=2}}function AC(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=Tl(r/Nt),t.d=[],n=(r+1)%Nt,r<0&&(n+=Nt),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=Nt;n<i;)t.d.push(+e.slice(n,n+=Nt));e=e.slice(n),n=Nt-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),$t&&(t.e>kh||t.e<-kh))throw Error(K1+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,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=Nt,i=e,d=f[p=0];else{if(p=Math.ceil((n+1)/Nt),a=f.length,p>=a)return t;for(d=a=f[p],o=1;a>=10;a/=10)o++;n%=Nt,i=n-Nt+o}if(r!==void 0&&(a=_o(10,o-i-1),c=d/a%10|0,u=e<0||f[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/_o(10,o-i):0:f[p-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return u?(a=er(t),f.length=1,e=e-a-1,f[0]=_o(10,(Nt-e%Nt)%Nt),t.e=Tl(-e/Nt)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=p,a=1,p--):(f.length=p+1,a=_o(10,Nt-n),f[p]=i>0?(d/_o(10,o-i)%_o(10,i)|0)*a:0),u)for(;;)if(p==0){(f[0]+=a)==mr&&(f[0]=1,++t.e);break}else{if(f[p]+=a,f[p]!=mr)break;f[p--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if($t&&(t.e>kh||t.e<-kh))throw Error(K1+er(t));return t}function c$(t,e){var r,n,i,a,o,c,u,d,p,f,y=t.constructor,v=y.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new y(t),$t?St(e,v):e;if(u=t.d,f=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=f.length):(r=f,n=d,c=u.length),i=Math.max(Math.ceil(v/Nt),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=f.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(u[i]!=f[i]){p=u[i]<f[i];break}o=0}for(p&&(r=u,u=f,f=r,e.s=-e.s),c=u.length,i=f.length-c;i>0;--i)u[c++]=0;for(i=f.length;i>o;){if(u[--i]<f[i]){for(a=i;a&&u[--a]===0;)u[a]=mr-1;--u[a],u[i]+=mr}u[i]-=f[i]}for(;u[--c]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=n,$t?St(e,v):e):new y(0)}function $o(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 TC(t,e){if(t.length>e)return t.length=e,!0}function u$(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(No+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 AC(o,a.toString())}else if(typeof a!="string")throw Error(No+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,zV.test(a))AC(o,a);else throw Error(No+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=u$,i.config=i.set=BV,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 BV(t){if(!t||typeof t!="object")throw Error(jn+"Object expected");var e,r,n,i=["precision",1,Al,"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(Tl(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(No+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(No+r+": "+n);return this}var V1=u$(DV);un=new V1(1);const xt=V1;function UV(t){return WV(t)||HV(t)||FV(t)||qV()}function qV(){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 VW(t,e){if(t){if(typeof t=="string")return P2(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 P2(t,e)}}function P2(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 YW(t){if(Array.isArray(t))return t}var EI=/[ \f\n\r\t\v\u2028\u2029]+/,OI=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];tt(r)||(n?a=r.toString().split(""):a=r.toString().split(EI));var o=a.map(function(u){return{word:u,width:Mc(u,i).width}}),c=n?0:Mc(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},JW=function(e,r,n,i,a){var o=e.maxLines,c=e.children,u=e.style,d=e.breakAll,p=ge(o),f=c,y=function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Y.reduce(function(G,Q){var W=Q.word,ee=Q.width,q=G[G.length-1];if(q&&(i==null||a||q.width+ee+n<Number(i)))q.words.push(W),q.width+=ee+n;else{var $={words:[W],width:ee};G.push($)}return G},[])},v=y(r),x=function(Y){return Y.reduce(function(G,Q){return G.width>Q.width?G:Q})};if(!p)return v;for(var w="…",b=function(Y){var G=f.slice(0,Y),Q=OI({breakAll:d,style:u,children:G+w}).wordsWithComputedWidth,W=y(Q),ee=W.length>o||x(W).width>Number(i);return[ee,W]},S=0,A=f.length-1,O=0,C;S<=A&&O<=f.length-1;){var E=Math.floor((S+A)/2),T=E-1,N=b(T),R=N2(N,2),I=R[0],K=R[1],B=b(E),U=N2(B,1),V=U[0];if(!I&&!V&&(S=E+1),I&&V&&(A=E-1),!I&&V){C=K;break}O++}return C||v},R2=function(e){var r=tt(e)?[]:e.toString().split(EI);return[{words:r}]},ZW=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,c=e.maxLines;if((r||n)&&!El.isSsr){var u,d,p=OI({breakAll:o,children:i,style:a});if(p){var f=p.wordsWithComputedWidth,y=p.spaceWidth;u=f,d=y}else return R2(i);return JW({breakAll:o,children:i,maxLines:c,style:a},u,d,r,n)}return R2(i)},I2="#808080",fh=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,f=p===void 0?!1:p,y=e.textAnchor,v=y===void 0?"start":y,x=e.verticalAnchor,w=x===void 0?"end":x,b=e.fill,S=b===void 0?I2:b,A=j2(e,HW),O=j.useMemo(function(){return ZW({breakAll:A.breakAll,children:A.children,maxLines:A.maxLines,scaleToFit:f,style:A.style,width:A.width})},[A.breakAll,A.children,A.maxLines,f,A.style,A.width]),C=A.dx,E=A.dy,T=A.angle,N=A.className,R=A.breakAll,I=j2(A,WW);if(!or(n)||!or(a))return null;var K=n+(ge(C)?C:0),B=a+(ge(E)?E:0),U;switch(w){case"start":U=H0("calc(".concat(d,")"));break;case"middle":U=H0("calc(".concat((O.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:U=H0("calc(".concat(O.length-1," * -").concat(c,")"));break}var V=[];if(f){var H=O[0].width,Y=A.width;V.push("scale(".concat((ge(Y)?Y/H:1)/H,")"))}return T&&V.push("rotate(".concat(T,", ").concat(K,", ").concat(B,")")),V.length&&(I.transform=V.join(" ")),L.createElement("text",Ax({},at(I,!0),{x:K,y:B,className:ot("recharts-text",N),textAnchor:v,fill:S.includes("url")?I2:S}),O.map(function(G,Q){var W=G.words.join(R?"":" ");return L.createElement("tspan",{x:K,dy:Q===0?U:c,key:"".concat(W,"-").concat(Q)},W)}))};function La(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 E1(t){let e,r,n;t.length!==2?(e=La,r=(c,u)=>La(t(c),u),n=(c,u)=>t(c)-u):(e=t===La||t===QW?t:eG,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 f=d+p>>>1;r(c[f],u)<0?d=f+1:p=f}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 f=d+p>>>1;r(c[f],u)<=0?d=f+1:p=f}while(d<p)}return d}function o(c,u,d=0,p=c.length){const f=i(c,u,d,p-1);return f>d&&n(c[f-1],u)>-n(c[f],u)?f-1:f}return{left:i,center:o,right:a}}function eG(){return 0}function AI(t){return t===null?NaN:+t}function*tG(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const rG=E1(La),Bu=rG.right;E1(AI).center;class $2 extends Map{constructor(e,r=aG){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(M2(this,e))}has(e){return super.has(M2(this,e))}set(e,r){return super.set(nG(this,e),r)}delete(e){return super.delete(iG(this,e))}}function M2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function nG({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function iG({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function aG(t){return t!==null&&typeof t=="object"?t.valueOf():t}function oG(t=La){if(t===La)return TI;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 TI(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const sG=Math.sqrt(50),lG=Math.sqrt(10),cG=Math.sqrt(2);function hh(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>=sG?10:a>=lG?5:a>=cG?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?hh(t,e,r*2):[c,u,d]}function Tx(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?hh(e,t,r):hh(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 Cx(t,e,r){return e=+e,t=+t,r=+r,hh(t,e,r)[2]}function jx(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?Cx(e,t,r):Cx(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function L2(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function D2(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function CI(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?TI:oG(i);n>r;){if(n-r>600){const u=n-r+1,d=e-r+1,p=Math.log(u),f=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*f*(u-f)/u)*(d-u/2<0?-1:1),v=Math.max(r,Math.floor(e-d*f/u+y)),x=Math.min(n,Math.floor(e+(u-d)*f/u+y));CI(t,e,v,x,i)}const a=t[e];let o=r,c=n;for(vc(t,r,e),i(t[n],a)>0&&vc(t,r,n);o<c;){for(vc(t,o,c),++o,--c;i(t[o],a)<0;)++o;for(;i(t[c],a)>0;)--c}i(t[r],a)===0?vc(t,r,c):(++c,vc(t,c,n)),c<=e&&(r=c+1),e<=c&&(n=c-1)}return t}function vc(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function uG(t,e,r){if(t=Float64Array.from(tG(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return D2(t);if(e>=1)return L2(t);var n,i=(n-1)*e,a=Math.floor(i),o=L2(CI(t,a).subarray(0,a+1)),c=D2(t.subarray(a+1));return o+(c-o)*(i-a)}}function dG(t,e,r=AI){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 fG(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 Nx=Symbol("implicit");function O1(){var t=new $2,e=[],r=[],n=Nx;function i(a){let o=t.get(a);if(o===void 0){if(n!==Nx)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 O1(e,r).unknown(n)},Pn.apply(i,arguments),i}function ru(){var t=O1().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 f(){var y=e().length,v=i<n,x=v?i:n,w=v?n:i;a=(w-x)/Math.max(1,y-u+d*2),c&&(a=Math.floor(a)),x+=(w-x-a*(y-u))*p,o=a*(1-u),c&&(x=Math.round(x),o=Math.round(o));var b=fG(y).map(function(S){return x+a*S});return r(v?b.reverse():b)}return t.domain=function(y){return arguments.length?(e(y),f()):e()},t.range=function(y){return arguments.length?([n,i]=y,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(y){return[n,i]=y,n=+n,i=+i,c=!0,f()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(y){return arguments.length?(c=!!y,f()):c},t.padding=function(y){return arguments.length?(u=Math.min(1,d=+y),f()):u},t.paddingInner=function(y){return arguments.length?(u=Math.min(1,y),f()):u},t.paddingOuter=function(y){return arguments.length?(d=+y,f()):d},t.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),f()):p},t.copy=function(){return ru(e(),[n,i]).round(c).paddingInner(u).paddingOuter(d).align(p)},Pn.apply(f(),arguments)}function jI(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return jI(e())},t}function Lc(){return jI(ru.apply(null,arguments).paddingInner(1))}function A1(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function NI(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Uu(){}var nu=.7,ph=1/nu,qs="\\s*([+-]?\\d+)\\s*",iu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hG=/^#([0-9a-f]{3,8})$/,pG=new RegExp(`^rgb\\(${qs},${qs},${qs}\\)$`),mG=new RegExp(`^rgb\\(${Si},${Si},${Si}\\)$`),gG=new RegExp(`^rgba\\(${qs},${qs},${qs},${iu}\\)$`),yG=new RegExp(`^rgba\\(${Si},${Si},${Si},${iu}\\)$`),vG=new RegExp(`^hsl\\(${iu},${Si},${Si}\\)$`),bG=new RegExp(`^hsla\\(${iu},${Si},${Si},${iu}\\)$`),z2={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};A1(Uu,au,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:B2,formatHex:B2,formatHex8:xG,formatHsl:wG,formatRgb:U2,toString:U2});function B2(){return this.rgb().formatHex()}function xG(){return this.rgb().formatHex8()}function wG(){return PI(this).formatHsl()}function U2(){return this.rgb().formatRgb()}function au(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=hG.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?q2(e):r===3?new Zr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?xf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?xf(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=pG.exec(t))?new Zr(e[1],e[2],e[3],1):(e=mG.exec(t))?new Zr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=gG.exec(t))?xf(e[1],e[2],e[3],e[4]):(e=yG.exec(t))?xf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=vG.exec(t))?W2(e[1],e[2]/100,e[3]/100,1):(e=bG.exec(t))?W2(e[1],e[2]/100,e[3]/100,e[4]):z2.hasOwnProperty(t)?q2(z2[t]):t==="transparent"?new Zr(NaN,NaN,NaN,0):null}function q2(t){return new Zr(t>>16&255,t>>8&255,t&255,1)}function xf(t,e,r,n){return n<=0&&(t=e=r=NaN),new Zr(t,e,r,n)}function _G(t){return t instanceof Uu||(t=au(t)),t?(t=t.rgb(),new Zr(t.r,t.g,t.b,t.opacity)):new Zr}function Px(t,e,r,n){return arguments.length===1?_G(t):new Zr(t,e,r,n??1)}function Zr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}A1(Zr,Px,NI(Uu,{brighter(t){return t=t==null?ph:Math.pow(ph,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?nu:Math.pow(nu,t),new Zr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zr(jo(this.r),jo(this.g),jo(this.b),mh(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:F2,formatHex:F2,formatHex8:SG,formatRgb:H2,toString:H2}));function F2(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}`}function SG(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}${Oo((isNaN(this.opacity)?1:this.opacity)*255)}`}function H2(){const t=mh(this.opacity);return`${t===1?"rgb(":"rgba("}${jo(this.r)}, ${jo(this.g)}, ${jo(this.b)}${t===1?")":`, ${t})`}`}function mh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function jo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oo(t){return t=jo(t),(t<16?"0":"")+t.toString(16)}function W2(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 PI(t){if(t instanceof Yn)return new Yn(t.h,t.s,t.l,t.opacity);if(t instanceof Uu||(t=au(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 kG(t,e,r,n){return arguments.length===1?PI(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}A1(Yn,kG,NI(Uu,{brighter(t){return t=t==null?ph:Math.pow(ph,t),new Yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?nu:Math.pow(nu,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 Zr(W0(t>=240?t-240:t+120,i,n),W0(t,i,n),W0(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Yn(G2(this.h),wf(this.s),wf(this.l),mh(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=mh(this.opacity);return`${t===1?"hsl(":"hsla("}${G2(this.h)}, ${wf(this.s)*100}%, ${wf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function G2(t){return t=(t||0)%360,t<0?t+360:t}function wf(t){return Math.max(0,Math.min(1,t||0))}function W0(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 T1=t=>()=>t;function EG(t,e){return function(r){return t+r*e}}function OG(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 AG(t){return(t=+t)==1?RI:function(e,r){return r-e?OG(e,r,t):T1(isNaN(e)?r:e)}}function RI(t,e){var r=e-t;return r?EG(t,r):T1(isNaN(t)?e:t)}const K2=(function t(e){var r=AG(e);function n(i,a){var o=r((i=Px(i)).r,(a=Px(a)).r),c=r(i.g,a.g),u=r(i.b,a.b),d=RI(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 TG(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 CG(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function jG(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]=Ol(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 NG(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function gh(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function PG(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]=Ol(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Rx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,G0=new RegExp(Rx.source,"g");function RG(t){return function(){return t}}function IG(t){return function(e){return t(e)+""}}function $G(t,e){var r=Rx.lastIndex=G0.lastIndex=0,n,i,a,o=-1,c=[],u=[];for(t=t+"",e=e+"";(n=Rx.exec(t))&&(i=G0.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:gh(n,i)})),r=G0.lastIndex;return r<e.length&&(a=e.slice(r),c[o]?c[o]+=a:c[++o]=a),c.length<2?u[0]?IG(u[0].x):RG(e):(e=u.length,function(d){for(var p=0,f;p<e;++p)c[(f=u[p]).i]=f.x(d);return c.join("")})}function Ol(t,e){var r=typeof e,n;return e==null||r==="boolean"?T1(e):(r==="number"?gh:r==="string"?(n=au(e))?(e=n,K2):$G:e instanceof au?K2:e instanceof Date?NG:CG(e)?TG:Array.isArray(e)?jG:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?PG:gh)(t,e)}function C1(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function MG(t,e){e===void 0&&(e=t,t=Ol);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 LG(t){return function(){return t}}function yh(t){return+t}var V2=[0,1];function Br(t){return t}function Ix(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:LG(isNaN(e)?NaN:.5)}function DG(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function zG(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Ix(i,n),a=r(o,a)):(n=Ix(n,i),a=r(a,o)),function(c){return a(n(c))}}function BG(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]=Ix(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(c){var u=Bu(t,c,1,n)-1;return a[u](i[u](c))}}function qu(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Sp(){var t=V2,e=V2,r=Ol,n,i,a,o=Br,c,u,d;function p(){var y=Math.min(t.length,e.length);return o!==Br&&(o=DG(t[0],t[y-1])),c=y>2?BG:zG,u=d=null,f}function f(y){return y==null||isNaN(y=+y)?a:(u||(u=c(t.map(n),e,r)))(n(o(y)))}return f.invert=function(y){return o(i((d||(d=c(e,t.map(n),gh)))(y)))},f.domain=function(y){return arguments.length?(t=Array.from(y,yh),p()):t.slice()},f.range=function(y){return arguments.length?(e=Array.from(y),p()):e.slice()},f.rangeRound=function(y){return e=Array.from(y),r=C1,p()},f.clamp=function(y){return arguments.length?(o=y?!0:Br,p()):o!==Br},f.interpolate=function(y){return arguments.length?(r=y,p()):r},f.unknown=function(y){return arguments.length?(a=y,f):a},function(y,v){return n=y,i=v,p()}}function j1(){return Sp()(Br,Br)}function UG(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function vh(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 Zs(t){return t=vh(Math.abs(t)),t?t[1]:NaN}function qG(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 FG(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var HG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ou(t){if(!(e=HG.exec(t)))throw new Error("invalid format: "+t);var e;return new N1({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]})}ou.prototype=N1.prototype;function N1(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+""}N1.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 WG(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 bh;function GG(t,e){var r=vh(t,e);if(!r)return bh=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(bh=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")+vh(t,Math.max(0,e+a-1))[0]}function X2(t,e){var r=vh(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 Y2={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:UG,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)=>X2(t*100,e),r:X2,s:GG,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function J2(t){return t}var Z2=Array.prototype.map,Q2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function KG(t){var e=t.grouping===void 0||t.thousands===void 0?J2:qG(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?J2:FG(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(f,y){f=ou(f);var v=f.fill,x=f.align,w=f.sign,b=f.symbol,S=f.zero,A=f.width,O=f.comma,C=f.precision,E=f.trim,T=f.type;T==="n"?(O=!0,T="g"):Y2[T]||(C===void 0&&(C=12),E=!0,T="g"),(S||v==="0"&&x==="=")&&(S=!0,v="0",x="=");var N=(y&&y.prefix!==void 0?y.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),R=(b==="$"?n:/[%p]/.test(T)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),I=Y2[T],K=/[defgprs%]/.test(T);C=C===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function B(U){var V=N,H=R,Y,G,Q;if(T==="c")H=I(U)+H,U="";else{U=+U;var W=U<0||1/U<0;if(U=isNaN(U)?u:I(Math.abs(U),C),E&&(U=WG(U)),W&&+U==0&&w!=="+"&&(W=!1),V=(W?w==="("?w:c:w==="-"||w==="("?"":w)+V,H=(T==="s"&&!isNaN(U)&&bh!==void 0?Q2[8+bh/3]:"")+H+(W&&w==="("?")":""),K){for(Y=-1,G=U.length;++Y<G;)if(Q=U.charCodeAt(Y),48>Q||Q>57){H=(Q===46?i+U.slice(Y+1):U.slice(Y))+H,U=U.slice(0,Y);break}}}O&&!S&&(U=e(U,1/0));var ee=V.length+U.length+H.length,q=ee<A?new Array(A-ee+1).join(v):"";switch(O&&S&&(U=e(q+U,q.length?A-H.length:1/0),q=""),x){case"<":U=V+U+H+q;break;case"=":U=V+q+U+H;break;case"^":U=q.slice(0,ee=q.length>>1)+V+U+H+q.slice(ee);break;default:U=q+V+U+H;break}return a(U)}return B.toString=function(){return f+""},B}function p(f,y){var v=Math.max(-8,Math.min(8,Math.floor(Zs(y)/3)))*3,x=Math.pow(10,-v),w=d((f=ou(f),f.type="f",f),{suffix:Q2[8+v/3]});return function(b){return w(x*b)}}return{format:d,formatPrefix:p}}var _f,P1,II;VG({thousands:",",grouping:[3],currency:["$",""]});function VG(t){return _f=KG(t),P1=_f.format,II=_f.formatPrefix,_f}function XG(t){return Math.max(0,-Zs(Math.abs(t)))}function YG(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zs(e)/3)))*3-Zs(Math.abs(t)))}function JG(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Zs(e)-Zs(t))+1}function $I(t,e,r,n){var i=jx(t,e,r),a;switch(n=ou(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=YG(i,o))&&(n.precision=a),II(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=JG(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=XG(i))&&(n.precision=a-(n.type==="%")*2);break}}return P1(n)}function Ga(t){var e=t.domain;return t.ticks=function(r){var n=e();return Tx(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=Cx(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 xh(){var t=j1();return t.copy=function(){return qu(t,xh())},Pn.apply(t,arguments),Ga(t)}function MI(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,yh),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return MI(t).unknown(e)},t=arguments.length?Array.from(t,yh):[0,1],Ga(r)}function LI(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 eC(t){return Math.log(t)}function tC(t){return Math.exp(t)}function ZG(t){return-Math.log(-t)}function QG(t){return-Math.exp(-t)}function eK(t){return isFinite(t)?+("1e"+t):t<0?0:t}function tK(t){return t===10?eK:t===Math.E?Math.exp:e=>Math.pow(t,e)}function rK(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 rC(t){return(e,r)=>-t(-e,r)}function R1(t){const e=t(eC,tC),r=e.domain;let n=10,i,a;function o(){return i=rK(n),a=tK(n),r()[0]<0?(i=rC(i),a=rC(a),t(ZG,QG)):t(eC,tC),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 f=p<d;f&&([d,p]=[p,d]);let y=i(d),v=i(p),x,w;const b=c==null?10:+c;let S=[];if(!(n%1)&&v-y<b){if(y=Math.floor(y),v=Math.ceil(v),d>0){for(;y<=v;++y)for(x=1;x<n;++x)if(w=y<0?x/a(-y):x*a(y),!(w<d)){if(w>p)break;S.push(w)}}else for(;y<=v;++y)for(x=n-1;x>=1;--x)if(w=y>0?x/a(-y):x*a(y),!(w<d)){if(w>p)break;S.push(w)}S.length*2<b&&(S=Tx(d,p,b))}else S=Tx(y,v,Math.min(v-y,b)).map(a);return f?S.reverse():S},e.tickFormat=(c,u)=>{if(c==null&&(c=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=ou(u)).precision==null&&(u.trim=!0),u=P1(u)),c===1/0)return u;const d=Math.max(1,n*c/e.ticks().length);return p=>{let f=p/a(Math.round(i(p)));return f*n<n-.5&&(f*=n),f<=d?u(p):""}},e.nice=()=>r(LI(r(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),e}function DI(){const t=R1(Sp()).domain([1,10]);return t.copy=()=>qu(t,DI()).base(t.base()),Pn.apply(t,arguments),t}function nC(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function iC(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function I1(t){var e=1,r=t(nC(e),iC(e));return r.constant=function(n){return arguments.length?t(nC(e=+n),iC(e)):e},Ga(r)}function zI(){var t=I1(Sp());return t.copy=function(){return qu(t,zI()).constant(t.constant())},Pn.apply(t,arguments)}function aC(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function nK(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function iK(t){return t<0?-t*t:t*t}function $1(t){var e=t(Br,Br),r=1;function n(){return r===1?t(Br,Br):r===.5?t(nK,iK):t(aC(r),aC(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Ga(e)}function M1(){var t=$1(Sp());return t.copy=function(){return qu(t,M1()).exponent(t.exponent())},Pn.apply(t,arguments),t}function aK(){return M1.apply(null,arguments).exponent(.5)}function oC(t){return Math.sign(t)*t*t}function oK(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function BI(){var t=j1(),e=[0,1],r=!1,n;function i(a){var o=oK(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(oC(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,yh)).map(oC)),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 BI(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Pn.apply(i,arguments),Ga(i)}function UI(){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]=dG(t,o/c);return a}function a(o){return o==null||isNaN(o=+o)?n:e[Bu(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(La),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 UI().domain(t).range(e).unknown(n)},Pn.apply(a,arguments)}function qI(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Bu(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 qI().domain([t,e]).range(i).unknown(a)},Pn.apply(Ga(o),arguments)}function FI(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[Bu(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 FI().domain(t).range(e).unknown(r)},Pn.apply(i,arguments)}const K0=new Date,V0=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)=>(K0.setTime(+a),V0.setTime(+o),t(K0),t(V0),Math.floor(r(K0,V0))),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 wh=sr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);wh.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):wh);wh.range;const Fi=1e3,An=Fi*60,Hi=An*60,Yi=Hi*24,L1=Yi*7,sC=Yi*30,X0=Yi*365,Ao=sr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Fi)},(t,e)=>(e-t)/Fi,t=>t.getUTCSeconds());Ao.range;const D1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Fi)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getMinutes());D1.range;const z1=sr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getUTCMinutes());z1.range;const B1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Fi-t.getMinutes()*An)},(t,e)=>{t.setTime(+t+e*Hi)},(t,e)=>(e-t)/Hi,t=>t.getHours());B1.range;const U1=sr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Hi)},(t,e)=>(e-t)/Hi,t=>t.getUTCHours());U1.range;const Fu=sr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*An)/Yi,t=>t.getDate()-1);Fu.range;const kp=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>t.getUTCDate()-1);kp.range;const HI=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));HI.range;function qo(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())*An)/L1)}const Ep=qo(0),_h=qo(1),sK=qo(2),lK=qo(3),Qs=qo(4),cK=qo(5),uK=qo(6);Ep.range;_h.range;sK.range;lK.range;Qs.range;cK.range;uK.range;function Fo(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)/L1)}const Op=Fo(0),Sh=Fo(1),dK=Fo(2),fK=Fo(3),el=Fo(4),hK=Fo(5),pK=Fo(6);Op.range;Sh.range;dK.range;fK.range;el.range;hK.range;pK.range;const q1=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());q1.range;const F1=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());F1.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 WI(t,e,r,n,i,a){const o=[[Ao,1,Fi],[Ao,5,5*Fi],[Ao,15,15*Fi],[Ao,30,30*Fi],[a,1,An],[a,5,5*An],[a,15,15*An],[a,30,30*An],[i,1,Hi],[i,3,3*Hi],[i,6,6*Hi],[i,12,12*Hi],[n,1,Yi],[n,2,2*Yi],[r,1,L1],[e,1,sC],[e,3,3*sC],[t,1,X0]];function c(d,p,f){const y=p<d;y&&([d,p]=[p,d]);const v=f&&typeof f.range=="function"?f:u(d,p,f),x=v?v.range(d,+p+1):[];return y?x.reverse():x}function u(d,p,f){const y=Math.abs(p-d)/f,v=E1(([,,b])=>b).right(o,y);if(v===o.length)return t.every(jx(d/X0,p/X0,f));if(v===0)return wh.every(Math.max(jx(d,p,f),1));const[x,w]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return x.every(w)}return[c,u]}const[mK,gK]=WI(Zi,F1,Op,HI,U1,z1),[yK,vK]=WI(Ji,q1,Ep,Fu,B1,D1);function Y0(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 J0(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 bc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function bK(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=xc(i),p=wc(i),f=xc(a),y=wc(a),v=xc(o),x=wc(o),w=xc(c),b=wc(c),S=xc(u),A=wc(u),O={a:Q,A:W,b:ee,B:q,c:null,d:hC,e:hC,f:qK,g:ZK,G:eV,H:zK,I:BK,j:UK,L:GI,m:FK,M:HK,p:$,q:M,Q:gC,s:yC,S:WK,u:GK,U:KK,V:VK,w:XK,W:YK,x:null,X:null,y:JK,Y:QK,Z:tV,"%":mC},C={a:J,A:oe,b:le,B:ve,c:null,d:pC,e:pC,f:aV,g:mV,G:yV,H:rV,I:nV,j:iV,L:VI,m:oV,M:sV,p:qe,q:xe,Q:gC,s:yC,S:lV,u:cV,U:uV,V:dV,w:fV,W:hV,x:null,X:null,y:pV,Y:gV,Z:vV,"%":mC},E={a:K,A:B,b:U,B:V,c:H,d:dC,e:dC,f:$K,g:uC,G:cC,H:fC,I:fC,j:NK,L:IK,m:jK,M:PK,p:I,q:CK,Q:LK,s:DK,S:RK,u:kK,U:EK,V:OK,w:SK,W:AK,x:Y,X:G,y:uC,Y:cC,Z:TK,"%":MK};O.x=T(r,O),O.X=T(n,O),O.c=T(e,O),C.x=T(r,C),C.X=T(n,C),C.c=T(e,C);function T(ae,Se){return function(Me){var se=[],rt=-1,Fe=0,kt=ae.length,wt,Et,Sr;for(Me instanceof Date||(Me=new Date(+Me));++rt<kt;)ae.charCodeAt(rt)===37&&(se.push(ae.slice(Fe,rt)),(Et=lC[wt=ae.charAt(++rt)])!=null?wt=ae.charAt(++rt):Et=wt==="e"?" ":"0",(Sr=Se[wt])&&(wt=Sr(Me,Et)),se.push(wt),Fe=rt+1);return se.push(ae.slice(Fe,rt)),se.join("")}}function N(ae,Se){return function(Me){var se=bc(1900,void 0,1),rt=R(se,ae,Me+="",0),Fe,kt;if(rt!=Me.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(Se&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(Fe=J0(bc(se.y,0,1)),kt=Fe.getUTCDay(),Fe=kt>4||kt===0?Sh.ceil(Fe):Sh(Fe),Fe=kp.offset(Fe,(se.V-1)*7),se.y=Fe.getUTCFullYear(),se.m=Fe.getUTCMonth(),se.d=Fe.getUTCDate()+(se.w+6)%7):(Fe=Y0(bc(se.y,0,1)),kt=Fe.getDay(),Fe=kt>4||kt===0?_h.ceil(Fe):_h(Fe),Fe=Fu.offset(Fe,(se.V-1)*7),se.y=Fe.getFullYear(),se.m=Fe.getMonth(),se.d=Fe.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),kt="Z"in se?J0(bc(se.y,0,1)).getUTCDay():Y0(bc(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(kt+5)%7:se.w+se.U*7-(kt+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,J0(se)):Y0(se)}}function R(ae,Se,Me,se){for(var rt=0,Fe=Se.length,kt=Me.length,wt,Et;rt<Fe;){if(se>=kt)return-1;if(wt=Se.charCodeAt(rt++),wt===37){if(wt=Se.charAt(rt++),Et=E[wt in lC?Se.charAt(rt++):wt],!Et||(se=Et(ae,Me,se))<0)return-1}else if(wt!=Me.charCodeAt(se++))return-1}return se}function I(ae,Se,Me){var se=d.exec(Se.slice(Me));return se?(ae.p=p.get(se[0].toLowerCase()),Me+se[0].length):-1}function K(ae,Se,Me){var se=v.exec(Se.slice(Me));return se?(ae.w=x.get(se[0].toLowerCase()),Me+se[0].length):-1}function B(ae,Se,Me){var se=f.exec(Se.slice(Me));return se?(ae.w=y.get(se[0].toLowerCase()),Me+se[0].length):-1}function U(ae,Se,Me){var se=S.exec(Se.slice(Me));return se?(ae.m=A.get(se[0].toLowerCase()),Me+se[0].length):-1}function V(ae,Se,Me){var se=w.exec(Se.slice(Me));return se?(ae.m=b.get(se[0].toLowerCase()),Me+se[0].length):-1}function H(ae,Se,Me){return R(ae,e,Se,Me)}function Y(ae,Se,Me){return R(ae,r,Se,Me)}function G(ae,Se,Me){return R(ae,n,Se,Me)}function Q(ae){return o[ae.getDay()]}function W(ae){return a[ae.getDay()]}function ee(ae){return u[ae.getMonth()]}function q(ae){return c[ae.getMonth()]}function $(ae){return i[+(ae.getHours()>=12)]}function M(ae){return 1+~~(ae.getMonth()/3)}function J(ae){return o[ae.getUTCDay()]}function oe(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=T(ae+="",O);return Se.toString=function(){return ae},Se},parse:function(ae){var Se=N(ae+="",!1);return Se.toString=function(){return ae},Se},utcFormat:function(ae){var Se=T(ae+="",C);return Se.toString=function(){return ae},Se},utcParse:function(ae){var Se=N(ae+="",!0);return Se.toString=function(){return ae},Se}}}var lC={"-":"",_:" ",0:"0"},gr=/^\s*\d+/,xK=/^%/,wK=/[\\^$*+?|[\]().{}]/g;function ft(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 _K(t){return t.replace(wK,"\\$&")}function xc(t){return new RegExp("^(?:"+t.map(_K).join("|")+")","i")}function wc(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function SK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function kK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function EK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function OK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function AK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function cC(t,e,r){var n=gr.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function uC(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 TK(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 CK(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 jK(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 dC(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function NK(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 fC(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function PK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function RK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function IK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function $K(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 MK(t,e,r){var n=xK.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function LK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function DK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function hC(t,e){return ft(t.getDate(),e,2)}function zK(t,e){return ft(t.getHours(),e,2)}function BK(t,e){return ft(t.getHours()%12||12,e,2)}function UK(t,e){return ft(1+Fu.count(Ji(t),t),e,3)}function GI(t,e){return ft(t.getMilliseconds(),e,3)}function qK(t,e){return GI(t,e)+"000"}function FK(t,e){return ft(t.getMonth()+1,e,2)}function HK(t,e){return ft(t.getMinutes(),e,2)}function WK(t,e){return ft(t.getSeconds(),e,2)}function GK(t){var e=t.getDay();return e===0?7:e}function KK(t,e){return ft(Ep.count(Ji(t)-1,t),e,2)}function KI(t){var e=t.getDay();return e>=4||e===0?Qs(t):Qs.ceil(t)}function VK(t,e){return t=KI(t),ft(Qs.count(Ji(t),t)+(Ji(t).getDay()===4),e,2)}function XK(t){return t.getDay()}function YK(t,e){return ft(_h.count(Ji(t)-1,t),e,2)}function JK(t,e){return ft(t.getFullYear()%100,e,2)}function ZK(t,e){return t=KI(t),ft(t.getFullYear()%100,e,2)}function QK(t,e){return ft(t.getFullYear()%1e4,e,4)}function eV(t,e){var r=t.getDay();return t=r>=4||r===0?Qs(t):Qs.ceil(t),ft(t.getFullYear()%1e4,e,4)}function tV(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ft(e/60|0,"0",2)+ft(e%60,"0",2)}function pC(t,e){return ft(t.getUTCDate(),e,2)}function rV(t,e){return ft(t.getUTCHours(),e,2)}function nV(t,e){return ft(t.getUTCHours()%12||12,e,2)}function iV(t,e){return ft(1+kp.count(Zi(t),t),e,3)}function VI(t,e){return ft(t.getUTCMilliseconds(),e,3)}function aV(t,e){return VI(t,e)+"000"}function oV(t,e){return ft(t.getUTCMonth()+1,e,2)}function sV(t,e){return ft(t.getUTCMinutes(),e,2)}function lV(t,e){return ft(t.getUTCSeconds(),e,2)}function cV(t){var e=t.getUTCDay();return e===0?7:e}function uV(t,e){return ft(Op.count(Zi(t)-1,t),e,2)}function XI(t){var e=t.getUTCDay();return e>=4||e===0?el(t):el.ceil(t)}function dV(t,e){return t=XI(t),ft(el.count(Zi(t),t)+(Zi(t).getUTCDay()===4),e,2)}function fV(t){return t.getUTCDay()}function hV(t,e){return ft(Sh.count(Zi(t)-1,t),e,2)}function pV(t,e){return ft(t.getUTCFullYear()%100,e,2)}function mV(t,e){return t=XI(t),ft(t.getUTCFullYear()%100,e,2)}function gV(t,e){return ft(t.getUTCFullYear()%1e4,e,4)}function yV(t,e){var r=t.getUTCDay();return t=r>=4||r===0?el(t):el.ceil(t),ft(t.getUTCFullYear()%1e4,e,4)}function vV(){return"+0000"}function mC(){return"%"}function gC(t){return+t}function yC(t){return Math.floor(+t/1e3)}var Es,YI,JI;bV({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 bV(t){return Es=bK(t),YI=Es.format,Es.parse,JI=Es.utcFormat,Es.utcParse,Es}function xV(t){return new Date(t)}function wV(t){return t instanceof Date?+t:+new Date(+t)}function H1(t,e,r,n,i,a,o,c,u,d){var p=j1(),f=p.invert,y=p.domain,v=d(".%L"),x=d(":%S"),w=d("%I:%M"),b=d("%I %p"),S=d("%a %d"),A=d("%b %d"),O=d("%B"),C=d("%Y");function E(T){return(u(T)<T?v:c(T)<T?x:o(T)<T?w:a(T)<T?b:n(T)<T?i(T)<T?S:A:r(T)<T?O:C)(T)}return p.invert=function(T){return new Date(f(T))},p.domain=function(T){return arguments.length?y(Array.from(T,wV)):y().map(xV)},p.ticks=function(T){var N=y();return t(N[0],N[N.length-1],T??10)},p.tickFormat=function(T,N){return N==null?E:d(N)},p.nice=function(T){var N=y();return(!T||typeof T.range!="function")&&(T=e(N[0],N[N.length-1],T??10)),T?y(LI(N,T)):p},p.copy=function(){return qu(p,H1(t,e,r,n,i,a,o,c,u,d))},p}function _V(){return Pn.apply(H1(yK,vK,Ji,q1,Ep,Fu,B1,D1,Ao,YI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function SV(){return Pn.apply(H1(mK,gK,Zi,F1,Op,kp,U1,z1,Ao,JI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ap(){var t=0,e=1,r,n,i,a,o=Br,c=!1,u;function d(f){return f==null||isNaN(f=+f)?u:o(i===0?.5:(f=(a(f)-r)*i,c?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([t,e]=f,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),d):[t,e]},d.clamp=function(f){return arguments.length?(c=!!f,d):c},d.interpolator=function(f){return arguments.length?(o=f,d):o};function p(f){return function(y){var v,x;return arguments.length?([v,x]=y,o=f(v,x),d):[o(0),o(1)]}}return d.range=p(Ol),d.rangeRound=p(C1),d.unknown=function(f){return arguments.length?(u=f,d):u},function(f){return a=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),d}}function Ka(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function ZI(){var t=Ga(Ap()(Br));return t.copy=function(){return Ka(t,ZI())},ia.apply(t,arguments)}function QI(){var t=R1(Ap()).domain([1,10]);return t.copy=function(){return Ka(t,QI()).base(t.base())},ia.apply(t,arguments)}function e$(){var t=I1(Ap());return t.copy=function(){return Ka(t,e$()).constant(t.constant())},ia.apply(t,arguments)}function W1(){var t=$1(Ap());return t.copy=function(){return Ka(t,W1()).exponent(t.exponent())},ia.apply(t,arguments)}function kV(){return W1.apply(null,arguments).exponent(.5)}function t$(){var t=[],e=Br;function r(n){if(n!=null&&!isNaN(n=+n))return e((Bu(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(La),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)=>uG(t,a/n))},r.copy=function(){return t$(e).domain(t)},ia.apply(r,arguments)}function Tp(){var t=0,e=.5,r=1,n=1,i,a,o,c,u,d=Br,p,f=!1,y;function v(w){return isNaN(w=+w)?y:(w=.5+((w=+p(w))-a)*(n*w<n*a?c:u),d(f?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([t,e,r]=w,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(w){return arguments.length?(f=!!w,v):f},v.interpolator=function(w){return arguments.length?(d=w,v):d};function x(w){return function(b){var S,A,O;return arguments.length?([S,A,O]=b,d=MG(w,[S,A,O]),v):[d(0),d(.5),d(1)]}}return v.range=x(Ol),v.rangeRound=x(C1),v.unknown=function(w){return arguments.length?(y=w,v):y},function(w){return p=w,i=w(t),a=w(e),o=w(r),c=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function r$(){var t=Ga(Tp()(Br));return t.copy=function(){return Ka(t,r$())},ia.apply(t,arguments)}function n$(){var t=R1(Tp()).domain([.1,1,10]);return t.copy=function(){return Ka(t,n$()).base(t.base())},ia.apply(t,arguments)}function i$(){var t=I1(Tp());return t.copy=function(){return Ka(t,i$()).constant(t.constant())},ia.apply(t,arguments)}function G1(){var t=$1(Tp());return t.copy=function(){return Ka(t,G1()).exponent(t.exponent())},ia.apply(t,arguments)}function EV(){return G1.apply(null,arguments).exponent(.5)}const vC=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ru,scaleDiverging:r$,scaleDivergingLog:n$,scaleDivergingPow:G1,scaleDivergingSqrt:EV,scaleDivergingSymlog:i$,scaleIdentity:MI,scaleImplicit:Nx,scaleLinear:xh,scaleLog:DI,scaleOrdinal:O1,scalePoint:Lc,scalePow:M1,scaleQuantile:UI,scaleQuantize:qI,scaleRadial:BI,scaleSequential:ZI,scaleSequentialLog:QI,scaleSequentialPow:W1,scaleSequentialQuantile:t$,scaleSequentialSqrt:kV,scaleSequentialSymlog:e$,scaleSqrt:aK,scaleSymlog:zI,scaleThreshold:FI,scaleTime:_V,scaleUtc:SV,tickFormat:$I},Symbol.toStringTag,{value:"Module"}));var Z0,bC;function a$(){if(bC)return Z0;bC=1;var t=_l();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 Z0=e,Z0}var Q0,xC;function OV(){if(xC)return Q0;xC=1;function t(e,r){return e>r}return Q0=t,Q0}var eb,wC;function AV(){if(wC)return eb;wC=1;var t=a$(),e=OV(),r=kl();function n(i){return i&&i.length?t(i,r,e):void 0}return eb=n,eb}var TV=AV();const Cp=vt(TV);var tb,_C;function CV(){if(_C)return tb;_C=1;function t(e,r){return e<r}return tb=t,tb}var rb,SC;function jV(){if(SC)return rb;SC=1;var t=a$(),e=CV(),r=kl();function n(i){return i&&i.length?t(i,r,e):void 0}return rb=n,rb}var NV=jV();const jp=vt(NV);var nb,kC;function PV(){if(kC)return nb;kC=1;var t=l1(),e=Wa(),r=pI(),n=Qr();function i(a,o){var c=n(a)?t:r;return c(a,e(o,3))}return nb=i,nb}var ib,EC;function RV(){if(EC)return ib;EC=1;var t=fI(),e=PV();function r(n,i){return t(e(n,i),1)}return ib=r,ib}var IV=RV();const $V=vt(IV);var ab,OC;function MV(){if(OC)return ab;OC=1;var t=w1();function e(r,n){return t(r,n)}return ab=e,ab}var LV=MV();const Np=vt(LV);var Al=1e9,DV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},V1,$t=!0,jn="[DecimalError] ",No=jn+"Invalid argument: ",K1=jn+"Exponent out of range: ",Tl=Math.floor,_o=Math.pow,zV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,un,mr=1e7,Nt=7,o$=9007199254740991,kh=Tl(o$/Nt),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)*Nt;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(jn+"NaN");if(r.s<1)throw Error(jn+(r.s?"NaN":"-Infinity"));return r.eq(un)?new n(0):($t=!1,e=Vi(su(r,a),su(t,a),a),$t=!0,St(e,i))};Te.minus=Te.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?c$(e,t):s$(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(jn+"NaN");return r.s?($t=!1,e=Vi(r,t,0,1).times(t),$t=!0,r.minus(e)):St(new n(r),i)};Te.naturalExponential=Te.exp=function(){return l$(this)};Te.naturalLogarithm=Te.ln=function(){return su(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?s$(e,t):c$(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(No+t);if(e=er(i)+1,n=i.d.length-1,r=n*Nt+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(jn+"NaN")}for(t=er(c),$t=!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=Tl((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 $t=!0,St(n,r)};Te.times=Te.mul=function(t){var e,r,n,i,a,o,c,u,d,p=this,f=p.constructor,y=p.d,v=(t=new f(t)).d;if(!p.s||!t.s)return new f(0);for(t.s*=p.s,r=p.e+t.e,u=y.length,d=v.length,u<d&&(a=y,y=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]*y[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,$t?St(t,f.precision):t};Te.toDecimalPlaces=Te.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Ei(t,0,Al),e===void 0?e=n.rounding:Ei(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=$o(n,!0):(Ei(t,0,Al),e===void 0?e=i.rounding:Ei(e,0,8),n=St(new i(n),t+1,e),r=$o(n,!0,t+1)),r};Te.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?$o(i):(Ei(t,0,Al),e===void 0?e=a.rounding:Ei(e,0,8),n=St(new a(i),t+er(i)+1,e),r=$o(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(jn+"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)<=o$){for(i=new u(un),e=Math.ceil(n/Nt+4),$t=!1;r%2&&(i=i.times(c),TC(i.d,e)),r=Tl(r/2),r!==0;)c=c.times(c),TC(c.d,e);return $t=!0,t.s<0?new u(un).div(i):St(i,n)}}else if(a<0)throw Error(jn+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,c.s=1,$t=!1,i=t.times(su(c,n+d)),$t=!0,i=l$(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=$o(i,r<=a.toExpNeg||r>=a.toExpPos)):(Ei(t,1,Al),e===void 0?e=a.rounding:Ei(e,0,8),i=St(new a(i),t,e),r=er(i),n=$o(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):(Ei(t,1,Al),e===void 0?e=n.rounding:Ei(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 $o(t,e<=r.toExpNeg||e>=r.toExpPos)};function s$(t,e){var r,n,i,a,o,c,u,d,p=t.constructor,f=p.precision;if(!t.s||!e.s)return e.s||(e=new p(t)),$t?St(e,f):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(f/Nt),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,$t?St(e,f):e}function Ei(t,e,r){if(t!==~~t||t<e||t>r)throw Error(No+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=Nt-n.length,r&&(a+=Ca(r)),a+=n;o=t[e],n=o+"",r=Nt-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,f,y,v,x,w,b,S,A,O,C,E,T,N,R,I=n.constructor,K=n.s==i.s?1:-1,B=n.d,U=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(jn+"Division by zero");for(u=n.e-i.e,N=U.length,E=B.length,v=new I(K),x=v.d=[],d=0;U[d]==(B[d]||0);)++d;if(U[d]>(B[d]||0)&&--u,a==null?A=a=I.precision:o?A=a+(er(n)-er(i))+1:A=a,A<0)return new I(0);if(A=A/Nt+2|0,d=0,N==1)for(p=0,U=U[0],A++;(d<E||p)&&A--;d++)O=p*mr+(B[d]||0),x[d]=O/U|0,p=O%U|0;else{for(p=mr/(U[0]+1)|0,p>1&&(U=t(U,p),B=t(B,p),N=U.length,E=B.length),C=N,w=B.slice(0,N),b=w.length;b<N;)w[b++]=0;R=U.slice(),R.unshift(0),T=U[0],U[1]>=mr/2&&++T;do p=0,c=e(U,w,N,b),c<0?(S=w[0],N!=b&&(S=S*mr+(w[1]||0)),p=S/T|0,p>1?(p>=mr&&(p=mr-1),f=t(U,p),y=f.length,b=w.length,c=e(f,w,y,b),c==1&&(p--,r(f,N<y?R:U,y))):(p==0&&(c=p=1),f=U.slice()),y=f.length,y<b&&f.unshift(0),r(w,f,b),c==-1&&(b=w.length,c=e(U,w,N,b),c<1&&(p++,r(w,N<b?R:U,b))),b=w.length):c===0&&(p++,w=[0]),x[d++]=p,c&&w[0]?w[b++]=B[C]||0:(w=[B[C]],b=1);while((C++<E||w[0]!==void 0)&&A--)}return x[0]||x.shift(),v.e=u,St(v,o?a+er(v)+1:a)}})();function l$(t,e){var r,n,i,a,o,c,u=0,d=0,p=t.constructor,f=p.precision;if(er(t)>16)throw Error(K1+er(t));if(!t.s)return new p(un);for($t=!1,c=f,o=new p(.03125);t.abs().gte(.1);)t=t.times(o),d+=5;for(n=Math.log(_o(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=f,e==null?($t=!0,St(a,f)):a}a=o}}function er(t){for(var e=t.e*Nt,r=t.d[0];r>=10;r/=10)e++;return e}function ob(t,e,r){if(e>t.LN10.sd())throw $t=!0,r&&(t.precision=r),Error(jn+"LN10 precision limit exceeded");return St(new t(t.LN10),e)}function Ca(t){for(var e="";t--;)e+="0";return e}function su(t,e){var r,n,i,a,o,c,u,d,p,f=1,y=10,v=t,x=v.d,w=v.constructor,b=w.precision;if(v.s<1)throw Error(jn+(v.s?"NaN":"-Infinity"));if(v.eq(un))return new w(0);if(e==null?($t=!1,d=b):d=e,v.eq(10))return e==null&&($t=!0),ob(w,d);if(d+=y,w.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),f++;a=er(v),n>1?(v=new w("0."+r),a++):v=new w(n+"."+r.slice(1))}else return u=ob(w,d+2,b).times(a+""),v=su(new w(n+"."+r.slice(1)),d-y).plus(u),w.precision=b,e==null?($t=!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 w(i),d)),wi(u.d).slice(0,d)===wi(c.d).slice(0,d))return c=c.times(2),a!==0&&(c=c.plus(ob(w,d+2,b).times(a+""))),c=Vi(c,new w(f),d),w.precision=b,e==null?($t=!0,St(c,b)):c;c=u,i+=2}}function AC(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=Tl(r/Nt),t.d=[],n=(r+1)%Nt,r<0&&(n+=Nt),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=Nt;n<i;)t.d.push(+e.slice(n,n+=Nt));e=e.slice(n),n=Nt-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),$t&&(t.e>kh||t.e<-kh))throw Error(K1+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,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=Nt,i=e,d=f[p=0];else{if(p=Math.ceil((n+1)/Nt),a=f.length,p>=a)return t;for(d=a=f[p],o=1;a>=10;a/=10)o++;n%=Nt,i=n-Nt+o}if(r!==void 0&&(a=_o(10,o-i-1),c=d/a%10|0,u=e<0||f[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/_o(10,o-i):0:f[p-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return u?(a=er(t),f.length=1,e=e-a-1,f[0]=_o(10,(Nt-e%Nt)%Nt),t.e=Tl(-e/Nt)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=p,a=1,p--):(f.length=p+1,a=_o(10,Nt-n),f[p]=i>0?(d/_o(10,o-i)%_o(10,i)|0)*a:0),u)for(;;)if(p==0){(f[0]+=a)==mr&&(f[0]=1,++t.e);break}else{if(f[p]+=a,f[p]!=mr)break;f[p--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if($t&&(t.e>kh||t.e<-kh))throw Error(K1+er(t));return t}function c$(t,e){var r,n,i,a,o,c,u,d,p,f,y=t.constructor,v=y.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new y(t),$t?St(e,v):e;if(u=t.d,f=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=f.length):(r=f,n=d,c=u.length),i=Math.max(Math.ceil(v/Nt),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=f.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(u[i]!=f[i]){p=u[i]<f[i];break}o=0}for(p&&(r=u,u=f,f=r,e.s=-e.s),c=u.length,i=f.length-c;i>0;--i)u[c++]=0;for(i=f.length;i>o;){if(u[--i]<f[i]){for(a=i;a&&u[--a]===0;)u[a]=mr-1;--u[a],u[i]+=mr}u[i]-=f[i]}for(;u[--c]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=n,$t?St(e,v):e):new y(0)}function $o(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 TC(t,e){if(t.length>e)return t.length=e,!0}function u$(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(No+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 AC(o,a.toString())}else if(typeof a!="string")throw Error(No+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,zV.test(a))AC(o,a);else throw Error(No+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=u$,i.config=i.set=BV,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 BV(t){if(!t||typeof t!="object")throw Error(jn+"Object expected");var e,r,n,i=["precision",1,Al,"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(Tl(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(No+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(No+r+": "+n);return this}var V1=u$(DV);un=new V1(1);const xt=V1;function UV(t){return WV(t)||HV(t)||FV(t)||qV()}function qV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
459
459
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FV(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 HV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function WV(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}var GV=function(e){return e},d$={},f$=function(e){return e===d$},CC=function(e){return function r(){return arguments.length===0||arguments.length===1&&f$(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},KV=function t(e,r){return e===1?r:CC(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!==d$}).length;return o>=e?r.apply(void 0,i):t(e-o,CC(function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];var p=i.map(function(f){return f$(f)?u.shift():f});return r.apply(void 0,UV(p).concat(u))}))})},Pp=function(e){return KV(e.length,e)},Mx=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},VV=Pp(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),XV=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return GV;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))}},Lx=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},h$=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 YV(t){var e;return t===0?e=1:e=Math.floor(new xt(t).abs().log(10).toNumber())+1,e}function JV(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 ZV=Pp(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),QV=Pp(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),eX=Pp(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const Rp={rangeStep:JV,getDigitCount:YV,interpolateNumber:ZV,uninterpolateNumber:QV,uninterpolateTruncation:eX};function Dx(t){return nX(t)||rX(t)||p$(t)||tX()}function tX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
460
460
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rX(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function nX(t){if(Array.isArray(t))return zx(t)}function lu(t,e){return oX(t)||aX(t,e)||p$(t,e)||iX()}function iX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
461
461
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p$(t,e){if(t){if(typeof t=="string")return zx(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 zx(t,e)}}function zx(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 aX(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 oX(t){if(Array.isArray(t))return t}function m$(t){var e=lu(t,2),r=e[0],n=e[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function g$(t,e,r){if(t.lte(0))return new xt(0);var n=Rp.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 sX(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(Rp.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=XV(VV(function(u){return i.add(new xt(u-o).mul(n)).toNumber()}),Mx);return c(0,e)}function y$(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=g$(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?y$(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 lX(t){var e=lu(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=m$([r,n]),u=lu(c,2),d=u[0],p=u[1];if(d===-1/0||p===1/0){var f=p===1/0?[d].concat(Dx(Mx(0,i-1).map(function(){return 1/0}))):[].concat(Dx(Mx(0,i-1).map(function(){return-1/0})),[p]);return r>n?Lx(f):f}if(d===p)return sX(d,i,a);var y=y$(d,p,o,a),v=y.step,x=y.tickMin,w=y.tickMax,b=Rp.rangeStep(x,w.add(new xt(.1).mul(v)),v);return r>n?Lx(b):b}function cX(t,e){var r=lu(t,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=m$([n,i]),c=lu(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),f=g$(new xt(d).sub(u).div(p-1),a,0),y=[].concat(Dx(Rp.rangeStep(new xt(u),new xt(d).sub(new xt(.99).mul(f)),f)),[d]);return n>i?Lx(y):y}var uX=h$(lX),dX=h$(cX),fX="Invariant failed";function Mo(t,e){throw new Error(fX)}var hX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 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 pX(t,e){return vX(t)||yX(t,e)||gX(t,e)||mX()}function mX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
462
462
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gX(t,e){if(t){if(typeof t=="string")return jC(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 jC(t,e)}}function jC(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 yX(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 vX(t){if(Array.isArray(t))return t}function bX(t,e){if(t==null)return{};var r=xX(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 xX(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 wX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _X(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 SX(t,e,r){return e&&_X(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kX(t,e,r){return e=Oh(e),EX(t,v$()?Reflect.construct(e,r||[],Oh(t).constructor):e.apply(t,r))}function EX(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 OX(t)}function OX(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 Oh(t){return Oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Oh(t)}function AX(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&&Bx(t,e)}function Bx(t,e){return Bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Bx(t,e)}function b$(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=TX(t,"string");return tl(e)=="symbol"?e:e+""}function TX(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 Hu=(function(t){function e(){return wX(this,e),kX(this,e,arguments)}return AX(e,t),SX(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,f=n.yAxis,y=bX(n,hX),v=at(y,!1);this.props.direction==="x"&&p.type!=="number"&&Mo();var x=u.map(function(w){var b=d(w,c),S=b.x,A=b.y,O=b.value,C=b.errorVal;if(!C)return null;var E=[],T,N;if(Array.isArray(C)){var R=pX(C,2);T=R[0],N=R[1]}else T=N=C;if(a==="vertical"){var I=p.scale,K=A+i,B=K+o,U=K-o,V=I(O-T),H=I(O+N);E.push({x1:H,y1:B,x2:H,y2:U}),E.push({x1:V,y1:K,x2:H,y2:K}),E.push({x1:V,y1:B,x2:V,y2:U})}else if(a==="horizontal"){var Y=f.scale,G=S+i,Q=G-o,W=G+o,ee=Y(O-T),q=Y(O+N);E.push({x1:Q,y1:q,x2:W,y2:q}),E.push({x1:G,y1:ee,x2:G,y2:q}),E.push({x1:Q,y1:ee,x2:W,y2:ee})}return L.createElement(Xt,Eh({className:"recharts-errorBar",key:"bar-".concat(E.map(function($){return"".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))},v),E.map(function($){return L.createElement("line",Eh({},$,{key:"line-".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))}))});return L.createElement(Xt,{className:"recharts-errorBars"},x)}}])})(L.Component);b$(Hu,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});b$(Hu,"displayName","ErrorBar");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 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 bo(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){CX(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 CX(t,e,r){return e=jX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jX(t){var e=NX(t,"string");return cu(e)=="symbol"?e:e+""}function NX(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 w$=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,o=sn(r,Us);if(!o)return null;var c=Us.defaultProps,u=c!==void 0?bo(bo({},c),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:a==="children"?d=(n||[]).reduce(function(p,f){var y=f.item,v=f.props,x=v.sectors||v.data||[];return p.concat(x.map(function(w){return{type:o.props.iconType||y.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):d=(n||[]).map(function(p){var f=p.item,y=f.type.defaultProps,v=y!==void 0?bo(bo({},y),f.props):{},x=v.dataKey,w=v.name,b=v.legendType,S=v.hide;return{inactive:S,dataKey:x,type:u.iconType||b||"square",color:X1(f),value:w||x,payload:v}}),bo(bo(bo({},u),Us.getWithHeight(o,i)),{},{payload:d,item:o})};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 PC(t){return $X(t)||IX(t)||RX(t)||PX()}function PX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
463
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RX(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 IX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $X(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}function RC(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 Wt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RC(Object(r),!0).forEach(function(n){Fs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fs(t,e,r){return e=MX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MX(t){var e=LX(t,"string");return uu(e)=="symbol"?e:e+""}function LX(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)}function dn(t,e,r){return et(t)||et(e)?r:or(e)?Tn(t,e,r):Je(e)?e(t):r}function Dc(t,e,r,n){var i=$V(t,function(c){return dn(c,e)});if(r==="number"){var a=i.filter(function(c){return ge(c)||parseFloat(c)});return a.length?[jp(a),Cp(a)]:[1/0,-1/0]}var o=n?i.filter(function(c){return!et(c)}):i;return o.map(function(c){return or(c)||c instanceof Date?c:""})}var DX=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,f=i[d].coordinate,y=d>=c-1?i[0].coordinate:i[d+1].coordinate,v=void 0;if(Jn(f-p)!==Jn(y-f)){var x=[];if(Jn(y-f)===Jn(u[1]-u[0])){v=y;var w=f+u[1]-u[0];x[0]=Math.min(w,(w+p)/2),x[1]=Math.max(w,(w+p)/2)}else{v=p;var b=y+u[1]-u[0];x[0]=Math.min(f,(b+f)/2),x[1]=Math.max(f,(b+f)/2)}var S=[Math.min(f,(v+f)/2),Math.max(f,(v+f)/2)];if(e>S[0]&&e<=S[1]||e>=x[0]&&e<=x[1]){o=i[d].index;break}}else{var A=Math.min(p,y),O=Math.max(p,y);if(e>(A+f)/2&&e<=(O+f)/2){o=i[d].index;break}}}else for(var C=0;C<c;C++)if(C===0&&e<=(n[C].coordinate+n[C+1].coordinate)/2||C>0&&C<c-1&&e>(n[C].coordinate+n[C-1].coordinate)/2&&e<=(n[C].coordinate+n[C+1].coordinate)/2||C===c-1&&e>(n[C].coordinate+n[C-1].coordinate)/2){o=n[C].index;break}return o},X1=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Wt(Wt({},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},zX=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,f=Object.keys(p),y=0,v=f.length;y<v;y++){var x=p[f[y]],w=x.items,b=x.cateAxisId,S=w.filter(function(N){return Gi(N.type).indexOf("Bar")>=0});if(S&&S.length){var A=S[0].type.defaultProps,O=A!==void 0?Wt(Wt({},A),S[0].props):S[0].props,C=O.barSize,E=O[b];o[E]||(o[E]=[]);var T=et(C)?r:C;o[E].push({item:S[0],stackList:S.slice(1),barSize:et(T)?void 0:Io(T,n,0)})}}return o},BX=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=Io(r,i,0,!0),p,f=[];if(o[0].barSize===+o[0].barSize){var y=!1,v=i/u,x=o.reduce(function(C,E){return C+E.barSize||0},0);x+=(u-1)*d,x>=i&&(x-=(u-1)*d,d=0),x>=i&&v>0&&(y=!0,v*=.9,x=u*v);var w=(i-x)/2>>0,b={offset:w-d,size:0};p=o.reduce(function(C,E){var T={item:E.item,position:{offset:b.offset+b.size+d,size:y?v:E.barSize}},N=[].concat(PC(C),[T]);return b=N[N.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){N.push({item:R,position:b})}),N},f)}else{var S=Io(n,i,0,!0);i-2*S-(u-1)*d<=0&&(d=0);var A=(i-2*S-(u-1)*d)/u;A>1&&(A>>=0);var O=c===+c?Math.min(A,c):A;p=o.reduce(function(C,E,T){var N=[].concat(PC(C),[{item:E.item,position:{offset:S+(A+d)*T+(A-O)/2,size:O}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){N.push({item:R,position:N[N.length-1].position})}),N},f)}return p},UX=function(e,r,n,i){var a=n.children,o=n.width,c=n.margin,u=o-(c.left||0)-(c.right||0),d=w$({children:a,legendWidth:u});if(d){var p=i||{},f=p.width,y=p.height,v=d.align,x=d.verticalAlign,w=d.layout;if((w==="vertical"||w==="horizontal"&&x==="middle")&&v!=="center"&&ge(e[v]))return Wt(Wt({},e),{},Fs({},v,e[v]+(f||0)));if((w==="horizontal"||w==="vertical"&&v==="center")&&x!=="middle"&&ge(e[x]))return Wt(Wt({},e),{},Fs({},x,e[x]+(y||0)))}return e},qX=function(e,r,n){return et(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},_$=function(e,r,n,i,a){var o=r.props.children,c=Cn(o,Hu).filter(function(d){return qX(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 f=dn(p,n);if(et(f))return d;var y=Array.isArray(f)?[jp(f),Cp(f)]:[f,f],v=u.reduce(function(x,w){var b=dn(p,w,0),S=y[0]-Math.abs(Array.isArray(b)?b[0]:b),A=y[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(S,x[0]),Math.max(A,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},FX=function(e,r,n,i,a){var o=r.map(function(c){return _$(e,c,n,a,i)}).filter(function(c){return!et(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},S$=function(e,r,n,i,a){var o=r.map(function(u){var d=u.props.dataKey;return n==="number"&&d&&_$(e,u,d,i)||Dc(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,f=d.length;p<f;p++)c[d[p]]||(c[d[p]]=!0,u.push(d[p]));return u},[])},k$=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},E$=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},Wi=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(f){var y=a?a.indexOf(f):f;return{coordinate:i(y)+d,value:f,offset:d}});return p.filter(function(f){return!Lu(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,y){return{coordinate:i(f)+d,value:f,index:y,offset:d}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+d,value:f,offset:d}}):i.domain().map(function(f,y){return{coordinate:i(f)+d,value:a?a[f]:f,index:y,offset:d}})},sb=new WeakMap,Sf=function(e,r){if(typeof r!="function")return e;sb.has(e)||sb.set(e,new WeakMap);var n=sb.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},HX=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:ru(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:xh(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Lc(),realScaleType:"point"}:a==="category"?{scale:ru(),realScaleType:"band"}:{scale:xh(),realScaleType:"linear"};if(Ro(i)){var u="scale".concat(gp(i));return{scale:(vC[u]||Lc)(),realScaleType:vC[u]?u:"point"}}return Je(i)?{scale:i}:{scale:Lc(),realScaleType:"point"}},IC=1e-4,WX=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])-IC,o=Math.max(i[0],i[1])+IC,c=e(r[0]),u=e(r[n-1]);(c<a||c>o||u<a||u>o)&&e.domain([r[0],r[n-1]])}},GX=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},KX=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},VX=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=Lu(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])}},XX=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=Lu(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)}},YX={sign:VX,expand:RF,none:Ks,silhouette:IF,wiggle:$F,positive:XX},JX=function(e,r,n){var i=r.map(function(c){return c.props.dataKey}),a=YX[n],o=PF().keys(i).value(function(c,u){return+dn(c,u,0)}).order(yx).offset(a);return o(e)},ZX=function(e,r,n,i,a,o){if(!e)return null;var c=o?r.reverse():r,u={},d=c.reduce(function(f,y){var v,x=(v=y.type)!==null&&v!==void 0&&v.defaultProps?Wt(Wt({},y.type.defaultProps),y.props):y.props,w=x.stackId,b=x.hide;if(b)return f;var S=x[n],A=f[S]||{hasStack:!1,stackGroups:{}};if(or(w)){var O=A.stackGroups[w]||{numericAxisId:n,cateAxisId:i,items:[]};O.items.push(y),A.hasStack=!0,A.stackGroups[w]=O}else A.stackGroups[Du("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[y]};return Wt(Wt({},f),{},Fs({},S,A))},u),p={};return Object.keys(d).reduce(function(f,y){var v=d[y];if(v.hasStack){var x={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(w,b){var S=v.stackGroups[b];return Wt(Wt({},w),{},Fs({},b,{numericAxisId:n,cateAxisId:i,items:S.items,stackedData:JX(e,S.items,a)}))},x)}return Wt(Wt({},f),{},Fs({},y,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=uX(d,a,c);return e.domain([jp(p),Cp(p)]),{niceTicks:p}}if(a&&i==="number"){var f=e.domain(),y=dX(f,a,c);return{niceTicks:y}}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&&!et(i[e.dataKey])){var c=Zf(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,et(o)?e.dataKey:o);return et(u)?null:e.scale(u)}var MC=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 et(u)?null:r.scale(u)-a/2+i},eY=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]},tY=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Wt(Wt({},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},rY=function(e){return e.reduce(function(r,n){return[jp(n.concat([r[0]]).filter(ge)),Cp(n.concat([r[1]]).filter(ge))]},[1/0,-1/0])},O$=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 f=rY(p.slice(r,n+1));return[Math.min(d[0],f[0]),Math.max(d[1],f[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})},LC=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,DC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qx=function(e,r,n){if(Je(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(LC.test(e[0])){var a=+LC.exec(e[0])[1];i[0]=r[0]-a}else Je(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(DC.test(e[1])){var o=+DC.exec(e[1])[1];i[1]=r[1]+o}else Je(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},Ah=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=S1(r,function(f){return f.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},zC=function(e,r,n){return!e||!e.length||Np(e,Tn(n,"type.defaultProps.domain"))?r:e},A$=function(e,r){var n=e.type.defaultProps?Wt(Wt({},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 Wt(Wt({},at(e,!1)),{},{dataKey:i,unit:o,formatter:c,name:a||i,color:X1(e),value:dn(r,i),type:u,payload:r,chartType:d,hide:p})};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 BC(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 UC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?BC(Object(r),!0).forEach(function(n){nY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nY(t,e,r){return e=iY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iY(t){var e=aY(t,"string");return du(e)=="symbol"?e:e+""}function aY(t,e){if(du(t)!="object"||!t)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 Th=Math.PI/180,oY=function(e){return e*180/Math.PI},_r=function(e,r,n,i){return{x:e+Math.cos(-Th*i)*n,y:r+Math.sin(-Th*i)*n}},sY=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))},lY=function(e,r){var n=e.x,i=e.y,a=r.cx,o=r.cy,c=sY({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:oY(d),angleInRadian:d}},cY=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}},uY=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},qC=function(e,r){var n=e.x,i=e.y,a=lY({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=cY(r),f=p.startAngle,y=p.endAngle,v=c,x;if(f<=y){for(;v>y;)v-=360;for(;v<f;)v+=360;x=v>=f&&v<=y}else{for(;v>f;)v-=360;for(;v<y;)v+=360;x=v>=y&&v<=f}return x?UC(UC({},r),{},{radius:o,angle:uY(v,r)}):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)}var dY=["offset"];function fY(t){return gY(t)||mY(t)||pY(t)||hY()}function hY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
464
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pY(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 mY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gY(t){if(Array.isArray(t))return Fx(t)}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 yY(t,e){if(t==null)return{};var r=vY(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 vY(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 FC(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?FC(Object(r),!0).forEach(function(n){bY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):FC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bY(t,e,r){return e=xY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xY(t){var e=wY(t,"string");return fu(e)=="symbol"?e:e+""}function wY(t,e){if(fu(t)!="object"||!t)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 hu(){return hu=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},hu.apply(this,arguments)}var _Y=function(e){var r=e.value,n=e.formatter,i=et(e.children)?r:e.children;return Je(n)?n(i):i},SY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),360);return n*i},kY=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,f=u.innerRadius,y=u.outerRadius,v=u.startAngle,x=u.endAngle,w=u.clockWise,b=(f+y)/2,S=SY(v,x),A=S>=0?1:-1,O,C;i==="insideStart"?(O=v+A*o,C=w):i==="insideEnd"?(O=x-A*o,C=!w):i==="end"&&(O=x+A*o,C=w),C=S<=0?C:!C;var E=_r(d,p,b,O),T=_r(d,p,b,O+(C?1:-1)*359),N="M".concat(E.x,",").concat(E.y,`
463
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RX(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 IX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $X(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}function RC(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 Wt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RC(Object(r),!0).forEach(function(n){Fs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fs(t,e,r){return e=MX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MX(t){var e=LX(t,"string");return uu(e)=="symbol"?e:e+""}function LX(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)}function dn(t,e,r){return tt(t)||tt(e)?r:or(e)?Tn(t,e,r):Je(e)?e(t):r}function Dc(t,e,r,n){var i=$V(t,function(c){return dn(c,e)});if(r==="number"){var a=i.filter(function(c){return ge(c)||parseFloat(c)});return a.length?[jp(a),Cp(a)]:[1/0,-1/0]}var o=n?i.filter(function(c){return!tt(c)}):i;return o.map(function(c){return or(c)||c instanceof Date?c:""})}var DX=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,f=i[d].coordinate,y=d>=c-1?i[0].coordinate:i[d+1].coordinate,v=void 0;if(Jn(f-p)!==Jn(y-f)){var x=[];if(Jn(y-f)===Jn(u[1]-u[0])){v=y;var w=f+u[1]-u[0];x[0]=Math.min(w,(w+p)/2),x[1]=Math.max(w,(w+p)/2)}else{v=p;var b=y+u[1]-u[0];x[0]=Math.min(f,(b+f)/2),x[1]=Math.max(f,(b+f)/2)}var S=[Math.min(f,(v+f)/2),Math.max(f,(v+f)/2)];if(e>S[0]&&e<=S[1]||e>=x[0]&&e<=x[1]){o=i[d].index;break}}else{var A=Math.min(p,y),O=Math.max(p,y);if(e>(A+f)/2&&e<=(O+f)/2){o=i[d].index;break}}}else for(var C=0;C<c;C++)if(C===0&&e<=(n[C].coordinate+n[C+1].coordinate)/2||C>0&&C<c-1&&e>(n[C].coordinate+n[C-1].coordinate)/2&&e<=(n[C].coordinate+n[C+1].coordinate)/2||C===c-1&&e>(n[C].coordinate+n[C-1].coordinate)/2){o=n[C].index;break}return o},X1=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Wt(Wt({},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},zX=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,f=Object.keys(p),y=0,v=f.length;y<v;y++){var x=p[f[y]],w=x.items,b=x.cateAxisId,S=w.filter(function(N){return Gi(N.type).indexOf("Bar")>=0});if(S&&S.length){var A=S[0].type.defaultProps,O=A!==void 0?Wt(Wt({},A),S[0].props):S[0].props,C=O.barSize,E=O[b];o[E]||(o[E]=[]);var T=tt(C)?r:C;o[E].push({item:S[0],stackList:S.slice(1),barSize:tt(T)?void 0:Io(T,n,0)})}}return o},BX=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=Io(r,i,0,!0),p,f=[];if(o[0].barSize===+o[0].barSize){var y=!1,v=i/u,x=o.reduce(function(C,E){return C+E.barSize||0},0);x+=(u-1)*d,x>=i&&(x-=(u-1)*d,d=0),x>=i&&v>0&&(y=!0,v*=.9,x=u*v);var w=(i-x)/2>>0,b={offset:w-d,size:0};p=o.reduce(function(C,E){var T={item:E.item,position:{offset:b.offset+b.size+d,size:y?v:E.barSize}},N=[].concat(PC(C),[T]);return b=N[N.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){N.push({item:R,position:b})}),N},f)}else{var S=Io(n,i,0,!0);i-2*S-(u-1)*d<=0&&(d=0);var A=(i-2*S-(u-1)*d)/u;A>1&&(A>>=0);var O=c===+c?Math.min(A,c):A;p=o.reduce(function(C,E,T){var N=[].concat(PC(C),[{item:E.item,position:{offset:S+(A+d)*T+(A-O)/2,size:O}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){N.push({item:R,position:N[N.length-1].position})}),N},f)}return p},UX=function(e,r,n,i){var a=n.children,o=n.width,c=n.margin,u=o-(c.left||0)-(c.right||0),d=w$({children:a,legendWidth:u});if(d){var p=i||{},f=p.width,y=p.height,v=d.align,x=d.verticalAlign,w=d.layout;if((w==="vertical"||w==="horizontal"&&x==="middle")&&v!=="center"&&ge(e[v]))return Wt(Wt({},e),{},Fs({},v,e[v]+(f||0)));if((w==="horizontal"||w==="vertical"&&v==="center")&&x!=="middle"&&ge(e[x]))return Wt(Wt({},e),{},Fs({},x,e[x]+(y||0)))}return e},qX=function(e,r,n){return tt(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},_$=function(e,r,n,i,a){var o=r.props.children,c=Cn(o,Hu).filter(function(d){return qX(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 f=dn(p,n);if(tt(f))return d;var y=Array.isArray(f)?[jp(f),Cp(f)]:[f,f],v=u.reduce(function(x,w){var b=dn(p,w,0),S=y[0]-Math.abs(Array.isArray(b)?b[0]:b),A=y[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(S,x[0]),Math.max(A,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},FX=function(e,r,n,i,a){var o=r.map(function(c){return _$(e,c,n,a,i)}).filter(function(c){return!tt(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},S$=function(e,r,n,i,a){var o=r.map(function(u){var d=u.props.dataKey;return n==="number"&&d&&_$(e,u,d,i)||Dc(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,f=d.length;p<f;p++)c[d[p]]||(c[d[p]]=!0,u.push(d[p]));return u},[])},k$=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},E$=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},Wi=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(f){var y=a?a.indexOf(f):f;return{coordinate:i(y)+d,value:f,offset:d}});return p.filter(function(f){return!Lu(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,y){return{coordinate:i(f)+d,value:f,index:y,offset:d}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+d,value:f,offset:d}}):i.domain().map(function(f,y){return{coordinate:i(f)+d,value:a?a[f]:f,index:y,offset:d}})},sb=new WeakMap,Sf=function(e,r){if(typeof r!="function")return e;sb.has(e)||sb.set(e,new WeakMap);var n=sb.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},HX=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:ru(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:xh(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Lc(),realScaleType:"point"}:a==="category"?{scale:ru(),realScaleType:"band"}:{scale:xh(),realScaleType:"linear"};if(Ro(i)){var u="scale".concat(gp(i));return{scale:(vC[u]||Lc)(),realScaleType:vC[u]?u:"point"}}return Je(i)?{scale:i}:{scale:Lc(),realScaleType:"point"}},IC=1e-4,WX=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])-IC,o=Math.max(i[0],i[1])+IC,c=e(r[0]),u=e(r[n-1]);(c<a||c>o||u<a||u>o)&&e.domain([r[0],r[n-1]])}},GX=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},KX=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},VX=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=Lu(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])}},XX=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=Lu(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)}},YX={sign:VX,expand:RF,none:Ks,silhouette:IF,wiggle:$F,positive:XX},JX=function(e,r,n){var i=r.map(function(c){return c.props.dataKey}),a=YX[n],o=PF().keys(i).value(function(c,u){return+dn(c,u,0)}).order(yx).offset(a);return o(e)},ZX=function(e,r,n,i,a,o){if(!e)return null;var c=o?r.reverse():r,u={},d=c.reduce(function(f,y){var v,x=(v=y.type)!==null&&v!==void 0&&v.defaultProps?Wt(Wt({},y.type.defaultProps),y.props):y.props,w=x.stackId,b=x.hide;if(b)return f;var S=x[n],A=f[S]||{hasStack:!1,stackGroups:{}};if(or(w)){var O=A.stackGroups[w]||{numericAxisId:n,cateAxisId:i,items:[]};O.items.push(y),A.hasStack=!0,A.stackGroups[w]=O}else A.stackGroups[Du("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[y]};return Wt(Wt({},f),{},Fs({},S,A))},u),p={};return Object.keys(d).reduce(function(f,y){var v=d[y];if(v.hasStack){var x={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(w,b){var S=v.stackGroups[b];return Wt(Wt({},w),{},Fs({},b,{numericAxisId:n,cateAxisId:i,items:S.items,stackedData:JX(e,S.items,a)}))},x)}return Wt(Wt({},f),{},Fs({},y,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=uX(d,a,c);return e.domain([jp(p),Cp(p)]),{niceTicks:p}}if(a&&i==="number"){var f=e.domain(),y=dX(f,a,c);return{niceTicks:y}}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&&!tt(i[e.dataKey])){var c=Zf(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,tt(o)?e.dataKey:o);return tt(u)?null:e.scale(u)}var MC=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 tt(u)?null:r.scale(u)-a/2+i},eY=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]},tY=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Wt(Wt({},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},rY=function(e){return e.reduce(function(r,n){return[jp(n.concat([r[0]]).filter(ge)),Cp(n.concat([r[1]]).filter(ge))]},[1/0,-1/0])},O$=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 f=rY(p.slice(r,n+1));return[Math.min(d[0],f[0]),Math.max(d[1],f[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})},LC=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,DC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qx=function(e,r,n){if(Je(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(LC.test(e[0])){var a=+LC.exec(e[0])[1];i[0]=r[0]-a}else Je(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(DC.test(e[1])){var o=+DC.exec(e[1])[1];i[1]=r[1]+o}else Je(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},Ah=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=S1(r,function(f){return f.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},zC=function(e,r,n){return!e||!e.length||Np(e,Tn(n,"type.defaultProps.domain"))?r:e},A$=function(e,r){var n=e.type.defaultProps?Wt(Wt({},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 Wt(Wt({},at(e,!1)),{},{dataKey:i,unit:o,formatter:c,name:a||i,color:X1(e),value:dn(r,i),type:u,payload:r,chartType:d,hide:p})};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 BC(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 UC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?BC(Object(r),!0).forEach(function(n){nY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nY(t,e,r){return e=iY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iY(t){var e=aY(t,"string");return du(e)=="symbol"?e:e+""}function aY(t,e){if(du(t)!="object"||!t)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 Th=Math.PI/180,oY=function(e){return e*180/Math.PI},_r=function(e,r,n,i){return{x:e+Math.cos(-Th*i)*n,y:r+Math.sin(-Th*i)*n}},sY=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))},lY=function(e,r){var n=e.x,i=e.y,a=r.cx,o=r.cy,c=sY({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:oY(d),angleInRadian:d}},cY=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}},uY=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},qC=function(e,r){var n=e.x,i=e.y,a=lY({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=cY(r),f=p.startAngle,y=p.endAngle,v=c,x;if(f<=y){for(;v>y;)v-=360;for(;v<f;)v+=360;x=v>=f&&v<=y}else{for(;v>f;)v-=360;for(;v<y;)v+=360;x=v>=y&&v<=f}return x?UC(UC({},r),{},{radius:o,angle:uY(v,r)}):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)}var dY=["offset"];function fY(t){return gY(t)||mY(t)||pY(t)||hY()}function hY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
464
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pY(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 mY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gY(t){if(Array.isArray(t))return Fx(t)}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 yY(t,e){if(t==null)return{};var r=vY(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 vY(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 FC(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?FC(Object(r),!0).forEach(function(n){bY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):FC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bY(t,e,r){return e=xY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xY(t){var e=wY(t,"string");return fu(e)=="symbol"?e:e+""}function wY(t,e){if(fu(t)!="object"||!t)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 hu(){return hu=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},hu.apply(this,arguments)}var _Y=function(e){var r=e.value,n=e.formatter,i=tt(e.children)?r:e.children;return Je(n)?n(i):i},SY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),360);return n*i},kY=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,f=u.innerRadius,y=u.outerRadius,v=u.startAngle,x=u.endAngle,w=u.clockWise,b=(f+y)/2,S=SY(v,x),A=S>=0?1:-1,O,C;i==="insideStart"?(O=v+A*o,C=w):i==="insideEnd"?(O=x-A*o,C=!w):i==="end"&&(O=x+A*o,C=w),C=S<=0?C:!C;var E=_r(d,p,b,O),T=_r(d,p,b,O+(C?1:-1)*359),N="M".concat(E.x,",").concat(E.y,`
465
465
  A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
466
- `).concat(T.x,",").concat(T.y),R=et(e.id)?Du("recharts-radial-line-"):e.id;return L.createElement("text",hu({},n,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",c)}),L.createElement("defs",null,L.createElement("path",{id:R,d:N})),L.createElement("textPath",{xlinkHref:"#".concat(R)},r))},EY=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,f=a.endAngle,y=(p+f)/2;if(i==="outside"){var v=_r(o,c,d+n,y),x=v.x,w=v.y;return{x,y:w,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,S=_r(o,c,b,y),A=S.x,O=S.y;return{x:A,y:O,textAnchor:"middle",verticalAnchor:"middle"}},OY=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,f=p>=0?1:-1,y=f*i,v=f>0?"end":"start",x=f>0?"start":"end",w=d>=0?1:-1,b=w*i,S=w>0?"end":"start",A=w>0?"start":"end";if(a==="top"){var O={x:c+d/2,y:u-f*i,textAnchor:"middle",verticalAnchor:v};return ar(ar({},O),n?{height:Math.max(u-n.y,0),width:d}:{})}if(a==="bottom"){var C={x:c+d/2,y:u+p+y,textAnchor:"middle",verticalAnchor:x};return ar(ar({},C),n?{height:Math.max(n.y+n.height-(u+p),0),width:d}:{})}if(a==="left"){var E={x:c-b,y:u+p/2,textAnchor:S,verticalAnchor:"middle"};return ar(ar({},E),n?{width:Math.max(E.x-n.x,0),height:p}:{})}if(a==="right"){var T={x:c+d+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"};return ar(ar({},T),n?{width:Math.max(n.x+n.width-T.x,0),height:p}:{})}var N=n?{width:d,height:p}:{};return a==="insideLeft"?ar({x:c+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"},N):a==="insideRight"?ar({x:c+d-b,y:u+p/2,textAnchor:S,verticalAnchor:"middle"},N):a==="insideTop"?ar({x:c+d/2,y:u+y,textAnchor:"middle",verticalAnchor:x},N):a==="insideBottom"?ar({x:c+d/2,y:u+p-y,textAnchor:"middle",verticalAnchor:v},N):a==="insideTopLeft"?ar({x:c+b,y:u+y,textAnchor:A,verticalAnchor:x},N):a==="insideTopRight"?ar({x:c+d-b,y:u+y,textAnchor:S,verticalAnchor:x},N):a==="insideBottomLeft"?ar({x:c+b,y:u+p-y,textAnchor:A,verticalAnchor:v},N):a==="insideBottomRight"?ar({x:c+d-b,y:u+p-y,textAnchor:S,verticalAnchor:v},N):Sl(a)&&(ge(a.x)||Eo(a.x))&&(ge(a.y)||Eo(a.y))?ar({x:c+Io(a.x,d),y:u+Io(a.y,p),textAnchor:"end",verticalAnchor:"end"},N):ar({x:c+d/2,y:u+p/2,textAnchor:"middle",verticalAnchor:"middle"},N)},AY=function(e){return"cx"in e&&ge(e.cx)};function jr(t){var e=t.offset,r=e===void 0?5:e,n=yY(t,dY),i=ar({offset:r},n),a=i.viewBox,o=i.position,c=i.value,u=i.children,d=i.content,p=i.className,f=p===void 0?"":p,y=i.textBreakAll;if(!a||et(c)&&et(u)&&!j.isValidElement(d)&&!Je(d))return null;if(j.isValidElement(d))return j.cloneElement(d,i);var v;if(Je(d)){if(v=j.createElement(d,i),j.isValidElement(v))return v}else v=_Y(i);var x=AY(a),w=at(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return kY(i,v,w);var b=x?EY(i):OY(i);return L.createElement(fh,hu({className:ot("recharts-label",f)},w,b,{breakAll:y}),v)}jr.displayName="Label";var T$=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,f=e.x,y=e.y,v=e.top,x=e.left,w=e.width,b=e.height,S=e.clockWise,A=e.labelViewBox;if(A)return A;if(ge(w)&&ge(b)){if(ge(f)&&ge(y))return{x:f,y,width:w,height:b};if(ge(v)&&ge(x))return{x:v,y:x,width:w,height:b}}return ge(f)&&ge(y)?{x:f,y,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:S}:e.viewBox?e.viewBox:{}},TY=function(e,r){return e?e===!0?L.createElement(jr,{key:"label-implicit",viewBox:r}):or(e)?L.createElement(jr,{key:"label-implicit",viewBox:r,value:e}):j.isValidElement(e)?e.type===jr?j.cloneElement(e,{key:"label-implicit",viewBox:r}):L.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):Je(e)?L.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):Sl(e)?L.createElement(jr,hu({viewBox:r},e,{key:"label-implicit"})):null:null},CY=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=T$(e),o=Cn(i,jr).map(function(u,d){return j.cloneElement(u,{viewBox:r||a,key:"label-".concat(d)})});if(!n)return o;var c=TY(e.label,r||a);return[c].concat(fY(o))};jr.parseViewBox=T$;jr.renderCallByParent=CY;var lb,HC;function jY(){if(HC)return lb;HC=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return lb=t,lb}var NY=jY();const PY=vt(NY);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 RY=["valueAccessor"],IY=["data","dataKey","clockWise","id","textBreakAll"];function $Y(t){return zY(t)||DY(t)||LY(t)||MY()}function MY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
467
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LY(t,e){if(t){if(typeof t=="string")return Hx(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 Hx(t,e)}}function DY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function zY(t){if(Array.isArray(t))return Hx(t)}function Hx(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 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 WC(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 GC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?WC(Object(r),!0).forEach(function(n){BY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):WC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function BY(t,e,r){return e=UY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UY(t){var e=qY(t,"string");return pu(e)=="symbol"?e:e+""}function qY(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 KC(t,e){if(t==null)return{};var r=FY(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 FY(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 HY=function(e){return Array.isArray(e.value)?PY(e.value):e.value};function Da(t){var e=t.valueAccessor,r=e===void 0?HY:e,n=KC(t,RY),i=n.data,a=n.dataKey,o=n.clockWise,c=n.id,u=n.textBreakAll,d=KC(n,IY);return!i||!i.length?null:L.createElement(Xt,{className:"recharts-label-list"},i.map(function(p,f){var y=et(a)?r(p,f):dn(p&&p.payload,a),v=et(c)?{}:{id:"".concat(c,"-").concat(f)};return L.createElement(jr,Ch({},at(p,!0),d,v,{parentViewBox:p.parentViewBox,value:y,textBreakAll:u,viewBox:jr.parseViewBox(et(o)?p:GC(GC({},p),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Da.displayName="LabelList";function WY(t,e){return t?t===!0?L.createElement(Da,{key:"labelList-implicit",data:e}):L.isValidElement(t)||Je(t)?L.createElement(Da,{key:"labelList-implicit",data:e,content:t}):Sl(t)?L.createElement(Da,Ch({data:e},t,{key:"labelList-implicit"})):null:null}function GY(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=Cn(n,Da).map(function(o,c){return j.cloneElement(o,{data:e,key:"labelList-".concat(c)})});if(!r)return i;var a=WY(t.label,e);return[a].concat($Y(i))}Da.renderCallByParent=GY;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 Wx(){return Wx=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},Wx.apply(this,arguments)}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 XC(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){KY(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 KY(t,e,r){return e=VY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VY(t){var e=XY(t,"string");return mu(e)=="symbol"?e:e+""}function XY(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 YY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},kf=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,f=Math.asin(u/p)/Th,y=d?a:a+o*f,v=_r(r,n,p,y),x=_r(r,n,i,y),w=d?a-o*f:a,b=_r(r,n,p*Math.cos(f*Th),w);return{center:v,circleTangency:x,lineTangency:b,theta:f}},C$=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.startAngle,c=e.endAngle,u=YY(o,c),d=o+u,p=_r(r,n,a,o),f=_r(r,n,a,d),y="M ".concat(p.x,",").concat(p.y,`
466
+ `).concat(T.x,",").concat(T.y),R=tt(e.id)?Du("recharts-radial-line-"):e.id;return L.createElement("text",hu({},n,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",c)}),L.createElement("defs",null,L.createElement("path",{id:R,d:N})),L.createElement("textPath",{xlinkHref:"#".concat(R)},r))},EY=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,f=a.endAngle,y=(p+f)/2;if(i==="outside"){var v=_r(o,c,d+n,y),x=v.x,w=v.y;return{x,y:w,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,S=_r(o,c,b,y),A=S.x,O=S.y;return{x:A,y:O,textAnchor:"middle",verticalAnchor:"middle"}},OY=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,f=p>=0?1:-1,y=f*i,v=f>0?"end":"start",x=f>0?"start":"end",w=d>=0?1:-1,b=w*i,S=w>0?"end":"start",A=w>0?"start":"end";if(a==="top"){var O={x:c+d/2,y:u-f*i,textAnchor:"middle",verticalAnchor:v};return ar(ar({},O),n?{height:Math.max(u-n.y,0),width:d}:{})}if(a==="bottom"){var C={x:c+d/2,y:u+p+y,textAnchor:"middle",verticalAnchor:x};return ar(ar({},C),n?{height:Math.max(n.y+n.height-(u+p),0),width:d}:{})}if(a==="left"){var E={x:c-b,y:u+p/2,textAnchor:S,verticalAnchor:"middle"};return ar(ar({},E),n?{width:Math.max(E.x-n.x,0),height:p}:{})}if(a==="right"){var T={x:c+d+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"};return ar(ar({},T),n?{width:Math.max(n.x+n.width-T.x,0),height:p}:{})}var N=n?{width:d,height:p}:{};return a==="insideLeft"?ar({x:c+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"},N):a==="insideRight"?ar({x:c+d-b,y:u+p/2,textAnchor:S,verticalAnchor:"middle"},N):a==="insideTop"?ar({x:c+d/2,y:u+y,textAnchor:"middle",verticalAnchor:x},N):a==="insideBottom"?ar({x:c+d/2,y:u+p-y,textAnchor:"middle",verticalAnchor:v},N):a==="insideTopLeft"?ar({x:c+b,y:u+y,textAnchor:A,verticalAnchor:x},N):a==="insideTopRight"?ar({x:c+d-b,y:u+y,textAnchor:S,verticalAnchor:x},N):a==="insideBottomLeft"?ar({x:c+b,y:u+p-y,textAnchor:A,verticalAnchor:v},N):a==="insideBottomRight"?ar({x:c+d-b,y:u+p-y,textAnchor:S,verticalAnchor:v},N):Sl(a)&&(ge(a.x)||Eo(a.x))&&(ge(a.y)||Eo(a.y))?ar({x:c+Io(a.x,d),y:u+Io(a.y,p),textAnchor:"end",verticalAnchor:"end"},N):ar({x:c+d/2,y:u+p/2,textAnchor:"middle",verticalAnchor:"middle"},N)},AY=function(e){return"cx"in e&&ge(e.cx)};function jr(t){var e=t.offset,r=e===void 0?5:e,n=yY(t,dY),i=ar({offset:r},n),a=i.viewBox,o=i.position,c=i.value,u=i.children,d=i.content,p=i.className,f=p===void 0?"":p,y=i.textBreakAll;if(!a||tt(c)&&tt(u)&&!j.isValidElement(d)&&!Je(d))return null;if(j.isValidElement(d))return j.cloneElement(d,i);var v;if(Je(d)){if(v=j.createElement(d,i),j.isValidElement(v))return v}else v=_Y(i);var x=AY(a),w=at(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return kY(i,v,w);var b=x?EY(i):OY(i);return L.createElement(fh,hu({className:ot("recharts-label",f)},w,b,{breakAll:y}),v)}jr.displayName="Label";var T$=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,f=e.x,y=e.y,v=e.top,x=e.left,w=e.width,b=e.height,S=e.clockWise,A=e.labelViewBox;if(A)return A;if(ge(w)&&ge(b)){if(ge(f)&&ge(y))return{x:f,y,width:w,height:b};if(ge(v)&&ge(x))return{x:v,y:x,width:w,height:b}}return ge(f)&&ge(y)?{x:f,y,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:S}:e.viewBox?e.viewBox:{}},TY=function(e,r){return e?e===!0?L.createElement(jr,{key:"label-implicit",viewBox:r}):or(e)?L.createElement(jr,{key:"label-implicit",viewBox:r,value:e}):j.isValidElement(e)?e.type===jr?j.cloneElement(e,{key:"label-implicit",viewBox:r}):L.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):Je(e)?L.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):Sl(e)?L.createElement(jr,hu({viewBox:r},e,{key:"label-implicit"})):null:null},CY=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=T$(e),o=Cn(i,jr).map(function(u,d){return j.cloneElement(u,{viewBox:r||a,key:"label-".concat(d)})});if(!n)return o;var c=TY(e.label,r||a);return[c].concat(fY(o))};jr.parseViewBox=T$;jr.renderCallByParent=CY;var lb,HC;function jY(){if(HC)return lb;HC=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return lb=t,lb}var NY=jY();const PY=vt(NY);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 RY=["valueAccessor"],IY=["data","dataKey","clockWise","id","textBreakAll"];function $Y(t){return zY(t)||DY(t)||LY(t)||MY()}function MY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
467
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LY(t,e){if(t){if(typeof t=="string")return Hx(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 Hx(t,e)}}function DY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function zY(t){if(Array.isArray(t))return Hx(t)}function Hx(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 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 WC(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 GC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?WC(Object(r),!0).forEach(function(n){BY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):WC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function BY(t,e,r){return e=UY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UY(t){var e=qY(t,"string");return pu(e)=="symbol"?e:e+""}function qY(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 KC(t,e){if(t==null)return{};var r=FY(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 FY(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 HY=function(e){return Array.isArray(e.value)?PY(e.value):e.value};function Da(t){var e=t.valueAccessor,r=e===void 0?HY:e,n=KC(t,RY),i=n.data,a=n.dataKey,o=n.clockWise,c=n.id,u=n.textBreakAll,d=KC(n,IY);return!i||!i.length?null:L.createElement(Xt,{className:"recharts-label-list"},i.map(function(p,f){var y=tt(a)?r(p,f):dn(p&&p.payload,a),v=tt(c)?{}:{id:"".concat(c,"-").concat(f)};return L.createElement(jr,Ch({},at(p,!0),d,v,{parentViewBox:p.parentViewBox,value:y,textBreakAll:u,viewBox:jr.parseViewBox(tt(o)?p:GC(GC({},p),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Da.displayName="LabelList";function WY(t,e){return t?t===!0?L.createElement(Da,{key:"labelList-implicit",data:e}):L.isValidElement(t)||Je(t)?L.createElement(Da,{key:"labelList-implicit",data:e,content:t}):Sl(t)?L.createElement(Da,Ch({data:e},t,{key:"labelList-implicit"})):null:null}function GY(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=Cn(n,Da).map(function(o,c){return j.cloneElement(o,{data:e,key:"labelList-".concat(c)})});if(!r)return i;var a=WY(t.label,e);return[a].concat($Y(i))}Da.renderCallByParent=GY;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 Wx(){return Wx=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},Wx.apply(this,arguments)}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 XC(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){KY(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 KY(t,e,r){return e=VY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VY(t){var e=XY(t,"string");return mu(e)=="symbol"?e:e+""}function XY(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 YY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},kf=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,f=Math.asin(u/p)/Th,y=d?a:a+o*f,v=_r(r,n,p,y),x=_r(r,n,i,y),w=d?a-o*f:a,b=_r(r,n,p*Math.cos(f*Th),w);return{center:v,circleTangency:x,lineTangency:b,theta:f}},C$=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.startAngle,c=e.endAngle,u=YY(o,c),d=o+u,p=_r(r,n,a,o),f=_r(r,n,a,d),y="M ".concat(p.x,",").concat(p.y,`
468
468
  A `).concat(a,",").concat(a,`,0,
469
469
  `).concat(+(Math.abs(u)>180),",").concat(+(o>d),`,
470
470
  `).concat(f.x,",").concat(f.y,`
@@ -499,12 +499,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
499
499
  A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+n-u*x,",").concat(r+i,`
500
500
  L `).concat(e+u*x,",").concat(r+i,`
501
501
  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},XZ=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),f=Math.min(o,o+u),y=Math.max(o,o+u);return n>=d&&n<=p&&i>=f&&i<=y}return!1},YZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Y1=function(e){var r=bj(bj({},YZ),e),n=j.useRef(),i=j.useState(-1),a=UZ(i,2),o=a[0],c=a[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var C=n.current.getTotalLength();C&&c(C)}catch{}},[]);var u=r.x,d=r.y,p=r.width,f=r.height,y=r.radius,v=r.className,x=r.animationEasing,w=r.animationDuration,b=r.animationBegin,S=r.isAnimationActive,A=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||f!==+f||p===0||f===0)return null;var O=ot("recharts-rectangle",v);return A?L.createElement(Qi,{canBegin:o>0,from:{width:p,height:f,x:u,y:d},to:{width:p,height:f,x:u,y:d},duration:w,animationEasing:x,isActive:A},function(C){var E=C.width,T=C.height,N=C.x,R=C.y;return L.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:w,isActive:S,easing:x},L.createElement("path",Ih({},at(r,!0),{className:O,d:xj(N,R,E,T,y),ref:n})))}):L.createElement("path",Ih({},at(r,!0),{className:O,d:xj(u,d,p,f,y)}))};function nw(){return nw=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},nw.apply(this,arguments)}var J1=function(e){var r=e.cx,n=e.cy,i=e.r,a=e.className,o=ot("recharts-dot",a);return r===+r&&n===+n&&i===+i?j.createElement("circle",nw({},at(e,!1),Qf(e),{className:o,cx:r,cy:n,r:i})):null};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)}var JZ=["x","y","top","left","width","height","className"];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 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 ZZ(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){QZ(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 QZ(t,e,r){return e=eQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eQ(t){var e=tQ(t,"string");return xu(e)=="symbol"?e:e+""}function tQ(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)}function rQ(t,e){if(t==null)return{};var r=nQ(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 nQ(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 iQ=function(e,r,n,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},aQ=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,f=p===void 0?0:p,y=e.height,v=y===void 0?0:y,x=e.className,w=rQ(e,JZ),b=ZZ({x:n,y:a,top:c,left:d,width:f,height:v},w);return!ge(n)||!ge(a)||!ge(f)||!ge(v)||!ge(c)||!ge(d)?null:L.createElement("path",iw({},at(b,!0),{className:ot("recharts-cross",x),d:iQ(n,a,f,v,c,d)}))},pb,_j;function oQ(){if(_j)return pb;_j=1;var t=iI(),e=t(Object.getPrototypeOf,Object);return pb=e,pb}var mb,Sj;function sQ(){if(Sj)return mb;Sj=1;var t=ra(),e=oQ(),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 f=e(p);if(f===null)return!0;var y=c.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&o.call(y)==u}return mb=d,mb}var lQ=sQ();const cQ=vt(lQ);var gb,kj;function uQ(){if(kj)return gb;kj=1;var t=ra(),e=na(),r="[object Boolean]";function n(i){return i===!0||i===!1||e(i)&&t(i)==r}return gb=n,gb}var dQ=uQ();const fQ=vt(dQ);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 $h(){return $h=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},$h.apply(this,arguments)}function hQ(t,e){return yQ(t)||gQ(t,e)||mQ(t,e)||pQ()}function pQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
502
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mQ(t,e){if(t){if(typeof t=="string")return Ej(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 Ej(t,e)}}function Ej(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 gQ(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 yQ(t){if(Array.isArray(t))return t}function Oj(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 Aj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Oj(Object(r),!0).forEach(function(n){vQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Oj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vQ(t,e,r){return e=bQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bQ(t){var e=xQ(t,"string");return wu(e)=="symbol"?e:e+""}function xQ(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)}var Tj=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},wQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},_Q=function(e){var r=Aj(Aj({},wQ),e),n=j.useRef(),i=j.useState(-1),a=hQ(i,2),o=a[0],c=a[1];j.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,f=r.lowerWidth,y=r.height,v=r.className,x=r.animationEasing,w=r.animationDuration,b=r.animationBegin,S=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||f!==+f||y!==+y||p===0&&f===0||y===0)return null;var A=ot("recharts-trapezoid",v);return S?L.createElement(Qi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:y,x:u,y:d},to:{upperWidth:p,lowerWidth:f,height:y,x:u,y:d},duration:w,animationEasing:x,isActive:S},function(O){var C=O.upperWidth,E=O.lowerWidth,T=O.height,N=O.x,R=O.y;return L.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:w,easing:x},L.createElement("path",$h({},at(r,!0),{className:A,d:Tj(N,R,C,E,T),ref:n})))}):L.createElement("g",null,L.createElement("path",$h({},at(r,!0),{className:A,d:Tj(u,d,p,f,y)})))},SQ=["option","shapeType","propTransformer","activeClassName","isActive"];function _u(t){"@babel/helpers - typeof";return _u=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},_u(t)}function kQ(t,e){if(t==null)return{};var r=EQ(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 EQ(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 Cj(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 Mh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Cj(Object(r),!0).forEach(function(n){OQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function OQ(t,e,r){return e=AQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AQ(t){var e=TQ(t,"string");return _u(e)=="symbol"?e:e+""}function TQ(t,e){if(_u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CQ(t,e){return Mh(Mh({},e),t)}function jQ(t,e){return t==="symbols"}function jj(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return L.createElement(Y1,r);case"trapezoid":return L.createElement(_Q,r);case"sector":return L.createElement(j$,r);case"symbols":if(jQ(e))return L.createElement(m1,r);break;default:return null}}function NQ(t){return j.isValidElement(t)?t.props:t}function PQ(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?CQ:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,c=t.isActive,u=kQ(t,SQ),d;if(j.isValidElement(e))d=j.cloneElement(e,Mh(Mh({},u),NQ(e)));else if(Je(e))d=e(u);else if(cQ(e)&&!fQ(e)){var p=i(e,u);d=L.createElement(jj,{shapeType:r,elementProps:p})}else{var f=u;d=L.createElement(jj,{shapeType:r,elementProps:f})}return c?L.createElement(Xt,{className:o},d):d}function Ip(t,e){return e!=null&&"trapezoids"in t.props}function $p(t,e){return e!=null&&"sectors"in t.props}function Su(t,e){return e!=null&&"points"in t.props}function RQ(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 IQ(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function $Q(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function MQ(t,e){var r;return Ip(t,e)?r=RQ:$p(t,e)?r=IQ:Su(t,e)&&(r=$Q),r}function LQ(t,e){var r;return Ip(t,e)?r="trapezoids":$p(t,e)?r="sectors":Su(t,e)&&(r="points"),r}function DQ(t,e){if(Ip(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($p(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 Su(t,e)?e.payload:{}}function zQ(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=LQ(r,e),a=DQ(r,e),o=n.filter(function(u,d){var p=Np(a,u),f=r.props[i].filter(function(x){var w=MQ(r,e);return w(x,e)}),y=r.props[i].indexOf(f[f.length-1]),v=d===y;return p&&v}),c=n.indexOf(o[o.length-1]);return c}var yb,Nj;function BQ(){if(Nj)return yb;Nj=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 yb=r,yb}var vb,Pj;function D$(){if(Pj)return vb;Pj=1;var t=xI(),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 vb=n,vb}var bb,Rj;function UQ(){if(Rj)return bb;Rj=1;var t=BQ(),e=_p(),r=D$();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 bb=n,bb}var xb,Ij;function qQ(){if(Ij)return xb;Ij=1;var t=UQ(),e=t();return xb=e,xb}var FQ=qQ();const Lh=vt(FQ);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 $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 Mj(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){z$(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 z$(t,e,r){return e=HQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HQ(t){var e=WQ(t,"string");return ku(e)=="symbol"?e:e+""}function WQ(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)}var GQ=["Webkit","Moz","O","ms"],KQ=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=GQ.reduce(function(a,o){return Mj(Mj({},a),{},z$({},o+n,r))},{});return i[e]=r,i};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 Dh(){return Dh=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},Dh.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 wb(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){on(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 VQ(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,U$(n.key),n)}}function XQ(t,e,r){return e&&Dj(t.prototype,e),r&&Dj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function YQ(t,e,r){return e=zh(e),JQ(t,B$()?Reflect.construct(e,r||[],zh(t).constructor):e.apply(t,r))}function JQ(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 ZQ(t)}function ZQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B$=function(){return!!t})()}function zh(t){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zh(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&&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 on(t,e,r){return e=U$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function U$(t){var e=eee(t,"string");return nl(e)=="symbol"?e:e+""}function eee(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 tee=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=Lc().domain(Lh(0,u)).range([a,a+o-c]),p=d.domain().map(function(f){return d(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(n),endX:d(i),scale:d,scaleValues:p}},zj=function(e){return e.changedTouches&&!!e.changedTouches.length},il=(function(t){function e(r){var n;return VQ(this,e),n=YQ(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=zj(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),XQ(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,f=Math.min(i,a),y=Math.max(i,a),v=e.getIndexInRange(o,f),x=e.getIndexInRange(o,y);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 Je(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,f=u.travellerWidth,y=u.startIndex,v=u.endIndex,x=u.onChange,w=n.pageX-a;w>0?w=Math.min(w,d+p-f-c,d+p-f-o):w<0&&(w=Math.max(w,d-o,d-c));var b=this.getIndex({startX:o+w,endX:c+w});(b.startIndex!==y||b.endIndex!==v)&&x&&x(b),this.setState({startX:o+w,endX:c+w,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=zj(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,f=p.x,y=p.width,v=p.travellerWidth,x=p.onChange,w=p.gap,b=p.data,S={startX:this.state.startX,endX:this.state.endX},A=n.pageX-a;A>0?A=Math.min(A,f+y-v-d):A<0&&(A=Math.max(A,f-d)),S[o]=d+A;var O=this.getIndex(S),C=O.startIndex,E=O.endIndex,T=function(){var R=b.length-1;return o==="startX"&&(c>u?C%w===0:E%w===0)||c<u&&E===R||o==="endX"&&(c>u?E%w===0:C%w===0)||c>u&&E===R};this.setState(on(on({},o,d+A),"brushMoveStartX",n.pageX),function(){x&&T()&&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],f=c.indexOf(p);if(f!==-1){var y=f+n;if(!(y===-1||y>=c.length)){var v=c[y];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 L.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,f=j.Children.only(d);return f?L.cloneElement(f,{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,f=u.height,y=u.traveller,v=u.ariaLabel,x=u.data,w=u.startIndex,b=u.endIndex,S=Math.max(n,this.props.x),A=wb(wb({},at(this.props,!1)),{},{x:S,y:d,width:p,height:f}),O=v||"Min value: ".concat((a=x[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=x[b])===null||o===void 0?void 0:o.name);return L.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(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),c.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(y,A))}},{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,f=Math.max(Math.abs(i-n)-d,0);return L.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:f,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,f=p.startX,y=p.endX,v=5,x={pointerEvents:"none",fill:d};return L.createElement(Xt,{className:"recharts-brush-texts"},L.createElement(fh,Dh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,y)-v,y:o+c/2},x),this.getTextOfTick(i)),L.createElement(fh,Dh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,y)+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,f=n.alwaysShowText,y=this.state,v=y.startX,x=y.endX,w=y.isTextActive,b=y.isSlideMoving,S=y.isTravellerMoving,A=y.isTravellerFocused;if(!i||!i.length||!ge(c)||!ge(u)||!ge(d)||!ge(p)||d<=0||p<=0)return null;var O=ot("recharts-brush",a),C=L.Children.count(o)===1,E=KQ("userSelect","none");return L.createElement(Xt,{className:O,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),C&&this.renderPanorama(),this.renderSlide(v,x),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(x,"endX"),(w||b||S||A||f)&&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 L.createElement(L.Fragment,null,L.createElement("rect",{x:i,y:a,width:o,height:c,fill:u,stroke:"none"}),L.createElement("line",{x1:i+1,y1:d,x2:i+o-1,y2:d,fill:"none",stroke:"#fff"}),L.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 L.isValidElement(n)?a=L.cloneElement(n,i):Je(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,f=n.endIndex;if(a!==i.prevData||d!==i.prevUpdateId)return wb({prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:c,prevWidth:o},a&&a.length?tee({data:a,width:o,x:c,travellerWidth:u,startIndex:p,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||c!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([c,c+o-u]);var y=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:y}}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}}])})(j.PureComponent);on(il,"displayName","Brush");on(il,"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 _b,Bj;function ree(){if(Bj)return _b;Bj=1;var t=_1();function e(r,n){var i;return t(r,function(a,o,c){return i=n(a,o,c),!i}),!!i}return _b=e,_b}var Sb,Uj;function nee(){if(Uj)return Sb;Uj=1;var t=JR(),e=Wa(),r=ree(),n=Qr(),i=_p();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 Sb=a,Sb}var iee=nee();const aee=vt(iee);var ki=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},kb,qj;function oee(){if(qj)return kb;qj=1;var t=mI();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return kb=e,kb}var Eb,Fj;function see(){if(Fj)return Eb;Fj=1;var t=oee(),e=hI(),r=Wa();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 Eb=n,Eb}var lee=see();const cee=vt(lee);var Ob,Hj;function uee(){if(Hj)return Ob;Hj=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 Ob=t,Ob}var Ab,Wj;function dee(){if(Wj)return Ab;Wj=1;var t=_1();function e(r,n){var i=!0;return t(r,function(a,o,c){return i=!!n(a,o,c),i}),i}return Ab=e,Ab}var Tb,Gj;function fee(){if(Gj)return Tb;Gj=1;var t=uee(),e=dee(),r=Wa(),n=Qr(),i=_p();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 Tb=a,Tb}var hee=fee();const q$=vt(hee);var pee=["x","y"];function Eu(t){"@babel/helpers - typeof";return Eu=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},Eu(t)}function ow(){return ow=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},ow.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 Ec(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){mee(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 mee(t,e,r){return e=gee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gee(t){var e=yee(t,"string");return Eu(e)=="symbol"?e:e+""}function yee(t,e){if(Eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vee(t,e){if(t==null)return{};var r=bee(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 bee(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 xee(t,e){var r=t.x,n=t.y,i=vee(t,pee),a="".concat(r),o=parseInt(a,10),c="".concat(n),u=parseInt(c,10),d="".concat(e.height||i.height),p=parseInt(d,10),f="".concat(e.width||i.width),y=parseInt(f,10);return Ec(Ec(Ec(Ec(Ec({},e),i),o?{x:o}:{}),u?{y:u}:{}),{},{height:p,width:y,name:e.name,radius:e.radius})}function Vj(t){return L.createElement(PQ,ow({shapeType:"rectangle",propTransformer:xee,activeClassName:"recharts-active-bar"},t))}var wee=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)||A9(n);return a?e(n,i):(a||Mo(),r)}},_ee=["value","background"],F$;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 See(t,e){if(t==null)return{};var r=kee(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 kee(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 Bh(){return Bh=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},Bh.apply(this,arguments)}function Xj(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?Xj(Object(r),!0).forEach(function(n){Ia(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Eee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yj(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 Oee(t,e,r){return e&&Yj(t.prototype,e),r&&Yj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Aee(t,e,r){return e=Uh(e),Tee(t,H$()?Reflect.construct(e,r||[],Uh(t).constructor):e.apply(t,r))}function Tee(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 Cee(t)}function Cee(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 Uh(t){return Uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uh(t)}function jee(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&&sw(t,e)}function sw(t,e){return sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sw(t,e)}function Ia(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=Nee(t,"string");return al(e)=="symbol"?e:e+""}function Nee(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 ea=(function(t){function e(){var r;Eee(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=Aee(this,e,[].concat(i)),Ia(r,"state",{isAnimationFinished:!1}),Ia(r,"id",Du("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 jee(e,t),Oee(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=at(this.props,!1);return n&&n.map(function(f,y){var v=y===u,x=v?d:o,w=Jt(Jt(Jt({},p),f),{},{isActive:v,option:x,index:y,dataKey:c,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return L.createElement(Xt,Bh({className:"recharts-bar-rectangle"},eh(i.props,f,y),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(y)}),L.createElement(Vj,w))})}},{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,f=i.animationId,y=this.state.prevData;return L.createElement(Qi,{begin:u,duration:d,isActive:c,easing:p,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var x=v.t,w=a.map(function(b,S){var A=y&&y[S];if(A){var O=Vn(A.x,b.x),C=Vn(A.y,b.y),E=Vn(A.width,b.width),T=Vn(A.height,b.height);return Jt(Jt({},b),{},{x:O(x),y:C(x),width:E(x),height:T(x)})}if(o==="horizontal"){var N=Vn(0,b.height),R=N(x);return Jt(Jt({},b),{},{y:b.y+b.height-R,height:R})}var I=Vn(0,b.width),K=I(x);return Jt(Jt({},b),{},{width:K})});return L.createElement(Xt,null,n.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Np(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=at(this.props.background,!1);return a.map(function(d,p){d.value;var f=d.background,y=See(d,_ee);if(!f)return null;var v=Jt(Jt(Jt(Jt(Jt({},y),{},{fill:"#eee"},f),u),eh(n.props,d,p)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:p,className:"recharts-bar-background-rectangle"});return L.createElement(Vj,Bh({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,f=Cn(p,Hu);if(!f)return null;var y=d==="vertical"?o[0].height/2:o[0].width/2,v=function(b,S){var A=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:A,errorVal:dn(b,S)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return L.createElement(Xt,x,f.map(function(w){return L.cloneElement(w,{key:"error-bar-".concat(i,"-").concat(w.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,offset:y,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,f=n.width,y=n.height,v=n.isAnimationActive,x=n.background,w=n.id;if(i||!a||!a.length)return null;var b=this.state.isAnimationFinished,S=ot("recharts-bar",o),A=c&&c.allowDataOverflow,O=u&&u.allowDataOverflow,C=A||O,E=et(w)?this.id:w;return L.createElement(Xt,{className:S},A||O?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(E)},L.createElement("rect",{x:A?d:d-f/2,y:O?p:p-y/2,width:A?f:f*2,height:O?y:y*2}))):null,L.createElement(Xt,{className:"recharts-bar-rectangles",clipPath:C?"url(#clipPath-".concat(E,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(C,E),(!v||b)&&Da.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}}])})(j.PureComponent);F$=ea;Ia(ea,"displayName","Bar");Ia(ea,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!El.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,f=t.displayedData,y=t.offset,v=GX(n,r);if(!v)return null;var x=e.layout,w=r.type.defaultProps,b=w!==void 0?Jt(Jt({},w),r.props):r.props,S=b.dataKey,A=b.children,O=b.minPointSize,C=x==="horizontal"?o:a,E=d?C.scale.domain():null,T=eY({numericAxis:C}),N=Cn(A,_I),R=f.map(function(I,K){var B,U,V,H,Y,G;d?B=KX(d[p+K],E):(B=dn(I,S),Array.isArray(B)||(B=[T,B]));var Q=wee(O,F$.defaultProps.minPointSize)(B[1],K);if(x==="horizontal"){var W,ee=[o.scale(B[0]),o.scale(B[1])],q=ee[0],$=ee[1];U=MC({axis:a,ticks:c,bandSize:i,offset:v.offset,entry:I,index:K}),V=(W=$??q)!==null&&W!==void 0?W:void 0,H=v.size;var M=q-$;if(Y=Number.isNaN(M)?0:M,G={x:U,y:o.y,width:H,height:o.height},Math.abs(Q)>0&&Math.abs(Y)<Math.abs(Q)){var J=Jn(Y||Q)*(Math.abs(Q)-Math.abs(Y));V-=J,Y+=J}}else{var oe=[a.scale(B[0]),a.scale(B[1])],le=oe[0],ve=oe[1];if(U=le,V=MC({axis:o,ticks:u,bandSize:i,offset:v.offset,entry:I,index:K}),H=ve-le,Y=v.size,G={x:a.x,y:V,width:a.width,height:Y},Math.abs(Q)>0&&Math.abs(H)<Math.abs(Q)){var qe=Jn(H||Q)*(Math.abs(Q)-Math.abs(H));H+=qe}}return Jt(Jt(Jt({},I),{},{x:U,y:V,width:H,height:Y,value:d?B:B[1],payload:I,background:G},N&&N[K]&&N[K].props),{},{tooltipPayload:[A$(r,I)],tooltipPosition:{x:U+H/2,y:V+Y/2}})});return Jt({data:R,layout:x},y)});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)}function Pee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jj(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,G$(n.key),n)}}function Ree(t,e,r){return e&&Jj(t.prototype,e),r&&Jj(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){Mp(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 Mp(t,e,r){return e=G$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G$(t){var e=Iee(t,"string");return Ou(e)=="symbol"?e:e+""}function Iee(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)}var K$=function(e,r,n,i,a){var o=e.width,c=e.height,u=e.layout,d=e.children,p=Object.keys(r),f={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},y=!!sn(d,ea);return p.reduce(function(v,x){var w=r[x],b=w.orientation,S=w.domain,A=w.padding,O=A===void 0?{}:A,C=w.mirror,E=w.reversed,T="".concat(b).concat(C?"Mirror":""),N,R,I,K,B;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var U=S[1]-S[0],V=1/0,H=w.categoricalDomain.sort(j9);if(H.forEach(function(oe,le){le>0&&(V=Math.min((oe||0)-(H[le-1]||0),V))}),Number.isFinite(V)){var Y=V/U,G=w.layout==="vertical"?n.height:n.width;if(w.padding==="gap"&&(N=Y*G/2),w.padding==="no-gap"){var Q=Io(e.barCategoryGap,Y*G),W=Y*G/2;N=W-Q-(W-Q)/G*Q}}}i==="xAxis"?R=[n.left+(O.left||0)+(N||0),n.left+n.width-(O.right||0)-(N||0)]:i==="yAxis"?R=u==="horizontal"?[n.top+n.height-(O.bottom||0),n.top+(O.top||0)]:[n.top+(O.top||0)+(N||0),n.top+n.height-(O.bottom||0)-(N||0)]:R=w.range,E&&(R=[R[1],R[0]]);var ee=HX(w,a,y),q=ee.scale,$=ee.realScaleType;q.domain(S).range(R),WX(q);var M=QX(q,Hn(Hn({},w),{},{realScaleType:$}));i==="xAxis"?(B=b==="top"&&!C||b==="bottom"&&C,I=n.left,K=f[T]-B*w.height):i==="yAxis"&&(B=b==="left"&&!C||b==="right"&&C,I=f[T]-B*w.width,K=n.top);var J=Hn(Hn(Hn({},w),M),{},{realScaleType:$,x:I,y:K,scale:q,width:i==="xAxis"?n.width:w.width,height:i==="yAxis"?n.height:w.height});return J.bandSize=Ah(J,M),!w.hide&&i==="xAxis"?f[T]+=(B?-1:1)*J.height:w.hide||(f[T]+=(B?-1:1)*J.width),Hn(Hn({},v),{},Mp({},x,J))},{})},V$=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)}},$ee=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return V$({x:r,y:n},{x:i,y:a})},X$=(function(){function t(e){Pee(this,t),this.scale=e}return Ree(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)}}])})();Mp(X$,"EPS",1e-4);var Z1=function(e){var r=Object.keys(e).reduce(function(n,i){return Hn(Hn({},n),{},Mp({},i,X$.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 cee(i,function(u,d){return r[d].apply(u,{bandAware:o,position:c})})},isInRange:function(i){return q$(i,function(a,o){return r[o].isInRange(a)})}})};function Mee(t){return(t%180+180)%180}var Lee=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Mee(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)},Cb,Qj;function Dee(){if(Qj)return Cb;Qj=1;var t=Wa(),e=zu(),r=xp();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(f){return d(u[f],f,u)}}var p=i(a,o,c);return p>-1?u[d?a[p]:p]:void 0}}return Cb=n,Cb}var jb,eN;function zee(){if(eN)return jb;eN=1;var t=D$();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return jb=e,jb}var Nb,tN;function Bee(){if(tN)return Nb;tN=1;var t=lI(),e=Wa(),r=zee(),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 Nb=i,Nb}var Pb,rN;function Uee(){if(rN)return Pb;rN=1;var t=Dee(),e=Bee(),r=t(e);return Pb=r,Pb}var qee=Uee();const Fee=vt(qee);var Hee=kR();const Wee=vt(Hee);var Gee=Wee(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=j.createContext(void 0),e_=j.createContext(void 0),Y$=j.createContext(void 0),J$=j.createContext({}),Z$=j.createContext(void 0),Q$=j.createContext(0),eM=j.createContext(0),nN=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=Gee(a);return L.createElement(Q1.Provider,{value:n},L.createElement(e_.Provider,{value:i},L.createElement(J$.Provider,{value:a},L.createElement(Y$.Provider,{value:p},L.createElement(Z$.Provider,{value:o},L.createElement(Q$.Provider,{value:d},L.createElement(eM.Provider,{value:u},c)))))))},Kee=function(){return j.useContext(Z$)},tM=function(e){var r=j.useContext(Q1);r==null&&Mo();var n=r[e];return n==null&&Mo(),n},Vee=function(){var e=j.useContext(Q1);return Pa(e)},Xee=function(){var e=j.useContext(e_),r=Fee(e,function(n){return q$(n.domain,Number.isFinite)});return r||Pa(e)},rM=function(e){var r=j.useContext(e_);r==null&&Mo();var n=r[e];return n==null&&Mo(),n},Yee=function(){var e=j.useContext(Y$);return e},Jee=function(){return j.useContext(J$)},t_=function(){return j.useContext(eM)},r_=function(){return j.useContext(Q$)};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 Zee(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,iM(n.key),n)}}function ete(t,e,r){return e&&Qee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function tte(t,e,r){return e=qh(e),rte(t,nM()?Reflect.construct(e,r||[],qh(t).constructor):e.apply(t,r))}function rte(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 nte(t)}function nte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nM=function(){return!!t})()}function qh(t){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qh(t)}function ite(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 iN(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?iN(Object(r),!0).forEach(function(n){n_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function n_(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=ate(t,"string");return ol(e)=="symbol"?e:e+""}function ate(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)}function ote(t,e){return ute(t)||cte(t,e)||lte(t,e)||ste()}function ste(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
502
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mQ(t,e){if(t){if(typeof t=="string")return Ej(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 Ej(t,e)}}function Ej(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 gQ(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 yQ(t){if(Array.isArray(t))return t}function Oj(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 Aj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Oj(Object(r),!0).forEach(function(n){vQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Oj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vQ(t,e,r){return e=bQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bQ(t){var e=xQ(t,"string");return wu(e)=="symbol"?e:e+""}function xQ(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)}var Tj=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},wQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},_Q=function(e){var r=Aj(Aj({},wQ),e),n=j.useRef(),i=j.useState(-1),a=hQ(i,2),o=a[0],c=a[1];j.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,f=r.lowerWidth,y=r.height,v=r.className,x=r.animationEasing,w=r.animationDuration,b=r.animationBegin,S=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||f!==+f||y!==+y||p===0&&f===0||y===0)return null;var A=ot("recharts-trapezoid",v);return S?L.createElement(Qi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:y,x:u,y:d},to:{upperWidth:p,lowerWidth:f,height:y,x:u,y:d},duration:w,animationEasing:x,isActive:S},function(O){var C=O.upperWidth,E=O.lowerWidth,T=O.height,N=O.x,R=O.y;return L.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:w,easing:x},L.createElement("path",$h({},at(r,!0),{className:A,d:Tj(N,R,C,E,T),ref:n})))}):L.createElement("g",null,L.createElement("path",$h({},at(r,!0),{className:A,d:Tj(u,d,p,f,y)})))},SQ=["option","shapeType","propTransformer","activeClassName","isActive"];function _u(t){"@babel/helpers - typeof";return _u=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},_u(t)}function kQ(t,e){if(t==null)return{};var r=EQ(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 EQ(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 Cj(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 Mh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Cj(Object(r),!0).forEach(function(n){OQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function OQ(t,e,r){return e=AQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AQ(t){var e=TQ(t,"string");return _u(e)=="symbol"?e:e+""}function TQ(t,e){if(_u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CQ(t,e){return Mh(Mh({},e),t)}function jQ(t,e){return t==="symbols"}function jj(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return L.createElement(Y1,r);case"trapezoid":return L.createElement(_Q,r);case"sector":return L.createElement(j$,r);case"symbols":if(jQ(e))return L.createElement(m1,r);break;default:return null}}function NQ(t){return j.isValidElement(t)?t.props:t}function PQ(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?CQ:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,c=t.isActive,u=kQ(t,SQ),d;if(j.isValidElement(e))d=j.cloneElement(e,Mh(Mh({},u),NQ(e)));else if(Je(e))d=e(u);else if(cQ(e)&&!fQ(e)){var p=i(e,u);d=L.createElement(jj,{shapeType:r,elementProps:p})}else{var f=u;d=L.createElement(jj,{shapeType:r,elementProps:f})}return c?L.createElement(Xt,{className:o},d):d}function Ip(t,e){return e!=null&&"trapezoids"in t.props}function $p(t,e){return e!=null&&"sectors"in t.props}function Su(t,e){return e!=null&&"points"in t.props}function RQ(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 IQ(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function $Q(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function MQ(t,e){var r;return Ip(t,e)?r=RQ:$p(t,e)?r=IQ:Su(t,e)&&(r=$Q),r}function LQ(t,e){var r;return Ip(t,e)?r="trapezoids":$p(t,e)?r="sectors":Su(t,e)&&(r="points"),r}function DQ(t,e){if(Ip(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($p(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 Su(t,e)?e.payload:{}}function zQ(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=LQ(r,e),a=DQ(r,e),o=n.filter(function(u,d){var p=Np(a,u),f=r.props[i].filter(function(x){var w=MQ(r,e);return w(x,e)}),y=r.props[i].indexOf(f[f.length-1]),v=d===y;return p&&v}),c=n.indexOf(o[o.length-1]);return c}var yb,Nj;function BQ(){if(Nj)return yb;Nj=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 yb=r,yb}var vb,Pj;function D$(){if(Pj)return vb;Pj=1;var t=xI(),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 vb=n,vb}var bb,Rj;function UQ(){if(Rj)return bb;Rj=1;var t=BQ(),e=_p(),r=D$();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 bb=n,bb}var xb,Ij;function qQ(){if(Ij)return xb;Ij=1;var t=UQ(),e=t();return xb=e,xb}var FQ=qQ();const Lh=vt(FQ);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 $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 Mj(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){z$(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 z$(t,e,r){return e=HQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HQ(t){var e=WQ(t,"string");return ku(e)=="symbol"?e:e+""}function WQ(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)}var GQ=["Webkit","Moz","O","ms"],KQ=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=GQ.reduce(function(a,o){return Mj(Mj({},a),{},z$({},o+n,r))},{});return i[e]=r,i};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 Dh(){return Dh=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},Dh.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 wb(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){on(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 VQ(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,U$(n.key),n)}}function XQ(t,e,r){return e&&Dj(t.prototype,e),r&&Dj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function YQ(t,e,r){return e=zh(e),JQ(t,B$()?Reflect.construct(e,r||[],zh(t).constructor):e.apply(t,r))}function JQ(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 ZQ(t)}function ZQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B$=function(){return!!t})()}function zh(t){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zh(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&&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 on(t,e,r){return e=U$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function U$(t){var e=eee(t,"string");return nl(e)=="symbol"?e:e+""}function eee(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 tee=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=Lc().domain(Lh(0,u)).range([a,a+o-c]),p=d.domain().map(function(f){return d(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(n),endX:d(i),scale:d,scaleValues:p}},zj=function(e){return e.changedTouches&&!!e.changedTouches.length},il=(function(t){function e(r){var n;return VQ(this,e),n=YQ(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=zj(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),XQ(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,f=Math.min(i,a),y=Math.max(i,a),v=e.getIndexInRange(o,f),x=e.getIndexInRange(o,y);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 Je(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,f=u.travellerWidth,y=u.startIndex,v=u.endIndex,x=u.onChange,w=n.pageX-a;w>0?w=Math.min(w,d+p-f-c,d+p-f-o):w<0&&(w=Math.max(w,d-o,d-c));var b=this.getIndex({startX:o+w,endX:c+w});(b.startIndex!==y||b.endIndex!==v)&&x&&x(b),this.setState({startX:o+w,endX:c+w,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=zj(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,f=p.x,y=p.width,v=p.travellerWidth,x=p.onChange,w=p.gap,b=p.data,S={startX:this.state.startX,endX:this.state.endX},A=n.pageX-a;A>0?A=Math.min(A,f+y-v-d):A<0&&(A=Math.max(A,f-d)),S[o]=d+A;var O=this.getIndex(S),C=O.startIndex,E=O.endIndex,T=function(){var R=b.length-1;return o==="startX"&&(c>u?C%w===0:E%w===0)||c<u&&E===R||o==="endX"&&(c>u?E%w===0:C%w===0)||c>u&&E===R};this.setState(on(on({},o,d+A),"brushMoveStartX",n.pageX),function(){x&&T()&&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],f=c.indexOf(p);if(f!==-1){var y=f+n;if(!(y===-1||y>=c.length)){var v=c[y];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 L.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,f=j.Children.only(d);return f?L.cloneElement(f,{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,f=u.height,y=u.traveller,v=u.ariaLabel,x=u.data,w=u.startIndex,b=u.endIndex,S=Math.max(n,this.props.x),A=wb(wb({},at(this.props,!1)),{},{x:S,y:d,width:p,height:f}),O=v||"Min value: ".concat((a=x[w])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=x[b])===null||o===void 0?void 0:o.name);return L.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(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),c.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(y,A))}},{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,f=Math.max(Math.abs(i-n)-d,0);return L.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:f,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,f=p.startX,y=p.endX,v=5,x={pointerEvents:"none",fill:d};return L.createElement(Xt,{className:"recharts-brush-texts"},L.createElement(fh,Dh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,y)-v,y:o+c/2},x),this.getTextOfTick(i)),L.createElement(fh,Dh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,y)+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,f=n.alwaysShowText,y=this.state,v=y.startX,x=y.endX,w=y.isTextActive,b=y.isSlideMoving,S=y.isTravellerMoving,A=y.isTravellerFocused;if(!i||!i.length||!ge(c)||!ge(u)||!ge(d)||!ge(p)||d<=0||p<=0)return null;var O=ot("recharts-brush",a),C=L.Children.count(o)===1,E=KQ("userSelect","none");return L.createElement(Xt,{className:O,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),C&&this.renderPanorama(),this.renderSlide(v,x),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(x,"endX"),(w||b||S||A||f)&&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 L.createElement(L.Fragment,null,L.createElement("rect",{x:i,y:a,width:o,height:c,fill:u,stroke:"none"}),L.createElement("line",{x1:i+1,y1:d,x2:i+o-1,y2:d,fill:"none",stroke:"#fff"}),L.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 L.isValidElement(n)?a=L.cloneElement(n,i):Je(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,f=n.endIndex;if(a!==i.prevData||d!==i.prevUpdateId)return wb({prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:c,prevWidth:o},a&&a.length?tee({data:a,width:o,x:c,travellerWidth:u,startIndex:p,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||c!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([c,c+o-u]);var y=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:y}}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}}])})(j.PureComponent);on(il,"displayName","Brush");on(il,"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 _b,Bj;function ree(){if(Bj)return _b;Bj=1;var t=_1();function e(r,n){var i;return t(r,function(a,o,c){return i=n(a,o,c),!i}),!!i}return _b=e,_b}var Sb,Uj;function nee(){if(Uj)return Sb;Uj=1;var t=JR(),e=Wa(),r=ree(),n=Qr(),i=_p();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 Sb=a,Sb}var iee=nee();const aee=vt(iee);var ki=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},kb,qj;function oee(){if(qj)return kb;qj=1;var t=mI();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return kb=e,kb}var Eb,Fj;function see(){if(Fj)return Eb;Fj=1;var t=oee(),e=hI(),r=Wa();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 Eb=n,Eb}var lee=see();const cee=vt(lee);var Ob,Hj;function uee(){if(Hj)return Ob;Hj=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 Ob=t,Ob}var Ab,Wj;function dee(){if(Wj)return Ab;Wj=1;var t=_1();function e(r,n){var i=!0;return t(r,function(a,o,c){return i=!!n(a,o,c),i}),i}return Ab=e,Ab}var Tb,Gj;function fee(){if(Gj)return Tb;Gj=1;var t=uee(),e=dee(),r=Wa(),n=Qr(),i=_p();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 Tb=a,Tb}var hee=fee();const q$=vt(hee);var pee=["x","y"];function Eu(t){"@babel/helpers - typeof";return Eu=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},Eu(t)}function ow(){return ow=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},ow.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 Ec(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){mee(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 mee(t,e,r){return e=gee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gee(t){var e=yee(t,"string");return Eu(e)=="symbol"?e:e+""}function yee(t,e){if(Eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vee(t,e){if(t==null)return{};var r=bee(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 bee(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 xee(t,e){var r=t.x,n=t.y,i=vee(t,pee),a="".concat(r),o=parseInt(a,10),c="".concat(n),u=parseInt(c,10),d="".concat(e.height||i.height),p=parseInt(d,10),f="".concat(e.width||i.width),y=parseInt(f,10);return Ec(Ec(Ec(Ec(Ec({},e),i),o?{x:o}:{}),u?{y:u}:{}),{},{height:p,width:y,name:e.name,radius:e.radius})}function Vj(t){return L.createElement(PQ,ow({shapeType:"rectangle",propTransformer:xee,activeClassName:"recharts-active-bar"},t))}var wee=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)||A9(n);return a?e(n,i):(a||Mo(),r)}},_ee=["value","background"],F$;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 See(t,e){if(t==null)return{};var r=kee(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 kee(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 Bh(){return Bh=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},Bh.apply(this,arguments)}function Xj(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?Xj(Object(r),!0).forEach(function(n){Ia(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Eee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yj(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 Oee(t,e,r){return e&&Yj(t.prototype,e),r&&Yj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Aee(t,e,r){return e=Uh(e),Tee(t,H$()?Reflect.construct(e,r||[],Uh(t).constructor):e.apply(t,r))}function Tee(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 Cee(t)}function Cee(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 Uh(t){return Uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uh(t)}function jee(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&&sw(t,e)}function sw(t,e){return sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sw(t,e)}function Ia(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=Nee(t,"string");return al(e)=="symbol"?e:e+""}function Nee(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 ea=(function(t){function e(){var r;Eee(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=Aee(this,e,[].concat(i)),Ia(r,"state",{isAnimationFinished:!1}),Ia(r,"id",Du("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 jee(e,t),Oee(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=at(this.props,!1);return n&&n.map(function(f,y){var v=y===u,x=v?d:o,w=Jt(Jt(Jt({},p),f),{},{isActive:v,option:x,index:y,dataKey:c,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return L.createElement(Xt,Bh({className:"recharts-bar-rectangle"},eh(i.props,f,y),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(y)}),L.createElement(Vj,w))})}},{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,f=i.animationId,y=this.state.prevData;return L.createElement(Qi,{begin:u,duration:d,isActive:c,easing:p,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var x=v.t,w=a.map(function(b,S){var A=y&&y[S];if(A){var O=Vn(A.x,b.x),C=Vn(A.y,b.y),E=Vn(A.width,b.width),T=Vn(A.height,b.height);return Jt(Jt({},b),{},{x:O(x),y:C(x),width:E(x),height:T(x)})}if(o==="horizontal"){var N=Vn(0,b.height),R=N(x);return Jt(Jt({},b),{},{y:b.y+b.height-R,height:R})}var I=Vn(0,b.width),K=I(x);return Jt(Jt({},b),{},{width:K})});return L.createElement(Xt,null,n.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Np(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=at(this.props.background,!1);return a.map(function(d,p){d.value;var f=d.background,y=See(d,_ee);if(!f)return null;var v=Jt(Jt(Jt(Jt(Jt({},y),{},{fill:"#eee"},f),u),eh(n.props,d,p)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:p,className:"recharts-bar-background-rectangle"});return L.createElement(Vj,Bh({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,f=Cn(p,Hu);if(!f)return null;var y=d==="vertical"?o[0].height/2:o[0].width/2,v=function(b,S){var A=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:A,errorVal:dn(b,S)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return L.createElement(Xt,x,f.map(function(w){return L.cloneElement(w,{key:"error-bar-".concat(i,"-").concat(w.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,offset:y,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,f=n.width,y=n.height,v=n.isAnimationActive,x=n.background,w=n.id;if(i||!a||!a.length)return null;var b=this.state.isAnimationFinished,S=ot("recharts-bar",o),A=c&&c.allowDataOverflow,O=u&&u.allowDataOverflow,C=A||O,E=tt(w)?this.id:w;return L.createElement(Xt,{className:S},A||O?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(E)},L.createElement("rect",{x:A?d:d-f/2,y:O?p:p-y/2,width:A?f:f*2,height:O?y:y*2}))):null,L.createElement(Xt,{className:"recharts-bar-rectangles",clipPath:C?"url(#clipPath-".concat(E,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(C,E),(!v||b)&&Da.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}}])})(j.PureComponent);F$=ea;Ia(ea,"displayName","Bar");Ia(ea,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!El.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,f=t.displayedData,y=t.offset,v=GX(n,r);if(!v)return null;var x=e.layout,w=r.type.defaultProps,b=w!==void 0?Jt(Jt({},w),r.props):r.props,S=b.dataKey,A=b.children,O=b.minPointSize,C=x==="horizontal"?o:a,E=d?C.scale.domain():null,T=eY({numericAxis:C}),N=Cn(A,_I),R=f.map(function(I,K){var B,U,V,H,Y,G;d?B=KX(d[p+K],E):(B=dn(I,S),Array.isArray(B)||(B=[T,B]));var Q=wee(O,F$.defaultProps.minPointSize)(B[1],K);if(x==="horizontal"){var W,ee=[o.scale(B[0]),o.scale(B[1])],q=ee[0],$=ee[1];U=MC({axis:a,ticks:c,bandSize:i,offset:v.offset,entry:I,index:K}),V=(W=$??q)!==null&&W!==void 0?W:void 0,H=v.size;var M=q-$;if(Y=Number.isNaN(M)?0:M,G={x:U,y:o.y,width:H,height:o.height},Math.abs(Q)>0&&Math.abs(Y)<Math.abs(Q)){var J=Jn(Y||Q)*(Math.abs(Q)-Math.abs(Y));V-=J,Y+=J}}else{var oe=[a.scale(B[0]),a.scale(B[1])],le=oe[0],ve=oe[1];if(U=le,V=MC({axis:o,ticks:u,bandSize:i,offset:v.offset,entry:I,index:K}),H=ve-le,Y=v.size,G={x:a.x,y:V,width:a.width,height:Y},Math.abs(Q)>0&&Math.abs(H)<Math.abs(Q)){var qe=Jn(H||Q)*(Math.abs(Q)-Math.abs(H));H+=qe}}return Jt(Jt(Jt({},I),{},{x:U,y:V,width:H,height:Y,value:d?B:B[1],payload:I,background:G},N&&N[K]&&N[K].props),{},{tooltipPayload:[A$(r,I)],tooltipPosition:{x:U+H/2,y:V+Y/2}})});return Jt({data:R,layout:x},y)});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)}function Pee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jj(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,G$(n.key),n)}}function Ree(t,e,r){return e&&Jj(t.prototype,e),r&&Jj(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){Mp(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 Mp(t,e,r){return e=G$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G$(t){var e=Iee(t,"string");return Ou(e)=="symbol"?e:e+""}function Iee(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)}var K$=function(e,r,n,i,a){var o=e.width,c=e.height,u=e.layout,d=e.children,p=Object.keys(r),f={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},y=!!sn(d,ea);return p.reduce(function(v,x){var w=r[x],b=w.orientation,S=w.domain,A=w.padding,O=A===void 0?{}:A,C=w.mirror,E=w.reversed,T="".concat(b).concat(C?"Mirror":""),N,R,I,K,B;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var U=S[1]-S[0],V=1/0,H=w.categoricalDomain.sort(j9);if(H.forEach(function(oe,le){le>0&&(V=Math.min((oe||0)-(H[le-1]||0),V))}),Number.isFinite(V)){var Y=V/U,G=w.layout==="vertical"?n.height:n.width;if(w.padding==="gap"&&(N=Y*G/2),w.padding==="no-gap"){var Q=Io(e.barCategoryGap,Y*G),W=Y*G/2;N=W-Q-(W-Q)/G*Q}}}i==="xAxis"?R=[n.left+(O.left||0)+(N||0),n.left+n.width-(O.right||0)-(N||0)]:i==="yAxis"?R=u==="horizontal"?[n.top+n.height-(O.bottom||0),n.top+(O.top||0)]:[n.top+(O.top||0)+(N||0),n.top+n.height-(O.bottom||0)-(N||0)]:R=w.range,E&&(R=[R[1],R[0]]);var ee=HX(w,a,y),q=ee.scale,$=ee.realScaleType;q.domain(S).range(R),WX(q);var M=QX(q,Hn(Hn({},w),{},{realScaleType:$}));i==="xAxis"?(B=b==="top"&&!C||b==="bottom"&&C,I=n.left,K=f[T]-B*w.height):i==="yAxis"&&(B=b==="left"&&!C||b==="right"&&C,I=f[T]-B*w.width,K=n.top);var J=Hn(Hn(Hn({},w),M),{},{realScaleType:$,x:I,y:K,scale:q,width:i==="xAxis"?n.width:w.width,height:i==="yAxis"?n.height:w.height});return J.bandSize=Ah(J,M),!w.hide&&i==="xAxis"?f[T]+=(B?-1:1)*J.height:w.hide||(f[T]+=(B?-1:1)*J.width),Hn(Hn({},v),{},Mp({},x,J))},{})},V$=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)}},$ee=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return V$({x:r,y:n},{x:i,y:a})},X$=(function(){function t(e){Pee(this,t),this.scale=e}return Ree(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)}}])})();Mp(X$,"EPS",1e-4);var Z1=function(e){var r=Object.keys(e).reduce(function(n,i){return Hn(Hn({},n),{},Mp({},i,X$.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 cee(i,function(u,d){return r[d].apply(u,{bandAware:o,position:c})})},isInRange:function(i){return q$(i,function(a,o){return r[o].isInRange(a)})}})};function Mee(t){return(t%180+180)%180}var Lee=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Mee(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)},Cb,Qj;function Dee(){if(Qj)return Cb;Qj=1;var t=Wa(),e=zu(),r=xp();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(f){return d(u[f],f,u)}}var p=i(a,o,c);return p>-1?u[d?a[p]:p]:void 0}}return Cb=n,Cb}var jb,eN;function zee(){if(eN)return jb;eN=1;var t=D$();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return jb=e,jb}var Nb,tN;function Bee(){if(tN)return Nb;tN=1;var t=lI(),e=Wa(),r=zee(),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 Nb=i,Nb}var Pb,rN;function Uee(){if(rN)return Pb;rN=1;var t=Dee(),e=Bee(),r=t(e);return Pb=r,Pb}var qee=Uee();const Fee=vt(qee);var Hee=kR();const Wee=vt(Hee);var Gee=Wee(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=j.createContext(void 0),e_=j.createContext(void 0),Y$=j.createContext(void 0),J$=j.createContext({}),Z$=j.createContext(void 0),Q$=j.createContext(0),eM=j.createContext(0),nN=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=Gee(a);return L.createElement(Q1.Provider,{value:n},L.createElement(e_.Provider,{value:i},L.createElement(J$.Provider,{value:a},L.createElement(Y$.Provider,{value:p},L.createElement(Z$.Provider,{value:o},L.createElement(Q$.Provider,{value:d},L.createElement(eM.Provider,{value:u},c)))))))},Kee=function(){return j.useContext(Z$)},tM=function(e){var r=j.useContext(Q1);r==null&&Mo();var n=r[e];return n==null&&Mo(),n},Vee=function(){var e=j.useContext(Q1);return Pa(e)},Xee=function(){var e=j.useContext(e_),r=Fee(e,function(n){return q$(n.domain,Number.isFinite)});return r||Pa(e)},rM=function(e){var r=j.useContext(e_);r==null&&Mo();var n=r[e];return n==null&&Mo(),n},Yee=function(){var e=j.useContext(Y$);return e},Jee=function(){return j.useContext(J$)},t_=function(){return j.useContext(eM)},r_=function(){return j.useContext(Q$)};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 Zee(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,iM(n.key),n)}}function ete(t,e,r){return e&&Qee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function tte(t,e,r){return e=qh(e),rte(t,nM()?Reflect.construct(e,r||[],qh(t).constructor):e.apply(t,r))}function rte(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 nte(t)}function nte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nM=function(){return!!t})()}function qh(t){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qh(t)}function ite(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 iN(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?iN(Object(r),!0).forEach(function(n){n_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function n_(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=ate(t,"string");return ol(e)=="symbol"?e:e+""}function ate(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)}function ote(t,e){return ute(t)||cte(t,e)||lte(t,e)||ste()}function ste(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
503
503
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lte(t,e){if(t){if(typeof t=="string")return oN(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 oN(t,e)}}function oN(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 cte(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 ute(t){if(Array.isArray(t))return t}function cw(){return cw=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},cw.apply(this,arguments)}var dte=function(e,r){var n;return L.isValidElement(e)?n=L.cloneElement(e,r):Je(e)?n=e(r):n=L.createElement("line",cw({},r,{className:"recharts-reference-line-line"})),n},fte=function(e,r,n,i,a,o,c,u,d){var p=a.x,f=a.y,y=a.width,v=a.height;if(n){var x=d.y,w=e.y.apply(x,{position:o});if(ki(d,"discard")&&!e.y.isInRange(w))return null;var b=[{x:p+y,y:w},{x:p,y:w}];return u==="left"?b.reverse():b}if(r){var S=d.x,A=e.x.apply(S,{position:o});if(ki(d,"discard")&&!e.x.isInRange(A))return null;var O=[{x:A,y:f+v},{x:A,y:f}];return c==="top"?O.reverse():O}if(i){var C=d.segment,E=C.map(function(T){return e.apply(T,{position:o})});return ki(d,"discard")&&aee(E,function(T){return!e.isInRange(T)})?null:E}return null};function hte(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=Kee(),p=tM(i),f=rM(a),y=Yee();if(!d||!y)return null;Ki(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=Z1({x:p.scale,y:f.scale}),x=or(e),w=or(r),b=n&&n.length===2,S=fte(v,x,w,b,y,t.position,p.orientation,f.orientation,t);if(!S)return null;var A=ote(S,2),O=A[0],C=O.x,E=O.y,T=A[1],N=T.x,R=T.y,I=ki(t,"hidden")?"url(#".concat(d,")"):void 0,K=aN(aN({clipPath:I},at(t,!0)),{},{x1:C,y1:E,x2:N,y2:R});return L.createElement(Xt,{className:ot("recharts-reference-line",c)},dte(o,K),jr.renderCallByParent(t,$ee({x1:C,y1:E,x2:N,y2:R})))}var i_=(function(t){function e(){return Zee(this,e),tte(this,e,arguments)}return ite(e,t),ete(e,[{key:"render",value:function(){return L.createElement(hte,this.props)}}])})(L.Component);n_(i_,"displayName","ReferenceLine");n_(i_,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});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 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 sN(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 lN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sN(Object(r),!0).forEach(function(n){Lp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mte(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,oM(n.key),n)}}function gte(t,e,r){return e&&mte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function yte(t,e,r){return e=Fh(e),vte(t,aM()?Reflect.construct(e,r||[],Fh(t).constructor):e.apply(t,r))}function vte(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 bte(t)}function bte(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 Fh(t){return Fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fh(t)}function xte(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 Lp(t,e,r){return e=oM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oM(t){var e=wte(t,"string");return sl(e)=="symbol"?e:e+""}function wte(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)}var _te=function(e){var r=e.x,n=e.y,i=e.xAxis,a=e.yAxis,o=Z1({x:i.scale,y:a.scale}),c=o.apply({x:r,y:n},{bandAware:!0});return ki(e,"discard")&&!o.isInRange(c)?null:c},Dp=(function(t){function e(){return pte(this,e),yte(this,e,arguments)}return xte(e,t),gte(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 f=_te(this.props);if(!f)return null;var y=f.x,v=f.y,x=this.props,w=x.shape,b=x.className,S=ki(this.props,"hidden")?"url(#".concat(u,")"):void 0,A=lN(lN({clipPath:S},at(this.props,!0)),{},{cx:y,cy:v});return L.createElement(Xt,{className:ot("recharts-reference-dot",b)},e.renderDot(w,A),jr.renderCallByParent(this.props,{x:y-o,y:v-o,width:2*o,height:2*o}))}}])})(L.Component);Lp(Dp,"displayName","ReferenceDot");Lp(Dp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Lp(Dp,"renderDot",function(t,e){var r;return L.isValidElement(t)?r=L.cloneElement(t,e):Je(t)?r=t(e):r=L.createElement(J1,uw({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});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)}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 cN(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?cN(Object(r),!0).forEach(function(n){zp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ste(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kte(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 Ete(t,e,r){return e&&kte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ote(t,e,r){return e=Hh(e),Ate(t,sM()?Reflect.construct(e,r||[],Hh(t).constructor):e.apply(t,r))}function Ate(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 Tte(t)}function Tte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sM=function(){return!!t})()}function Hh(t){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hh(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&&hw(t,e)}function hw(t,e){return hw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hw(t,e)}function zp(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=jte(t,"string");return ll(e)=="symbol"?e:e+""}function jte(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)}var Nte=function(e,r,n,i,a){var o=a.x1,c=a.x2,u=a.y1,d=a.y2,p=a.xAxis,f=a.yAxis;if(!p||!f)return null;var y=Z1({x:p.scale,y:f.scale}),v={x:e?y.x.apply(o,{position:"start"}):y.x.rangeMin,y:n?y.y.apply(u,{position:"start"}):y.y.rangeMin},x={x:r?y.x.apply(c,{position:"end"}):y.x.rangeMax,y:i?y.y.apply(d,{position:"end"}):y.y.rangeMax};return ki(a,"discard")&&(!y.isInRange(v)||!y.isInRange(x))?null:V$(v,x)},Bp=(function(t){function e(){return Ste(this,e),Ote(this,e,arguments)}return Cte(e,t),Ete(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 f=or(i),y=or(a),v=or(o),x=or(c),w=this.props.shape;if(!f&&!y&&!v&&!x&&!w)return null;var b=Nte(f,y,v,x,this.props);if(!b&&!w)return null;var S=ki(this.props,"hidden")?"url(#".concat(p,")"):void 0;return L.createElement(Xt,{className:ot("recharts-reference-area",u)},e.renderRect(w,uN(uN({clipPath:S},at(this.props,!0)),b)),jr.renderCallByParent(this.props,b))}}])})(L.Component);zp(Bp,"displayName","ReferenceArea");zp(Bp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});zp(Bp,"renderRect",function(t,e){var r;return L.isValidElement(t)?r=L.cloneElement(t,e):Je(t)?r=t(e):r=L.createElement(Y1,fw({},e,{className:"recharts-reference-area-rect"})),r});function cM(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 Pte(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Lee(n,r)}function Rte(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 Wh(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 Ite(t,e){return cM(t,e+1)}function $te(t,e,r,n,i){for(var a=(n||[]).slice(),o=e.start,c=e.end,u=0,d=1,p=o,f=function(){var x=n==null?void 0:n[u];if(x===void 0)return{v:cM(n,d)};var w=u,b,S=function(){return b===void 0&&(b=r(x,w)),b},A=x.coordinate,O=u===0||Wh(t,A,S,p,c);O||(u=0,p=o,d+=1),O&&(p=A+t*(S()/2+i),u+=d)},y;d<=a.length;)if(y=f(),y)return y.v;return[]}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 dN(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?dN(Object(r),!0).forEach(function(n){Mte(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Mte(t,e,r){return e=Lte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lte(t){var e=Dte(t,"string");return Au(e)=="symbol"?e:e+""}function Dte(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)}function zte(t,e,r,n,i){for(var a=(n||[]).slice(),o=a.length,c=e.start,u=e.end,d=function(y){var v=a[y],x,w=function(){return x===void 0&&(x=r(v,y)),x};if(y===o-1){var b=t*(v.coordinate+t*w()/2-u);a[y]=v=Cr(Cr({},v),{},{tickCoord:b>0?v.coordinate-b*t:v.coordinate})}else a[y]=v=Cr(Cr({},v),{},{tickCoord:v.coordinate});var S=Wh(t,v.tickCoord,w,c,u);S&&(u=v.tickCoord-t*(w()/2+i),a[y]=Cr(Cr({},v),{},{isShow:!0}))},p=o-1;p>=0;p--)d(p);return a}function Bte(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],f=r(p,c-1),y=t*(p.coordinate+t*f/2-d);o[c-1]=p=Cr(Cr({},p),{},{tickCoord:y>0?p.coordinate-y*t:p.coordinate});var v=Wh(t,p.tickCoord,function(){return f},u,d);v&&(d=p.tickCoord-t*(f/2+i),o[c-1]=Cr(Cr({},p),{},{isShow:!0}))}for(var x=a?c-1:c,w=function(A){var O=o[A],C,E=function(){return C===void 0&&(C=r(O,A)),C};if(A===0){var T=t*(O.coordinate-t*E()/2-u);o[A]=O=Cr(Cr({},O),{},{tickCoord:T<0?O.coordinate-T*t:O.coordinate})}else o[A]=O=Cr(Cr({},O),{},{tickCoord:O.coordinate});var N=Wh(t,O.tickCoord,E,u,d);N&&(u=O.tickCoord+t*(E()/2+i),o[A]=Cr(Cr({},O),{},{isShow:!0}))},b=0;b<x;b++)w(b);return o}function a_(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,f=t.angle;if(!i||!i.length||!n)return[];if(ge(u)||El.isSsr)return Ite(i,typeof u=="number"&&ge(u)?u:0);var y=[],v=c==="top"||c==="bottom"?"width":"height",x=p&&v==="width"?Mc(p,{fontSize:e,letterSpacing:r}):{width:0,height:0},w=function(O,C){var E=Je(d)?d(O.value,C):O.value;return v==="width"?Pte(Mc(E,{fontSize:e,letterSpacing:r}),x,f):Mc(E,{fontSize:e,letterSpacing:r})[v]},b=i.length>=2?Jn(i[1].coordinate-i[0].coordinate):1,S=Rte(a,b,v);return u==="equidistantPreserveStart"?$te(b,S,w,i,o):(u==="preserveStart"||u==="preserveStartEnd"?y=Bte(b,S,w,i,o,u==="preserveStartEnd"):y=zte(b,S,w,i,o),y.filter(function(A){return A.isShow}))}var Ute=["viewBox"],qte=["viewBox"],Fte=["ticks"];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 $s(){return $s=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},$s.apply(this,arguments)}function fN(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?fN(Object(r),!0).forEach(function(n){o_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Rb(t,e){if(t==null)return{};var r=Hte(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 Hte(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 Wte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hN(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,dM(n.key),n)}}function Gte(t,e,r){return e&&hN(t.prototype,e),r&&hN(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Kte(t,e,r){return e=Gh(e),Vte(t,uM()?Reflect.construct(e,r||[],Gh(t).constructor):e.apply(t,r))}function Vte(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 Xte(t)}function Xte(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 Gh(t){return Gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gh(t)}function Yte(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&&pw(t,e)}function pw(t,e){return pw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pw(t,e)}function o_(t,e,r){return e=dM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dM(t){var e=Jte(t,"string");return cl(e)=="symbol"?e:e+""}function Jte(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 String(t)}var Cl=(function(t){function e(r){var n;return Wte(this,e),n=Kte(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return Yte(e,t),Gte(e,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=Rb(n,Ute),c=this.props,u=c.viewBox,d=Rb(c,qte);return!Bs(a,u)||!Bs(o,d)||!Bs(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,f=i.mirror,y=i.tickMargin,v,x,w,b,S,A,O=f?-1:1,C=n.tickSize||p,E=ge(n.tickCoord)?n.tickCoord:n.coordinate;switch(d){case"top":v=x=n.coordinate,b=o+ +!f*u,w=b-O*C,A=w-O*y,S=E;break;case"left":w=b=n.coordinate,x=a+ +!f*c,v=x-O*C,S=v-O*y,A=E;break;case"right":w=b=n.coordinate,x=a+ +f*c,v=x+O*C,S=v+O*y,A=E;break;default:v=x=n.coordinate,b=o+ +f*u,w=b+O*C,A=w+O*y,S=E;break}return{line:{x1:v,y1:w,x2:x,y2:b},tick:{x:S,y:A}}}},{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,f=ir(ir(ir({},at(this.props,!1)),at(p,!1)),{},{fill:"none"});if(u==="top"||u==="bottom"){var y=+(u==="top"&&!d||u==="bottom"&&d);f=ir(ir({},f),{},{x1:i,y1:a+y*c,x2:i+o,y2:a+y*c})}else{var v=+(u==="left"&&!d||u==="right"&&d);f=ir(ir({},f),{},{x1:i+v*o,y1:a,x2:i+v*o,y2:a+c})}return L.createElement("line",$s({},f,{className:ot("recharts-cartesian-axis-line",Tn(p,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,c=this.props,u=c.tickLine,d=c.stroke,p=c.tick,f=c.tickFormatter,y=c.unit,v=a_(ir(ir({},this.props),{},{ticks:n}),i,a),x=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),b=at(this.props,!1),S=at(p,!1),A=ir(ir({},b),{},{fill:"none"},at(u,!1)),O=v.map(function(C,E){var T=o.getTickLineCoord(C),N=T.line,R=T.tick,I=ir(ir(ir(ir({textAnchor:x,verticalAnchor:w},b),{},{stroke:"none",fill:d},S),R),{},{index:E,payload:C,visibleTicksCount:v.length,tickFormatter:f});return L.createElement(Xt,$s({className:"recharts-cartesian-axis-tick",key:"tick-".concat(C.value,"-").concat(C.coordinate,"-").concat(C.tickCoord)},eh(o.props,C,E)),u&&L.createElement("line",$s({},A,N,{className:ot("recharts-cartesian-axis-tick-line",Tn(u,"className"))})),p&&e.renderTickItem(p,I,"".concat(Je(f)?f(C.value,E):C.value).concat(y||"")))});return L.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 f=this.props,y=f.ticks,v=Rb(f,Fte),x=y;return Je(u)&&(x=y&&y.length>0?u(this.props):u(v)),o<=0||c<=0||!x||!x.length?null:L.createElement(Xt,{className:ot("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=ot(i.className,"recharts-cartesian-axis-tick-value");return L.isValidElement(n)?o=L.cloneElement(n,ir(ir({},i),{},{className:c})):Je(n)?o=n(ir(ir({},i),{},{className:c})):o=L.createElement(fh,$s({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(j.Component);o_(Cl,"displayName","CartesianAxis");o_(Cl,"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 Zte=["x1","y1","x2","y2","key"],Qte=["offset"];function Lo(t){"@babel/helpers - typeof";return Lo=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},Lo(t)}function pN(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 Nr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pN(Object(r),!0).forEach(function(n){ere(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ere(t,e,r){return e=tre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tre(t){var e=rre(t,"string");return Lo(e)=="symbol"?e:e+""}function rre(t,e){if(Lo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Lo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function To(){return To=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},To.apply(this,arguments)}function mN(t,e){if(t==null)return{};var r=nre(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 nre(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 ire=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 L.createElement("rect",{x:i,y:a,ry:u,width:o,height:c,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function fM(t,e){var r;if(L.isValidElement(t))r=L.cloneElement(t,e);else if(Je(t))r=t(e);else{var n=e.x1,i=e.y1,a=e.x2,o=e.y2,c=e.key,u=mN(e,Zte),d=at(u,!1);d.offset;var p=mN(d,Qte);r=L.createElement("line",To({},p,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:c}))}return r}function are(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=Nr(Nr({},t),{},{x1:e,y1:c,x2:e+r,y2:c,key:"line-".concat(u),index:u});return fM(i,d)});return L.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function ore(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=Nr(Nr({},t),{},{x1:c,y1:e,x2:c,y2:e+r,key:"line-".concat(u),index:u});return fM(i,d)});return L.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function sre(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(y){return Math.round(y+i-i)}).sort(function(y,v){return y-v});i!==p[0]&&p.unshift(0);var f=p.map(function(y,v){var x=!p[v+1],w=x?i+o-y:p[v+1]-y;if(w<=0)return null;var b=v%e.length;return L.createElement("rect",{key:"react-".concat(v),y,x:n,height:w,width:a,stroke:"none",fill:e[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function lre(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(y){return Math.round(y+a-a)}).sort(function(y,v){return y-v});a!==p[0]&&p.unshift(0);var f=p.map(function(y,v){var x=!p[v+1],w=x?a+c-y:p[v+1]-y;if(w<=0)return null;var b=v%n.length;return L.createElement("rect",{key:"react-".concat(v),x:y,y:o,width:w,height:u,stroke:"none",fill:n[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var cre=function(e,r){var n=e.xAxis,i=e.width,a=e.height,o=e.offset;return E$(a_(Nr(Nr(Nr({},Cl.defaultProps),n),{},{ticks:Wi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},ure=function(e,r){var n=e.yAxis,i=e.width,a=e.height,o=e.offset;return E$(a_(Nr(Nr(Nr({},Cl.defaultProps),n),{},{ticks:Wi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Os={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Tu(t){var e,r,n,i,a,o,c=t_(),u=r_(),d=Jee(),p=Nr(Nr({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Os.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:Os.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:Os.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:Os.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:Os.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:Os.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}),f=p.x,y=p.y,v=p.width,x=p.height,w=p.syncWithTicks,b=p.horizontalValues,S=p.verticalValues,A=Vee(),O=Xee();if(!ge(v)||v<=0||!ge(x)||x<=0||!ge(f)||f!==+f||!ge(y)||y!==+y)return null;var C=p.verticalCoordinatesGenerator||cre,E=p.horizontalCoordinatesGenerator||ure,T=p.horizontalPoints,N=p.verticalPoints;if((!T||!T.length)&&Je(E)){var R=b&&b.length,I=E({yAxis:O?Nr(Nr({},O),{},{ticks:R?b:O.ticks}):void 0,width:c,height:u,offset:d},R?!0:w);Ki(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Lo(I),"]")),Array.isArray(I)&&(T=I)}if((!N||!N.length)&&Je(C)){var K=S&&S.length,B=C({xAxis:A?Nr(Nr({},A),{},{ticks:K?S:A.ticks}):void 0,width:c,height:u,offset:d},K?!0:w);Ki(Array.isArray(B),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Lo(B),"]")),Array.isArray(B)&&(N=B)}return L.createElement("g",{className:"recharts-cartesian-grid"},L.createElement(ire,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),L.createElement(are,To({},p,{offset:d,horizontalPoints:T,xAxis:A,yAxis:O})),L.createElement(ore,To({},p,{offset:d,verticalPoints:N,xAxis:A,yAxis:O})),L.createElement(sre,To({},p,{horizontalPoints:T})),L.createElement(lre,To({},p,{verticalPoints:N})))}Tu.displayName="CartesianGrid";var dre=["type","layout","connectNulls","ref"],fre=["key"];function ul(t){"@babel/helpers - typeof";return ul=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},ul(t)}function gN(t,e){if(t==null)return{};var r=hre(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 hre(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 Bc(){return Bc=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},Bc.apply(this,arguments)}function yN(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?yN(Object(r),!0).forEach(function(n){Wn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function As(t){return yre(t)||gre(t)||mre(t)||pre()}function pre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
504
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mre(t,e){if(t){if(typeof t=="string")return mw(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 mw(t,e)}}function gre(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function yre(t){if(Array.isArray(t))return mw(t)}function mw(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 vre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vN(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,pM(n.key),n)}}function bre(t,e,r){return e&&vN(t.prototype,e),r&&vN(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xre(t,e,r){return e=Kh(e),wre(t,hM()?Reflect.construct(e,r||[],Kh(t).constructor):e.apply(t,r))}function wre(t,e){if(e&&(ul(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _re(t)}function _re(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hM=function(){return!!t})()}function Kh(t){return Kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kh(t)}function Sre(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&&gw(t,e)}function gw(t,e){return gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gw(t,e)}function Wn(t,e,r){return e=pM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pM(t){var e=kre(t,"string");return ul(e)=="symbol"?e:e+""}function kre(t,e){if(ul(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ul(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Wu=(function(t){function e(){var r;vre(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=xre(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(S,A){return S+A});if(!d)return r.generateSimpleStrokeDasharray(c,o);for(var p=Math.floor(o/d),f=o%d,y=c-o,v=[],x=0,w=0;x<u.length;w+=u[x],++x)if(w+u[x]>f){v=[].concat(As(u.slice(0,x)),[f-w]);break}var b=v.length%2===0?[0,y]:[y];return[].concat(As(e.repeat(u,p)),As(v),b).map(function(S){return"".concat(S,"px")}).join(", ")}),Wn(r,"id",Du("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 Sre(e,t),bre(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,f=Cn(p,Hu);if(!f)return null;var y=function(w,b){return{x:w.x,y:w.y,value:w.value,errorVal:dn(w.payload,b)}},v={clipPath:n?"url(#clipPath-".concat(i,")"):null};return L.createElement(Xt,v,f.map(function(x){return L.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,dataPointFormatter:y})}))}},{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,f=at(this.props,!1),y=at(u,!0),v=d.map(function(w,b){var S=an(an(an({key:"dot-".concat(b),r:3},f),y),{},{index:b,cx:w.x,cy:w.y,value:w.value,dataKey:p,payload:w.payload,points:d});return e.renderDotItem(u,S)}),x={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return L.createElement(Xt,Bc({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 f=gN(c,dre),y=an(an(an({},at(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:u,layout:d,connectNulls:p});return L.createElement(Kx,Bc({},y,{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,f=o.animationDuration,y=o.animationEasing,v=o.animationId,x=o.animateNewValues,w=o.width,b=o.height,S=this.state,A=S.prevPoints,O=S.totalLength;return L.createElement(Qi,{begin:p,duration:f,isActive:d,easing:y,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(C){var E=C.t;if(A){var T=A.length/c.length,N=c.map(function(U,V){var H=Math.floor(V*T);if(A[H]){var Y=A[H],G=Vn(Y.x,U.x),Q=Vn(Y.y,U.y);return an(an({},U),{},{x:G(E),y:Q(E)})}if(x){var W=Vn(w*2,U.x),ee=Vn(b/2,U.y);return an(an({},U),{},{x:W(E),y:ee(E)})}return an(an({},U),{},{x:U.x,y:U.y})});return a.renderCurveStatically(N,n,i)}var R=Vn(0,O),I=R(E),K;if(u){var B="".concat(u).split(/[,\s]+/gim).map(function(U){return parseFloat(U)});K=a.getStrokeDasharray(I,O,B)}else K=a.generateSimpleStrokeDasharray(O,I);return a.renderCurveStatically(c,n,i,{strokeDasharray:K})})}},{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||!Np(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,f=i.top,y=i.left,v=i.width,x=i.height,w=i.isAnimationActive,b=i.id;if(a||!c||!c.length)return null;var S=this.state.isAnimationFinished,A=c.length===1,O=ot("recharts-line",u),C=d&&d.allowDataOverflow,E=p&&p.allowDataOverflow,T=C||E,N=et(b)?this.id:b,R=(n=at(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,K=I===void 0?3:I,B=R.strokeWidth,U=B===void 0?2:B,V=z9(o)?o:{},H=V.clipDot,Y=H===void 0?!0:H,G=K*2+U;return L.createElement(Xt,{className:O},C||E?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(N)},L.createElement("rect",{x:C?y:y-v/2,y:E?f:f-x/2,width:C?v:v*2,height:E?x:x*2})),!Y&&L.createElement("clipPath",{id:"clipPath-dots-".concat(N)},L.createElement("rect",{x:y-G/2,y:f-G/2,width:v+G,height:x+G}))):null,!A&&this.renderCurve(T,N),this.renderErrorBar(T,N),(A||o)&&this.renderDots(T,Y,N),(!w||S)&&Da.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(As(n),[0]):n,o=[],c=0;c<i;++c)o=[].concat(As(o),As(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(L.isValidElement(n))a=L.cloneElement(n,i);else if(Je(n))a=n(i);else{var o=i.key,c=gN(i,fre),u=ot("recharts-line-dot",typeof n!="boolean"?n.className:"");a=L.createElement(J1,Bc({key:o},c,{className:u}))}return a}}])})(j.PureComponent);Wn(Wu,"displayName","Line");Wn(Wu,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!El.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Wn(Wu,"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,f=u.map(function(y,v){var x=dn(y,o);return p==="horizontal"?{x:$C({axis:r,ticks:i,bandSize:c,entry:y,index:v}),y:et(x)?null:n.scale(x),value:x,payload:y}:{x:et(x)?null:r.scale(x),y:$C({axis:n,ticks:a,bandSize:c,entry:y,index:v}),value:x,payload:y}});return an({points:f,layout:p},d)});function dl(t){"@babel/helpers - typeof";return dl=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},dl(t)}function Ere(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ore(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,yM(n.key),n)}}function Are(t,e,r){return e&&Ore(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tre(t,e,r){return e=Vh(e),Cre(t,mM()?Reflect.construct(e,r||[],Vh(t).constructor):e.apply(t,r))}function Cre(t,e){if(e&&(dl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jre(t)}function jre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mM=function(){return!!t})()}function Vh(t){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vh(t)}function Nre(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&&yw(t,e)}function yw(t,e){return yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yw(t,e)}function gM(t,e,r){return e=yM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yM(t){var e=Pre(t,"string");return dl(e)=="symbol"?e:e+""}function Pre(t,e){if(dl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(dl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function vw(){return vw=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},vw.apply(this,arguments)}function Rre(t){var e=t.xAxisId,r=t_(),n=r_(),i=tM(e);return i==null?null:j.createElement(Cl,vw({},i,{className:ot("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Wi(o,!0)}}))}var Ba=(function(t){function e(){return Ere(this,e),Tre(this,e,arguments)}return Nre(e,t),Are(e,[{key:"render",value:function(){return j.createElement(Rre,this.props)}}])})(j.Component);gM(Ba,"displayName","XAxis");gM(Ba,"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 fl(t){"@babel/helpers - typeof";return fl=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},fl(t)}function Ire(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $re(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,xM(n.key),n)}}function Mre(t,e,r){return e&&$re(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lre(t,e,r){return e=Xh(e),Dre(t,vM()?Reflect.construct(e,r||[],Xh(t).constructor):e.apply(t,r))}function Dre(t,e){if(e&&(fl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zre(t)}function zre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vM=function(){return!!t})()}function Xh(t){return Xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xh(t)}function Bre(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&&bw(t,e)}function bw(t,e){return bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},bw(t,e)}function bM(t,e,r){return e=xM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xM(t){var e=Ure(t,"string");return fl(e)=="symbol"?e:e+""}function Ure(t,e){if(fl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function xw(){return xw=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},xw.apply(this,arguments)}var qre=function(e){var r=e.yAxisId,n=t_(),i=r_(),a=rM(r);return a==null?null:j.createElement(Cl,xw({},a,{className:ot("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(c){return Wi(c,!0)}}))},Ua=(function(t){function e(){return Ire(this,e),Lre(this,e,arguments)}return Bre(e,t),Mre(e,[{key:"render",value:function(){return j.createElement(qre,this.props)}}])})(j.Component);bM(Ua,"displayName","YAxis");bM(Ua,"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 bN(t){return Gre(t)||Wre(t)||Hre(t)||Fre()}function Fre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
504
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mre(t,e){if(t){if(typeof t=="string")return mw(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 mw(t,e)}}function gre(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function yre(t){if(Array.isArray(t))return mw(t)}function mw(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 vre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vN(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,pM(n.key),n)}}function bre(t,e,r){return e&&vN(t.prototype,e),r&&vN(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xre(t,e,r){return e=Kh(e),wre(t,hM()?Reflect.construct(e,r||[],Kh(t).constructor):e.apply(t,r))}function wre(t,e){if(e&&(ul(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _re(t)}function _re(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hM=function(){return!!t})()}function Kh(t){return Kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kh(t)}function Sre(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&&gw(t,e)}function gw(t,e){return gw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gw(t,e)}function Wn(t,e,r){return e=pM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pM(t){var e=kre(t,"string");return ul(e)=="symbol"?e:e+""}function kre(t,e){if(ul(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ul(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Wu=(function(t){function e(){var r;vre(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=xre(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(S,A){return S+A});if(!d)return r.generateSimpleStrokeDasharray(c,o);for(var p=Math.floor(o/d),f=o%d,y=c-o,v=[],x=0,w=0;x<u.length;w+=u[x],++x)if(w+u[x]>f){v=[].concat(As(u.slice(0,x)),[f-w]);break}var b=v.length%2===0?[0,y]:[y];return[].concat(As(e.repeat(u,p)),As(v),b).map(function(S){return"".concat(S,"px")}).join(", ")}),Wn(r,"id",Du("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 Sre(e,t),bre(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,f=Cn(p,Hu);if(!f)return null;var y=function(w,b){return{x:w.x,y:w.y,value:w.value,errorVal:dn(w.payload,b)}},v={clipPath:n?"url(#clipPath-".concat(i,")"):null};return L.createElement(Xt,v,f.map(function(x){return L.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,dataPointFormatter:y})}))}},{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,f=at(this.props,!1),y=at(u,!0),v=d.map(function(w,b){var S=an(an(an({key:"dot-".concat(b),r:3},f),y),{},{index:b,cx:w.x,cy:w.y,value:w.value,dataKey:p,payload:w.payload,points:d});return e.renderDotItem(u,S)}),x={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return L.createElement(Xt,Bc({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 f=gN(c,dre),y=an(an(an({},at(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:u,layout:d,connectNulls:p});return L.createElement(Kx,Bc({},y,{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,f=o.animationDuration,y=o.animationEasing,v=o.animationId,x=o.animateNewValues,w=o.width,b=o.height,S=this.state,A=S.prevPoints,O=S.totalLength;return L.createElement(Qi,{begin:p,duration:f,isActive:d,easing:y,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(C){var E=C.t;if(A){var T=A.length/c.length,N=c.map(function(U,V){var H=Math.floor(V*T);if(A[H]){var Y=A[H],G=Vn(Y.x,U.x),Q=Vn(Y.y,U.y);return an(an({},U),{},{x:G(E),y:Q(E)})}if(x){var W=Vn(w*2,U.x),ee=Vn(b/2,U.y);return an(an({},U),{},{x:W(E),y:ee(E)})}return an(an({},U),{},{x:U.x,y:U.y})});return a.renderCurveStatically(N,n,i)}var R=Vn(0,O),I=R(E),K;if(u){var B="".concat(u).split(/[,\s]+/gim).map(function(U){return parseFloat(U)});K=a.getStrokeDasharray(I,O,B)}else K=a.generateSimpleStrokeDasharray(O,I);return a.renderCurveStatically(c,n,i,{strokeDasharray:K})})}},{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||!Np(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,f=i.top,y=i.left,v=i.width,x=i.height,w=i.isAnimationActive,b=i.id;if(a||!c||!c.length)return null;var S=this.state.isAnimationFinished,A=c.length===1,O=ot("recharts-line",u),C=d&&d.allowDataOverflow,E=p&&p.allowDataOverflow,T=C||E,N=tt(b)?this.id:b,R=(n=at(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,K=I===void 0?3:I,B=R.strokeWidth,U=B===void 0?2:B,V=z9(o)?o:{},H=V.clipDot,Y=H===void 0?!0:H,G=K*2+U;return L.createElement(Xt,{className:O},C||E?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(N)},L.createElement("rect",{x:C?y:y-v/2,y:E?f:f-x/2,width:C?v:v*2,height:E?x:x*2})),!Y&&L.createElement("clipPath",{id:"clipPath-dots-".concat(N)},L.createElement("rect",{x:y-G/2,y:f-G/2,width:v+G,height:x+G}))):null,!A&&this.renderCurve(T,N),this.renderErrorBar(T,N),(A||o)&&this.renderDots(T,Y,N),(!w||S)&&Da.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(As(n),[0]):n,o=[],c=0;c<i;++c)o=[].concat(As(o),As(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(L.isValidElement(n))a=L.cloneElement(n,i);else if(Je(n))a=n(i);else{var o=i.key,c=gN(i,fre),u=ot("recharts-line-dot",typeof n!="boolean"?n.className:"");a=L.createElement(J1,Bc({key:o},c,{className:u}))}return a}}])})(j.PureComponent);Wn(Wu,"displayName","Line");Wn(Wu,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!El.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Wn(Wu,"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,f=u.map(function(y,v){var x=dn(y,o);return p==="horizontal"?{x:$C({axis:r,ticks:i,bandSize:c,entry:y,index:v}),y:tt(x)?null:n.scale(x),value:x,payload:y}:{x:tt(x)?null:r.scale(x),y:$C({axis:n,ticks:a,bandSize:c,entry:y,index:v}),value:x,payload:y}});return an({points:f,layout:p},d)});function dl(t){"@babel/helpers - typeof";return dl=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},dl(t)}function Ere(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ore(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,yM(n.key),n)}}function Are(t,e,r){return e&&Ore(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Tre(t,e,r){return e=Vh(e),Cre(t,mM()?Reflect.construct(e,r||[],Vh(t).constructor):e.apply(t,r))}function Cre(t,e){if(e&&(dl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jre(t)}function jre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mM=function(){return!!t})()}function Vh(t){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vh(t)}function Nre(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&&yw(t,e)}function yw(t,e){return yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yw(t,e)}function gM(t,e,r){return e=yM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yM(t){var e=Pre(t,"string");return dl(e)=="symbol"?e:e+""}function Pre(t,e){if(dl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(dl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function vw(){return vw=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},vw.apply(this,arguments)}function Rre(t){var e=t.xAxisId,r=t_(),n=r_(),i=tM(e);return i==null?null:j.createElement(Cl,vw({},i,{className:ot("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Wi(o,!0)}}))}var Ba=(function(t){function e(){return Ere(this,e),Tre(this,e,arguments)}return Nre(e,t),Are(e,[{key:"render",value:function(){return j.createElement(Rre,this.props)}}])})(j.Component);gM(Ba,"displayName","XAxis");gM(Ba,"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 fl(t){"@babel/helpers - typeof";return fl=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},fl(t)}function Ire(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $re(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,xM(n.key),n)}}function Mre(t,e,r){return e&&$re(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lre(t,e,r){return e=Xh(e),Dre(t,vM()?Reflect.construct(e,r||[],Xh(t).constructor):e.apply(t,r))}function Dre(t,e){if(e&&(fl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zre(t)}function zre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vM=function(){return!!t})()}function Xh(t){return Xh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xh(t)}function Bre(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&&bw(t,e)}function bw(t,e){return bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},bw(t,e)}function bM(t,e,r){return e=xM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xM(t){var e=Ure(t,"string");return fl(e)=="symbol"?e:e+""}function Ure(t,e){if(fl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function xw(){return xw=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},xw.apply(this,arguments)}var qre=function(e){var r=e.yAxisId,n=t_(),i=r_(),a=rM(r);return a==null?null:j.createElement(Cl,xw({},a,{className:ot("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(c){return Wi(c,!0)}}))},Ua=(function(t){function e(){return Ire(this,e),Lre(this,e,arguments)}return Bre(e,t),Mre(e,[{key:"render",value:function(){return j.createElement(qre,this.props)}}])})(j.Component);bM(Ua,"displayName","YAxis");bM(Ua,"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 bN(t){return Gre(t)||Wre(t)||Hre(t)||Fre()}function Fre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
505
505
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hre(t,e){if(t){if(typeof t=="string")return ww(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 ww(t,e)}}function Wre(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Gre(t){if(Array.isArray(t))return ww(t)}function ww(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 _w=function(e,r,n,i,a){var o=Cn(e,i_),c=Cn(e,Dp),u=[].concat(bN(o),bN(c)),d=Cn(e,Bp),p="".concat(i,"Id"),f=i[0],y=r;if(u.length&&(y=u.reduce(function(w,b){if(b.props[p]===n&&ki(b.props,"extendDomain")&&ge(b.props[f])){var S=b.props[f];return[Math.min(w[0],S),Math.max(w[1],S)]}return w},y)),d.length){var v="".concat(f,"1"),x="".concat(f,"2");y=d.reduce(function(w,b){if(b.props[p]===n&&ki(b.props,"extendDomain")&&ge(b.props[v])&&ge(b.props[x])){var S=b.props[v],A=b.props[x];return[Math.min(w[0],S,A),Math.max(w[1],S,A)]}return w},y)}return a&&a.length&&(y=a.reduce(function(w,b){return ge(b)?[Math.min(w[0],b),Math.max(w[1],b)]:w},y)),y},Ib={exports:{}},xN;function Kre(){return xN||(xN=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,f,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,f||u,y),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,f;if(this._eventsCount===0)return d;for(f in p=this._events)e.call(p,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},c.prototype.listeners=function(d){var p=r?r+d:d,f=this._events[p];if(!f)return[];if(f.fn)return[f.fn];for(var y=0,v=f.length,x=new Array(v);y<v;y++)x[y]=f[y].fn;return x},c.prototype.listenerCount=function(d){var p=r?r+d:d,f=this._events[p];return f?f.fn?1:f.length:0},c.prototype.emit=function(d,p,f,y,v,x){var w=r?r+d:d;if(!this._events[w])return!1;var b=this._events[w],S=arguments.length,A,O;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),S){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,f),!0;case 4:return b.fn.call(b.context,p,f,y),!0;case 5:return b.fn.call(b.context,p,f,y,v),!0;case 6:return b.fn.call(b.context,p,f,y,v,x),!0}for(O=1,A=new Array(S-1);O<S;O++)A[O-1]=arguments[O];b.fn.apply(b.context,A)}else{var C=b.length,E;for(O=0;O<C;O++)switch(b[O].once&&this.removeListener(d,b[O].fn,void 0,!0),S){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,f);break;case 4:b[O].fn.call(b[O].context,p,f,y);break;default:if(!A)for(E=1,A=new Array(S-1);E<S;E++)A[E-1]=arguments[E];b[O].fn.apply(b[O].context,A)}}return!0},c.prototype.on=function(d,p,f){return a(this,d,p,f,!1)},c.prototype.once=function(d,p,f){return a(this,d,p,f,!0)},c.prototype.removeListener=function(d,p,f,y){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&&(!y||x.once)&&(!f||x.context===f)&&o(this,v);else{for(var w=0,b=[],S=x.length;w<S;w++)(x[w].fn!==p||y&&!x[w].once||f&&x[w].context!==f)&&b.push(x[w]);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})(Ib)),Ib.exports}var Vre=Kre();const Xre=vt(Vre);var $b=new Xre,Mb="recharts.syncMouseEvents";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 Yre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jre(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,wM(n.key),n)}}function Zre(t,e,r){return e&&Jre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lb(t,e,r){return e=wM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wM(t){var e=Qre(t,"string");return Cu(e)=="symbol"?e:e+""}function Qre(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 String(t)}var ene=(function(){function t(){Yre(this,t),Lb(this,"activeIndex",0),Lb(this,"coordinateList",[]),Lb(this,"layout","horizontal")}return Zre(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,f=p===void 0?null:p,y=r.mouseHandlerCallback,v=y===void 0?null:y;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=c??this.container,this.layout=d??this.layout,this.offset=f??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,f=a+u+d,y=o+this.offset.top+c/2+p;this.mouseHandlerCallback({pageX:f,pageY:y})}}}])})();function tne(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 rne(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 _M(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 nne(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,f=e.angle,y=_r(c,u,d,f),v=_r(c,u,p,f);n=y.x,i=y.y,a=v.x,o=v.y}else return _M(e);return[{x:n,y:i},{x:a,y:o}]}function ju(t){"@babel/helpers - typeof";return ju=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},ju(t)}function wN(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 Af(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wN(Object(r),!0).forEach(function(n){ine(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ine(t,e,r){return e=ane(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ane(t){var e=one(t,"string");return ju(e)=="symbol"?e:e+""}function one(t,e){if(ju(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ju(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sne(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,f=t.layout,y=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||y!=="ScatterChart"&&i!=="axis")return null;var x,w=Kx;if(y==="ScatterChart")x=o,w=aQ;else if(y==="BarChart")x=rne(f,o,u,p),w=Y1;else if(f==="radial"){var b=_M(o),S=b.cx,A=b.cy,O=b.radius,C=b.startAngle,E=b.endAngle;x={cx:S,cy:A,startAngle:C,endAngle:E,innerRadius:O,outerRadius:O},w=j$}else x={points:nne(f,o,u)},w=Kx;var T=Af(Af(Af(Af({stroke:"#ccc",pointerEvents:"none"},u),x),at(v,!1)),{},{payload:c,payloadIndex:d,className:ot("recharts-tooltip-cursor",v.className)});return j.isValidElement(v)?j.cloneElement(v,T):j.createElement(w,T)}var lne=["item"],cne=["children","className","width","height","style","compact","title","desc"];function hl(t){"@babel/helpers - typeof";return hl=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},hl(t)}function Ms(){return Ms=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},Ms.apply(this,arguments)}function _N(t,e){return fne(t)||dne(t,e)||kM(t,e)||une()}function une(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
506
506
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dne(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 fne(t){if(Array.isArray(t))return t}function SN(t,e){if(t==null)return{};var r=hne(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 hne(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 pne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mne(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,EM(n.key),n)}}function gne(t,e,r){return e&&mne(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function yne(t,e,r){return e=Yh(e),vne(t,SM()?Reflect.construct(e,r||[],Yh(t).constructor):e.apply(t,r))}function vne(t,e){if(e&&(hl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bne(t)}function bne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SM=function(){return!!t})()}function Yh(t){return Yh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yh(t)}function xne(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&&Sw(t,e)}function Sw(t,e){return Sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Sw(t,e)}function pl(t){return Sne(t)||_ne(t)||kM(t)||wne()}function wne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
507
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kM(t,e){if(t){if(typeof t=="string")return kw(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 kw(t,e)}}function _ne(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Sne(t){if(Array.isArray(t))return kw(t)}function kw(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 kN(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?kN(Object(r),!0).forEach(function(n){Be(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Be(t,e,r){return e=EM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EM(t){var e=kne(t,"string");return hl(e)=="symbol"?e:e+""}function kne(t,e){if(hl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ene={xAxis:["bottom","top"],yAxis:["left","right"]},One={width:"100%",height:"100%"},OM={x:0,y:0};function Tf(t){return t}var Ane=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},Tne=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 OM},Up=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(pl(c),pl(d)):c},[]);return o.length>0?o:e&&e.length&&ge(i)&&ge(a)?e.slice(i,a+1):[]};function AM(t){return t==="number"?[0,"auto"]:void 0}var Ew=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,c=Up(r,e);return n<0||!a||!a.length||n>=c.length?null:a.reduce(function(u,d){var p,f=(p=d.props.data)!==null&&p!==void 0?p:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var y;if(o.dataKey&&!o.allowDuplicatedCategory){var v=f===void 0?c:f;y=Zf(v,o.dataKey,i)}else y=f&&f[n]||c[n];return y?[].concat(pl(u),[A$(d,y)]):u},[])},EN=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=Ane(a,n),c=e.orderedTooltipTicks,u=e.tooltipAxis,d=e.tooltipTicks,p=DX(o,c,d,u);if(p>=0&&d){var f=d[p]&&d[p].value,y=Ew(e,r,p,f),v=Tne(n,c,p,a);return{activeTooltipIndex:p,activeLabel:f,activePayload:y,activeCoordinate:v}}return null},Cne=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,f=e.children,y=e.stackOffset,v=k$(p,a);return n.reduce(function(x,w){var b,S=w.type.defaultProps!==void 0?ie(ie({},w.type.defaultProps),w.props):w.props,A=S.type,O=S.dataKey,C=S.allowDataOverflow,E=S.allowDuplicatedCategory,T=S.scale,N=S.ticks,R=S.includeHidden,I=S[o];if(x[I])return x;var K=Up(e.data,{graphicalItems:i.filter(function(M){var J,oe=o in M.props?M.props[o]:(J=M.type.defaultProps)===null||J===void 0?void 0:J[o];return oe===I}),dataStartIndex:u,dataEndIndex:d}),B=K.length,U,V,H;tne(S.domain,C,A)&&(U=qx(S.domain,null,C),v&&(A==="number"||T!=="auto")&&(H=Dc(K,O,"category")));var Y=AM(A);if(!U||U.length===0){var G,Q=(G=S.domain)!==null&&G!==void 0?G:Y;if(O){if(U=Dc(K,O,A),A==="category"&&v){var W=C9(U);E&&W?(V=U,U=Lh(0,B)):E||(U=zC(Q,U,w).reduce(function(M,J){return M.indexOf(J)>=0?M:[].concat(pl(M),[J])},[]))}else if(A==="category")E?U=U.filter(function(M){return M!==""&&!et(M)}):U=zC(Q,U,w).reduce(function(M,J){return M.indexOf(J)>=0||J===""||et(J)?M:[].concat(pl(M),[J])},[]);else if(A==="number"){var ee=FX(K,i.filter(function(M){var J,oe,le=o in M.props?M.props[o]:(J=M.type.defaultProps)===null||J===void 0?void 0:J[o],ve="hide"in M.props?M.props.hide:(oe=M.type.defaultProps)===null||oe===void 0?void 0:oe.hide;return le===I&&(R||!ve)}),O,a,p);ee&&(U=ee)}v&&(A==="number"||T!=="auto")&&(H=Dc(K,O,"category"))}else v?U=Lh(0,B):c&&c[I]&&c[I].hasStack&&A==="number"?U=y==="expand"?[0,1]:O$(c[I].stackGroups,u,d):U=S$(K,i.filter(function(M){var J=o in M.props?M.props[o]:M.type.defaultProps[o],oe="hide"in M.props?M.props.hide:M.type.defaultProps.hide;return J===I&&(R||!oe)}),A,p,!0);if(A==="number")U=_w(f,U,I,a,N),Q&&(U=qx(Q,U,C));else if(A==="category"&&Q){var q=Q,$=U.every(function(M){return q.indexOf(M)>=0});$&&(U=q)}}return ie(ie({},x),{},Be({},I,ie(ie({},S),{},{axisType:a,domain:U,categoricalDomain:H,duplicateDomain:V,originalDomain:(b=S.domain)!==null&&b!==void 0?b:Y,isCategorical:v,layout:p})))},{})},jne=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,f=e.children,y=Up(e.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:d}),v=y.length,x=k$(p,a),w=-1;return n.reduce(function(b,S){var A=S.type.defaultProps!==void 0?ie(ie({},S.type.defaultProps),S.props):S.props,O=A[o],C=AM("number");if(!b[O]){w++;var E;return x?E=Lh(0,v):c&&c[O]&&c[O].hasStack?(E=O$(c[O].stackGroups,u,d),E=_w(f,E,O,a)):(E=qx(C,S$(y,n.filter(function(T){var N,R,I=o in T.props?T.props[o]:(N=T.type.defaultProps)===null||N===void 0?void 0:N[o],K="hide"in T.props?T.props.hide:(R=T.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===O&&!K}),"number",p),i.defaultProps.allowDataOverflow),E=_w(f,E,O,a)),ie(ie({},b),{},Be({},O,ie(ie({axisType:a},i.defaultProps),{},{hide:!0,orientation:Tn(Ene,"".concat(a,".").concat(w%2),null),domain:E,originalDomain:C,isCategorical:x,layout:p})))}return b},{})},Nne=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,f="".concat(i,"Id"),y=Cn(p,a),v={};return y&&y.length?v=Cne(e,{axes:y,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:u,dataEndIndex:d}):o&&o.length&&(v=jne(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:u,dataEndIndex:d})),v},Pne=function(e){var r=Pa(e),n=Wi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:S1(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Ah(r,n)}},ON=function(e){var r=e.children,n=e.defaultShowTooltip,i=sn(r,il),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}},Rne=function(e){return!e||!e.length?!1:e.some(function(r){var n=Gi(r&&r.type);return n&&n.indexOf("Bar")>=0})},AN=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"}},Ine=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,f=n.children,y=n.margin||{},v=sn(f,il),x=sn(f,Us),w=Object.keys(u).reduce(function(E,T){var N=u[T],R=N.orientation;return!N.mirror&&!N.hide?ie(ie({},E),{},Be({},R,E[R]+N.width)):E},{left:y.left||0,right:y.right||0}),b=Object.keys(o).reduce(function(E,T){var N=o[T],R=N.orientation;return!N.mirror&&!N.hide?ie(ie({},E),{},Be({},R,Tn(E,"".concat(R))+N.height)):E},{top:y.top||0,bottom:y.bottom||0}),S=ie(ie({},b),w),A=S.bottom;v&&(S.bottom+=v.props.height||il.defaultProps.height),x&&r&&(S=UX(S,i,n,r));var O=d-S.left-S.right,C=p-S.top-S.bottom;return ie(ie({brushBottom:A},S),{},{width:Math.max(O,0),height:Math.max(C,0)})},$ne=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},TM=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,f=e.defaultProps,y=function(S,A){var O=A.graphicalItems,C=A.stackGroups,E=A.offset,T=A.updateId,N=A.dataStartIndex,R=A.dataEndIndex,I=S.barSize,K=S.layout,B=S.barGap,U=S.barCategoryGap,V=S.maxBarSize,H=AN(K),Y=H.numericAxisName,G=H.cateAxisName,Q=Rne(O),W=[];return O.forEach(function(ee,q){var $=Up(S.data,{graphicalItems:[ee],dataStartIndex:N,dataEndIndex:R}),M=ee.type.defaultProps!==void 0?ie(ie({},ee.type.defaultProps),ee.props):ee.props,J=M.dataKey,oe=M.maxBarSize,le=M["".concat(Y,"Id")],ve=M["".concat(G,"Id")],qe={},xe=u.reduce(function(lr,_t){var kr=A["".concat(_t.axisType,"Map")],Ir=M["".concat(_t.axisType,"Id")];kr&&kr[Ir]||_t.axisType==="zAxis"||Mo();var ni=kr[Ir];return ie(ie({},lr),{},Be(Be({},_t.axisType,ni),"".concat(_t.axisType,"Ticks"),Wi(ni)))},qe),ae=xe[G],Se=xe["".concat(G,"Ticks")],Me=C&&C[le]&&C[le].hasStack&&tY(ee,C[le].stackGroups),se=Gi(ee.type).indexOf("Bar")>=0,rt=Ah(ae,Se),Fe=[],kt=Q&&zX({barSize:I,stackGroups:C,totalSize:$ne(xe,G)});if(se){var wt,Et,Sr=et(oe)?V:oe,Ut=(wt=(Et=Ah(ae,Se,!0))!==null&&Et!==void 0?Et:Sr)!==null&&wt!==void 0?wt:0;Fe=BX({barGap:B,barCategoryGap:U,bandSize:Ut!==rt?Ut:rt,sizeList:kt[ve],maxBarSize:Sr}),Ut!==rt&&(Fe=Fe.map(function(lr){return ie(ie({},lr),{},{position:ie(ie({},lr.position),{},{offset:lr.position.offset-Ut/2})})}))}var Rr=ee&&ee.type&&ee.type.getComposedData;Rr&&W.push({props:ie(ie({},Rr(ie(ie({},xe),{},{displayedData:$,props:S,dataKey:J,item:ee,bandSize:rt,barPosition:Fe,offset:E,stackedData:Me,layout:K,dataStartIndex:N,dataEndIndex:R}))),{},Be(Be(Be({key:ee.key||"item-".concat(q)},Y,xe[Y]),G,xe[G]),"animationId",T)),childIndex:q9(ee,S.children),item:ee})}),W},v=function(S,A){var O=S.props,C=S.dataStartIndex,E=S.dataEndIndex,T=S.updateId;if(!QO({props:O}))return null;var N=O.children,R=O.layout,I=O.stackOffset,K=O.data,B=O.reverseStackOrder,U=AN(R),V=U.numericAxisName,H=U.cateAxisName,Y=Cn(N,n),G=ZX(K,Y,"".concat(V,"Id"),"".concat(H,"Id"),I,B),Q=u.reduce(function(M,J){var oe="".concat(J.axisType,"Map");return ie(ie({},M),{},Be({},oe,Nne(O,ie(ie({},J),{},{graphicalItems:Y,stackGroups:J.axisType===V&&G,dataStartIndex:C,dataEndIndex:E}))))},{}),W=Ine(ie(ie({},Q),{},{props:O,graphicalItems:Y}),A==null?void 0:A.legendBBox);Object.keys(Q).forEach(function(M){Q[M]=p(O,Q[M],W,M.replace("Map",""),r)});var ee=Q["".concat(H,"Map")],q=Pne(ee),$=y(O,ie(ie({},Q),{},{dataStartIndex:C,dataEndIndex:E,updateId:T,graphicalItems:Y,stackGroups:G,offset:W}));return ie(ie({formattedGraphicalItems:$,graphicalItems:Y,offset:W,stackGroups:G},q),Q)},x=(function(b){function S(A){var O,C,E;return pne(this,S),E=yne(this,S,[A]),Be(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Be(E,"accessibilityManager",new ene),Be(E,"handleLegendBBoxUpdate",function(T){if(T){var N=E.state,R=N.dataStartIndex,I=N.dataEndIndex,K=N.updateId;E.setState(ie({legendBBox:T},v({props:E.props,dataStartIndex:R,dataEndIndex:I,updateId:K},ie(ie({},E.state),{},{legendBBox:T}))))}}),Be(E,"handleReceiveSyncEvent",function(T,N,R){if(E.props.syncId===T){if(R===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(N)}}),Be(E,"handleBrushChange",function(T){var N=T.startIndex,R=T.endIndex;if(N!==E.state.dataStartIndex||R!==E.state.dataEndIndex){var I=E.state.updateId;E.setState(function(){return ie({dataStartIndex:N,dataEndIndex:R},v({props:E.props,dataStartIndex:N,dataEndIndex:R,updateId:I},E.state))}),E.triggerSyncEvent({dataStartIndex:N,dataEndIndex:R})}}),Be(E,"handleMouseEnter",function(T){var N=E.getMouseInfo(T);if(N){var R=ie(ie({},N),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var I=E.props.onMouseEnter;Je(I)&&I(R,T)}}),Be(E,"triggeredAfterMouseMove",function(T){var N=E.getMouseInfo(T),R=N?ie(ie({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var I=E.props.onMouseMove;Je(I)&&I(R,T)}),Be(E,"handleItemMouseEnter",function(T){E.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Be(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Be(E,"handleMouseMove",function(T){T.persist(),E.throttleTriggeredAfterMouseMove(T)}),Be(E,"handleMouseLeave",function(T){E.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};E.setState(N),E.triggerSyncEvent(N);var R=E.props.onMouseLeave;Je(R)&&R(N,T)}),Be(E,"handleOuterEvent",function(T){var N=U9(T),R=Tn(E.props,"".concat(N));if(N&&Je(R)){var I,K;/.*touch.*/i.test(N)?K=E.getMouseInfo(T.changedTouches[0]):K=E.getMouseInfo(T),R((I=K)!==null&&I!==void 0?I:{},T)}}),Be(E,"handleClick",function(T){var N=E.getMouseInfo(T);if(N){var R=ie(ie({},N),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var I=E.props.onClick;Je(I)&&I(R,T)}}),Be(E,"handleMouseDown",function(T){var N=E.props.onMouseDown;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"handleMouseUp",function(T){var N=E.props.onMouseUp;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Be(E,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseDown(T.changedTouches[0])}),Be(E,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseUp(T.changedTouches[0])}),Be(E,"handleDoubleClick",function(T){var N=E.props.onDoubleClick;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"handleContextMenu",function(T){var N=E.props.onContextMenu;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"triggerSyncEvent",function(T){E.props.syncId!==void 0&&$b.emit(Mb,E.props.syncId,T,E.eventEmitterSymbol)}),Be(E,"applySyncEvent",function(T){var N=E.props,R=N.layout,I=N.syncMethod,K=E.state.updateId,B=T.dataStartIndex,U=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)E.setState(ie({dataStartIndex:B,dataEndIndex:U},v({props:E.props,dataStartIndex:B,dataEndIndex:U,updateId:K},E.state)));else if(T.activeTooltipIndex!==void 0){var V=T.chartX,H=T.chartY,Y=T.activeTooltipIndex,G=E.state,Q=G.offset,W=G.tooltipTicks;if(!Q)return;if(typeof I=="function")Y=I(W,T);else if(I==="value"){Y=-1;for(var ee=0;ee<W.length;ee++)if(W[ee].value===T.activeLabel){Y=ee;break}}var q=ie(ie({},Q),{},{x:Q.left,y:Q.top}),$=Math.min(V,q.x+q.width),M=Math.min(H,q.y+q.height),J=W[Y]&&W[Y].value,oe=Ew(E.state,E.props.data,Y),le=W[Y]?{x:R==="horizontal"?W[Y].coordinate:$,y:R==="horizontal"?M:W[Y].coordinate}:OM;E.setState(ie(ie({},T),{},{activeLabel:J,activeCoordinate:le,activePayload:oe,activeTooltipIndex:Y}))}else E.setState(T)}),Be(E,"renderCursor",function(T){var N,R=E.state,I=R.isTooltipActive,K=R.activeCoordinate,B=R.activePayload,U=R.offset,V=R.activeTooltipIndex,H=R.tooltipAxisBandSize,Y=E.getTooltipEventType(),G=(N=T.props.active)!==null&&N!==void 0?N:I,Q=E.props.layout,W=T.key||"_recharts-cursor";return L.createElement(sne,{key:W,activeCoordinate:K,activePayload:B,activeTooltipIndex:V,chartName:r,element:T,isActive:G,layout:Q,offset:U,tooltipAxisBandSize:H,tooltipEventType:Y})}),Be(E,"renderPolarAxis",function(T,N,R){var I=Tn(T,"type.axisType"),K=Tn(E.state,"".concat(I,"Map")),B=T.type.defaultProps,U=B!==void 0?ie(ie({},B),T.props):T.props,V=K&&K[U["".concat(I,"Id")]];return j.cloneElement(T,ie(ie({},V),{},{className:ot(I,V.className),key:T.key||"".concat(N,"-").concat(R),ticks:Wi(V,!0)}))}),Be(E,"renderPolarGrid",function(T){var N=T.props,R=N.radialLines,I=N.polarAngles,K=N.polarRadius,B=E.state,U=B.radiusAxisMap,V=B.angleAxisMap,H=Pa(U),Y=Pa(V),G=Y.cx,Q=Y.cy,W=Y.innerRadius,ee=Y.outerRadius;return j.cloneElement(T,{polarAngles:Array.isArray(I)?I:Wi(Y,!0).map(function(q){return q.coordinate}),polarRadius:Array.isArray(K)?K:Wi(H,!0).map(function(q){return q.coordinate}),cx:G,cy:Q,innerRadius:W,outerRadius:ee,key:T.key||"polar-grid",radialLines:R})}),Be(E,"renderLegend",function(){var T=E.state.formattedGraphicalItems,N=E.props,R=N.children,I=N.width,K=N.height,B=E.props.margin||{},U=I-(B.left||0)-(B.right||0),V=w$({children:R,formattedGraphicalItems:T,legendWidth:U,legendContent:d});if(!V)return null;var H=V.item,Y=SN(V,lne);return j.cloneElement(H,ie(ie({},Y),{},{chartWidth:I,chartHeight:K,margin:B,onBBoxUpdate:E.handleLegendBBoxUpdate}))}),Be(E,"renderTooltip",function(){var T,N=E.props,R=N.children,I=N.accessibilityLayer,K=sn(R,ln);if(!K)return null;var B=E.state,U=B.isTooltipActive,V=B.activeCoordinate,H=B.activePayload,Y=B.activeLabel,G=B.offset,Q=(T=K.props.active)!==null&&T!==void 0?T:U;return j.cloneElement(K,{viewBox:ie(ie({},G),{},{x:G.left,y:G.top}),active:Q,label:Y,payload:Q?H:[],coordinate:V,accessibilityLayer:I})}),Be(E,"renderBrush",function(T){var N=E.props,R=N.margin,I=N.data,K=E.state,B=K.offset,U=K.dataStartIndex,V=K.dataEndIndex,H=K.updateId;return j.cloneElement(T,{key:T.key||"_recharts-brush",onChange:Sf(E.handleBrushChange,T.props.onChange),data:I,x:ge(T.props.x)?T.props.x:B.left,y:ge(T.props.y)?T.props.y:B.top+B.height+B.brushBottom-(R.bottom||0),width:ge(T.props.width)?T.props.width:B.width,startIndex:U,endIndex:V,updateId:"brush-".concat(H)})}),Be(E,"renderReferenceElement",function(T,N,R){if(!T)return null;var I=E,K=I.clipPathId,B=E.state,U=B.xAxisMap,V=B.yAxisMap,H=B.offset,Y=T.type.defaultProps||{},G=T.props,Q=G.xAxisId,W=Q===void 0?Y.xAxisId:Q,ee=G.yAxisId,q=ee===void 0?Y.yAxisId:ee;return j.cloneElement(T,{key:T.key||"".concat(N,"-").concat(R),xAxis:U[W],yAxis:V[q],viewBox:{x:H.left,y:H.top,width:H.width,height:H.height},clipPathId:K})}),Be(E,"renderActivePoints",function(T){var N=T.item,R=T.activePoint,I=T.basePoint,K=T.childIndex,B=T.isRange,U=[],V=N.props.key,H=N.item.type.defaultProps!==void 0?ie(ie({},N.item.type.defaultProps),N.item.props):N.item.props,Y=H.activeDot,G=H.dataKey,Q=ie(ie({index:K,dataKey:G,cx:R.x,cy:R.y,r:4,fill:X1(N.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},at(Y,!1)),Qf(Y));return U.push(S.renderActiveDot(Y,Q,"".concat(V,"-activePoint-").concat(K))),I?U.push(S.renderActiveDot(Y,ie(ie({},Q),{},{cx:I.x,cy:I.y}),"".concat(V,"-basePoint-").concat(K))):B&&U.push(null),U}),Be(E,"renderGraphicChild",function(T,N,R){var I=E.filterFormatItem(T,N,R);if(!I)return null;var K=E.getTooltipEventType(),B=E.state,U=B.isTooltipActive,V=B.tooltipAxis,H=B.activeTooltipIndex,Y=B.activeLabel,G=E.props.children,Q=sn(G,ln),W=I.props,ee=W.points,q=W.isRange,$=W.baseLine,M=I.item.type.defaultProps!==void 0?ie(ie({},I.item.type.defaultProps),I.item.props):I.item.props,J=M.activeDot,oe=M.hide,le=M.activeBar,ve=M.activeShape,qe=!!(!oe&&U&&Q&&(J||le||ve)),xe={};K!=="axis"&&Q&&Q.props.trigger==="click"?xe={onClick:Sf(E.handleItemMouseEnter,T.props.onClick)}:K!=="axis"&&(xe={onMouseLeave:Sf(E.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:Sf(E.handleItemMouseEnter,T.props.onMouseEnter)});var ae=j.cloneElement(T,ie(ie({},I.props),xe));function Se(_t){return typeof V.dataKey=="function"?V.dataKey(_t.payload):null}if(qe)if(H>=0){var Me,se;if(V.dataKey&&!V.allowDuplicatedCategory){var rt=typeof V.dataKey=="function"?Se:"payload.".concat(V.dataKey.toString());Me=Zf(ee,rt,Y),se=q&&$&&Zf($,rt,Y)}else Me=ee==null?void 0:ee[H],se=q&&$&&$[H];if(ve||le){var Fe=T.props.activeIndex!==void 0?T.props.activeIndex:H;return[j.cloneElement(T,ie(ie(ie({},I.props),xe),{},{activeIndex:Fe})),null,null]}if(!et(Me))return[ae].concat(pl(E.renderActivePoints({item:I,activePoint:Me,basePoint:se,childIndex:H,isRange:q})))}else{var kt,wt=(kt=E.getItemByXY(E.state.activeCoordinate))!==null&&kt!==void 0?kt:{graphicalItem:ae},Et=wt.graphicalItem,Sr=Et.item,Ut=Sr===void 0?T:Sr,Rr=Et.childIndex,lr=ie(ie(ie({},I.props),xe),{},{activeIndex:Rr});return[j.cloneElement(Ut,lr),null,null]}return q?[ae,null,null]:[ae,null]}),Be(E,"renderCustomized",function(T,N,R){return j.cloneElement(T,ie(ie({key:"recharts-customized-".concat(R)},E.props),E.state))}),Be(E,"renderMap",{CartesianGrid:{handler:Tf,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Tf},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Tf},YAxis:{handler:Tf},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((O=A.id)!==null&&O!==void 0?O:Du("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=wI(E.triggeredAfterMouseMove,(C=A.throttleDelay)!==null&&C!==void 0?C:1e3/60),E.state={},E}return xne(S,b),gne(S,[{key:"componentDidMount",value:function(){var O,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,C=O.children,E=O.data,T=O.height,N=O.layout,R=sn(C,ln);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var K=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,B=Ew(this.state,E,I,K),U=this.state.tooltipTicks[I].coordinate,V=(this.state.offset.top+T)/2,H=N==="horizontal",Y=H?{x:U,y:V}:{y:U,x:V},G=this.state.formattedGraphicalItems.find(function(W){var ee=W.item;return ee.type.name==="Scatter"});G&&(Y=ie(ie({},Y),G.props.points[I].tooltipPosition),B=G.props.points[I].tooltipPayload);var Q={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:K,activePayload:B,activeCoordinate:Y};this.setState(Q),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.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 E,T;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(O){ux([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 C=O.props.shared?"axis":"item";return c.indexOf(C)>=0?C:a}return a}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var C=this.container,E=C.getBoundingClientRect(),T=TW(E),N={chartX:Math.round(O.pageX-T.left),chartY:Math.round(O.pageY-T.top)},R=E.width/C.offsetWidth||1,I=this.inRange(N.chartX,N.chartY,R);if(!I)return null;var K=this.state,B=K.xAxisMap,U=K.yAxisMap,V=this.getTooltipEventType(),H=EN(this.state,this.props.data,this.props.layout,I);if(V!=="axis"&&B&&U){var Y=Pa(B).scale,G=Pa(U).scale,Q=Y&&Y.invert?Y.invert(N.chartX):null,W=G&&G.invert?G.invert(N.chartY):null;return ie(ie({},N),{},{xValue:Q,yValue:W},H)}return H?ie(ie({},N),H):null}},{key:"inRange",value:function(O,C){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,N=O/E,R=C/E;if(T==="horizontal"||T==="vertical"){var I=this.state.offset,K=N>=I.left&&N<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return K?{x:N,y:R}:null}var B=this.state,U=B.angleAxisMap,V=B.radiusAxisMap;if(U&&V){var H=Pa(U);return qC({x:N,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,C=this.getTooltipEventType(),E=sn(O,ln),T={};E&&C==="axis"&&(E.props.trigger==="click"?T={onClick:this.handleClick}:T={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 N=Qf(this.props,this.handleOuterEvent);return ie(ie({},N),T)}},{key:"addListener",value:function(){$b.on(Mb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){$b.removeListener(Mb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,C,E){for(var T=this.state.formattedGraphicalItems,N=0,R=T.length;N<R;N++){var I=T[N];if(I.item===O||I.props.key===O.key||C===Gi(I.item.type)&&E===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,C=this.state.offset,E=C.left,T=C.top,N=C.height,R=C.width;return L.createElement("defs",null,L.createElement("clipPath",{id:O},L.createElement("rect",{x:E,y:T,height:N,width:R})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(C,E){var T=_N(E,2),N=T[0],R=T[1];return ie(ie({},C),{},Be({},N,R.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(C,E){var T=_N(E,2),N=T[0],R=T[1];return ie(ie({},C),{},Be({},N,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[O])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(O){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[O])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(O){var C=this.state,E=C.formattedGraphicalItems,T=C.activeItem;if(E&&E.length)for(var N=0,R=E.length;N<R;N++){var I=E[N],K=I.props,B=I.item,U=B.type.defaultProps!==void 0?ie(ie({},B.type.defaultProps),B.props):B.props,V=Gi(B.type);if(V==="Bar"){var H=(K.data||[]).find(function(W){return XZ(O,W)});if(H)return{graphicalItem:I,payload:H}}else if(V==="RadialBar"){var Y=(K.data||[]).find(function(W){return qC(O,W)});if(Y)return{graphicalItem:I,payload:Y}}else if(Ip(I,T)||$p(I,T)||Su(I,T)){var G=zQ({graphicalItem:I,activeTooltipItem:T,itemData:U.data}),Q=U.activeIndex===void 0?G:U.activeIndex;return{graphicalItem:ie(ie({},I),{},{childIndex:Q}),payload:Su(I,T)?U.data[G]:I.props.data[G]}}}return null}},{key:"render",value:function(){var O=this;if(!QO(this))return null;var C=this.props,E=C.children,T=C.className,N=C.width,R=C.height,I=C.style,K=C.compact,B=C.title,U=C.desc,V=SN(C,cne),H=at(V,!1);if(K)return L.createElement(nN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement(fx,Ms({},H,{width:N,height:R,title:B,desc:U}),this.renderClipPath(),tA(E,this.renderMap)));if(this.props.accessibilityLayer){var Y,G;H.tabIndex=(Y=this.props.tabIndex)!==null&&Y!==void 0?Y:0,H.role=(G=this.props.role)!==null&&G!==void 0?G:"application",H.onKeyDown=function(W){O.accessibilityManager.keyboardEvent(W)},H.onFocus=function(){O.accessibilityManager.focus()}}var Q=this.parseEventsOfWrapper();return L.createElement(nN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement("div",Ms({className:ot("recharts-wrapper",T),style:ie({position:"relative",cursor:"default",width:N,height:R},I)},Q,{ref:function(ee){O.container=ee}}),L.createElement(fx,Ms({},H,{width:N,height:R,title:B,desc:U,style:One}),this.renderClipPath(),tA(E,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(j.Component);Be(x,"displayName",r),Be(x,"defaultProps",ie({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Be(x,"getDerivedStateFromProps",function(b,S){var A=b.dataKey,O=b.data,C=b.children,E=b.width,T=b.height,N=b.layout,R=b.stackOffset,I=b.margin,K=S.dataStartIndex,B=S.dataEndIndex;if(S.updateId===void 0){var U=ON(b);return ie(ie(ie({},U),{},{updateId:0},v(ie(ie({props:b},U),{},{updateId:0}),S)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:N,prevStackOffset:R,prevMargin:I,prevChildren:C})}if(A!==S.prevDataKey||O!==S.prevData||E!==S.prevWidth||T!==S.prevHeight||N!==S.prevLayout||R!==S.prevStackOffset||!Bs(I,S.prevMargin)){var V=ON(b),H={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},Y=ie(ie({},EN(S,O,N)),{},{updateId:S.updateId+1}),G=ie(ie(ie({},V),H),Y);return ie(ie(ie({},G),v(ie({props:b},G),S)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:N,prevStackOffset:R,prevMargin:I,prevChildren:C})}if(!ux(C,S.prevChildren)){var Q,W,ee,q,$=sn(C,il),M=$&&(Q=(W=$.props)===null||W===void 0?void 0:W.startIndex)!==null&&Q!==void 0?Q:K,J=$&&(ee=(q=$.props)===null||q===void 0?void 0:q.endIndex)!==null&&ee!==void 0?ee:B,oe=M!==K||J!==B,le=!et(O),ve=le&&!oe?S.updateId:S.updateId+1;return ie(ie({updateId:ve},v(ie(ie({props:b},S),{},{updateId:ve,dataStartIndex:M,dataEndIndex:J}),S)),{},{prevChildren:C,dataStartIndex:M,dataEndIndex:J})}return null}),Be(x,"renderActiveDot",function(b,S,A){var O;return j.isValidElement(b)?O=j.cloneElement(b,S):Je(b)?O=b(S):O=L.createElement(J1,S),L.createElement(Xt,{className:"recharts-active-dot",key:A},O)});var w=j.forwardRef(function(S,A){return L.createElement(x,Ms({},S,{ref:A}))});return w.displayName=x.displayName,w},Mne=TM({chartName:"LineChart",GraphicalChild:Wu,axisComponents:[{axisType:"xAxis",AxisComp:Ba},{axisType:"yAxis",AxisComp:Ua}],formatAxisMap:K$}),Ow=TM({chartName:"BarChart",GraphicalChild:ea,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ba},{axisType:"yAxis",AxisComp:Ua}],formatAxisMap:K$});const Jh={backgroundColor:"#1e1e1e",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",color:"#e4e0dc",fontSize:"11px",fontFamily:"JetBrains Mono, monospace"};function It(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 g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-5 py-4",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mb-1",children:t}),g.jsx("p",{className:`text-xl font-mono font-medium ${n?"text-[#E43A9C]":"text-zinc-100"}`,children:e}),r&&g.jsx("p",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:r})]})}const Lne={summary:"Summary","by squad":"By Squad","by agent":"By Agent",io:"IO",timeline:"Timeline"};function Dne({tabs:t,active:e,onChange:r}){return g.jsx("div",{className:"flex gap-0 border-b border-white/[0.06] mb-5",children:t.map(n=>g.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:Lne[n]??n},n))})}function zne({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 g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[g.jsx($a,{label:"Total Tokens",value:It(r),sub:`${It(e.totalInputTokens)} in · ${It(e.totalOutputTokens)} out`}),g.jsx($a,{label:"Total Cost",value:Zn(e.totalCostUsd),accent:!0}),g.jsx($a,{label:"API Calls",value:It(e.callCount),sub:"across all entities"}),g.jsx($a,{label:"Avg Cost / Call",value:e.callCount>0?Zn(e.totalCostUsd/e.callCount):"$0.00",sub:`over ${e.callCount} calls`})]}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost by entity"}),a.length>0?g.jsx(uh,{width:"100%",height:180,children:g.jsxs(Ow,{data:a,barCategoryGap:"35%",children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`$${o}`,width:40}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`$${o.toFixed(2)}`,"Cost"]}),g.jsx(ea,{dataKey:"cost",fill:"url(#costGrad)",radius:[6,6,0,0]}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"costGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),g.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):g.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens by entity (k)"}),a.length>0?g.jsx(uh,{width:"100%",height:180,children:g.jsxs(Ow,{data:a,barCategoryGap:"35%",children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`${o}k`,width:40}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`${o}k`,"Tokens"]}),g.jsx(ea,{dataKey:"tokens",fill:"url(#tokenGrad)",radius:[6,6,0,0]}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"tokenGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#818cf8"}),g.jsx("stop",{offset:"100%",stopColor:"#6366f1",stopOpacity:.7})]})})]})}):g.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]})]}),g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Entity","Input","Output","Calls","Cost"].map(o=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),g.jsxs("tbody",{children:[i.map(o=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name)),g.jsxs("tr",{className:"bg-[#1a1a1a]",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-200 font-medium",children:"Total"}),g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:It(e.totalInputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:It(e.totalOutputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:e.callCount}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C] font-medium",children:Zn(e.totalCostUsd)})]})]})]})})]})}function Bne({records:t}){const[e,r]=j.useState([]),[n,i]=j.useState("cost"),[a,o]=j.useState("desc");function c(f){f===n?o(y=>y==="asc"?"desc":"asc"):(i(f),o("desc"))}const u=j.useMemo(()=>{const f=new Map;for(const v of t){if(!v.squadId)continue;const x=f.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 w=`${v.agentRole??"unknown"}:${v.model}`,b=x.agents.get(w)??{role:v.agentRole??"unknown",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(w,b),f.set(v.squadId,x)}return[...Array.from(f.values())].sort((v,x)=>{const w=v[n],b=x[n],S=typeof w=="string"?w.localeCompare(b):w-b;return a==="desc"?-S:S})},[t,n,a]),d=f=>r(y=>y.includes(f)?y.filter(v=>v!==f):[...y,f]),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?g.jsx("div",{className:"text-center py-12 text-zinc-700 text-[11px] font-mono",children:"No squad usage data"}):g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-1 px-1 mb-1",children:[g.jsx("span",{className:"text-[10px] font-mono text-zinc-700 mr-1",children:"sort by"}),p.map(f=>g.jsxs("button",{type:"button",onClick:()=>c(f.key),className:`flex items-center gap-0.5 px-2 py-1 rounded-lg text-[10px] font-mono transition-colors ${n===f.key?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400 hover:bg-white/[0.04]"}`,style:n===f.key?{background:"rgba(228,58,156,0.1)"}:void 0,children:[f.label,n===f.key&&g.jsx("span",{className:"text-[9px]",children:a==="desc"?"↓":"↑"})]},f.key))]}),u.map(f=>{const y=e.includes(f.id),v=Array.from(f.agents.values());return g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl overflow-hidden",children:[g.jsxs("button",{type:"button",onClick:()=>d(f.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:[g.jsx("div",{className:`transition-transform ${y?"rotate-90":""}`,children:g.jsx(Lw,{className:"w-3.5 h-3.5 text-zinc-600"})}),g.jsx("span",{className:"text-sm font-mono text-zinc-100 flex-1",children:f.name}),g.jsxs("div",{className:"flex items-center gap-6 text-[11px] font-mono",children:[g.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[g.jsx("span",{className:"text-zinc-700 mr-1",children:"in"}),It(f.inputTokens)]}),g.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[g.jsx("span",{className:"text-zinc-700 mr-1",children:"out"}),It(f.outputTokens)]}),g.jsxs("span",{className:"text-zinc-500",children:[g.jsx("span",{className:"text-zinc-700 mr-1",children:"calls"}),f.calls]}),g.jsx("span",{className:"text-[#E43A9C] font-medium w-16 text-right",children:Zn(f.cost)})]})]}),y&&g.jsx("div",{className:"border-t border-white/[0.05]",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"bg-[#191919]",children:["Agent","Model","Input","Output","Calls","Cost"].map(x=>g.jsx("th",{className:`text-left px-4 py-2 text-zinc-700 font-medium ${x==="Cost"?"text-right":""}`,children:x},x))})}),g.jsx("tbody",{children:v.map(x=>g.jsxs("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-2.5 text-zinc-300",children:x.role}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-600",children:x.model}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:It(x.inputTokens)}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:It(x.outputTokens)}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:x.calls}),g.jsx("td",{className:"px-4 py-2.5 text-right text-[#E43A9C]",children:Zn(x.cost)})]},x.role))})]})})]},f.id)})]})}function Une({records:t}){const e=j.useMemo(()=>{const n=new Map;for(const i of t){const a=`${i.squadId??"io"}:${i.agentRole??"orchestrator"}:${i.model}`,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 g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Agent","Squad","Model","Input","Output","Calls","Cost","% of total"].map(n=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),g.jsx("tbody",{children:e.map(n=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.squad}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.model}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(n.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(n.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(n.cost)}),g.jsx("td",{className:"px-4 py-3",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-16 h-1.5 rounded-full bg-[#252525] overflow-hidden",children:g.jsx("div",{className:"h-full bg-[#E43A9C] rounded-full",style:{width:`${r>0?n.cost/r*100:0}%`}})}),g.jsx("span",{className:"text-zinc-600 text-[10px]",children:r>0?`${(n.cost/r*100).toFixed(1)}%`:"0%"})]})})]},`${n.squad}:${n.name}`))})]})})}function qne({records:t}){const e=j.useMemo(()=>t.filter(o=>!o.squadId),[t]),r=j.useMemo(()=>{const o=new Map;for(const c of e){const u=`${c.agentRole??"orchestrator"}:${c.model}`,d=o.get(u)??{name:c.agentRole??"orchestrator",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 g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[g.jsx($a,{label:"IO Tokens",value:It(n+i),sub:`${It(n)} in · ${It(i)} out`}),g.jsx($a,{label:"IO Cost",value:Zn(a),accent:!0}),g.jsx($a,{label:"IO Calls",value:It(e.length)}),g.jsx($a,{label:"IO Roles",value:String(r.length)})]}),g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Role","Model","Input","Output","Calls","Cost"].map(o=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),g.jsx("tbody",{children:r.map(o=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:o.model}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name))})]})})]})}function Fne({records:t}){const e=qa(),r=j.useMemo(()=>{const i=new Map;for(const a of t){const o=a.timestamp.slice(0,10),c=i.get(o)??{date:o,inputTokens:0,outputTokens:0,cost:0,calls:0};c.inputTokens+=a.inputTokens,c.outputTokens+=a.outputTokens,c.cost+=a.estimatedCostUsd??0,c.calls+=1,i.set(o,c)}return Array.from(i.values()).sort((a,o)=>a.date.localeCompare(o.date))},[t]),n=r.map(i=>({...i,label:iz(i.date,e),tokens:i.inputTokens+i.outputTokens}));return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens per day"}),n.length>0?g.jsx(uh,{width:"100%",height:220,children:g.jsxs(Mne,{data:n,children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:It,width:44}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[It(i),"Tokens"]}),g.jsx(Wu,{type:"monotone",dataKey:"tokens",stroke:"#E43A9C",strokeWidth:2,dot:!1})]})}):g.jsx("div",{className:"h-[220px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost per day"}),n.length>0?g.jsx(uh,{width:"100%",height:180,children:g.jsxs(Ow,{data:n,barCategoryGap:"20%",children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:i=>`$${i.toFixed(2)}`,width:44}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[Zn(i),"Cost"]}),g.jsx(ea,{dataKey:"cost",fill:"url(#costGradTl)",radius:[4,4,0,0]}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"costGradTl",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),g.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):g.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Date","Input","Output","Calls","Cost"].map(i=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${i==="Cost"?"text-right":""}`,children:i},i))})}),g.jsx("tbody",{children:r.map(i=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:i.date}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(i.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(i.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:i.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(i.cost)})]},i.date))})]})})]})}function Hne(){const[t,e]=j.useState("summary"),[r,n]=j.useState(null),[i,a]=j.useState("14d"),o=["summary","by squad","by agent","io","timeline"];if(j.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),Ke.get(`/usage?since=${u.toISOString()}`).then(n).catch(()=>{})},[i]),!r)return g.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 g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[g.jsxs("div",{className:"flex items-start justify-between mb-5 gap-4 flex-wrap",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Usage"}),g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:c})]}),g.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=>g.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))})]}),g.jsx(Dne,{tabs:o,active:t,onChange:u=>e(u)}),t==="summary"&&g.jsx(zne,{records:r.records,totals:r.totals}),t==="by squad"&&g.jsx(Bne,{records:r.records}),t==="by agent"&&g.jsx(Une,{records:r.records}),t==="io"&&g.jsx(qne,{records:r.records}),t==="timeline"&&g.jsx(Fne,{records:r.records})]})}function CM(t){return[...t].sort((e,r)=>e.isDir!==r.isDir?e.isDir?-1:1:e.name.localeCompare(r.name)).map(e=>({...e,children:CM(e.children)}))}function Wne(t){const e=[];for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e,a="";if(r.isDir){for(const o of n){a=a?`${a}/${o}`:o;let c=i.find(u=>u.path===a);c||(c={name:o,path:a,isDir:!0,children:[]},i.push(c)),i=c.children}continue}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 CM(e)}function jM(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=jM(r.children,e);return i.length?[{...r,children:i}]:[]}):t}function Aw(t){const e=new Set;for(const r of t)if(r.isDir){e.add(r.path);for(const n of Aw(r.children))e.add(n)}return e}function Gne(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 NM({node:t,depth:e,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o,onAddToFolder:c,onDeleteFolder:u}){const d=r===t.path,p=t.isDir&&(n.has(t.path)||i.has(t.path)),f=12+e*16,y=t.isDir&&["io","shared","squads","templates"].includes(t.path);return t.isDir?g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full items-center group 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:f},children:[g.jsxs("button",{type:"button",onClick:()=>a(t.path),className:"flex items-center gap-2 flex-1 min-w-0",children:[g.jsx(Lw,{size:14,className:`shrink-0 transition-transform ${p?"rotate-90":""}`}),p?g.jsx(f4,{size:14,className:"shrink-0 text-zinc-500"}):g.jsx(p4,{size:14,className:"shrink-0 text-zinc-500"}),g.jsx("span",{className:"truncate",children:t.name})]}),g.jsxs("div",{className:"flex items-center gap-0.5",children:[!y&&g.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),u(t.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-red-500/20 transition-opacity text-zinc-600 hover:text-red-400",title:`Delete ${t.name}`,children:g.jsx(Ma,{size:12})}),g.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),c(t.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-white/[0.08] transition-opacity text-zinc-600 hover:text-zinc-300",title:`Add page to ${t.name}`,children:g.jsx(Uw,{size:12})})]})]}),p&&g.jsx("div",{children:t.children.map(v=>g.jsx(NM,{node:v,depth:e+1,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o,onAddToFolder:c,onDeleteFolder:u},v.path))})]}):g.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 ${d?"border-l-2 border-[#E43A9C] bg-[#E43A9C]/10 text-[#E43A9C]":"text-zinc-500 hover:bg-white/[0.04] hover:text-zinc-300"}`,style:{paddingLeft:f},children:[g.jsx(u4,{size:14,className:"shrink-0"}),g.jsx("span",{className:"truncate",children:t.name})]})}function Kne(){const[t,e]=j.useState([]),[r,n]=j.useState(null),[i,a]=j.useState(""),[o,c]=j.useState(!1),[u,d]=j.useState(""),[p,f]=j.useState(""),[y,v]=j.useState(""),[x,w]=j.useState(new Set),[b,S]=j.useState(!1),[A,O]=j.useState(null),C=j.useRef(null);j.useEffect(()=>{B()},[]);const E=j.useMemo(()=>Wne(t),[t]),T=y.trim().toLowerCase(),N=j.useMemo(()=>jM(E,T),[E,T]),R=j.useMemo(()=>{const $=T?Aw(N):new Set;if(r)for(const M of Gne(r))$.add(M);return $},[N,T,r]),I=r?(function $(M){for(const J of M){if(J.path===r)return J;const oe=$(J.children);if(oe)return oe}return null})(N):null,K=(I==null?void 0:I.name)??(r?r.split("/").pop()??"":"");j.useEffect(()=>{const $=Aw(E);w(M=>new Set([...M,...$]))},[E]);async function B(){try{const $=await Ke.get("/wiki/all");e($.pages)}catch{e([])}}function U($){if($.startsWith("squads/")){const M=$.split("/"),J=M[1]??"",oe=M.slice(2).join("/");return{scope:J,relativePath:oe}}return $.startsWith("templates/")?{scope:"templates",relativePath:$.slice(10)}:$.startsWith("io/")?{scope:"io",relativePath:$.slice(3)}:$.startsWith("shared/")?{scope:"shared",relativePath:$.slice(7)}:{scope:"shared",relativePath:$}}async function V($){try{const{scope:M,relativePath:J}=U($),oe=await Ke.get(`/wiki/${M}/${J}`);a(oe.content),d(oe.content),n($),c(!1)}catch{tt.error("Failed to load page")}}async function H(){if(r)try{const{scope:$,relativePath:M}=U(r);await Ke.put(`/wiki/${$}/${M}`,{content:u}),a(u),c(!1),tt.success("Page saved")}catch{tt.error("Failed to save page")}}async function Y(){if(r)try{const{scope:$,relativePath:M}=U(r);await Ke.delete(`/wiki/${$}/${M}`),tt.success("Page deleted"),n(null),a(""),d(""),c(!1),B()}catch{tt.error("Failed to delete page")}}function G($){f(`${$}/`),setTimeout(()=>{const M=C.current;M&&(M.focus(),M.setSelectionRange(M.value.length,M.value.length))},0)}function Q($){O($)}async function W(){if(A)try{await Ke.delete(`/wiki/dir/${A}`),tt.success(`Deleted ${A}`),r!=null&&r.startsWith(A)&&(n(null),a(""),d(""),c(!1)),B()}catch{tt.error("Failed to delete directory")}finally{O(null)}}async function ee(){let $=p.trim().replace(/^\/+|\/+$/g,"");if(!$)return;$=$.replace(/\.md$/i,"");const M=$.startsWith("io/")||$.startsWith("shared/")||$.startsWith("squads/")?$:`shared/${$}`;S(!0);try{const{scope:J,relativePath:oe}=U(M),le=oe.split("/").slice(-1)[0]??oe;await Ke.put(`/wiki/${J}/${oe}`,{content:`# ${le}
507
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kM(t,e){if(t){if(typeof t=="string")return kw(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 kw(t,e)}}function _ne(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Sne(t){if(Array.isArray(t))return kw(t)}function kw(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 kN(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?kN(Object(r),!0).forEach(function(n){Be(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Be(t,e,r){return e=EM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EM(t){var e=kne(t,"string");return hl(e)=="symbol"?e:e+""}function kne(t,e){if(hl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ene={xAxis:["bottom","top"],yAxis:["left","right"]},One={width:"100%",height:"100%"},OM={x:0,y:0};function Tf(t){return t}var Ane=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},Tne=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 OM},Up=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(pl(c),pl(d)):c},[]);return o.length>0?o:e&&e.length&&ge(i)&&ge(a)?e.slice(i,a+1):[]};function AM(t){return t==="number"?[0,"auto"]:void 0}var Ew=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,c=Up(r,e);return n<0||!a||!a.length||n>=c.length?null:a.reduce(function(u,d){var p,f=(p=d.props.data)!==null&&p!==void 0?p:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var y;if(o.dataKey&&!o.allowDuplicatedCategory){var v=f===void 0?c:f;y=Zf(v,o.dataKey,i)}else y=f&&f[n]||c[n];return y?[].concat(pl(u),[A$(d,y)]):u},[])},EN=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=Ane(a,n),c=e.orderedTooltipTicks,u=e.tooltipAxis,d=e.tooltipTicks,p=DX(o,c,d,u);if(p>=0&&d){var f=d[p]&&d[p].value,y=Ew(e,r,p,f),v=Tne(n,c,p,a);return{activeTooltipIndex:p,activeLabel:f,activePayload:y,activeCoordinate:v}}return null},Cne=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,f=e.children,y=e.stackOffset,v=k$(p,a);return n.reduce(function(x,w){var b,S=w.type.defaultProps!==void 0?ie(ie({},w.type.defaultProps),w.props):w.props,A=S.type,O=S.dataKey,C=S.allowDataOverflow,E=S.allowDuplicatedCategory,T=S.scale,N=S.ticks,R=S.includeHidden,I=S[o];if(x[I])return x;var K=Up(e.data,{graphicalItems:i.filter(function(M){var J,oe=o in M.props?M.props[o]:(J=M.type.defaultProps)===null||J===void 0?void 0:J[o];return oe===I}),dataStartIndex:u,dataEndIndex:d}),B=K.length,U,V,H;tne(S.domain,C,A)&&(U=qx(S.domain,null,C),v&&(A==="number"||T!=="auto")&&(H=Dc(K,O,"category")));var Y=AM(A);if(!U||U.length===0){var G,Q=(G=S.domain)!==null&&G!==void 0?G:Y;if(O){if(U=Dc(K,O,A),A==="category"&&v){var W=C9(U);E&&W?(V=U,U=Lh(0,B)):E||(U=zC(Q,U,w).reduce(function(M,J){return M.indexOf(J)>=0?M:[].concat(pl(M),[J])},[]))}else if(A==="category")E?U=U.filter(function(M){return M!==""&&!tt(M)}):U=zC(Q,U,w).reduce(function(M,J){return M.indexOf(J)>=0||J===""||tt(J)?M:[].concat(pl(M),[J])},[]);else if(A==="number"){var ee=FX(K,i.filter(function(M){var J,oe,le=o in M.props?M.props[o]:(J=M.type.defaultProps)===null||J===void 0?void 0:J[o],ve="hide"in M.props?M.props.hide:(oe=M.type.defaultProps)===null||oe===void 0?void 0:oe.hide;return le===I&&(R||!ve)}),O,a,p);ee&&(U=ee)}v&&(A==="number"||T!=="auto")&&(H=Dc(K,O,"category"))}else v?U=Lh(0,B):c&&c[I]&&c[I].hasStack&&A==="number"?U=y==="expand"?[0,1]:O$(c[I].stackGroups,u,d):U=S$(K,i.filter(function(M){var J=o in M.props?M.props[o]:M.type.defaultProps[o],oe="hide"in M.props?M.props.hide:M.type.defaultProps.hide;return J===I&&(R||!oe)}),A,p,!0);if(A==="number")U=_w(f,U,I,a,N),Q&&(U=qx(Q,U,C));else if(A==="category"&&Q){var q=Q,$=U.every(function(M){return q.indexOf(M)>=0});$&&(U=q)}}return ie(ie({},x),{},Be({},I,ie(ie({},S),{},{axisType:a,domain:U,categoricalDomain:H,duplicateDomain:V,originalDomain:(b=S.domain)!==null&&b!==void 0?b:Y,isCategorical:v,layout:p})))},{})},jne=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,f=e.children,y=Up(e.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:d}),v=y.length,x=k$(p,a),w=-1;return n.reduce(function(b,S){var A=S.type.defaultProps!==void 0?ie(ie({},S.type.defaultProps),S.props):S.props,O=A[o],C=AM("number");if(!b[O]){w++;var E;return x?E=Lh(0,v):c&&c[O]&&c[O].hasStack?(E=O$(c[O].stackGroups,u,d),E=_w(f,E,O,a)):(E=qx(C,S$(y,n.filter(function(T){var N,R,I=o in T.props?T.props[o]:(N=T.type.defaultProps)===null||N===void 0?void 0:N[o],K="hide"in T.props?T.props.hide:(R=T.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===O&&!K}),"number",p),i.defaultProps.allowDataOverflow),E=_w(f,E,O,a)),ie(ie({},b),{},Be({},O,ie(ie({axisType:a},i.defaultProps),{},{hide:!0,orientation:Tn(Ene,"".concat(a,".").concat(w%2),null),domain:E,originalDomain:C,isCategorical:x,layout:p})))}return b},{})},Nne=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,f="".concat(i,"Id"),y=Cn(p,a),v={};return y&&y.length?v=Cne(e,{axes:y,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:u,dataEndIndex:d}):o&&o.length&&(v=jne(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:u,dataEndIndex:d})),v},Pne=function(e){var r=Pa(e),n=Wi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:S1(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Ah(r,n)}},ON=function(e){var r=e.children,n=e.defaultShowTooltip,i=sn(r,il),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}},Rne=function(e){return!e||!e.length?!1:e.some(function(r){var n=Gi(r&&r.type);return n&&n.indexOf("Bar")>=0})},AN=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"}},Ine=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,f=n.children,y=n.margin||{},v=sn(f,il),x=sn(f,Us),w=Object.keys(u).reduce(function(E,T){var N=u[T],R=N.orientation;return!N.mirror&&!N.hide?ie(ie({},E),{},Be({},R,E[R]+N.width)):E},{left:y.left||0,right:y.right||0}),b=Object.keys(o).reduce(function(E,T){var N=o[T],R=N.orientation;return!N.mirror&&!N.hide?ie(ie({},E),{},Be({},R,Tn(E,"".concat(R))+N.height)):E},{top:y.top||0,bottom:y.bottom||0}),S=ie(ie({},b),w),A=S.bottom;v&&(S.bottom+=v.props.height||il.defaultProps.height),x&&r&&(S=UX(S,i,n,r));var O=d-S.left-S.right,C=p-S.top-S.bottom;return ie(ie({brushBottom:A},S),{},{width:Math.max(O,0),height:Math.max(C,0)})},$ne=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},TM=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,f=e.defaultProps,y=function(S,A){var O=A.graphicalItems,C=A.stackGroups,E=A.offset,T=A.updateId,N=A.dataStartIndex,R=A.dataEndIndex,I=S.barSize,K=S.layout,B=S.barGap,U=S.barCategoryGap,V=S.maxBarSize,H=AN(K),Y=H.numericAxisName,G=H.cateAxisName,Q=Rne(O),W=[];return O.forEach(function(ee,q){var $=Up(S.data,{graphicalItems:[ee],dataStartIndex:N,dataEndIndex:R}),M=ee.type.defaultProps!==void 0?ie(ie({},ee.type.defaultProps),ee.props):ee.props,J=M.dataKey,oe=M.maxBarSize,le=M["".concat(Y,"Id")],ve=M["".concat(G,"Id")],qe={},xe=u.reduce(function(lr,_t){var kr=A["".concat(_t.axisType,"Map")],Ir=M["".concat(_t.axisType,"Id")];kr&&kr[Ir]||_t.axisType==="zAxis"||Mo();var ni=kr[Ir];return ie(ie({},lr),{},Be(Be({},_t.axisType,ni),"".concat(_t.axisType,"Ticks"),Wi(ni)))},qe),ae=xe[G],Se=xe["".concat(G,"Ticks")],Me=C&&C[le]&&C[le].hasStack&&tY(ee,C[le].stackGroups),se=Gi(ee.type).indexOf("Bar")>=0,rt=Ah(ae,Se),Fe=[],kt=Q&&zX({barSize:I,stackGroups:C,totalSize:$ne(xe,G)});if(se){var wt,Et,Sr=tt(oe)?V:oe,Ut=(wt=(Et=Ah(ae,Se,!0))!==null&&Et!==void 0?Et:Sr)!==null&&wt!==void 0?wt:0;Fe=BX({barGap:B,barCategoryGap:U,bandSize:Ut!==rt?Ut:rt,sizeList:kt[ve],maxBarSize:Sr}),Ut!==rt&&(Fe=Fe.map(function(lr){return ie(ie({},lr),{},{position:ie(ie({},lr.position),{},{offset:lr.position.offset-Ut/2})})}))}var Rr=ee&&ee.type&&ee.type.getComposedData;Rr&&W.push({props:ie(ie({},Rr(ie(ie({},xe),{},{displayedData:$,props:S,dataKey:J,item:ee,bandSize:rt,barPosition:Fe,offset:E,stackedData:Me,layout:K,dataStartIndex:N,dataEndIndex:R}))),{},Be(Be(Be({key:ee.key||"item-".concat(q)},Y,xe[Y]),G,xe[G]),"animationId",T)),childIndex:q9(ee,S.children),item:ee})}),W},v=function(S,A){var O=S.props,C=S.dataStartIndex,E=S.dataEndIndex,T=S.updateId;if(!QO({props:O}))return null;var N=O.children,R=O.layout,I=O.stackOffset,K=O.data,B=O.reverseStackOrder,U=AN(R),V=U.numericAxisName,H=U.cateAxisName,Y=Cn(N,n),G=ZX(K,Y,"".concat(V,"Id"),"".concat(H,"Id"),I,B),Q=u.reduce(function(M,J){var oe="".concat(J.axisType,"Map");return ie(ie({},M),{},Be({},oe,Nne(O,ie(ie({},J),{},{graphicalItems:Y,stackGroups:J.axisType===V&&G,dataStartIndex:C,dataEndIndex:E}))))},{}),W=Ine(ie(ie({},Q),{},{props:O,graphicalItems:Y}),A==null?void 0:A.legendBBox);Object.keys(Q).forEach(function(M){Q[M]=p(O,Q[M],W,M.replace("Map",""),r)});var ee=Q["".concat(H,"Map")],q=Pne(ee),$=y(O,ie(ie({},Q),{},{dataStartIndex:C,dataEndIndex:E,updateId:T,graphicalItems:Y,stackGroups:G,offset:W}));return ie(ie({formattedGraphicalItems:$,graphicalItems:Y,offset:W,stackGroups:G},q),Q)},x=(function(b){function S(A){var O,C,E;return pne(this,S),E=yne(this,S,[A]),Be(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Be(E,"accessibilityManager",new ene),Be(E,"handleLegendBBoxUpdate",function(T){if(T){var N=E.state,R=N.dataStartIndex,I=N.dataEndIndex,K=N.updateId;E.setState(ie({legendBBox:T},v({props:E.props,dataStartIndex:R,dataEndIndex:I,updateId:K},ie(ie({},E.state),{},{legendBBox:T}))))}}),Be(E,"handleReceiveSyncEvent",function(T,N,R){if(E.props.syncId===T){if(R===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(N)}}),Be(E,"handleBrushChange",function(T){var N=T.startIndex,R=T.endIndex;if(N!==E.state.dataStartIndex||R!==E.state.dataEndIndex){var I=E.state.updateId;E.setState(function(){return ie({dataStartIndex:N,dataEndIndex:R},v({props:E.props,dataStartIndex:N,dataEndIndex:R,updateId:I},E.state))}),E.triggerSyncEvent({dataStartIndex:N,dataEndIndex:R})}}),Be(E,"handleMouseEnter",function(T){var N=E.getMouseInfo(T);if(N){var R=ie(ie({},N),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var I=E.props.onMouseEnter;Je(I)&&I(R,T)}}),Be(E,"triggeredAfterMouseMove",function(T){var N=E.getMouseInfo(T),R=N?ie(ie({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var I=E.props.onMouseMove;Je(I)&&I(R,T)}),Be(E,"handleItemMouseEnter",function(T){E.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Be(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Be(E,"handleMouseMove",function(T){T.persist(),E.throttleTriggeredAfterMouseMove(T)}),Be(E,"handleMouseLeave",function(T){E.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};E.setState(N),E.triggerSyncEvent(N);var R=E.props.onMouseLeave;Je(R)&&R(N,T)}),Be(E,"handleOuterEvent",function(T){var N=U9(T),R=Tn(E.props,"".concat(N));if(N&&Je(R)){var I,K;/.*touch.*/i.test(N)?K=E.getMouseInfo(T.changedTouches[0]):K=E.getMouseInfo(T),R((I=K)!==null&&I!==void 0?I:{},T)}}),Be(E,"handleClick",function(T){var N=E.getMouseInfo(T);if(N){var R=ie(ie({},N),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var I=E.props.onClick;Je(I)&&I(R,T)}}),Be(E,"handleMouseDown",function(T){var N=E.props.onMouseDown;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"handleMouseUp",function(T){var N=E.props.onMouseUp;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Be(E,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseDown(T.changedTouches[0])}),Be(E,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseUp(T.changedTouches[0])}),Be(E,"handleDoubleClick",function(T){var N=E.props.onDoubleClick;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"handleContextMenu",function(T){var N=E.props.onContextMenu;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),Be(E,"triggerSyncEvent",function(T){E.props.syncId!==void 0&&$b.emit(Mb,E.props.syncId,T,E.eventEmitterSymbol)}),Be(E,"applySyncEvent",function(T){var N=E.props,R=N.layout,I=N.syncMethod,K=E.state.updateId,B=T.dataStartIndex,U=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)E.setState(ie({dataStartIndex:B,dataEndIndex:U},v({props:E.props,dataStartIndex:B,dataEndIndex:U,updateId:K},E.state)));else if(T.activeTooltipIndex!==void 0){var V=T.chartX,H=T.chartY,Y=T.activeTooltipIndex,G=E.state,Q=G.offset,W=G.tooltipTicks;if(!Q)return;if(typeof I=="function")Y=I(W,T);else if(I==="value"){Y=-1;for(var ee=0;ee<W.length;ee++)if(W[ee].value===T.activeLabel){Y=ee;break}}var q=ie(ie({},Q),{},{x:Q.left,y:Q.top}),$=Math.min(V,q.x+q.width),M=Math.min(H,q.y+q.height),J=W[Y]&&W[Y].value,oe=Ew(E.state,E.props.data,Y),le=W[Y]?{x:R==="horizontal"?W[Y].coordinate:$,y:R==="horizontal"?M:W[Y].coordinate}:OM;E.setState(ie(ie({},T),{},{activeLabel:J,activeCoordinate:le,activePayload:oe,activeTooltipIndex:Y}))}else E.setState(T)}),Be(E,"renderCursor",function(T){var N,R=E.state,I=R.isTooltipActive,K=R.activeCoordinate,B=R.activePayload,U=R.offset,V=R.activeTooltipIndex,H=R.tooltipAxisBandSize,Y=E.getTooltipEventType(),G=(N=T.props.active)!==null&&N!==void 0?N:I,Q=E.props.layout,W=T.key||"_recharts-cursor";return L.createElement(sne,{key:W,activeCoordinate:K,activePayload:B,activeTooltipIndex:V,chartName:r,element:T,isActive:G,layout:Q,offset:U,tooltipAxisBandSize:H,tooltipEventType:Y})}),Be(E,"renderPolarAxis",function(T,N,R){var I=Tn(T,"type.axisType"),K=Tn(E.state,"".concat(I,"Map")),B=T.type.defaultProps,U=B!==void 0?ie(ie({},B),T.props):T.props,V=K&&K[U["".concat(I,"Id")]];return j.cloneElement(T,ie(ie({},V),{},{className:ot(I,V.className),key:T.key||"".concat(N,"-").concat(R),ticks:Wi(V,!0)}))}),Be(E,"renderPolarGrid",function(T){var N=T.props,R=N.radialLines,I=N.polarAngles,K=N.polarRadius,B=E.state,U=B.radiusAxisMap,V=B.angleAxisMap,H=Pa(U),Y=Pa(V),G=Y.cx,Q=Y.cy,W=Y.innerRadius,ee=Y.outerRadius;return j.cloneElement(T,{polarAngles:Array.isArray(I)?I:Wi(Y,!0).map(function(q){return q.coordinate}),polarRadius:Array.isArray(K)?K:Wi(H,!0).map(function(q){return q.coordinate}),cx:G,cy:Q,innerRadius:W,outerRadius:ee,key:T.key||"polar-grid",radialLines:R})}),Be(E,"renderLegend",function(){var T=E.state.formattedGraphicalItems,N=E.props,R=N.children,I=N.width,K=N.height,B=E.props.margin||{},U=I-(B.left||0)-(B.right||0),V=w$({children:R,formattedGraphicalItems:T,legendWidth:U,legendContent:d});if(!V)return null;var H=V.item,Y=SN(V,lne);return j.cloneElement(H,ie(ie({},Y),{},{chartWidth:I,chartHeight:K,margin:B,onBBoxUpdate:E.handleLegendBBoxUpdate}))}),Be(E,"renderTooltip",function(){var T,N=E.props,R=N.children,I=N.accessibilityLayer,K=sn(R,ln);if(!K)return null;var B=E.state,U=B.isTooltipActive,V=B.activeCoordinate,H=B.activePayload,Y=B.activeLabel,G=B.offset,Q=(T=K.props.active)!==null&&T!==void 0?T:U;return j.cloneElement(K,{viewBox:ie(ie({},G),{},{x:G.left,y:G.top}),active:Q,label:Y,payload:Q?H:[],coordinate:V,accessibilityLayer:I})}),Be(E,"renderBrush",function(T){var N=E.props,R=N.margin,I=N.data,K=E.state,B=K.offset,U=K.dataStartIndex,V=K.dataEndIndex,H=K.updateId;return j.cloneElement(T,{key:T.key||"_recharts-brush",onChange:Sf(E.handleBrushChange,T.props.onChange),data:I,x:ge(T.props.x)?T.props.x:B.left,y:ge(T.props.y)?T.props.y:B.top+B.height+B.brushBottom-(R.bottom||0),width:ge(T.props.width)?T.props.width:B.width,startIndex:U,endIndex:V,updateId:"brush-".concat(H)})}),Be(E,"renderReferenceElement",function(T,N,R){if(!T)return null;var I=E,K=I.clipPathId,B=E.state,U=B.xAxisMap,V=B.yAxisMap,H=B.offset,Y=T.type.defaultProps||{},G=T.props,Q=G.xAxisId,W=Q===void 0?Y.xAxisId:Q,ee=G.yAxisId,q=ee===void 0?Y.yAxisId:ee;return j.cloneElement(T,{key:T.key||"".concat(N,"-").concat(R),xAxis:U[W],yAxis:V[q],viewBox:{x:H.left,y:H.top,width:H.width,height:H.height},clipPathId:K})}),Be(E,"renderActivePoints",function(T){var N=T.item,R=T.activePoint,I=T.basePoint,K=T.childIndex,B=T.isRange,U=[],V=N.props.key,H=N.item.type.defaultProps!==void 0?ie(ie({},N.item.type.defaultProps),N.item.props):N.item.props,Y=H.activeDot,G=H.dataKey,Q=ie(ie({index:K,dataKey:G,cx:R.x,cy:R.y,r:4,fill:X1(N.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},at(Y,!1)),Qf(Y));return U.push(S.renderActiveDot(Y,Q,"".concat(V,"-activePoint-").concat(K))),I?U.push(S.renderActiveDot(Y,ie(ie({},Q),{},{cx:I.x,cy:I.y}),"".concat(V,"-basePoint-").concat(K))):B&&U.push(null),U}),Be(E,"renderGraphicChild",function(T,N,R){var I=E.filterFormatItem(T,N,R);if(!I)return null;var K=E.getTooltipEventType(),B=E.state,U=B.isTooltipActive,V=B.tooltipAxis,H=B.activeTooltipIndex,Y=B.activeLabel,G=E.props.children,Q=sn(G,ln),W=I.props,ee=W.points,q=W.isRange,$=W.baseLine,M=I.item.type.defaultProps!==void 0?ie(ie({},I.item.type.defaultProps),I.item.props):I.item.props,J=M.activeDot,oe=M.hide,le=M.activeBar,ve=M.activeShape,qe=!!(!oe&&U&&Q&&(J||le||ve)),xe={};K!=="axis"&&Q&&Q.props.trigger==="click"?xe={onClick:Sf(E.handleItemMouseEnter,T.props.onClick)}:K!=="axis"&&(xe={onMouseLeave:Sf(E.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:Sf(E.handleItemMouseEnter,T.props.onMouseEnter)});var ae=j.cloneElement(T,ie(ie({},I.props),xe));function Se(_t){return typeof V.dataKey=="function"?V.dataKey(_t.payload):null}if(qe)if(H>=0){var Me,se;if(V.dataKey&&!V.allowDuplicatedCategory){var rt=typeof V.dataKey=="function"?Se:"payload.".concat(V.dataKey.toString());Me=Zf(ee,rt,Y),se=q&&$&&Zf($,rt,Y)}else Me=ee==null?void 0:ee[H],se=q&&$&&$[H];if(ve||le){var Fe=T.props.activeIndex!==void 0?T.props.activeIndex:H;return[j.cloneElement(T,ie(ie(ie({},I.props),xe),{},{activeIndex:Fe})),null,null]}if(!tt(Me))return[ae].concat(pl(E.renderActivePoints({item:I,activePoint:Me,basePoint:se,childIndex:H,isRange:q})))}else{var kt,wt=(kt=E.getItemByXY(E.state.activeCoordinate))!==null&&kt!==void 0?kt:{graphicalItem:ae},Et=wt.graphicalItem,Sr=Et.item,Ut=Sr===void 0?T:Sr,Rr=Et.childIndex,lr=ie(ie(ie({},I.props),xe),{},{activeIndex:Rr});return[j.cloneElement(Ut,lr),null,null]}return q?[ae,null,null]:[ae,null]}),Be(E,"renderCustomized",function(T,N,R){return j.cloneElement(T,ie(ie({key:"recharts-customized-".concat(R)},E.props),E.state))}),Be(E,"renderMap",{CartesianGrid:{handler:Tf,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Tf},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Tf},YAxis:{handler:Tf},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((O=A.id)!==null&&O!==void 0?O:Du("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=wI(E.triggeredAfterMouseMove,(C=A.throttleDelay)!==null&&C!==void 0?C:1e3/60),E.state={},E}return xne(S,b),gne(S,[{key:"componentDidMount",value:function(){var O,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,C=O.children,E=O.data,T=O.height,N=O.layout,R=sn(C,ln);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var K=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,B=Ew(this.state,E,I,K),U=this.state.tooltipTicks[I].coordinate,V=(this.state.offset.top+T)/2,H=N==="horizontal",Y=H?{x:U,y:V}:{y:U,x:V},G=this.state.formattedGraphicalItems.find(function(W){var ee=W.item;return ee.type.name==="Scatter"});G&&(Y=ie(ie({},Y),G.props.points[I].tooltipPosition),B=G.props.points[I].tooltipPayload);var Q={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:K,activePayload:B,activeCoordinate:Y};this.setState(Q),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.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 E,T;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(O){ux([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 C=O.props.shared?"axis":"item";return c.indexOf(C)>=0?C:a}return a}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var C=this.container,E=C.getBoundingClientRect(),T=TW(E),N={chartX:Math.round(O.pageX-T.left),chartY:Math.round(O.pageY-T.top)},R=E.width/C.offsetWidth||1,I=this.inRange(N.chartX,N.chartY,R);if(!I)return null;var K=this.state,B=K.xAxisMap,U=K.yAxisMap,V=this.getTooltipEventType(),H=EN(this.state,this.props.data,this.props.layout,I);if(V!=="axis"&&B&&U){var Y=Pa(B).scale,G=Pa(U).scale,Q=Y&&Y.invert?Y.invert(N.chartX):null,W=G&&G.invert?G.invert(N.chartY):null;return ie(ie({},N),{},{xValue:Q,yValue:W},H)}return H?ie(ie({},N),H):null}},{key:"inRange",value:function(O,C){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,N=O/E,R=C/E;if(T==="horizontal"||T==="vertical"){var I=this.state.offset,K=N>=I.left&&N<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return K?{x:N,y:R}:null}var B=this.state,U=B.angleAxisMap,V=B.radiusAxisMap;if(U&&V){var H=Pa(U);return qC({x:N,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,C=this.getTooltipEventType(),E=sn(O,ln),T={};E&&C==="axis"&&(E.props.trigger==="click"?T={onClick:this.handleClick}:T={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 N=Qf(this.props,this.handleOuterEvent);return ie(ie({},N),T)}},{key:"addListener",value:function(){$b.on(Mb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){$b.removeListener(Mb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,C,E){for(var T=this.state.formattedGraphicalItems,N=0,R=T.length;N<R;N++){var I=T[N];if(I.item===O||I.props.key===O.key||C===Gi(I.item.type)&&E===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,C=this.state.offset,E=C.left,T=C.top,N=C.height,R=C.width;return L.createElement("defs",null,L.createElement("clipPath",{id:O},L.createElement("rect",{x:E,y:T,height:N,width:R})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(C,E){var T=_N(E,2),N=T[0],R=T[1];return ie(ie({},C),{},Be({},N,R.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(C,E){var T=_N(E,2),N=T[0],R=T[1];return ie(ie({},C),{},Be({},N,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[O])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(O){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[O])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(O){var C=this.state,E=C.formattedGraphicalItems,T=C.activeItem;if(E&&E.length)for(var N=0,R=E.length;N<R;N++){var I=E[N],K=I.props,B=I.item,U=B.type.defaultProps!==void 0?ie(ie({},B.type.defaultProps),B.props):B.props,V=Gi(B.type);if(V==="Bar"){var H=(K.data||[]).find(function(W){return XZ(O,W)});if(H)return{graphicalItem:I,payload:H}}else if(V==="RadialBar"){var Y=(K.data||[]).find(function(W){return qC(O,W)});if(Y)return{graphicalItem:I,payload:Y}}else if(Ip(I,T)||$p(I,T)||Su(I,T)){var G=zQ({graphicalItem:I,activeTooltipItem:T,itemData:U.data}),Q=U.activeIndex===void 0?G:U.activeIndex;return{graphicalItem:ie(ie({},I),{},{childIndex:Q}),payload:Su(I,T)?U.data[G]:I.props.data[G]}}}return null}},{key:"render",value:function(){var O=this;if(!QO(this))return null;var C=this.props,E=C.children,T=C.className,N=C.width,R=C.height,I=C.style,K=C.compact,B=C.title,U=C.desc,V=SN(C,cne),H=at(V,!1);if(K)return L.createElement(nN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement(fx,Ms({},H,{width:N,height:R,title:B,desc:U}),this.renderClipPath(),tA(E,this.renderMap)));if(this.props.accessibilityLayer){var Y,G;H.tabIndex=(Y=this.props.tabIndex)!==null&&Y!==void 0?Y:0,H.role=(G=this.props.role)!==null&&G!==void 0?G:"application",H.onKeyDown=function(W){O.accessibilityManager.keyboardEvent(W)},H.onFocus=function(){O.accessibilityManager.focus()}}var Q=this.parseEventsOfWrapper();return L.createElement(nN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement("div",Ms({className:ot("recharts-wrapper",T),style:ie({position:"relative",cursor:"default",width:N,height:R},I)},Q,{ref:function(ee){O.container=ee}}),L.createElement(fx,Ms({},H,{width:N,height:R,title:B,desc:U,style:One}),this.renderClipPath(),tA(E,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(j.Component);Be(x,"displayName",r),Be(x,"defaultProps",ie({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Be(x,"getDerivedStateFromProps",function(b,S){var A=b.dataKey,O=b.data,C=b.children,E=b.width,T=b.height,N=b.layout,R=b.stackOffset,I=b.margin,K=S.dataStartIndex,B=S.dataEndIndex;if(S.updateId===void 0){var U=ON(b);return ie(ie(ie({},U),{},{updateId:0},v(ie(ie({props:b},U),{},{updateId:0}),S)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:N,prevStackOffset:R,prevMargin:I,prevChildren:C})}if(A!==S.prevDataKey||O!==S.prevData||E!==S.prevWidth||T!==S.prevHeight||N!==S.prevLayout||R!==S.prevStackOffset||!Bs(I,S.prevMargin)){var V=ON(b),H={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},Y=ie(ie({},EN(S,O,N)),{},{updateId:S.updateId+1}),G=ie(ie(ie({},V),H),Y);return ie(ie(ie({},G),v(ie({props:b},G),S)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:N,prevStackOffset:R,prevMargin:I,prevChildren:C})}if(!ux(C,S.prevChildren)){var Q,W,ee,q,$=sn(C,il),M=$&&(Q=(W=$.props)===null||W===void 0?void 0:W.startIndex)!==null&&Q!==void 0?Q:K,J=$&&(ee=(q=$.props)===null||q===void 0?void 0:q.endIndex)!==null&&ee!==void 0?ee:B,oe=M!==K||J!==B,le=!tt(O),ve=le&&!oe?S.updateId:S.updateId+1;return ie(ie({updateId:ve},v(ie(ie({props:b},S),{},{updateId:ve,dataStartIndex:M,dataEndIndex:J}),S)),{},{prevChildren:C,dataStartIndex:M,dataEndIndex:J})}return null}),Be(x,"renderActiveDot",function(b,S,A){var O;return j.isValidElement(b)?O=j.cloneElement(b,S):Je(b)?O=b(S):O=L.createElement(J1,S),L.createElement(Xt,{className:"recharts-active-dot",key:A},O)});var w=j.forwardRef(function(S,A){return L.createElement(x,Ms({},S,{ref:A}))});return w.displayName=x.displayName,w},Mne=TM({chartName:"LineChart",GraphicalChild:Wu,axisComponents:[{axisType:"xAxis",AxisComp:Ba},{axisType:"yAxis",AxisComp:Ua}],formatAxisMap:K$}),Ow=TM({chartName:"BarChart",GraphicalChild:ea,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ba},{axisType:"yAxis",AxisComp:Ua}],formatAxisMap:K$});const Jh={backgroundColor:"#1e1e1e",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",color:"#e4e0dc",fontSize:"11px",fontFamily:"JetBrains Mono, monospace"};function It(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 g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-5 py-4",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mb-1",children:t}),g.jsx("p",{className:`text-xl font-mono font-medium ${n?"text-[#E43A9C]":"text-zinc-100"}`,children:e}),r&&g.jsx("p",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:r})]})}const Lne={summary:"Summary","by squad":"By Squad","by agent":"By Agent",io:"IO",timeline:"Timeline"};function Dne({tabs:t,active:e,onChange:r}){return g.jsx("div",{className:"flex gap-0 border-b border-white/[0.06] mb-5",children:t.map(n=>g.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:Lne[n]??n},n))})}function zne({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 g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[g.jsx($a,{label:"Total Tokens",value:It(r),sub:`${It(e.totalInputTokens)} in · ${It(e.totalOutputTokens)} out`}),g.jsx($a,{label:"Total Cost",value:Zn(e.totalCostUsd),accent:!0}),g.jsx($a,{label:"API Calls",value:It(e.callCount),sub:"across all entities"}),g.jsx($a,{label:"Avg Cost / Call",value:e.callCount>0?Zn(e.totalCostUsd/e.callCount):"$0.00",sub:`over ${e.callCount} calls`})]}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost by entity"}),a.length>0?g.jsx(uh,{width:"100%",height:180,children:g.jsxs(Ow,{data:a,barCategoryGap:"35%",children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`$${o}`,width:40}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`$${o.toFixed(2)}`,"Cost"]}),g.jsx(ea,{dataKey:"cost",fill:"url(#costGrad)",radius:[6,6,0,0]}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"costGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),g.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):g.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens by entity (k)"}),a.length>0?g.jsx(uh,{width:"100%",height:180,children:g.jsxs(Ow,{data:a,barCategoryGap:"35%",children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`${o}k`,width:40}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`${o}k`,"Tokens"]}),g.jsx(ea,{dataKey:"tokens",fill:"url(#tokenGrad)",radius:[6,6,0,0]}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"tokenGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#818cf8"}),g.jsx("stop",{offset:"100%",stopColor:"#6366f1",stopOpacity:.7})]})})]})}):g.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]})]}),g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Entity","Input","Output","Calls","Cost"].map(o=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),g.jsxs("tbody",{children:[i.map(o=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name)),g.jsxs("tr",{className:"bg-[#1a1a1a]",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-200 font-medium",children:"Total"}),g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:It(e.totalInputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:It(e.totalOutputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:e.callCount}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C] font-medium",children:Zn(e.totalCostUsd)})]})]})]})})]})}function Bne({records:t}){const[e,r]=j.useState([]),[n,i]=j.useState("cost"),[a,o]=j.useState("desc");function c(f){f===n?o(y=>y==="asc"?"desc":"asc"):(i(f),o("desc"))}const u=j.useMemo(()=>{const f=new Map;for(const v of t){if(!v.squadId)continue;const x=f.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 w=`${v.agentRole??"unknown"}:${v.model}`,b=x.agents.get(w)??{role:v.agentRole??"unknown",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(w,b),f.set(v.squadId,x)}return[...Array.from(f.values())].sort((v,x)=>{const w=v[n],b=x[n],S=typeof w=="string"?w.localeCompare(b):w-b;return a==="desc"?-S:S})},[t,n,a]),d=f=>r(y=>y.includes(f)?y.filter(v=>v!==f):[...y,f]),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?g.jsx("div",{className:"text-center py-12 text-zinc-700 text-[11px] font-mono",children:"No squad usage data"}):g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-1 px-1 mb-1",children:[g.jsx("span",{className:"text-[10px] font-mono text-zinc-700 mr-1",children:"sort by"}),p.map(f=>g.jsxs("button",{type:"button",onClick:()=>c(f.key),className:`flex items-center gap-0.5 px-2 py-1 rounded-lg text-[10px] font-mono transition-colors ${n===f.key?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400 hover:bg-white/[0.04]"}`,style:n===f.key?{background:"rgba(228,58,156,0.1)"}:void 0,children:[f.label,n===f.key&&g.jsx("span",{className:"text-[9px]",children:a==="desc"?"↓":"↑"})]},f.key))]}),u.map(f=>{const y=e.includes(f.id),v=Array.from(f.agents.values());return g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl overflow-hidden",children:[g.jsxs("button",{type:"button",onClick:()=>d(f.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:[g.jsx("div",{className:`transition-transform ${y?"rotate-90":""}`,children:g.jsx(Lw,{className:"w-3.5 h-3.5 text-zinc-600"})}),g.jsx("span",{className:"text-sm font-mono text-zinc-100 flex-1",children:f.name}),g.jsxs("div",{className:"flex items-center gap-6 text-[11px] font-mono",children:[g.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[g.jsx("span",{className:"text-zinc-700 mr-1",children:"in"}),It(f.inputTokens)]}),g.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[g.jsx("span",{className:"text-zinc-700 mr-1",children:"out"}),It(f.outputTokens)]}),g.jsxs("span",{className:"text-zinc-500",children:[g.jsx("span",{className:"text-zinc-700 mr-1",children:"calls"}),f.calls]}),g.jsx("span",{className:"text-[#E43A9C] font-medium w-16 text-right",children:Zn(f.cost)})]})]}),y&&g.jsx("div",{className:"border-t border-white/[0.05]",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"bg-[#191919]",children:["Agent","Model","Input","Output","Calls","Cost"].map(x=>g.jsx("th",{className:`text-left px-4 py-2 text-zinc-700 font-medium ${x==="Cost"?"text-right":""}`,children:x},x))})}),g.jsx("tbody",{children:v.map(x=>g.jsxs("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-2.5 text-zinc-300",children:x.role}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-600",children:x.model}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:It(x.inputTokens)}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:It(x.outputTokens)}),g.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:x.calls}),g.jsx("td",{className:"px-4 py-2.5 text-right text-[#E43A9C]",children:Zn(x.cost)})]},x.role))})]})})]},f.id)})]})}function Une({records:t}){const e=j.useMemo(()=>{const n=new Map;for(const i of t){const a=`${i.squadId??"io"}:${i.agentRole??"orchestrator"}:${i.model}`,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 g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Agent","Squad","Model","Input","Output","Calls","Cost","% of total"].map(n=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),g.jsx("tbody",{children:e.map(n=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.squad}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.model}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(n.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(n.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(n.cost)}),g.jsx("td",{className:"px-4 py-3",children:g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("div",{className:"w-16 h-1.5 rounded-full bg-[#252525] overflow-hidden",children:g.jsx("div",{className:"h-full bg-[#E43A9C] rounded-full",style:{width:`${r>0?n.cost/r*100:0}%`}})}),g.jsx("span",{className:"text-zinc-600 text-[10px]",children:r>0?`${(n.cost/r*100).toFixed(1)}%`:"0%"})]})})]},`${n.squad}:${n.name}`))})]})})}function qne({records:t}){const e=j.useMemo(()=>t.filter(o=>!o.squadId),[t]),r=j.useMemo(()=>{const o=new Map;for(const c of e){const u=`${c.agentRole??"orchestrator"}:${c.model}`,d=o.get(u)??{name:c.agentRole??"orchestrator",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 g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[g.jsx($a,{label:"IO Tokens",value:It(n+i),sub:`${It(n)} in · ${It(i)} out`}),g.jsx($a,{label:"IO Cost",value:Zn(a),accent:!0}),g.jsx($a,{label:"IO Calls",value:It(e.length)}),g.jsx($a,{label:"IO Roles",value:String(r.length)})]}),g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Role","Model","Input","Output","Calls","Cost"].map(o=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),g.jsx("tbody",{children:r.map(o=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),g.jsx("td",{className:"px-4 py-3 text-zinc-600",children:o.model}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name))})]})})]})}function Fne({records:t}){const e=qa(),r=j.useMemo(()=>{const i=new Map;for(const a of t){const o=a.timestamp.slice(0,10),c=i.get(o)??{date:o,inputTokens:0,outputTokens:0,cost:0,calls:0};c.inputTokens+=a.inputTokens,c.outputTokens+=a.outputTokens,c.cost+=a.estimatedCostUsd??0,c.calls+=1,i.set(o,c)}return Array.from(i.values()).sort((a,o)=>a.date.localeCompare(o.date))},[t]),n=r.map(i=>({...i,label:iz(i.date,e),tokens:i.inputTokens+i.outputTokens}));return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens per day"}),n.length>0?g.jsx(uh,{width:"100%",height:220,children:g.jsxs(Mne,{data:n,children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:It,width:44}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[It(i),"Tokens"]}),g.jsx(Wu,{type:"monotone",dataKey:"tokens",stroke:"#E43A9C",strokeWidth:2,dot:!1})]})}):g.jsx("div",{className:"h-[220px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),g.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[g.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost per day"}),n.length>0?g.jsx(uh,{width:"100%",height:180,children:g.jsxs(Ow,{data:n,barCategoryGap:"20%",children:[g.jsx(Tu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),g.jsx(Ba,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),g.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:i=>`$${i.toFixed(2)}`,width:44}),g.jsx(ln,{contentStyle:Jh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[Zn(i),"Cost"]}),g.jsx(ea,{dataKey:"cost",fill:"url(#costGradTl)",radius:[4,4,0,0]}),g.jsx("defs",{children:g.jsxs("linearGradient",{id:"costGradTl",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),g.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):g.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),g.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:g.jsxs("table",{className:"w-full text-[11px] font-mono",children:[g.jsx("thead",{children:g.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Date","Input","Output","Calls","Cost"].map(i=>g.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${i==="Cost"?"text-right":""}`,children:i},i))})}),g.jsx("tbody",{children:r.map(i=>g.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[g.jsx("td",{className:"px-4 py-3 text-zinc-300",children:i.date}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(i.inputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(i.outputTokens)}),g.jsx("td",{className:"px-4 py-3 text-zinc-500",children:i.calls}),g.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(i.cost)})]},i.date))})]})})]})}function Hne(){const[t,e]=j.useState("summary"),[r,n]=j.useState(null),[i,a]=j.useState("14d"),o=["summary","by squad","by agent","io","timeline"];if(j.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),Ke.get(`/usage?since=${u.toISOString()}`).then(n).catch(()=>{})},[i]),!r)return g.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 g.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[g.jsxs("div",{className:"flex items-start justify-between mb-5 gap-4 flex-wrap",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Usage"}),g.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:c})]}),g.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=>g.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))})]}),g.jsx(Dne,{tabs:o,active:t,onChange:u=>e(u)}),t==="summary"&&g.jsx(zne,{records:r.records,totals:r.totals}),t==="by squad"&&g.jsx(Bne,{records:r.records}),t==="by agent"&&g.jsx(Une,{records:r.records}),t==="io"&&g.jsx(qne,{records:r.records}),t==="timeline"&&g.jsx(Fne,{records:r.records})]})}function CM(t){return[...t].sort((e,r)=>e.isDir!==r.isDir?e.isDir?-1:1:e.name.localeCompare(r.name)).map(e=>({...e,children:CM(e.children)}))}function Wne(t){const e=[];for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e,a="";if(r.isDir){for(const o of n){a=a?`${a}/${o}`:o;let c=i.find(u=>u.path===a);c||(c={name:o,path:a,isDir:!0,children:[]},i.push(c)),i=c.children}continue}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 CM(e)}function jM(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=jM(r.children,e);return i.length?[{...r,children:i}]:[]}):t}function Aw(t){const e=new Set;for(const r of t)if(r.isDir){e.add(r.path);for(const n of Aw(r.children))e.add(n)}return e}function Gne(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 NM({node:t,depth:e,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o,onAddToFolder:c,onDeleteFolder:u}){const d=r===t.path,p=t.isDir&&(n.has(t.path)||i.has(t.path)),f=12+e*16,y=t.isDir&&["io","shared","squads","templates"].includes(t.path);return t.isDir?g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full items-center group 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:f},children:[g.jsxs("button",{type:"button",onClick:()=>a(t.path),className:"flex items-center gap-2 flex-1 min-w-0",children:[g.jsx(Lw,{size:14,className:`shrink-0 transition-transform ${p?"rotate-90":""}`}),p?g.jsx(f4,{size:14,className:"shrink-0 text-zinc-500"}):g.jsx(p4,{size:14,className:"shrink-0 text-zinc-500"}),g.jsx("span",{className:"truncate",children:t.name})]}),g.jsxs("div",{className:"flex items-center gap-0.5",children:[!y&&g.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),u(t.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-red-500/20 transition-opacity text-zinc-600 hover:text-red-400",title:`Delete ${t.name}`,children:g.jsx(Ma,{size:12})}),g.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),c(t.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-white/[0.08] transition-opacity text-zinc-600 hover:text-zinc-300",title:`Add page to ${t.name}`,children:g.jsx(Uw,{size:12})})]})]}),p&&g.jsx("div",{children:t.children.map(v=>g.jsx(NM,{node:v,depth:e+1,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o,onAddToFolder:c,onDeleteFolder:u},v.path))})]}):g.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 ${d?"border-l-2 border-[#E43A9C] bg-[#E43A9C]/10 text-[#E43A9C]":"text-zinc-500 hover:bg-white/[0.04] hover:text-zinc-300"}`,style:{paddingLeft:f},children:[g.jsx(u4,{size:14,className:"shrink-0"}),g.jsx("span",{className:"truncate",children:t.name})]})}function Kne(){const[t,e]=j.useState([]),[r,n]=j.useState(null),[i,a]=j.useState(""),[o,c]=j.useState(!1),[u,d]=j.useState(""),[p,f]=j.useState(""),[y,v]=j.useState(""),[x,w]=j.useState(new Set),[b,S]=j.useState(!1),[A,O]=j.useState(null),C=j.useRef(null);j.useEffect(()=>{B()},[]);const E=j.useMemo(()=>Wne(t),[t]),T=y.trim().toLowerCase(),N=j.useMemo(()=>jM(E,T),[E,T]),R=j.useMemo(()=>{const $=T?Aw(N):new Set;if(r)for(const M of Gne(r))$.add(M);return $},[N,T,r]),I=r?(function $(M){for(const J of M){if(J.path===r)return J;const oe=$(J.children);if(oe)return oe}return null})(N):null,K=(I==null?void 0:I.name)??(r?r.split("/").pop()??"":"");j.useEffect(()=>{const $=Aw(E);w(M=>new Set([...M,...$]))},[E]);async function B(){try{const $=await Ke.get("/wiki/all");e($.pages)}catch{e([])}}function U($){if($.startsWith("squads/")){const M=$.split("/"),J=M[1]??"",oe=M.slice(2).join("/");return{scope:J,relativePath:oe}}return $.startsWith("templates/")?{scope:"templates",relativePath:$.slice(10)}:$.startsWith("io/")?{scope:"io",relativePath:$.slice(3)}:$.startsWith("shared/")?{scope:"shared",relativePath:$.slice(7)}:{scope:"shared",relativePath:$}}async function V($){try{const{scope:M,relativePath:J}=U($),oe=await Ke.get(`/wiki/${M}/${J}`);a(oe.content),d(oe.content),n($),c(!1)}catch{et.error("Failed to load page")}}async function H(){if(r)try{const{scope:$,relativePath:M}=U(r);await Ke.put(`/wiki/${$}/${M}`,{content:u}),a(u),c(!1),et.success("Page saved")}catch{et.error("Failed to save page")}}async function Y(){if(r)try{const{scope:$,relativePath:M}=U(r);await Ke.delete(`/wiki/${$}/${M}`),et.success("Page deleted"),n(null),a(""),d(""),c(!1),B()}catch{et.error("Failed to delete page")}}function G($){f(`${$}/`),setTimeout(()=>{const M=C.current;M&&(M.focus(),M.setSelectionRange(M.value.length,M.value.length))},0)}function Q($){O($)}async function W(){if(A)try{await Ke.delete(`/wiki/dir/${A}`),et.success(`Deleted ${A}`),r!=null&&r.startsWith(A)&&(n(null),a(""),d(""),c(!1)),B()}catch{et.error("Failed to delete directory")}finally{O(null)}}async function ee(){let $=p.trim().replace(/^\/+|\/+$/g,"");if(!$)return;$=$.replace(/\.md$/i,"");const M=$.startsWith("io/")||$.startsWith("shared/")||$.startsWith("squads/")?$:`shared/${$}`;S(!0);try{const{scope:J,relativePath:oe}=U(M),le=oe.split("/").slice(-1)[0]??oe;await Ke.put(`/wiki/${J}/${oe}`,{content:`# ${le}
508
508
 
509
- `}),tt.success("Page created"),f(""),await B(),await V(M)}catch{tt.error("Failed to create page")}finally{S(!1)}}function q($){w(M=>{const J=new Set(M);return J.has($)?J.delete($):J.add($),J})}return g.jsxs("div",{className:"flex h-full",children:[g.jsxs("div",{className:"flex h-full w-64 flex-col border-r border-white/[0.07] bg-[#181818]",children:[g.jsx("div",{className:"border-b border-white/[0.07] p-3",children:g.jsxs("div",{className:"relative",children:[g.jsx(nP,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-zinc-600"}),g.jsx("input",{type:"text",value:y,onChange:$=>v($.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"})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3",children:N.length>0?N.map($=>g.jsx(NM,{node:$,depth:0,selectedPage:r,expandedPaths:x,autoExpandedPaths:R,onToggle:q,onSelect:V,onAddToFolder:G,onDeleteFolder:Q},$.path)):g.jsx("p",{className:"py-4 text-center font-mono text-[11px] text-zinc-700",children:"No pages found"})}),g.jsx("div",{className:"border-t border-white/[0.07] p-3",children:g.jsxs("div",{className:"space-y-2",children:[g.jsx("input",{ref:C,type:"text",value:p,onChange:$=>f($.target.value),onKeyDown:$=>{$.key==="Enter"&&ee(),$.key==="Escape"&&f("")},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"}),g.jsx(za,{onClick:ee,disabled:!p.trim()||b,className:"w-full justify-center px-3 py-2",children:b?g.jsxs(g.Fragment,{children:[g.jsx(Ts,{size:13,className:"animate-spin"})," Creating..."]}):g.jsxs(g.Fragment,{children:[g.jsx(Uw,{size:13})," Add Page"]})})]})})]}),g.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:r?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-white/[0.07] px-6",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h3",{className:"truncate font-mono text-sm text-zinc-100",children:K}),g.jsxs("p",{className:"truncate font-mono text-[11px] text-zinc-500",children:[r,".md"]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[o?g.jsxs(g.Fragment,{children:[g.jsxs(za,{onClick:H,className:"px-3 py-1.5",children:[g.jsx(tp,{size:12})," Save"]}),g.jsx(_i,{onClick:()=>{c(!1),d(i)},className:"px-3 py-1.5",children:"Cancel"})]}):g.jsxs(_i,{onClick:()=>{c(!0),d(i)},className:"px-3 py-1.5",children:[g.jsx(Lf,{size:12})," Edit"]}),g.jsxs(Wf,{onClick:Y,className:"px-3 py-1.5",children:[g.jsx(Ma,{size:12})," Delete"]})]})]}),g.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o?g.jsx("textarea",{value:u,onChange:$=>d($.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"}):g.jsx("div",{className:"mx-auto max-w-4xl",children:g.jsx("div",{className:"prose-io text-sm text-zinc-300",dangerouslySetInnerHTML:{__html:it.parse(i)}})})})]}):g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsxs("div",{className:"text-center",children:[g.jsx(YN,{size:48,className:"mx-auto mb-3 text-zinc-800"}),g.jsx("p",{className:"font-mono text-[11px] text-zinc-700",children:"Select a page to view"})]})})}),A&&g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:g.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/[0.07] bg-[#1a1a1a] p-6 shadow-2xl",children:[g.jsx("h3",{className:"mb-2 text-sm font-medium text-zinc-100",children:"Delete directory?"}),g.jsxs("p",{className:"mb-4 text-xs text-zinc-400",children:["This will permanently delete ",g.jsx("span",{className:"font-mono text-zinc-200",children:A})," and all its contents."]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(_i,{onClick:()=>O(null),className:"px-3 py-1.5",children:"Cancel"}),g.jsxs(Wf,{onClick:W,className:"px-3 py-1.5",children:[g.jsx(Ma,{size:12})," Delete"]})]})]})})]})}function Vne({children:t}){const{session:e,supabase:r,loading:n}=up();return n?g.jsx("div",{className:"min-h-screen flex items-center justify-center text-[var(--color-muted-foreground)]",children:"Loading..."}):r?e?g.jsx(g.Fragment,{children:t}):g.jsx(wq,{}):g.jsx(g.Fragment,{children:t})}function Xne(){const{pathname:t}=ti(),e=t==="/"||t==="/chat"||t.startsWith("/chat/");return g.jsxs(g.Fragment,{children:[g.jsx(wD,{children:g.jsxs(Yr,{element:g.jsx(yq,{}),children:[g.jsx(Yr,{index:!0,element:g.jsx(vq,{})}),g.jsx(Yr,{path:"squads",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"squads/:name",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"squads/:name/instances/:instanceId",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"squads/:name/agents/:role",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"feed",element:g.jsx(xq,{})}),g.jsx(Yr,{path:"skills",element:g.jsx(Pq,{})}),g.jsx(Yr,{path:"schedules",element:g.jsx(kq,{})}),g.jsx(Yr,{path:"wiki",element:g.jsx(Kne,{})}),g.jsx(Yr,{path:"settings",element:g.jsx(Tq,{})}),g.jsx(Yr,{path:"usage",element:g.jsx(Hne,{})}),g.jsx(Yr,{path:"*",element:g.jsx(vD,{to:"/",replace:!0})})]})}),!e&&g.jsx(bB,{})]})}function Yne(){return g.jsx(pq,{children:g.jsx(Vne,{children:g.jsx(rz,{children:g.jsx(fz,{children:g.jsx(Xne,{})})})})})}vL.createRoot(document.getElementById("root")).render(g.jsx(j.StrictMode,{children:g.jsxs(WD,{children:[g.jsx(Yne,{}),g.jsx(T5,{theme:"dark",position:"bottom-right"})]})}));
510
- //# sourceMappingURL=index-B6z8B8--.js.map
509
+ `}),et.success("Page created"),f(""),await B(),await V(M)}catch{et.error("Failed to create page")}finally{S(!1)}}function q($){w(M=>{const J=new Set(M);return J.has($)?J.delete($):J.add($),J})}return g.jsxs("div",{className:"flex h-full",children:[g.jsxs("div",{className:"flex h-full w-64 flex-col border-r border-white/[0.07] bg-[#181818]",children:[g.jsx("div",{className:"border-b border-white/[0.07] p-3",children:g.jsxs("div",{className:"relative",children:[g.jsx(nP,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-zinc-600"}),g.jsx("input",{type:"text",value:y,onChange:$=>v($.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"})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3",children:N.length>0?N.map($=>g.jsx(NM,{node:$,depth:0,selectedPage:r,expandedPaths:x,autoExpandedPaths:R,onToggle:q,onSelect:V,onAddToFolder:G,onDeleteFolder:Q},$.path)):g.jsx("p",{className:"py-4 text-center font-mono text-[11px] text-zinc-700",children:"No pages found"})}),g.jsx("div",{className:"border-t border-white/[0.07] p-3",children:g.jsxs("div",{className:"space-y-2",children:[g.jsx("input",{ref:C,type:"text",value:p,onChange:$=>f($.target.value),onKeyDown:$=>{$.key==="Enter"&&ee(),$.key==="Escape"&&f("")},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"}),g.jsx(za,{onClick:ee,disabled:!p.trim()||b,className:"w-full justify-center px-3 py-2",children:b?g.jsxs(g.Fragment,{children:[g.jsx(Ts,{size:13,className:"animate-spin"})," Creating..."]}):g.jsxs(g.Fragment,{children:[g.jsx(Uw,{size:13})," Add Page"]})})]})})]}),g.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:r?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-white/[0.07] px-6",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h3",{className:"truncate font-mono text-sm text-zinc-100",children:K}),g.jsxs("p",{className:"truncate font-mono text-[11px] text-zinc-500",children:[r,".md"]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[o?g.jsxs(g.Fragment,{children:[g.jsxs(za,{onClick:H,className:"px-3 py-1.5",children:[g.jsx(tp,{size:12})," Save"]}),g.jsx(_i,{onClick:()=>{c(!1),d(i)},className:"px-3 py-1.5",children:"Cancel"})]}):g.jsxs(_i,{onClick:()=>{c(!0),d(i)},className:"px-3 py-1.5",children:[g.jsx(Lf,{size:12})," Edit"]}),g.jsxs(Wf,{onClick:Y,className:"px-3 py-1.5",children:[g.jsx(Ma,{size:12})," Delete"]})]})]}),g.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o?g.jsx("textarea",{value:u,onChange:$=>d($.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"}):g.jsx("div",{className:"mx-auto max-w-4xl",children:g.jsx("div",{className:"prose-io text-sm text-zinc-300",dangerouslySetInnerHTML:{__html:it.parse(i)}})})})]}):g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsxs("div",{className:"text-center",children:[g.jsx(YN,{size:48,className:"mx-auto mb-3 text-zinc-800"}),g.jsx("p",{className:"font-mono text-[11px] text-zinc-700",children:"Select a page to view"})]})})}),A&&g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:g.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/[0.07] bg-[#1a1a1a] p-6 shadow-2xl",children:[g.jsx("h3",{className:"mb-2 text-sm font-medium text-zinc-100",children:"Delete directory?"}),g.jsxs("p",{className:"mb-4 text-xs text-zinc-400",children:["This will permanently delete ",g.jsx("span",{className:"font-mono text-zinc-200",children:A})," and all its contents."]}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(_i,{onClick:()=>O(null),className:"px-3 py-1.5",children:"Cancel"}),g.jsxs(Wf,{onClick:W,className:"px-3 py-1.5",children:[g.jsx(Ma,{size:12})," Delete"]})]})]})})]})}function Vne({children:t}){const{session:e,supabase:r,loading:n}=up();return n?g.jsx("div",{className:"min-h-screen flex items-center justify-center text-[var(--color-muted-foreground)]",children:"Loading..."}):r?e?g.jsx(g.Fragment,{children:t}):g.jsx(wq,{}):g.jsx(g.Fragment,{children:t})}function Xne(){const{pathname:t}=ti(),e=t==="/"||t==="/chat"||t.startsWith("/chat/");return g.jsxs(g.Fragment,{children:[g.jsx(wD,{children:g.jsxs(Yr,{element:g.jsx(yq,{}),children:[g.jsx(Yr,{index:!0,element:g.jsx(vq,{})}),g.jsx(Yr,{path:"squads",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"squads/:name",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"squads/:name/instances/:instanceId",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"squads/:name/agents/:role",element:g.jsx(mf,{})}),g.jsx(Yr,{path:"feed",element:g.jsx(xq,{})}),g.jsx(Yr,{path:"skills",element:g.jsx(Pq,{})}),g.jsx(Yr,{path:"schedules",element:g.jsx(kq,{})}),g.jsx(Yr,{path:"wiki",element:g.jsx(Kne,{})}),g.jsx(Yr,{path:"settings",element:g.jsx(Tq,{})}),g.jsx(Yr,{path:"usage",element:g.jsx(Hne,{})}),g.jsx(Yr,{path:"*",element:g.jsx(vD,{to:"/",replace:!0})})]})}),!e&&g.jsx(bB,{})]})}function Yne(){return g.jsx(pq,{children:g.jsx(Vne,{children:g.jsx(rz,{children:g.jsx(fz,{children:g.jsx(Xne,{})})})})})}vL.createRoot(document.getElementById("root")).render(g.jsx(j.StrictMode,{children:g.jsxs(WD,{children:[g.jsx(Yne,{}),g.jsx(T5,{theme:"dark",position:"bottom-right"})]})}));
510
+ //# sourceMappingURL=index-BywBQCtu.js.map